diff mbox

[v2,1/2] regulator: DT: Add properties for asymmetric settling times

Message ID 20170501183715.35375-1-mka@chromium.org
State Not Applicable, archived
Headers show

Commit Message

Matthias Kaehlcke May 1, 2017, 6:37 p.m. UTC
Some regulators have different settling times for voltage increases and
decreases. Add DT properties to define separate settling times for up-
and downward voltage changes.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
Changes in v2:
- Moved DT binding doc to separate patch
- Don't remove settling_time property

 Documentation/devicetree/bindings/regulator/regulator.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Laxman Dewangan May 2, 2017, 6:51 a.m. UTC | #1
On Tuesday 02 May 2017 12:07 AM, Matthias Kaehlcke wrote:
> Some regulators have different settling times for voltage increases and
> decreases. Add DT properties to define separate settling times for up-
> and downward voltage changes.
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---

Acked-by: Laxman Dewangan <ldewangan@nvidia.com>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laxman Dewangan May 2, 2017, 6:53 a.m. UTC | #2
On Tuesday 02 May 2017 12:07 AM, Matthias Kaehlcke wrote:
> Some regulators have different settling times for voltage increases and
> decreases. To avoid a time penalty on the faster transition allow for
> different settings for up- and downward transitions.
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---

Acked-by: Laxman Dewangan <ldewangan@nvidia.com>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring (Arm) May 8, 2017, 2:08 p.m. UTC | #3
On Mon, May 01, 2017 at 11:37:14AM -0700, Matthias Kaehlcke wrote:
> Some regulators have different settling times for voltage increases and
> decreases. Add DT properties to define separate settling times for up-
> and downward voltage changes.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> Changes in v2:
> - Moved DT binding doc to separate patch
> - Don't remove settling_time property
> 
>  Documentation/devicetree/bindings/regulator/regulator.txt | 8 ++++++++
>  1 file changed, 8 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown May 14, 2017, 10:16 a.m. UTC | #4
On Mon, May 01, 2017 at 11:37:15AM -0700, Matthias Kaehlcke wrote:

>  	else if (rdev->constraints->settling_time)
>  		return rdev->constraints->settling_time;
> +	else if (rdev->constraints->settling_time_up &&
> +		 (new_uV > old_uV))
> +		return rdev->constraints->settling_time_up;
> +	else if (rdev->constraints->settling_time_down &&
> +		 (new_uV < old_uV))
> +		return rdev->constraints->settling_time_down;

It feels like we should warn if the user mixes specific up/down settling
times with the more general property, can you please send a followup
patch adding a warning for that?  It's not exactly obvious what the
precedence is and may do the wrong thing with an older kernel or
non-Linux OS.
Matthias Kaehlcke May 15, 2017, 10:55 p.m. UTC | #5
El Sun, May 14, 2017 at 07:16:52PM +0900 Mark Brown ha dit:

> On Mon, May 01, 2017 at 11:37:15AM -0700, Matthias Kaehlcke wrote:
> 
> >  	else if (rdev->constraints->settling_time)
> >  		return rdev->constraints->settling_time;
> > +	else if (rdev->constraints->settling_time_up &&
> > +		 (new_uV > old_uV))
> > +		return rdev->constraints->settling_time_up;
> > +	else if (rdev->constraints->settling_time_down &&
> > +		 (new_uV < old_uV))
> > +		return rdev->constraints->settling_time_down;
> 
> It feels like we should warn if the user mixes specific up/down settling
> times with the more general property, can you please send a followup
> patch adding a warning for that?  It's not exactly obvious what the
> precedence is and may do the wrong thing with an older kernel or
> non-Linux OS.

Sounds good. I'll send out the patch soon.

Thanks

Matthias
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index d18edb075e1c..378f6dc8b8bd 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -24,6 +24,14 @@  Optional properties:
 - regulator-settling-time-us: Settling time, in microseconds, for voltage
   change if regulator have the constant time for any level voltage change.
   This is useful when regulator have exponential voltage change.
+- regulator-settling-time-up-us: Settling time, in microseconds, for voltage
+  increase if the regulator needs a constant time to settle after voltage
+  increases of any level. This is useful for regulators with exponential
+  voltage changes.
+- regulator-settling-time-down-us: Settling time, in microseconds, for voltage
+  decrease if the regulator needs a constant time to settle after voltage
+  decreases of any level. This is useful for regulators with exponential
+  voltage changes.
 - regulator-soft-start: Enable soft start so that voltage ramps slowly
 - regulator-state-mem sub-root node for Suspend-to-RAM mode
   : suspend to memory, the device goes to sleep, but all data stored in memory,