Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1633794 > unrolled thread

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

Started byMatthias Kaehlcke <mka@chromium.org>
First post2017-05-01 20:40 +0200
Last post2017-05-08 16:20 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times Matthias Kaehlcke <mka@chromium.org> - 2017-05-01 20:40 +0200
    [PATCH v2 2/2] regulator: Allow for asymmetric settling times Matthias Kaehlcke <mka@chromium.org> - 2017-05-01 20:40 +0200
      Re: [PATCH v2 2/2] regulator: Allow for asymmetric settling times Laxman Dewangan <ldewangan@nvidia.com> - 2017-05-02 09:00 +0200
    Re: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling  times Laxman Dewangan <ldewangan@nvidia.com> - 2017-05-02 09:00 +0200
    Re: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric  settling times Rob Herring <robh@kernel.org> - 2017-05-08 16:20 +0200

#1633794 — [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times

FromMatthias Kaehlcke <mka@chromium.org>
Date2017-05-01 20:40 +0200
Subject[PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times
Message-ID<tCooN-4aC-1@gated-at.bofh.it>
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(+)

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,
-- 
2.13.0.rc0.306.g87b477812d-goog

[toc] | [next] | [standalone]


#1633798 — [PATCH v2 2/2] regulator: Allow for asymmetric settling times

FromMatthias Kaehlcke <mka@chromium.org>
Date2017-05-01 20:40 +0200
Subject[PATCH v2 2/2] regulator: Allow for asymmetric settling times
Message-ID<tCooN-4aC-13@gated-at.bofh.it>
In reply to#1633794
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>
---
Changes in v2:
- Don't remove settling_time property
- Split DT bindings doc into separate patch

 drivers/regulator/core.c          | 6 ++++++
 drivers/regulator/of_regulator.c  | 9 +++++++++
 include/linux/regulator/machine.h | 6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 811096b23143..7836f07431d8 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2775,6 +2775,12 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev,
 		ramp_delay = rdev->desc->ramp_delay;
 	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;
 
 	if (ramp_delay == 0) {
 		rdev_dbg(rdev, "ramp_delay not set\n");
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 09d677d5d3f0..b0a007c349ef 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -90,6 +90,15 @@ static void of_get_regulation_constraints(struct device_node *np,
 	if (!ret)
 		constraints->settling_time = pval;
 
+	ret = of_property_read_u32(np, "regulator-settling-time-up-us", &pval);
+	if (!ret)
+		constraints->settling_time_up = pval;
+
+	ret = of_property_read_u32(np, "regulator-settling-time-down-us",
+				   &pval);
+	if (!ret)
+		constraints->settling_time_down = pval;
+
 	ret = of_property_read_u32(np, "regulator-enable-ramp-delay", &pval);
 	if (!ret)
 		constraints->enable_time = pval;
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 117699d1f7df..9cd4fef37203 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -110,6 +110,10 @@ struct regulator_state {
  * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
  * @settling_time: Time to settle down after voltage change when voltage
  *		   change is non-linear (unit: microseconds).
+ * @settling_time_up: Time to settle down after voltage increase when voltage
+ *		      change is non-linear (unit: microseconds).
+ * @settling_time_down : Time to settle down after voltage decrease when
+ *			 voltage change is non-linear (unit: microseconds).
  * @active_discharge: Enable/disable active discharge. The enum
  *		      regulator_active_discharge values are used for
  *		      initialisation.
@@ -152,6 +156,8 @@ struct regulation_constraints {
 
 	unsigned int ramp_delay;
 	unsigned int settling_time;
+	unsigned int settling_time_up;
+	unsigned int settling_time_down;
 	unsigned int enable_time;
 
 	unsigned int active_discharge;
-- 
2.13.0.rc0.306.g87b477812d-goog

[toc] | [prev] | [next] | [standalone]


#1634172 — Re: [PATCH v2 2/2] regulator: Allow for asymmetric settling times

FromLaxman Dewangan <ldewangan@nvidia.com>
Date2017-05-02 09:00 +0200
SubjectRe: [PATCH v2 2/2] regulator: Allow for asymmetric settling times
Message-ID<tCzWW-2WF-3@gated-at.bofh.it>
In reply to#1633798
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>

[toc] | [prev] | [next] | [standalone]


#1634171 — Re: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times

FromLaxman Dewangan <ldewangan@nvidia.com>
Date2017-05-02 09:00 +0200
SubjectRe: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times
Message-ID<tCzWV-2WF-1@gated-at.bofh.it>
In reply to#1633794
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>

[toc] | [prev] | [next] | [standalone]


#1637466 — Re: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times

FromRob Herring <robh@kernel.org>
Date2017-05-08 16:20 +0200
SubjectRe: [PATCH v2 1/2] regulator: DT: Add properties for asymmetric settling times
Message-ID<tERG2-4Yr-13@gated-at.bofh.it>
In reply to#1633794
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web