809-v5.19-0004-nvmem-core-support-passing-DT-node-in-cell-info.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From dbc2f62061c6bfba0aee93161ee3194dcee84bd0 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Fri, 29 Apr 2022 17:26:46 +0100
  4. Subject: [PATCH] nvmem: core: support passing DT node in cell info
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Some hardware may have NVMEM cells described in Device Tree using
  9. individual nodes. Let drivers pass such nodes to the NVMEM subsystem so
  10. they can be later used by NVMEM consumers.
  11. Signed-off-by: Rafał Miłecki <[email protected]>
  12. Signed-off-by: Srinivas Kandagatla <[email protected]>
  13. Link: https://lore.kernel.org/r/[email protected]
  14. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  15. ---
  16. drivers/nvmem/core.c | 1 +
  17. include/linux/nvmem-consumer.h | 1 +
  18. 2 files changed, 2 insertions(+)
  19. --- a/drivers/nvmem/core.c
  20. +++ b/drivers/nvmem/core.c
  21. @@ -467,6 +467,7 @@ static int nvmem_cell_info_to_nvmem_cell
  22. cell->bit_offset = info->bit_offset;
  23. cell->nbits = info->nbits;
  24. + cell->np = info->np;
  25. if (cell->nbits)
  26. cell->bytes = DIV_ROUND_UP(cell->nbits + cell->bit_offset,
  27. --- a/include/linux/nvmem-consumer.h
  28. +++ b/include/linux/nvmem-consumer.h
  29. @@ -25,6 +25,7 @@ struct nvmem_cell_info {
  30. unsigned int bytes;
  31. unsigned int bit_offset;
  32. unsigned int nbits;
  33. + struct device_node *np;
  34. };
  35. /**