[PATCH v3 0/3] nvmem: add ONIE NVMEM cells provider
From: Vadym Kochan
Date: Sun Aug 30 2020 - 21:56:20 EST
This series adds cells provider for the ONIE TLV attributes which are
stored on NVMEM device. It adds possibility to read the mac address (and
other info) by other drivers.
There is a special case for this driver that before registering cells
the nvmem device should be first parsed to read the TLV layout which
holds the cells data.
v3:
1) Update core.c changes by extending notification mechanism
by adding new NVMEM_PRE_ADD event id which is called before lookup
table cells binding, this allows for notification handler to
register cells which require nvmem parsing.
2) Update onie-cells.c to use nvmem notification to parse and
register cells before device and cells are finally registered.
Use subsys_init() macro which allows to probe before nvmem drivers.
3) at24 driver enables regulator and pm state machine after nvmem
registration which does not allow to use it on handing NVMEM_PRE_ADD event.
v2:
1) Fixed wrong memcmp comparison
Vadym Kochan (3):
nvmem: core: allow to register cells during nvmem registration
nvmem: add ONIE NVMEM cells support
misc: eeprom: at24: register nvmem only after eeprom is ready to use
drivers/misc/eeprom/at24.c | 11 +-
drivers/nvmem/Kconfig | 9 +
drivers/nvmem/Makefile | 3 +
drivers/nvmem/core.c | 2 +
drivers/nvmem/onie-cells.c | 410 +++++++++++++++++++++++++++++++++
include/linux/nvmem-consumer.h | 1 +
6 files changed, 432 insertions(+), 4 deletions(-)
create mode 100644 drivers/nvmem/onie-cells.c
--
2.17.1