linux-stable/drivers/nvmem
Michael Walle 5d8e6e6c10 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>
2023-02-06 19:06:59 +01:00
..
apple-efuses.c nvmem: Add Apple eFuse driver 2022-05-09 15:44:21 +02:00
bcm-ocotp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
brcm_nvram.c nvmem: brcm_nvram: Add check for kzalloc 2023-01-28 14:36:28 +01:00
core.c nvmem: core: add an index parameter to the cell 2023-02-06 19:06:59 +01:00
imx-iim.c nvmem: imx-iim: Use of_device_get_match_data() 2021-02-04 17:04:18 +01:00
imx-ocotp-scu.c nvmem: imx: scu: correct the fuse word index 2020-01-10 13:52:12 +01:00
imx-ocotp.c nvmem: core: add an index parameter to the cell 2023-02-06 19:06:59 +01:00
jz4780-efuse.c nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:20:02 +02:00
Kconfig nvmem: Kconfig: Fix spelling mistake "controlls" -> "controls" 2022-11-23 19:44:52 +01:00
lan9662-otpc.c nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear() 2022-11-22 18:22:05 +01:00
layerscape-sfp.c nvmem: sfp: Add support for TA 2.1 devices 2022-05-09 15:46:29 +02:00
lpc18xx_eeprom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lpc18xx_otp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile nvmem: lan9662-otp: add support 2022-09-24 14:54:38 +02:00
meson-efuse.c firmware: meson_sm: Rework driver as a proper platform driver 2019-10-03 08:43:33 -07:00
meson-mx-efuse.c nvmem: meson-mx-efuse: replace unnecessary devm_kstrdup() 2022-02-21 18:00:30 +01:00
microchip-otpc.c nvmem: microchip-otpc: add support 2022-07-08 15:45:05 +02:00
mtk-efuse.c nvmem: mtk-efuse: Simplify with devm_platform_get_and_ioremap_resource() 2022-07-08 15:45:05 +02:00
mxs-ocotp.c nvmem: mxs-ocotp: Use devm_add_action_or_reset() for cleanup 2020-03-23 20:05:23 +01:00
nintendo-otp.c nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP 2021-08-13 10:27:20 +02:00
qcom-spmi-sdam.c nvmem: qcom-spmi-sdam: fix module autoloading 2023-01-28 14:39:31 +01:00
qfprom.c nvmem: qfprom: using pm_runtime_resume_and_get instead of pm_runtime_get_sync 2022-05-09 15:45:39 +02:00
rave-sp-eeprom.c
rmem.c nvmem: rmem: Fix return value check in rmem_read() 2022-11-22 18:21:58 +01:00
rockchip-efuse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
rockchip-otp.c nvmem: add Rockchip OTP driver 2019-11-05 18:35:33 +01:00
sc27xx-efuse.c nvmem: sc27xx: add sc2730 efuse support 2020-07-29 17:12:08 +02:00
snvs_lpgpr.c nvmem: convert comma to semicolon 2021-04-02 16:26:33 +02:00
sprd-efuse.c nvmem: sprd: Fix an error message 2021-05-14 13:39:50 +02:00
stm32-romem.c nvmem: stm32: fix spelling typo in comment 2022-11-23 19:44:52 +01:00
sunplus-ocotp.c nvmem: sunplus-ocotp: drop useless probe confirmation 2022-04-24 17:15:15 +02:00
sunxi_sid.c nvmem: sunxi_sid: Drop the workaround on A64 2023-02-06 19:06:58 +01:00
u-boot-env.c nvmem: u-boot-env: add Broadcom format support 2022-11-23 19:44:52 +01:00
uniphier-efuse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
vf610-ocotp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
zynqmp_nvmem.c firmware: xilinx: Remove eemi ops for get_chipid 2020-04-28 15:45:06 +02:00