diff mbox series

[v2,5/5] regulator: add documentation for regulator modes and suspend states

Message ID 1543319801-19100-6-git-send-email-claudiu.beznea@microchip.com
State Changes Requested, archived
Headers show
Series add PM functionality for act8945a PMIC | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Claudiu Beznea Nov. 27, 2018, 11:57 a.m. UTC
From: Claudiu Beznea <claudiu.beznea@microchip.com>

Add documentation for regulator modes and suspend states.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 .../bindings/regulator/act8945a-regulator.txt      | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Rob Herring (Arm) Dec. 11, 2018, 10:13 p.m. UTC | #1
On Tue, Nov 27, 2018 at 11:57:25AM +0000, Claudiu.Beznea@microchip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> 
> Add documentation for regulator modes and suspend states.
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  .../bindings/regulator/act8945a-regulator.txt      | 34 ++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> index ac955dea00d1..4017527619ab 100644
> --- a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> @@ -15,11 +15,17 @@ Optional input supply properties:
>    - inl67-supply: The input supply for REG_LDO3 and REG_LDO4
>  
>  Any standard regulator properties can be used to configure the single regulator.
> +regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
> +specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
> +file.
>  
>  The valid names for regulators are:
>  	REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.
>  
>  Example:
> +
> +#include <dt-bindings/regulator/active-semi,8945a-regulator.h>

This file belongs in this patch.

