linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
@ 2016-04-16  6:37 Ivaylo Dimitrov
  2016-04-17  0:05 ` Sebastian Reichel
  0 siblings, 1 reply; 9+ messages in thread
From: Ivaylo Dimitrov @ 2016-04-16  6:37 UTC (permalink / raw)
  To: linux-arm-kernel

Without that, regulators are left in the mode last set by the bootloader or
by the kernel the device was rebooted from. This leads to various problems
like non-working peripherals.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b3c26a9..1bb36e2 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -329,6 +329,7 @@
 	regulator-name = "V28";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <2800000>;
+	regulator-initial-mode = <0x0e>;
 	regulator-always-on; /* due to battery cover sensor */
 };
 
@@ -336,30 +337,35 @@
 	regulator-name = "VCSI";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>;
 };
 
 &vaux3 {
 	regulator-name = "VMMC2_30";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <3000000>;
+	regulator-initial-mode = <0x0e>;
 };
 
 &vaux4 {
 	regulator-name = "VCAM_ANA_28";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <2800000>;
+	regulator-initial-mode = <0x0e>;
 };
 
 &vmmc1 {
 	regulator-name = "VMMC1";
 	regulator-min-microvolt = <1850000>;
 	regulator-max-microvolt = <3150000>;
+	regulator-initial-mode = <0x0e>;
 };
 
 &vmmc2 {
 	regulator-name = "V28_A";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <3000000>;
+	regulator-initial-mode = <0x0e>;
 	regulator-always-on; /* due VIO leak to AIC34 VDDs */
 };
 
@@ -367,6 +373,7 @@
 	regulator-name = "VPLL";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>;
 	regulator-always-on;
 };
 
@@ -374,6 +381,7 @@
 	regulator-name = "VSDI_CSI";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>;
 	regulator-always-on;
 };
 
@@ -381,6 +389,7 @@
 	regulator-name = "VMMC2_IO_18";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>;
 };
 
 &vio {
-- 
1.9.1

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

* [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-16  6:37 [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode Ivaylo Dimitrov
@ 2016-04-17  0:05 ` Sebastian Reichel
  2016-04-17  6:14   ` Ivaylo Dimitrov
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Reichel @ 2016-04-17  0:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ivo,

On Sat, Apr 16, 2016 at 09:37:23AM +0300, Ivaylo Dimitrov wrote:
> Without that, regulators are left in the mode last set by the bootloader or
> by the kernel the device was rebooted from. This leads to various problems
> like non-working peripherals.
> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> ---
>  arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index b3c26a9..1bb36e2 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -329,6 +329,7 @@
>  	regulator-name = "V28";
>  	regulator-min-microvolt = <2800000>;
>  	regulator-max-microvolt = <2800000>;
> +	regulator-initial-mode = <0x0e>;
>  	regulator-always-on; /* due to battery cover sensor */
>  };

I think this should either get an additional
comment like /* MODE_NORMAL */ or implemented
using a define and a TWL4030_REGULATOR_MODE_NORMAL
constant to keep the *.dts easily readable.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160417/941df239/attachment.sig>

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

* [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17  0:05 ` Sebastian Reichel
@ 2016-04-17  6:14   ` Ivaylo Dimitrov
  2016-04-17 12:29     ` Sebastian Reichel
  0 siblings, 1 reply; 9+ messages in thread
From: Ivaylo Dimitrov @ 2016-04-17  6:14 UTC (permalink / raw)
  To: linux-arm-kernel



On 17.04.2016 03:05, Sebastian Reichel wrote:
> Hi Ivo,
>
> On Sat, Apr 16, 2016 at 09:37:23AM +0300, Ivaylo Dimitrov wrote:
>> Without that, regulators are left in the mode last set by the bootloader or
>> by the kernel the device was rebooted from. This leads to various problems
>> like non-working peripherals.
>>
>> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
>> ---
>>   arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
>> index b3c26a9..1bb36e2 100644
>> --- a/arch/arm/boot/dts/omap3-n900.dts
>> +++ b/arch/arm/boot/dts/omap3-n900.dts
>> @@ -329,6 +329,7 @@
>>   	regulator-name = "V28";
>>   	regulator-min-microvolt = <2800000>;
>>   	regulator-max-microvolt = <2800000>;
>> +	regulator-initial-mode = <0x0e>;
>>   	regulator-always-on; /* due to battery cover sensor */
>>   };
>
> I think this should either get an additional
> comment like /* MODE_NORMAL */ or implemented

