summaryrefslogtreecommitdiffstats
path: root/include/linux/nvmem-provider.h
Commit message (Collapse)AuthorAgeFilesLines
* nvmem: add support for nvmem-cells bindingAhmad Fatoum2021-06-211-0/+8
| | | | | | | | | | | | 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>
* nvmem: add nvmem_regmap_register helperAhmad Fatoum2021-06-021-0/+8
| | | | | | | | | | | | | | | | Registering a nvmem device for a regmap involves some boilerplate that doesn't need to change from driver to driver: - Reads are made aligned, to support normal use with md - Writes are passed along as is - nvmem parameters can be extracted from regmap Instead of having to replicate this driver by driver, add one helper to make this adaptation easier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531072406.5630-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvmem: provider: align read/write callback prototype with upstreamAhmad Fatoum2021-06-021-4/+3
| | | | | | | | | | | | | | barebox allocates a NVMEM device as part of nvmem_register, which it passes along to the callbacks. Callbacks then use dev->parent->priv to retrieve the driver private data. This indirection makes definition of nvmem helpers inconvenient, because they would need to hijack the ->priv member of the hardware device. Avoid this by passing along some private data pointer defined at registration time, just like Linux does. This will be used in a follow up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531072406.5630-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: add nvmem framework from kernelSteffen Trumtrar2017-03-301-0/+49
Add the nvmem framework from Linux. Based on the v4.4-rc3 version. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>