nvmem: Add mockup nvmem driver
PATCH 1/1 nvmem: Add mockup nvmem driver
This driver provides an easy way to test other drivers that use nvmem.
E.g. Testing that an nvmem-driver that reads from OTP memory works as intended for all possible values without having to actually write all the values to OTP. Swapping the nvmem-driver reading the OTP memory for this dummy driver makes it easy to manipulate the values to test.
Signed-off-by Ludvig Pärsson <[email protected]>
--- drivers/nvmem/Kconfig | 5 +++ drivers/nvmem/Makefile | 2 ++ drivers/nvmem/mockup.c | 80 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 drivers/nvmem/mockup.c
drivers/nvmem/Kconfig +5 -0
@@ -300,4 +300,9 @@ config NVMEM_BRCM_NVRAM This driver provides support for Broadcom's NVRAM that can be accessed using I/O mapping. +config NVMEM_MOCKUP + tristate "Mockup nvmem support" + help + This driver can be used to test other drivers that use nvmem. + endif
drivers/nvmem/Makefile +2 -0
@@ -61,3 +61,5 @@ obj-$(CONFIG_NVMEM_RMEM) += nvmem-rmem.o nvmem-rmem-y := rmem.o obj-$(CONFIG_NVMEM_BRCM_NVRAM) += nvmem_brcm_nvram.o nvmem_brcm_nvram-y := brcm_nvram.o +obj-$(CONFIG_NVMEM_MOCKUP) += nvmem-mockup.o +nvmem-mockup-y := mockup.o
drivers/nvmem/mockup.c new file +80 -0
80 lines not on this page · raw message
Signature · 1 line
2.20.1