According to the TRM, this is 'ACTIVE state', but that does not fit in 
the regulator framework terminology.

> using a define and a TWL4030_REGULATOR_MODE_NORMAL
> constant to keep the *.dts easily readable.

We already have RES_STATE_ACTIVE defined in linux/i2c/twl.h, is there a 
way to include that in a dts?

Ivo

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

* [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17  6:14   ` Ivaylo Dimitrov
@ 2016-04-17 12:29     ` Sebastian Reichel
  2016-04-17 14:29       ` [PATCH v1] " Ivaylo Dimitrov
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Reichel @ 2016-04-17 12:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Apr 17, 2016 at 09:14:08AM +0300, Ivaylo Dimitrov wrote:
> On 17.04.2016 03:05, Sebastian Reichel wrote:
> >On Sat, Apr 16, 2016 at 09:37:23AM +0300, Ivaylo Dimitrov wrote:
> >>Without that, regulators are left in the mode last set by the bootloader or
> >>by the kernel the device was rebooted from. This leads to various problems
> >>like non-working peripherals.
> >>
> >>Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> >>---
> >>  arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
> >>  1 file changed, 9 insertions(+)
> >>
> >>diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> >>index b3c26a9..1bb36e2 100644
> >>--- a/arch/arm/boot/dts/omap3-n900.dts
> >>+++ b/arch/arm/boot/dts/omap3-n900.dts
> >>@@ -329,6 +329,7 @@
> >>  	regulator-name = "V28";
> >>  	regulator-min-microvolt = <2800000>;
> >>  	regulator-max-microvolt = <2800000>;
> >>+	regulator-initial-mode = <0x0e>;
> >>  	regulator-always-on; /* due to battery cover sensor */
> >>  };
> >
> >I think this should either get an additional
> >comment like /* MODE_NORMAL */ or implemented
> 
> According to the TRM, this is 'ACTIVE state', but that does not fit in the
> regulator framework terminology.

No problem with using STATE_ACTIVE or any other fitting description. IMHO
that "active" is misleading for regulators without "always-on/boot-on" tag,
but that was TI's decision.

> >using a define and a TWL4030_REGULATOR_MODE_NORMAL
> >constant to keep the *.dts easily readable.
> 
> We already have RES_STATE_ACTIVE defined in linux/i2c/twl.h, is there a way
> to include that in a dts?

Not in its current state. During kernel build the C preprocessor is
applied on the *.dts files. So the header may only contain
preprocessor macros (e.g. #define). For that solution something like
~/src/linux/include/dt-bindings/regulator/maxim,max77802.h should
be created for the twl regulator.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160417/5d018411/attachment.sig>

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

* [PATCH v1] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17 12:29     ` Sebastian Reichel
@ 2016-04-17 14:29       ` Ivaylo Dimitrov
  2016-04-18  5:11         ` Sebastian Reichel
                           ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ivaylo Dimitrov @ 2016-04-17 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Without that, regulators are left in the mode last set by the bootloader or
by the kernel the device was rebooted from. This leads to various problems,
like non-working peripherals.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b3c26a9..d9e2d9c 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -329,6 +329,7 @@
 	regulator-name = "V28";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <2800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 	regulator-always-on; /* due to battery cover sensor */
 };
 
@@ -336,30 +337,35 @@
 	regulator-name = "VCSI";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 };
 
 &vaux3 {
 	regulator-name = "VMMC2_30";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <3000000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 };
 
 &vaux4 {
 	regulator-name = "VCAM_ANA_28";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <2800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 };
 
 &vmmc1 {
 	regulator-name = "VMMC1";
 	regulator-min-microvolt = <1850000>;
 	regulator-max-microvolt = <3150000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 };
 
 &vmmc2 {
 	regulator-name = "V28_A";
 	regulator-min-microvolt = <2800000>;
 	regulator-max-microvolt = <3000000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 	regulator-always-on; /* due VIO leak to AIC34 VDDs */
 };
 
@@ -367,6 +373,7 @@
 	regulator-name = "VPLL";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 	regulator-always-on;
 };
 
@@ -374,6 +381,7 @@
 	regulator-name = "VSDI_CSI";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 	regulator-always-on;
 };
 