> +
>  	pmic@5b {
>  		compatible = "active-semi,act8945a";
>  		reg = <0x5b>;
> @@ -32,6 +38,18 @@ Example:
>  				regulator-min-microvolt = <1350000>;
>  				regulator-max-microvolt = <1350000>;
>  				regulator-always-on;
> +
> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
> +
> +				regulator-state-mem {
> +					regulator-on-in-suspend;
> +					regulator-suspend-min-microvolt=<1400000>;
> +					regulator-suspend-max-microvolt=<1400000>;
> +					regulator-changeable-in-suspend;
> +					regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
> +				};
>  			};
>  
>  			vdd_1v2_reg: REG_DCDC2 {
> @@ -39,6 +57,14 @@ Example:
>  				regulator-min-microvolt = <1100000>;
>  				regulator-max-microvolt = <1300000>;
>  				regulator-always-on;
> +
> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
> +
> +				regulator-state-mem {
> +					regulator-off-in-suspend;
> +				};
>  			};
>  
>  			vdd_3v3_reg: REG_DCDC3 {
> @@ -53,6 +79,14 @@ Example:
>  				regulator-min-microvolt = <2500000>;
>  				regulator-max-microvolt = <2500000>;
>  				regulator-always-on;
> +
> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
> +
> +				regulator-state-mem {
> +					regulator-off-in-suspend;
> +				};
>  			};
>  
>  			vdd_3v3_lp_reg: REG_LDO2 {
> -- 
> 2.7.4
>
Claudiu Beznea Dec. 12, 2018, 9:12 a.m. UTC | #2
On 12.12.2018 00:13, Rob Herring wrote:
> On Tue, Nov 27, 2018 at 11:57:25AM +0000, Claudiu.Beznea@microchip.com wrote:
>> From: Claudiu Beznea <claudiu.beznea@microchip.com>
>>
>> Add documentation for regulator modes and suspend states.
>>
>> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
>> ---
>>  .../bindings/regulator/act8945a-regulator.txt      | 34 ++++++++++++++++++++++
>>  1 file changed, 34 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>> index ac955dea00d1..4017527619ab 100644
>> --- a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>> +++ b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>> @@ -15,11 +15,17 @@ Optional input supply properties:
>>    - inl67-supply: The input supply for REG_LDO3 and REG_LDO4
>>  
>>  Any standard regulator properties can be used to configure the single regulator.
>> +regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
>> +specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
>> +file.
>>  
>>  The valid names for regulators are:
>>  	REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.
>>  
>>  Example:
>> +
>> +#include <dt-bindings/regulator/active-semi,8945a-regulator.h>
> 
> This file belongs in this patch.

I'm using the defines in this file also in driver. I was thinking that if I
would include this file in this patch the driver compilation would fail if
the patches would be accepted via different trees.

Would you like me to have different defines in driver and this new header
or could happen that these patches to be included in the main tree via the
same tree (e.g. regulator tree)?

Please, let me know what do you think.

Thank you,
Claudiu Beznea

> 
>> +
>>  	pmic@5b {
>>  		compatible = "active-semi,act8945a";
>>  		reg = <0x5b>;
>> @@ -32,6 +38,18 @@ Example:
>>  				regulator-min-microvolt = <1350000>;
>>  				regulator-max-microvolt = <1350000>;
>>  				regulator-always-on;
>> +
>> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
>> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
>> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
>> +
>> +				regulator-state-mem {
>> +					regulator-on-in-suspend;
>> +					regulator-suspend-min-microvolt=<1400000>;
>> +					regulator-suspend-max-microvolt=<1400000>;
>> +					regulator-changeable-in-suspend;
>> +					regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
>> +				};
>>  			};
>>  
>>  			vdd_1v2_reg: REG_DCDC2 {
>> @@ -39,6 +57,14 @@ Example:
>>  				regulator-min-microvolt = <1100000>;
>>  				regulator-max-microvolt = <1300000>;
>>  				regulator-always-on;
>> +
>> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
>> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
>> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
>> +
>> +				regulator-state-mem {
>> +					regulator-off-in-suspend;
>> +				};
>>  			};
>>  
>>  			vdd_3v3_reg: REG_DCDC3 {
>> @@ -53,6 +79,14 @@ Example:
>>  				regulator-min-microvolt = <2500000>;
>>  				regulator-max-microvolt = <2500000>;
>>  				regulator-always-on;
>> +
>> +				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
>> +							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
>> +				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
>> +
>> +				regulator-state-mem {
>> +					regulator-off-in-suspend;
>> +				};
>>  			};
>>  
>>  			vdd_3v3_lp_reg: REG_LDO2 {
>> -- 
>> 2.7.4
>>
>
Rob Herring (Arm) Dec. 12, 2018, 1:32 p.m. UTC | #3
On Wed, Dec 12, 2018 at 3:13 AM <Claudiu.Beznea@microchip.com> wrote:
>
>
>
> On 12.12.2018 00:13, Rob Herring wrote:
> > On Tue, Nov 27, 2018 at 11:57:25AM +0000, Claudiu.Beznea@microchip.com wrote:
> >> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> >>
> >> Add documentation for regulator modes and suspend states.
> >>
> >> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> >> ---
> >>  .../bindings/regulator/act8945a-regulator.txt      | 34 ++++++++++++++++++++++
> >>  1 file changed, 34 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> >> index ac955dea00d1..4017527619ab 100644
> >> --- a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> >> +++ b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
> >> @@ -15,11 +15,17 @@ Optional input supply properties:
> >>    - inl67-supply: The input supply for REG_LDO3 and REG_LDO4
> >>
> >>  Any standard regulator properties can be used to configure the single regulator.
> >> +regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
> >> +specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
> >> +file.
> >>
> >>  The valid names for regulators are:
> >>      REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.
> >>
> >>  Example:
> >> +
> >> +#include <dt-bindings/regulator/active-semi,8945a-regulator.h>
> >
> > This file belongs in this patch.
>
> I'm using the defines in this file also in driver. I was thinking that if I
> would include this file in this patch the driver compilation would fail if
> the patches would be accepted via different trees.

They won't be.

> Would you like me to have different defines in driver and this new header
> or could happen that these patches to be included in the main tree via the
> same tree (e.g. regulator tree)?

No need for different defines. The subsystem maintainer will take
everything in this case.

Rob
Claudiu Beznea Dec. 12, 2018, 4:24 p.m. UTC | #4
On 12.12.2018 15:32, Rob Herring wrote:
> On Wed, Dec 12, 2018 at 3:13 AM <Claudiu.Beznea@microchip.com> wrote:
>>
>>
>>
>> On 12.12.2018 00:13, Rob Herring wrote:
>>> On Tue, Nov 27, 2018 at 11:57:25AM +0000, Claudiu.Beznea@microchip.com wrote:
>>>> From: Claudiu Beznea <claudiu.beznea@microchip.com>
>>>>
>>>> Add documentation for regulator modes and suspend states.
>>>>
>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
>>>> ---
>>>>  .../bindings/regulator/act8945a-regulator.txt      | 34 ++++++++++++++++++++++
>>>>  1 file changed, 34 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>>>> index ac955dea00d1..4017527619ab 100644
>>>> --- a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>>>> +++ b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
>>>> @@ -15,11 +15,17 @@ Optional input supply properties:
>>>>    - inl67-supply: The input supply for REG_LDO3 and REG_LDO4
>>>>
>>>>  Any standard regulator properties can be used to configure the single regulator.
>>>> +regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
>>>> +specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
>>>> +file.
>>>>
>>>>  The valid names for regulators are:
>>>>      REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.
>>>>
>>>>  Example:
>>>> +
>>>> +#include <dt-bindings/regulator/active-semi,8945a-regulator.h>
>>>
>>> This file belongs in this patch.
>>
>> I'm using the defines in this file also in driver. I was thinking that if I
>> would include this file in this patch the driver compilation would fail if
>> the patches would be accepted via different trees.
> 
> They won't be.

Thank you! I'll send a new version with the proposed change.

> 
>> Would you like me to have different defines in driver and this new header
>> or could happen that these patches to be included in the main tree via the
>> same tree (e.g. regulator tree)?
> 
> No need for different defines. The subsystem maintainer will take
> everything in this case.
> 
> Rob
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
index ac955dea00d1..4017527619ab 100644
--- a/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
@@ -15,11 +15,17 @@  Optional input supply properties:
   - inl67-supply: The input supply for REG_LDO3 and REG_LDO4
 
 Any standard regulator properties can be used to configure the single regulator.
+regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
+specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
+file.
 
 The valid names for regulators are:
 	REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.
 
 Example:
+
+#include <dt-bindings/regulator/active-semi,8945a-regulator.h>
+
 	pmic@5b {
 		compatible = "active-semi,act8945a";
 		reg = <0x5b>;
@@ -32,6 +38,18 @@  Example:
 				regulator-min-microvolt = <1350000>;
 				regulator-max-microvolt = <1350000>;
 				regulator-always-on;
+
+				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
+							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
+
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-min-microvolt=<1400000>;
+					regulator-suspend-max-microvolt=<1400000>;
+					regulator-changeable-in-suspend;
+					regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
+				};
 			};
 
 			vdd_1v2_reg: REG_DCDC2 {
@@ -39,6 +57,14 @@  Example:
 				regulator-min-microvolt = <1100000>;
 				regulator-max-microvolt = <1300000>;
 				regulator-always-on;
+
+				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
+							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
 			};
 
 			vdd_3v3_reg: REG_DCDC3 {
@@ -53,6 +79,14 @@  Example:
 				regulator-min-microvolt = <2500000>;
 				regulator-max-microvolt = <2500000>;
 				regulator-always-on;
+
+				regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
+							  <ACT8945A_REGULATOR_MODE_LOWPOWER>;
+				regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
 			};
 
 			vdd_3v3_lp_reg: REG_LDO2 {