]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nvmem: core: support passing DT node in cell info
authorRafał Miłecki <rafal@milecki.pl>
Fri, 29 Apr 2022 16:26:46 +0000 (17:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 13:44:21 +0000 (15:44 +0200)
Some hardware may have NVMEM cells described in Device Tree using
individual nodes. Let drivers pass such nodes to the NVMEM subsystem so
they can be later used by NVMEM consumers.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220429162701.2222-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c
include/linux/nvmem-consumer.h

index f58d9bc7aa08363165321ee2e6d100eb6ea45bb9..1e3c754efd0d8dae59d2b40d3876b03bfa11e44b 100644 (file)
@@ -467,6 +467,7 @@ static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,
 
        cell->bit_offset = info->bit_offset;
        cell->nbits = info->nbits;
+       cell->np = info->np;
 
        if (cell->nbits)
                cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
index c0c0cefc3b925658e2b5f61de820b8b90a5b2d39..980f9c9ac0bc6d5689b1a152871e4be40ab31312 100644 (file)
@@ -25,6 +25,7 @@ struct nvmem_cell_info {
        unsigned int            bytes;
        unsigned int            bit_offset;
        unsigned int            nbits;
+       struct device_node      *np;
 };
 
 /**