All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
@ 2024-04-11 10:01 Fabio Aiuto
  2024-04-11 10:01 ` [PATCH v2 1/1] " Fabio Aiuto
  2024-04-11 12:37 ` [PATCH v2 0/1] " Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Fabio Aiuto @ 2024-04-11 10:01 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, linux-kernel

Hello all,

sorry for spamming, this one have the correct email addresses.
This patch adds a property for to control reset behavior on
PMIC_RST_B assertion.

---
v1 ---> v2:
	- Fix email addresses

Fabio Aiuto (1):
  regulator: pca9450: make warm reset on PMIC_RST_B assertion

 .../bindings/regulator/nxp,pca9450-regulator.yaml     |  6 ++++++
 drivers/regulator/pca9450-regulator.c                 | 11 ++++++++---
 include/linux/regulator/pca9450.h                     |  6 ++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

-- 
2.34.1


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

* [PATCH v2 1/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 10:01 [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion Fabio Aiuto
@ 2024-04-11 10:01 ` Fabio Aiuto
  2024-04-11 14:46   ` Krzysztof Kozlowski
  2024-04-11 12:37 ` [PATCH v2 0/1] " Mark Brown
  1 sibling, 1 reply; 7+ messages in thread
From: Fabio Aiuto @ 2024-04-11 10:01 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, linux-kernel; +Cc: Matteo Lisi, Mirko Ardinghi

The default configuration of the PMIC behavior makes the PMIC
power cycle most regulators on PMIC_RST_B assertion. This power
cycling causes the memory contents of OCRAM to be lost.
Some systems needs some memory that survives reset and
reboot, therefore this patch is created.

This patch extends commit 2364a64d0673 ("regulator: pca9450:
Make warm reset on WDOG_B assertion") to the other reset
input source PMIC_RST_B as per pmic specs.

CC: Matteo Lisi <matteo.lisi@engicam.com>
CC: Mirko Ardinghi <mirko.ardinghi@engicam.com>
Signed-off-by: Fabio Aiuto <fabio.aiuto@engicam.com>
---
 .../bindings/regulator/nxp,pca9450-regulator.yaml     |  6 ++++++
 drivers/regulator/pca9450-regulator.c                 | 11 ++++++++---
 include/linux/regulator/pca9450.h                     |  6 ++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
index 849bfa50bdba..1030375a8578 100644
--- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
@@ -93,6 +93,12 @@ properties:
       When WDOG_B signal is asserted a warm reset will be done instead of cold
       reset.
 
+  nxp,pmic_rst_b-warm-reset:
+    type: boolean
+    description:
+      When PMIC_RST_B signal is asserted a warm reset will be done instead of cold
+      reset.
+
 required:
   - compatible
   - reg
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index be488c5dff14..6e3823032e6c 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -999,11 +999,16 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
 	else
 		reset_ctrl = WDOG_B_CFG_COLD_LDO12;
 
-	/* Set reset behavior on assertion of WDOG_B signal */
+	if (of_property_read_bool(i2c->dev.of_node, "nxp,pmic_rst_b-warm-reset"))
+		reset_ctrl |= PMIC_RST_CFG_WARM;
+	else
+		reset_ctrl |= PMIC_RST_CFG_COLD_LDO12;
+
+	/* Set reset behavior on assertion of WDOG_B/PMIC_RST_B signal */
 	ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL,
-				 WDOG_B_CFG_MASK, reset_ctrl);
+				 WDOG_B_CFG_MASK | PMIC_RST_CFG_MASK, reset_ctrl);
 	if (ret) {
-		dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n");
+		dev_err(&i2c->dev, "Failed to set WDOG_B/PMIC_RST_B reset behavior\n");
 		return ret;
 	}
 
diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h
index 243633c8dceb..d87f0b410b00 100644
--- a/include/linux/regulator/pca9450.h
+++ b/include/linux/regulator/pca9450.h
@@ -227,6 +227,12 @@ enum {
 #define WDOG_B_CFG_COLD_LDO12		0x80
 #define WDOG_B_CFG_COLD			0xC0
 
+#define PMIC_RST_CFG_MASK		0x30
+#define PMIC_RST_CFG_NONE		0x00
+#define PMIC_RST_CFG_WARM		0x10
+#define PMIC_RST_CFG_COLD_LDO12		0x20
+#define PMIC_RST_CFG_COLD		0x30
+
 /* PCA9450_REG_CONFIG2 bits */
 #define I2C_LT_MASK			0x03
 #define I2C_LT_FORCE_DISABLE		0x00
-- 
2.34.1


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

* Re: [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 10:01 [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion Fabio Aiuto
  2024-04-11 10:01 ` [PATCH v2 1/1] " Fabio Aiuto
@ 2024-04-11 12:37 ` Mark Brown
  2024-04-11 13:22   ` Fabio Aiuto
  1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2024-04-11 12:37 UTC (permalink / raw)
  To: Fabio Aiuto; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On Thu, Apr 11, 2024 at 12:01:37PM +0200, Fabio Aiuto wrote:
> Hello all,
> 
> sorry for spamming, this one have the correct email addresses.
> This patch adds a property for to control reset behavior on
> PMIC_RST_B assertion.

Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff.  This reduces mail volume and ensures that 
any important information is recorded in the changelog rather than being
lost. 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 12:37 ` [PATCH v2 0/1] " Mark Brown
@ 2024-04-11 13:22   ` Fabio Aiuto
  2024-04-11 13:49     ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Aiuto @ 2024-04-11 13:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

Dear Mark,

Il Thu, Apr 11, 2024 at 01:37:48PM +0100, Mark Brown ha scritto:
> On Thu, Apr 11, 2024 at 12:01:37PM +0200, Fabio Aiuto wrote:
> > Hello all,
> > 
> > sorry for spamming, this one have the correct email addresses.
> > This patch adds a property for to control reset behavior on
> > PMIC_RST_B assertion.
> 
> Please don't send cover letters for single patches, if there is anything
> that needs saying put it in the changelog of the patch or after the ---
> if it's administrative stuff.  This reduces mail volume and ensures that 
> any important information is recorded in the changelog rather than being
> lost. 

I've got it, thanks. Do you want me to send a v3 or are you taking in
consideration this one?

kr

fabio


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

* Re: [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 13:22   ` Fabio Aiuto
@ 2024-04-11 13:49     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2024-04-11 13:49 UTC (permalink / raw)
  To: Fabio Aiuto; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

On Thu, Apr 11, 2024 at 03:22:22PM +0200, Fabio Aiuto wrote:

> I've got it, thanks. Do you want me to send a v3 or are you taking in
> consideration this one?

No, it's fine this time - just a note for next time.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 1/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 10:01 ` [PATCH v2 1/1] " Fabio Aiuto
@ 2024-04-11 14:46   ` Krzysztof Kozlowski
  2024-04-11 15:29     ` Fabio Aiuto
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-04-11 14:46 UTC (permalink / raw)
  To: Fabio Aiuto, Liam Girdwood, Mark Brown, linux-kernel
  Cc: Matteo Lisi, Mirko Ardinghi

On 11/04/2024 12:01, Fabio Aiuto wrote:
> The default configuration of the PMIC behavior makes the PMIC
> power cycle most regulators on PMIC_RST_B assertion. This power
> cycling causes the memory contents of OCRAM to be lost.
> Some systems needs some memory that survives reset and
> reboot, therefore this patch is created.
> 
> This patch extends commit 2364a64d0673 ("regulator: pca9450:
> Make warm reset on WDOG_B assertion") to the other reset
> input source PMIC_RST_B as per pmic specs.
> 
> CC: Matteo Lisi <matteo.lisi@engicam.com>
> CC: Mirko Ardinghi <mirko.ardinghi@engicam.com>
> Signed-off-by: Fabio Aiuto <fabio.aiuto@engicam.com>
> ---
>  .../bindings/regulator/nxp,pca9450-regulator.yaml     |  6 ++++++

Please run scripts/checkpatch.pl and fix reported warnings. Then please
run `scripts/checkpatch.pl --strict` and (probably) fix more warnings.
Some warnings can be ignored, especially from --strict run, but the code
here looks like it needs a fix. Feel free to get in touch if the warning
is not clear.

>  drivers/regulator/pca9450-regulator.c                 | 11 ++++++++---
>  include/linux/regulator/pca9450.h                     |  6 ++++++
>  3 files changed, 20 insertions(+), 3 deletions(-)
> 

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline), work on fork of kernel
(don't, instead use mainline) or you ignore some maintainers (really
don't). Just use b4 and everything should be fine, although remember
about `b4 prep --auto-to-cc` if you added new patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time, thus I will skip this patch entirely till you follow
the process allowing the patch to be tested.

Please kindly resend and include all necessary To/Cc entries.



Also: underscores are not allowed in property names.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion
  2024-04-11 14:46   ` Krzysztof Kozlowski
@ 2024-04-11 15:29     ` Fabio Aiuto
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Aiuto @ 2024-04-11 15:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Liam Girdwood, Mark Brown, linux-kernel, Matteo Lisi,
	Mirko Ardinghi

Dear Krzysztof,

Il Thu, Apr 11, 2024 at 04:46:06PM +0200, Krzysztof Kozlowski ha scritto:
> On 11/04/2024 12:01, Fabio Aiuto wrote:
> > The default configuration of the PMIC behavior makes the PMIC
> > power cycle most regulators on PMIC_RST_B assertion. This power
> > cycling causes the memory contents of OCRAM to be lost.
> > Some systems needs some memory that survives reset and
> > reboot, therefore this patch is created.
> > 
> > This patch extends commit 2364a64d0673 ("regulator: pca9450:
> > Make warm reset on WDOG_B assertion") to the other reset
> > input source PMIC_RST_B as per pmic specs.
> > 
> > CC: Matteo Lisi <matteo.lisi@engicam.com>
> > CC: Mirko Ardinghi <mirko.ardinghi@engicam.com>
> > Signed-off-by: Fabio Aiuto <fabio.aiuto@engicam.com>
> > ---
> >  .../bindings/regulator/nxp,pca9450-regulator.yaml     |  6 ++++++
> 
> Please run scripts/checkpatch.pl and fix reported warnings. Then please
> run `scripts/checkpatch.pl --strict` and (probably) fix more warnings.
> Some warnings can be ignored, especially from --strict run, but the code
> here looks like it needs a fix. Feel free to get in touch if the warning
> is not clear.
> 
> >  drivers/regulator/pca9450-regulator.c                 | 11 ++++++++---
> >  include/linux/regulator/pca9450.h                     |  6 ++++++
> >  3 files changed, 20 insertions(+), 3 deletions(-)
> > 
> 
> Please use scripts/get_maintainers.pl to get a list of necessary people
> and lists to CC. It might happen, that command when run on an older
> kernel, gives you outdated entries. Therefore please be sure you base
> your patches on recent Linux kernel.
> 
> Tools like b4 or scripts/get_maintainer.pl provide you proper list of
> people, so fix your workflow. Tools might also fail if you work on some
> ancient tree (don't, instead use mainline), work on fork of kernel
> (don't, instead use mainline) or you ignore some maintainers (really
> don't). Just use b4 and everything should be fine, although remember
> about `b4 prep --auto-to-cc` if you added new patches to the patchset.
> 
> You missed at least devicetree list (maybe more), so this won't be
> tested by automated tooling. Performing review on untested code might be
> a waste of time, thus I will skip this patch entirely till you follow
> the process allowing the patch to be tested.
> 
> Please kindly resend and include all necessary To/Cc entries.
> 
> 
> 
> Also: underscores are not allowed in property names.

thanks a lot for all suggestions, will send a patchset soon.

kind regards,

fabio

> 
> Best regards,
> Krzysztof
> 

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

end of thread, other threads:[~2024-04-11 15:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11 10:01 [PATCH v2 0/1] regulator: pca9450: make warm reset on PMIC_RST_B assertion Fabio Aiuto
2024-04-11 10:01 ` [PATCH v2 1/1] " Fabio Aiuto
2024-04-11 14:46   ` Krzysztof Kozlowski
2024-04-11 15:29     ` Fabio Aiuto
2024-04-11 12:37 ` [PATCH v2 0/1] " Mark Brown
2024-04-11 13:22   ` Fabio Aiuto
2024-04-11 13:49     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.