diff mbox

ARM: dts: omap3-n900: Specify peripherals LDO regulators initial mode

Message ID 1460788643-18590-1-git-send-email-ivo.g.dimitrov.75@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ivaylo Dimitrov April 16, 2016, 6:37 a.m. UTC
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(+)

Comments

Sebastian Reichel April 17, 2016, 12:05 a.m. UTC | #1
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
Ivaylo Dimitrov April 17, 2016, 6:14 a.m. UTC | #2
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
Sebastian Reichel April 17, 2016, 12:29 p.m. UTC | #3
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
diff mbox

Patch

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 {