Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4903d19c authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Greg Kroah-Hartman
Browse files

Documentation: nvmem: document cell tables and lookup entries



Document the new nvmem kernel APIs.

Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 506157be
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -58,6 +58,37 @@ static int qfprom_probe(struct platform_device *pdev)
It is mandatory that the NVMEM provider has a regmap associated with its
struct device. Failure to do would return error code from nvmem_register().

Users of board files can define and register nvmem cells using the
nvmem_cell_table struct:

static struct nvmem_cell_info foo_nvmem_cells[] = {
	{
		.name		= "macaddr",
		.offset		= 0x7f00,
		.bytes		= ETH_ALEN,
	}
};

static struct nvmem_cell_table foo_nvmem_cell_table = {
	.nvmem_name		= "i2c-eeprom",
	.cells			= foo_nvmem_cells,
	.ncells			= ARRAY_SIZE(foo_nvmem_cells),
};

nvmem_add_cell_table(&foo_nvmem_cell_table);

Additionally it is possible to create nvmem cell lookup entries and register
them with the nvmem framework from machine code as shown in the example below:

static struct nvmem_cell_lookup foo_nvmem_lookup = {
	.nvmem_name		= "i2c-eeprom",
	.cell_name		= "macaddr",
	.dev_id			= "foo_mac.0",
	.con_id			= "mac-address",
};

nvmem_add_cell_lookups(&foo_nvmem_lookup, 1);

NVMEM Consumers
+++++++++++++++