linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] doc: nvmem: Remove references to regmap
@ 2022-02-14 16:35 Sean Anderson
  2022-02-14 16:35 ` [PATCH v3 2/2] doc: nvmem: Update example Sean Anderson
  2022-02-14 16:37 ` [PATCH v3 1/2] doc: nvmem: Remove references to regmap Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Sean Anderson @ 2022-02-14 16:35 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc
  Cc: linux-kernel, Michael Walle, Srinivas Kandagatla, Sean Anderson

Since commit 795ddd18d38f ("nvmem: core: remove regmap dependency"),
nvmem devices do not use the regmap API. Remove references to it from
the documentation.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

(no changes since v2)

Changes in v2:
- Replace spaces with tabs

 Documentation/driver-api/nvmem.rst | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/Documentation/driver-api/nvmem.rst b/Documentation/driver-api/nvmem.rst
index 287e86819640..56352ad1b1b0 100644
--- a/Documentation/driver-api/nvmem.rst
+++ b/Documentation/driver-api/nvmem.rst
@@ -26,9 +26,7 @@ was a rather big abstraction leak.
 
 This framework aims at solve these problems. It also introduces DT
 representation for consumer devices to go get the data they require (MAC
-Addresses, SoC/Revision ID, part numbers, and so on) from the NVMEMs. This
-framework is based on regmap, so that most of the abstraction available in
-regmap can be reused, across multiple types of buses.
+Addresses, SoC/Revision ID, part numbers, and so on) from the NVMEMs.
 
 NVMEM Providers
 +++++++++++++++
@@ -60,9 +58,6 @@ For example, a simple qfprom case::
 	...
   }
 
-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::
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v3 2/2] doc: nvmem: Update example
  2022-02-14 16:35 [PATCH v3 1/2] doc: nvmem: Remove references to regmap Sean Anderson
@ 2022-02-14 16:35 ` Sean Anderson
  2022-02-14 16:37 ` [PATCH v3 1/2] doc: nvmem: Remove references to regmap Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Sean Anderson @ 2022-02-14 16:35 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc
  Cc: linux-kernel, Michael Walle, Srinivas Kandagatla, Sean Anderson

Update the example to reflect the new API. I have chosen the brcm-nvram
driver since it seems to be simpler than the qfprom driver.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

Changes in v3:
- Split into two patches as requested
- Fix one missing conversion of econfig to config

 Documentation/driver-api/nvmem.rst | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/Documentation/driver-api/nvmem.rst b/Documentation/driver-api/nvmem.rst
index 56352ad1b1b0..e3366322d46c 100644
--- a/Documentation/driver-api/nvmem.rst
+++ b/Documentation/driver-api/nvmem.rst
@@ -43,19 +43,20 @@ nvmem_device pointer.
 
 nvmem_unregister(nvmem) is used to unregister a previously registered provider.
 
-For example, a simple qfprom case::
+For example, a simple nvram case::
 
-  static struct nvmem_config econfig = {
-	.name = "qfprom",
-	.owner = THIS_MODULE,
-  };
-
-  static int qfprom_probe(struct platform_device *pdev)
+  static int brcm_nvram_probe(struct platform_device *pdev)
   {
+	struct nvmem_config config = {
+		.name = "brcm-nvram",
+		.reg_read = brcm_nvram_read,
+	};
 	...
-	econfig.dev = &pdev->dev;
-	nvmem = nvmem_register(&econfig);
-	...
+	config.dev = &pdev->dev;
+	config.priv = priv;
+	config.size = resource_size(res);
+
+	devm_nvmem_register(&config);
   }
 
 Users of board files can define and register nvmem cells using the
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 1/2] doc: nvmem: Remove references to regmap
  2022-02-14 16:35 [PATCH v3 1/2] doc: nvmem: Remove references to regmap Sean Anderson
  2022-02-14 16:35 ` [PATCH v3 2/2] doc: nvmem: Update example Sean Anderson
@ 2022-02-14 16:37 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2022-02-14 16:37 UTC (permalink / raw)
  To: Sean Anderson, Jonathan Corbet, linux-doc; +Cc: linux-kernel, Michael Walle



On 14/02/2022 16:35, Sean Anderson wrote:
> Since commit 795ddd18d38f ("nvmem: core: remove regmap dependency"),
> nvmem devices do not use the regmap API. Remove references to it from
> the documentation.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>


Applied both thanks,

--srini
> ---
> 
> (no changes since v2)
> 
> Changes in v2:
> - Replace spaces with tabs
> 
>   Documentation/driver-api/nvmem.rst | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/Documentation/driver-api/nvmem.rst b/Documentation/driver-api/nvmem.rst
> index 287e86819640..56352ad1b1b0 100644
> --- a/Documentation/driver-api/nvmem.rst
> +++ b/Documentation/driver-api/nvmem.rst
> @@ -26,9 +26,7 @@ was a rather big abstraction leak.
>   
>   This framework aims at solve these problems. It also introduces DT
>   representation for consumer devices to go get the data they require (MAC
> -Addresses, SoC/Revision ID, part numbers, and so on) from the NVMEMs. This
> -framework is based on regmap, so that most of the abstraction available in
> -regmap can be reused, across multiple types of buses.
> +Addresses, SoC/Revision ID, part numbers, and so on) from the NVMEMs.
>   
>   NVMEM Providers
>   +++++++++++++++
> @@ -60,9 +58,6 @@ For example, a simple qfprom case::
>   	...
>     }
>   
> -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::
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-14 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 16:35 [PATCH v3 1/2] doc: nvmem: Remove references to regmap Sean Anderson
2022-02-14 16:35 ` [PATCH v3 2/2] doc: nvmem: Update example Sean Anderson
2022-02-14 16:37 ` [PATCH v3 1/2] doc: nvmem: Remove references to regmap Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).