diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-06-19 05:45:07 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-21 08:04:36 +0200 |
commit | d61d31fc4d4beaf261ff9f7f9d24907f52576d7e (patch) | |
tree | 0bd9b63fb2960acae423f6c3d91cfef27f314d79 /include | |
parent | 20dbfeaff73ff9417bf0fa74e373ffa1f1059a60 (diff) | |
download | barebox-d61d31fc4d4beaf261ff9f7f9d24907f52576d7e.tar.gz barebox-d61d31fc4d4beaf261ff9f7f9d24907f52576d7e.tar.xz |
nvmem: add support for nvmem-cells binding
Recently, nvmem cell and MTD partition bindings were made to coexist:
Partitions can now be compatible = "nvmem-cells"; which registers a
NVMEM provider and interprets its child nodes as cells. Teach barebox
about this. This allows fetching NVMEM cells from MTD partitions and
hostfiles.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210619034516.6737-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nvmem-provider.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 2d73898373..a293f60c1e 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -26,6 +26,7 @@ struct nvmem_config { struct device_d *dev; const char *name; bool read_only; + struct cdev *cdev; int stride; int word_size; int size; @@ -34,11 +35,13 @@ struct nvmem_config { }; struct regmap; +struct cdev; #if IS_ENABLED(CONFIG_NVMEM) struct nvmem_device *nvmem_register(const struct nvmem_config *cfg); struct nvmem_device *nvmem_regmap_register(struct regmap *regmap, const char *name); +struct nvmem_device *nvmem_partition_register(struct cdev *cdev); #else @@ -52,5 +55,10 @@ static inline struct nvmem_device *nvmem_regmap_register(struct regmap *regmap, return ERR_PTR(-ENOSYS); } +static inline struct nvmem_device *nvmem_partition_register(struct cdev *cdev) +{ + return ERR_PTR(-ENOSYS); +} + #endif /* CONFIG_NVMEM */ #endif /* ifndef _LINUX_NVMEM_PROVIDER_H */ |