summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem/imx-ocotp.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2023-02-06 13:43:46 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-06 19:06:59 +0100
commit5d8e6e6c10a3d37486d263b16ddc15991a7e4a88 (patch)
tree1e697b87dca46cf6d93fc4c007b3c4348f1018d9 /drivers/nvmem/imx-ocotp.c
parente2d8172043d2e50df19fcd59c11e5593de8188d7 (diff)
downloadlinux-stable-5d8e6e6c10a3d37486d263b16ddc15991a7e4a88.tar.gz
linux-stable-5d8e6e6c10a3d37486d263b16ddc15991a7e4a88.tar.bz2
linux-stable-5d8e6e6c10a3d37486d263b16ddc15991a7e4a88.zip
nvmem: core: add an index parameter to the cell
Sometimes a cell can represend multiple values. For example, a base ethernet address stored in the NVMEM can be expanded into multiple discreet ones by adding an offset. For this use case, introduce an index parameter which is then used to distiguish between values. This parameter will then be passed to the post process hook which can then use it to create different values during reading. At the moment, there is only support for the device tree path. You can add the index to the phandle, e.g. &net { nvmem-cells = <&base_mac_address 2>; nvmem-cell-names = "mac-address"; }; &nvmem_provider { base_mac_address: base-mac-address@0 { #nvmem-cell-cells = <1>; reg = <0 6>; }; }; Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230206134356.839737-13-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem/imx-ocotp.c')
-rw-r--r--drivers/nvmem/imx-ocotp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index 14284e866f26..e9b52ecb3f72 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -222,8 +222,8 @@ read_end:
return ret;
}
-static int imx_ocotp_cell_pp(void *context, const char *id, unsigned int offset,
- void *data, size_t bytes)
+static int imx_ocotp_cell_pp(void *context, const char *id, int index,
+ unsigned int offset, void *data, size_t bytes)
{
struct ocotp_priv *priv = context;