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 Users of board files can define and register nvmem cells using the
81 Additionally it is possible to create nvmem cell lookup entries and register
82 them with the nvmem framework from machine code as shown in the example below::
93 NVMEM Consumers
96 NVMEM consumers are the entities which make use of the NVMEM provider to
97 read from and to NVMEM.
99 3. NVMEM cell based consumer APIs
102 NVMEM cells are the data entries/fields in the NVMEM.
103 The NVMEM framework provides 3 APIs to read/write NVMEM cells::
114 `*nvmem_cell_get()` apis will get a reference to nvmem cell for a given id,
119 4. Direct NVMEM device based consumer APIs
122 In some instances it is necessary to directly read/write the NVMEM.
123 To facilitate such consumers NVMEM framework provides below apis::
130 void nvmem_device_put(struct nvmem_device *nvmem);
131 int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset,
133 int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset,
135 int nvmem_device_cell_read(struct nvmem_device *nvmem,
137 int nvmem_device_cell_write(struct nvmem_device *nvmem,
140 Before the consumers can read/write NVMEM directly, it should get hold
146 5. Releasing a reference to the NVMEM
149 When a consumer no longer needs the NVMEM, it has to release the reference
150 to the NVMEM it has obtained using the APIs mentioned in the above section.
151 The NVMEM framework provides 2 APIs to release a reference to the NVMEM::
155 void nvmem_device_put(struct nvmem_device *nvmem);
156 void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem);
158 Both these APIs are used to release a reference to the NVMEM and
160 with this NVMEM.
168 Userspace can read/write the raw NVMEM file located at::
170 /sys/bus/nvmem/devices/*/nvmem
174 hexdump /sys/bus/nvmem/devices/qfprom0/nvmem
187 See Documentation/devicetree/bindings/nvmem/nvmem.txt
189 8. NVMEM layouts
192 NVMEM layouts are yet another mechanism to create cells. With the device
196 the NVMEM device content has to be first parsed and the cells need to
197 be added accordingly. Layouts let you read the content of the NVMEM device
207 .. kernel-doc:: drivers/nvmem/core.c