06 Dec, 2018

3 commits

  • We want to add nvmem support for MTD. TI DaVinci is the first platform
    that will be using it, but only in non-DT mode. In order not to
    introduce any new interface to supporting of which we would have to
    commit - add a new config option that tells nvmem not to use the DT
    node of the parent device.

    This way we won't be creating nvmem devices corresponding with MTD
    partitions defined in device tree. By default MTD will set this new
    field to true.

    Once a set of bindings for MTD nvmem cells is agreed upon, we'll be
    able to remove this option.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • Since we put static variable to a header file it's copied to each module
    that includes the header. But not all of them are actually using it.

    Move nvmem_type_str array to its only user to make a compiler happy:

    In file included from include/linux/rtc.h:18,
    from drivers/rtc/rtc-proc.c:15:
    include/linux/nvmem-provider.h:29:27: warning: 'nvmem_type_str'
    defined but not used [-Wunused-const-variable=]
    static const char * const nvmem_type_str[] = {
    ^~~~~~~~~~~~~~

    Suggested-by: Alexandre Belloni
    Suggested-by: Joe Perches
    Cc: Srinivas Kandagatla
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • Add a type attribute so userspace is able to know how the data is stored as
    this can help taking the correct decision when selecting which device to
    use. This will also help program display the proper warnings when burning
    fuses for example.

    Signed-off-by: Alexandre Belloni
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Alexandre Belloni
     

28 Sep, 2018

4 commits

  • Checkpatch emits warnings when using ENOSYS. Some of the frameworks
    started using EOPNOTSUPP as return values for API functions when given
    subsystem is disabled in Kconfig.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • Use SPDX license identiefiers to core nvmem files and remove GPL 2.0
    license boilerplate.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • Add new structs and routines allowing users to define nvmem cells from
    machine code. This global list of entries is parsed when a provider
    is registered and cells are associated with the relevant nvmem_device
    struct.

    A possible improvement for the future is to allow users to register
    cell tables after the nvmem provider has been registered by updating
    the cell list at each call to nvmem_(add|del)_cell_table().

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • We switched the nvmem framework to using kref instead of manually
    checking the current number of users in nvmem_unregister() so this
    function can no longer fail. We also converted all remaining users
    that still checked the return value of nvmem_unregister() to using
    devm_nvmem_register(). Make the routine return void.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     

14 May, 2018

1 commit

  • Not all platforms use device tree. It is useful to be able to add
    cells to a NVMEM device from code. Export nvmem_add_cells() so making
    this possible.

    This required changing the parameters a bit, so that just the cells
    and the number of cells are passed, not the whole nvmem config
    structure.

    Signed-off-by: Andrew Lunn
    Reviewed-by: Andrey Smirnov
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Andrew Lunn
     

15 Mar, 2018

3 commits

  • Introduce devm_nvmem_register()/devm_nvmem_unregister() to make
    .remove() unnecessary in trivial drivers.

    Cc: Srinivas Kandagatla
    Cc: Heiko Stuebner
    Cc: Masahiro Yamada
    Cc: Carlo Caione
    Cc: Kevin Hilman
    Cc: Matthias Brugger
    Cc: cphealy@gmail.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mediatek@lists.infradead.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: linux-amlogic@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Andrey Smirnov
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Andrey Smirnov
     
  • Add code to allow avoid having nvmem core append a numeric suffix to
    the end of the name by passing config->id of -1.

    Cc: Srinivas Kandagatla
    Cc: Heiko Stuebner
    Cc: Masahiro Yamada
    Cc: Carlo Caione
    Cc: Kevin Hilman
    Cc: Matthias Brugger
    Cc: cphealy@gmail.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mediatek@lists.infradead.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: linux-amlogic@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Andrey Smirnov
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Andrey Smirnov
     
  • Add a simple description of struct nvmem_config and its fields.

    Cc: Srinivas Kandagatla
    Cc: Heiko Stuebner
    Cc: Masahiro Yamada
    Cc: Carlo Caione
    Cc: Kevin Hilman
    Cc: Matthias Brugger
    Cc: cphealy@gmail.com
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mediatek@lists.infradead.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: linux-amlogic@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Andrey Smirnov
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Andrey Smirnov
     

10 Jul, 2017

1 commit

  • The new support for nvmem devices from the rtc layer caused a build
    error in some configurations:

    include/linux/nvmem-provider.h: In function 'nvmem_register':
    include/linux/nvmem-provider.h:51:9: error: implicit declaration of function 'ERR_PTR' [-Werror=implicit-function-declaration]

    This adds the missing include to ensure we can always include
    the header.

    Fixes: 697e5a47aa12 ("rtc: add generic nvmem support")
    Signed-off-by: Arnd Bergmann
    Acked-by: Srinivas Kandagatla
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     

02 May, 2016

1 commit

  • nvmem uses regmap_raw_read/write apis to read/write data from providers,
    regmap raw apis stopped working with recent kernels which removed raw
    accessors on mmio bus. This resulted in broken nvmem for providers
    which are based on regmap mmio bus. This issue can be fixed temporarly
    by moving to other regmap apis, but we might hit same issue in future.
    Moving to interfaces based on read/write callbacks from providers would
    be more robust.

    This patch removes regmap dependency from nvmem and introduces
    read/write callbacks from the providers.

    Without this patch nvmem providers like qfprom based on regmap mmio
    bus would not work.

    Reported-by: Rajendra Nayak
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Greg Kroah-Hartman

    Srinivas Kandagatla
     

02 Mar, 2016

2 commits


06 Aug, 2015

1 commit

  • This patch adds just providers part of the framework just to enable easy
    review.

    Up until now, NVMEM drivers like eeprom were stored in drivers/misc,
    where they all had to duplicate pretty much the same code to register
    a sysfs file, allow in-kernel users to access the content of the devices
    they were driving, etc.

    This was also a problem as far as other in-kernel users were involved,
    since the solutions used were pretty much different from on driver to
    another, there was a rather big abstraction leak.

    This introduction of this framework aims at solving this. It also
    introduces DT representation for consumer devices to go get the data
    they require (MAC Addresses, SoC/Revision ID, part numbers, and so on)
    from the nvmems.

    Having regmap interface to this framework would give much better
    abstraction for nvmems on different buses.

    Signed-off-by: Maxime Ripard
    [Maxime Ripard: intial version of eeprom framework]
    Signed-off-by: Srinivas Kandagatla
    Tested-by: Stefan Wahren
    Tested-by: Philipp Zabel
    Tested-by: Rajendra Nayak
    Signed-off-by: Greg Kroah-Hartman

    Srinivas Kandagatla