[PATCH v2 2/2] nvmem: layouts: Make the fixed-layout driver optional
From: Mathieu Dubois-Briand
Date: Fri May 15 2026 - 08:34:53 EST
The fixed-layout support is now managed by a separate driver, so we can
make this support optional. This aligns with the approach taken for
other layout drivers.
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@xxxxxxxxxxx>
---
drivers/nvmem/core.c | 1 +
drivers/nvmem/layouts/Kconfig | 8 ++++++++
drivers/nvmem/layouts/Makefile | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 0ec4924c4bda..594180d4b889 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -834,6 +834,7 @@ int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
return 0;
}
+EXPORT_SYMBOL_GPL(nvmem_add_cells_from_dt);
static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem)
{
diff --git a/drivers/nvmem/layouts/Kconfig b/drivers/nvmem/layouts/Kconfig
index 5e586dfebe47..f823d56210a3 100644
--- a/drivers/nvmem/layouts/Kconfig
+++ b/drivers/nvmem/layouts/Kconfig
@@ -8,6 +8,14 @@ if NVMEM_LAYOUTS
menu "Layout Types"
+config NVMEM_LAYOUT_FIXED_LAYOUT
+ tristate "Fixed layout support"
+ help
+ Say Y here to enable support for NVMEM fixed layout, which provides a
+ way to describe memory cells with fixed offsets and sizes.
+
+ If unsure, say N.
+
config NVMEM_LAYOUT_SL28_VPD
tristate "Kontron sl28 VPD layout support"
select CRC8
diff --git a/drivers/nvmem/layouts/Makefile b/drivers/nvmem/layouts/Makefile
index dd6c6c70b1a9..9da790a9dde9 100644
--- a/drivers/nvmem/layouts/Makefile
+++ b/drivers/nvmem/layouts/Makefile
@@ -3,7 +3,7 @@
# Makefile for nvmem layouts.
#
-obj-$(CONFIG_NVMEM_LAYOUTS) += fixed-layout.o
+obj-$(CONFIG_NVMEM_LAYOUT_FIXED_LAYOUT) += fixed-layout.o
obj-$(CONFIG_NVMEM_LAYOUT_SL28_VPD) += sl28vpd.o
obj-$(CONFIG_NVMEM_LAYOUT_ONIE_TLV) += onie-tlv.o
obj-$(CONFIG_NVMEM_LAYOUT_U_BOOT_ENV) += u-boot-env.o
--
2.47.3