aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/nvmem-provider.h
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2023-04-04 18:21:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-05 19:41:11 +0200
commitde12c9691501ccba41a154c223869f82be4c12fd (patch)
treea2f14345216af939da60e31f795eb04bbed62795 /include/linux/nvmem-provider.h
parentnvmem: core: add per-cell post processing (diff)
downloadwireguard-linux-de12c9691501ccba41a154c223869f82be4c12fd.tar.xz
wireguard-linux-de12c9691501ccba41a154c223869f82be4c12fd.zip
nvmem: core: allow to modify a cell before adding it
Provide a way to modify a cell before it will get added. This is useful to attach a custom post processing hook via a layout. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230404172148.82422-18-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nvmem-provider.h')
-rw-r--r--include/linux/nvmem-provider.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 3bfc23553a9e..be81cc88eabc 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -155,6 +155,8 @@ struct nvmem_cell_table {
* @add_cells: Will be called if a nvmem device is found which
* has this layout. The function will add layout
* specific cells with nvmem_add_one_cell().
+ * @fixup_cell_info: Will be called before a cell is added. Can be
+ * used to modify the nvmem_cell_info.
* @owner: Pointer to struct module.
* @node: List node.
*
@@ -168,6 +170,9 @@ struct nvmem_layout {
const struct of_device_id *of_match_table;
int (*add_cells)(struct device *dev, struct nvmem_device *nvmem,
struct nvmem_layout *layout);
+ void (*fixup_cell_info)(struct nvmem_device *nvmem,
+ struct nvmem_layout *layout,
+ struct nvmem_cell_info *cell);
/* private */
struct module *owner;