Lines Matching full:nvmem

4 NVMEM Subsystem
9 This document explains the NVMEM Framework along with the APIs provided,
14 *NVMEM* is the abbreviation for Non Volatile Memory layer. It is used to
18 Before this framework existed, NVMEM drivers like eeprom were stored in
31 NVMEM Providers
34 NVMEM provider refers to an entity that implements methods to initialize, read
37 2. Registering/Unregistering the NVMEM provider
40 A NVMEM provider can register with NVMEM core by supplying relevant
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::
87 NVMEM Consumers
90 NVMEM consumers are the entities which make use of the NVMEM provider to
91 read from and to NVMEM.
93 3. NVMEM cell based consumer APIs
96 NVMEM cells are the data entries/fields in the NVMEM.
97 The NVMEM framework provides 3 APIs to read/write NVMEM cells::
108 `*nvmem_cell_get()` apis will get a reference to nvmem cell for a given id,
113 4. Direct NVMEM device based consumer APIs
116 In some instances it is necessary to directly read/write the NVMEM.
117 To facilitate such consumers NVMEM framework provides below apis::
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,
131 int nvmem_device_cell_write(struct nvmem_device *nvmem,
134 Before the consumers can read/write NVMEM directly, it should get hold
140 5. Releasing a reference to the NVMEM
143 When a consumer no longer needs the NVMEM, it has to release the reference
144 to the NVMEM it has obtained using the APIs mentioned in the above section.
145 The NVMEM framework provides 2 APIs to release a reference to the NVMEM::
149 void nvmem_device_put(struct nvmem_device *nvmem);
150 void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem);
152 Both these APIs are used to release a reference to the NVMEM and
154 with this NVMEM.
162 Userspace can read/write the raw NVMEM file located at::
164 /sys/bus/nvmem/devices/*/nvmem
168 hexdump /sys/bus/nvmem/devices/qfprom0/nvmem
181 See Documentation/devicetree/bindings/nvmem/nvmem.txt
183 8. NVMEM layouts
186 NVMEM layouts are yet another mechanism to create cells. With the device
190 the NVMEM device content has to be first parsed and the cells need to
191 be added accordingly. Layouts let you read the content of the NVMEM device
201 .. kernel-doc:: drivers/nvmem/core.c