Skip to content

Commit

Permalink
nvmem: Add a simple NVMEM framework for nvmem providers
Browse files Browse the repository at this point in the history
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@free-electrons.com>
[Maxime Ripard: intial version of eeprom framework]
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Srinivas-Kandagatla authored and gregkh committed Aug 5, 2015
1 parent 4edd70c commit eace75c
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ source "drivers/android/Kconfig"

source "drivers/nvdimm/Kconfig"

source "drivers/nvmem/Kconfig"

endmenu
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,4 @@ obj-$(CONFIG_RAS) += ras/
obj-$(CONFIG_THUNDERBOLT) += thunderbolt/
obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/
obj-$(CONFIG_ANDROID) += android/
obj-$(CONFIG_NVMEM) += nvmem/
13 changes: 13 additions & 0 deletions drivers/nvmem/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
menuconfig NVMEM
tristate "NVMEM Support"
select REGMAP
help
Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...

This framework is designed to provide a generic interface to NVMEM
from both the Linux Kernel and the userspace.

This driver can also be built as a module. If so, the module
will be called nvmem_core.

If unsure, say no.
6 changes: 6 additions & 0 deletions drivers/nvmem/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Makefile for nvmem drivers.
#

obj-$(CONFIG_NVMEM) += nvmem_core.o
nvmem_core-y := core.o
Loading

0 comments on commit eace75c

Please sign in to comment.