| /linux/drivers/nvmem/ |
| H A D | core.c | 37 struct nvmem_device *nvmem; member 55 static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset, in __nvmem_reg_read() argument 58 if (nvmem->reg_read) in __nvmem_reg_read() 59 return nvmem->reg_read(nvmem->priv, offset, val, bytes); in __nvmem_reg_read() 64 static int __nvmem_reg_write(struct nvmem_device *nvmem, unsigned int offset, in __nvmem_reg_write() argument 69 if (nvmem->reg_write) { in __nvmem_reg_write() 70 gpiod_set_value_cansleep(nvmem->wp_gpio, 0); in __nvmem_reg_write() 71 ret = nvmem->reg_write(nvmem->priv, offset, val, bytes); in __nvmem_reg_write() 72 gpiod_set_value_cansleep(nvmem->wp_gpio, 1); in __nvmem_reg_write() 79 static int nvmem_access_with_keepouts(struct nvmem_device *nvmem, in nvmem_access_with_keepouts() argument [all …]
|
| H A D | Makefile | 13 obj-$(CONFIG_NVMEM_AN8855_EFUSE) += nvmem-an8855-efuse.o 14 nvmem-an8855-efuse-y := an8855-efuse.o 15 obj-$(CONFIG_NVMEM_APPLE_EFUSES) += nvmem-apple-efuses.o 16 nvmem-apple-efuses-y := apple-efuses.o 18 apple_nvmem_spmi-y := apple-spmi-nvmem.o 19 obj-$(CONFIG_NVMEM_BCM_OCOTP) += nvmem-bcm-ocotp.o 20 nvmem-bcm-ocotp-y := bcm-ocotp.o 23 obj-$(CONFIG_NVMEM_IMX_IIM) += nvmem-imx-iim.o 24 nvmem-imx-iim-y := imx-iim.o 25 obj-$(CONFIG_NVMEM_IMX_OCOTP) += nvmem-imx-ocotp.o [all …]
|
| H A D | layouts.c | 92 static int nvmem_layout_create_device(struct nvmem_device *nvmem, in nvmem_layout_create_device() argument 104 layout->nvmem = nvmem; in nvmem_layout_create_device() 105 nvmem->layout = layout; in nvmem_layout_create_device() 110 dev->parent = &nvmem->dev; in nvmem_layout_create_device() 133 static int nvmem_layout_bus_populate(struct nvmem_device *nvmem, in nvmem_layout_bus_populate() argument 159 ret = nvmem_layout_create_device(nvmem, layout_dn); in nvmem_layout_bus_populate() 168 struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem) in of_nvmem_layout_get_container() argument 170 return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout"); in of_nvmem_layout_get_container() 178 int nvmem_populate_layout(struct nvmem_device *nvmem) in nvmem_populate_layout() argument 183 layout_dn = of_nvmem_layout_get_container(nvmem); in nvmem_populate_layout() [all …]
|
| H A D | max77759-nvmem.c | 36 struct max77759_nvmem *nvmem = priv; in max77759_nvmem_reg_read() local 48 ret = max77759_maxq_command(nvmem->max77759, cmd, rsp); in max77759_nvmem_reg_read() 53 dev_warn(nvmem->dev, "protocol error (read)\n"); in max77759_nvmem_reg_read() 65 struct max77759_nvmem *nvmem = priv; in max77759_nvmem_reg_write() local 79 ret = max77759_maxq_command(nvmem->max77759, cmd, rsp); in max77759_nvmem_reg_write() 84 dev_warn(nvmem->dev, "protocol error (write)\n"); in max77759_nvmem_reg_write() 105 struct max77759_nvmem *nvmem; in max77759_nvmem_probe() local 107 nvmem = devm_kzalloc(&pdev->dev, sizeof(*nvmem), GFP_KERNEL); in max77759_nvmem_probe() 108 if (!nvmem) in max77759_nvmem_probe() 111 nvmem->dev = &pdev->dev; in max77759_nvmem_probe() [all …]
|
| H A D | internals.h | 26 void (*fixup_dt_cell_info)(struct nvmem_device *nvmem, 41 int nvmem_populate_layout(struct nvmem_device *nvmem); 42 void nvmem_destroy_layout(struct nvmem_device *nvmem); 51 static inline int nvmem_populate_layout(struct nvmem_device *nvmem) in nvmem_populate_layout() argument 56 static inline void nvmem_destroy_layout(struct nvmem_device *nvmem) { } in nvmem_destroy_layout() argument
|
| H A D | u-boot-env.c | 18 struct nvmem_device *nvmem; member 73 priv->nvmem = devm_nvmem_register(dev, &config); in u_boot_env_probe() 74 if (IS_ERR(priv->nvmem)) in u_boot_env_probe() 75 return PTR_ERR(priv->nvmem); in u_boot_env_probe() 77 return u_boot_env_parse(dev, priv->nvmem, priv->format); in u_boot_env_probe()
|
| H A D | Kconfig | 16 bool "/sys/bus/nvmem/devices/*/nvmem (sysfs interface)" 23 read/write directly into nvmem. 27 source "drivers/nvmem/layouts/Kconfig" 40 be called nvmem-an8855-efuse. 51 be called nvmem-apple-efuses. 64 will be called apple-nvmem-spmi. 76 will be called nvmem-bcm-ocotp. 96 will be called nvmem-imx-iim. 108 will be called nvmem-imx-ocotp. 190 will be called nvmem-max77759. [all …]
|
| /linux/include/linux/ |
| H A D | nvmem-consumer.h | 72 void nvmem_device_put(struct nvmem_device *nvmem); 73 void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem); 74 int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, 76 int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, 78 ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, 80 int nvmem_device_cell_write(struct nvmem_device *nvmem, 83 const char *nvmem_dev_name(struct nvmem_device *nvmem); 84 size_t nvmem_dev_size(struct nvmem_device *nvmem); 181 static inline void nvmem_device_put(struct nvmem_device *nvmem) in nvmem_device_put() argument 186 struct nvmem_device *nvmem) in devm_nvmem_device_put() argument [all …]
|
| H A D | nvmem-provider.h | 119 void (*fixup_dt_cell_info)(struct nvmem_device *nvmem, 156 struct nvmem_device *nvmem; member 169 void nvmem_unregister(struct nvmem_device *nvmem); 174 int nvmem_add_one_cell(struct nvmem_device *nvmem, 196 static inline void nvmem_unregister(struct nvmem_device *nvmem) {} in nvmem_unregister() argument 204 static inline int nvmem_add_one_cell(struct nvmem_device *nvmem, in nvmem_add_one_cell() argument 229 struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem); 233 static inline struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem) in of_nvmem_layout_get_container() argument
|
| /linux/arch/arm64/boot/dts/freescale/ |
| H A D | fsl-ls1028a-kontron-kbox-a-230-ls.dts | 59 nvmem-cells = <&base_mac_address 2>; 60 nvmem-cell-names = "mac-address"; 65 nvmem-cells = <&base_mac_address 3>; 66 nvmem-cell-names = "mac-address"; 87 nvmem-cells = <&base_mac_address 4>; 88 nvmem-cell-names = "mac-address"; 97 nvmem-cells = <&base_mac_address 5>; 98 nvmem-cell-names = "mac-address"; 107 nvmem-cells = <&base_mac_address 6>; 108 nvmem-cell-names = "mac-address"; [all …]
|
| H A D | fsl-ls1028a-kontron-sl28-var2.dts | 39 nvmem-cells = <&base_mac_address 2>; 40 nvmem-cell-names = "mac-address"; 45 nvmem-cells = <&base_mac_address 3>; 46 nvmem-cell-names = "mac-address"; 59 nvmem-cells = <&base_mac_address 0>; 60 nvmem-cell-names = "mac-address"; 69 nvmem-cells = <&base_mac_address 1>; 70 nvmem-cell-names = "mac-address";
|
| /linux/drivers/soc/tegra/fuse/ |
| H A D | fuse-tegra.c | 143 struct nvmem_config nvmem; in tegra_fuse_probe() local 208 memset(&nvmem, 0, sizeof(nvmem)); in tegra_fuse_probe() 209 nvmem.dev = &pdev->dev; in tegra_fuse_probe() 210 nvmem.name = "fuse"; in tegra_fuse_probe() 211 nvmem.id = -1; in tegra_fuse_probe() 212 nvmem.owner = THIS_MODULE; in tegra_fuse_probe() 213 nvmem.cells = fuse->soc->cells; in tegra_fuse_probe() 214 nvmem.ncells = fuse->soc->num_cells; in tegra_fuse_probe() 215 nvmem.keepout = fuse->soc->keepouts; in tegra_fuse_probe() 216 nvmem.nkeepout = fuse->soc->num_keepouts; in tegra_fuse_probe() [all …]
|
| /linux/arch/arm/boot/dts/broadcom/ |
| H A D | bcm47094-asus-rt-ac3100.dts | 16 #nvmem-cell-cells = <1>; 22 nvmem-cells = <&et0macaddr 0>; 23 nvmem-cell-names = "mac-address"; 27 nvmem-cells = <&et0macaddr 1>; 28 nvmem-cell-names = "mac-address"; 32 nvmem-cells = <&et0macaddr 2>; 33 nvmem-cell-names = "mac-address";
|
| H A D | bcm4709-asus-rt-ac3200.dts | 28 #nvmem-cell-cells = <1>; 79 nvmem-cells = <&et0macaddr 0>; 80 nvmem-cell-names = "mac-address"; 84 nvmem-cells = <&et0macaddr 1>; 85 nvmem-cell-names = "mac-address"; 89 nvmem-cells = <&et0macaddr 2>; 90 nvmem-cell-names = "mac-address";
|
| H A D | bcm47094-asus-rt-ac5300.dts | 28 #nvmem-cell-cells = <1>; 85 nvmem-cells = <&et1macaddr 0>; 86 nvmem-cell-names = "mac-address"; 90 nvmem-cells = <&et1macaddr 1>; 91 nvmem-cell-names = "mac-address"; 95 nvmem-cells = <&et1macaddr 2>; 96 nvmem-cell-names = "mac-address";
|
| H A D | bcm47094-luxul-abr-4500.dts | 30 #nvmem-cell-cells = <1>; 69 nvmem-cells = <&et0macaddr 0>; 70 nvmem-cell-names = "mac-address"; 87 nvmem-cells = <&et0macaddr 1>; 88 nvmem-cell-names = "mac-address";
|
| H A D | bcm47094-luxul-xbr-4500.dts | 30 #nvmem-cell-cells = <1>; 69 nvmem-cells = <&et0macaddr 0>; 70 nvmem-cell-names = "mac-address"; 87 nvmem-cells = <&et0macaddr 1>; 88 nvmem-cell-names = "mac-address";
|
| H A D | bcm47094-asus-rt-ac88u.dts | 16 #nvmem-cell-cells = <1>; 101 nvmem-cells = <&et1macaddr 0>; 102 nvmem-cell-names = "mac-address"; 106 nvmem-cells = <&et1macaddr 1>; 107 nvmem-cell-names = "mac-address";
|
| /linux/Documentation/driver-api/ |
| H A D | nvmem.rst | 41 nvmem configuration to nvmem_register(), on success core would return a valid 62 Device drivers can define and register an nvmem cell using the nvmem_cell_info 73 int nvmem_add_one_cell(nvmem, &foo_nvmem_cell); 75 Additionally it is possible to create nvmem cell lookup entries and register 76 them with the nvmem framework from machine code as shown in the example below:: 108 `*nvmem_cell_get()` apis will get a reference to nvmem cell for a given id, 124 void nvmem_device_put(struct nvmem_device *nvmem); 125 int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, 127 int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, 129 int nvmem_device_cell_read(struct nvmem_device *nvmem, [all …]
|
| /linux/Documentation/devicetree/bindings/net/ |
| H A D | nixge.txt | 15 - nvmem-cells: Phandle of nvmem cell containing the MAC address 16 - nvmem-cell-names: Should be "address" 31 nvmem-cells = <ð1_addr>; 32 nvmem-cell-names = "address"; 54 nvmem-cells = <ð1_addr>; 55 nvmem-cell-names = "address"; 70 nvmem-cells = <ð1_addr>; 71 nvmem-cell-names = "address";
|
| /linux/drivers/soc/ti/ |
| H A D | pm33xx.c | 276 struct nvmem_device *nvmem; in am33xx_pm_begin() local 279 nvmem = devm_nvmem_device_get(&omap_rtc->dev, in am33xx_pm_begin() 281 if (!IS_ERR(nvmem)) in am33xx_pm_begin() 282 nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4, in am33xx_pm_begin() 306 struct nvmem_device *nvmem; in am33xx_pm_end() local 308 nvmem = devm_nvmem_device_get(&omap_rtc->dev, "omap_rtc_scratch0"); in am33xx_pm_end() 309 if (IS_ERR(nvmem)) in am33xx_pm_end() 327 nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4, in am33xx_pm_end() 430 struct nvmem_device *nvmem; in am33xx_pm_rtc_setup() local 455 nvmem = devm_nvmem_device_get(&omap_rtc->dev, in am33xx_pm_rtc_setup() [all …]
|
| /linux/Documentation/ABI/stable/ |
| H A D | sysfs-bus-nvmem | 1 What: /sys/bus/nvmem/devices/.../force_ro 18 What: /sys/bus/nvmem/devices/.../nvmem 24 Permissions for write to this file depends on the nvmem 31 hexdump /sys/bus/nvmem/devices/qfprom0/nvmem 41 What: /sys/bus/nvmem/devices/.../type
|
| /linux/drivers/rtc/ |
| H A D | nvmem.c | 17 struct nvmem_device *nvmem; in devm_rtc_nvmem_register() local 25 nvmem = devm_nvmem_register(dev, nvmem_config); in devm_rtc_nvmem_register() 26 if (IS_ERR(nvmem)) in devm_rtc_nvmem_register() 29 return PTR_ERR_OR_ZERO(nvmem); in devm_rtc_nvmem_register()
|
| /linux/drivers/nvmem/layouts/ |
| H A D | u-boot-env.c | 54 static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf, in u_boot_env_parse_cells() argument 83 nvmem_add_one_cell(nvmem, &info); in u_boot_env_parse_cells() 89 int u_boot_env_parse(struct device *dev, struct nvmem_device *nvmem, in u_boot_env_parse() argument 107 nvmem_dev_size(nvmem) : (size_t)env_size; in u_boot_env_parse() 115 bytes = nvmem_device_read(nvmem, 0, dev_size, buf); in u_boot_env_parse() 161 err = u_boot_env_parse_cells(dev, nvmem, buf, data_offset, data_len); in u_boot_env_parse() 177 return u_boot_env_parse(dev, layout->nvmem, format); in u_boot_env_add_cells()
|
| /linux/drivers/mtd/ubi/ |
| H A D | nvmem.c | 15 struct nvmem_device *nvmem; member 99 unv->nvmem = nvmem_register(&config); in ubi_nvmem_add() 100 if (IS_ERR(unv->nvmem)) { in ubi_nvmem_add() 101 ret = dev_err_probe(vi->dev, PTR_ERR(unv->nvmem), in ubi_nvmem_add() 132 nvmem_unregister(unv->nvmem); in ubi_nvmem_remove() 178 nvmem_unregister(unv->nvmem); in ubi_nvmem_exit()
|