@@ -381,6 +389,7 @@
 	regulator-name = "VMMC2_IO_18";
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
+	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
 };
 
 &vio {
-- 
1.9.1

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

* [PATCH v1] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17 14:29       ` [PATCH v1] " Ivaylo Dimitrov
@ 2016-04-18  5:11         ` Sebastian Reichel
  2016-04-19 21:18         ` Javier Martinez Canillas
  2016-04-24 10:08         ` Pavel Machek
  2 siblings, 0 replies; 9+ messages in thread
From: Sebastian Reichel @ 2016-04-18  5:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Apr 17, 2016 at 05:29:23PM +0300, Ivaylo Dimitrov wrote:
> Without that, regulators are left in the mode last set by the bootloader or
> by the kernel the device was rebooted from. This leads to various problems,
> like non-working peripherals.
> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>

Reviewed-By: Sebastian Reichel <sre@kernel.org>

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160418/1b76b54a/attachment.sig>

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

* [PATCH v1] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17 14:29       ` [PATCH v1] " Ivaylo Dimitrov
  2016-04-18  5:11         ` Sebastian Reichel
@ 2016-04-19 21:18         ` Javier Martinez Canillas
  2016-04-24 10:08         ` Pavel Machek
  2 siblings, 0 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-04-19 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Ivaylo,

On Sun, Apr 17, 2016 at 10:29 AM, Ivaylo Dimitrov
<ivo.g.dimitrov.75@gmail.com> wrote:
> Without that, regulators are left in the mode last set by the bootloader or
> by the kernel the device was rebooted from. This leads to various problems,
> like non-working peripherals.
>
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> ---
>  arch/arm/boot/dts/omap3-n900.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index b3c26a9..d9e2d9c 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -329,6 +329,7 @@
>         regulator-name = "V28";
>         regulator-min-microvolt = <2800000>;
>         regulator-max-microvolt = <2800000>;
> +       regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */

As Sebastian said, it would be nice if instead of magic numbers +
comments, we have defines for the modes by moving the definitions from
include/linux/i2c/twl.h to include/dt-bindings/regulator/ so they can
be used by DTS.

But that can be done as a follow-up though, to avoid adding a
dependency between the regulator and arm-soc subsystems to get this
fix applied.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
Javier

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

* [PATCH v1] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-17 14:29       ` [PATCH v1] " Ivaylo Dimitrov
  2016-04-18  5:11         ` Sebastian Reichel
  2016-04-19 21:18         ` Javier Martinez Canillas
@ 2016-04-24 10:08         ` Pavel Machek
  2016-04-26 17:14           ` Tony Lindgren
  2 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2016-04-24 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun 2016-04-17 17:29:23, Ivaylo Dimitrov wrote:
> Without that, regulators are left in the mode last set by the bootloader or
> by the kernel the device was rebooted from. This leads to various problems,
> like non-working peripherals.
> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>

Reviewed-by: Pavel Machek <pavel@ucw.cz>

> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -329,6 +329,7 @@
>  	regulator-name = "V28";
>  	regulator-min-microvolt = <2800000>;
>  	regulator-max-microvolt = <2800000>;
> +	regulator-initial-mode = <0x0e>; /* RES_STATE_ACTIVE */
>  	regulator-always-on; /* due to battery cover sensor */
>  };
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [PATCH v1] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode
  2016-04-24 10:08         ` Pavel Machek
@ 2016-04-26 17:14           ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-04-26 17:14 UTC (permalink / raw)
  To: linux-arm-kernel

* Pavel Machek <pavel@ucw.cz> [160424 03:09]:
> On Sun 2016-04-17 17:29:23, Ivaylo Dimitrov wrote:
> > Without that, regulators are left in the mode last set by the bootloader or
> > by the kernel the device was rebooted from. This leads to various problems,
> > like non-working peripherals.
> > 
> > Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> 
> Reviewed-by: Pavel Machek <pavel@ucw.cz>

Thanks applying into omap-for-v4.6/fixes-rc5.

Tony

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

end of thread, other threads:[~2016-04-26 17:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-16  6:37 [PATCH] ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode Ivaylo Dimitrov
2016-04-17  0:05 ` Sebastian Reichel
2016-04-17  6:14   ` Ivaylo Dimitrov
2016-04-17 12:29     ` Sebastian Reichel
2016-04-17 14:29       ` [PATCH v1] " Ivaylo Dimitrov
2016-04-18  5:11         ` Sebastian Reichel
2016-04-19 21:18         ` Javier Martinez Canillas
2016-04-24 10:08         ` Pavel Machek
2016-04-26 17:14           ` Tony Lindgren

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).