regulator: pwm: DT: Add ramp delay for exponential voltage transition
Subsystems (2)
PATCH 1/2 regulator: pwm: DT: Add ramp delay for exponential voltage transition
Some PWM regulator has the exponential transition in voltage change as opposite to fixed slew-rate linear transition on other regulators. For such PWM regulators, add the property for providing the delay from DT node.
Add DT binding details of the new property "pwm-regulator-voltage-ramp-time-us" added for providing voltage transition delay.
---
This patch is continuation of discussion on patch
regulator: pwm: Fix regulator ramp delay for continuous mode
https://patchwork.kernel.org/patch/9216857/
where is it discussed to have separate property for PWM which has exponential voltage transition.
--- Documentation/devicetree/bindings/regulator/pwm-regulator.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/regulator/pwm-regulator.txt +10 -0
@@ -54,6 +54,16 @@ Optional properties: -------------------- - enable-gpios: GPIO to use to enable/disable the regulator +- pwm-regulator-voltage-ramp-time-us: Integer, voltage ramp time in + microseconds. Some PWM regulator has the exponential + transition in voltage change as opposite to fixed + slew-rate linear transition on other regulators. + For such regulator, this property is used to provide + the settling time for voltage change which is same + for any voltage change. + If PWM regulator supports the fixed slew rate then + property "regulator-ramp-delay" should be used. + Any property defined as part of the core regulator binding can also be used. (See: ../regulator/regulator.txt)
Signature · 1 line
2.1.4
PATCH 2/2 regulator: pwm: Add ramp delay for exponential voltage transition
Some PWM regulator has the exponential transition in voltage change as opposite to fixed slew-rate linear transition on other regulators. For such PWM regulators, voltage transition is same for all voltage change.
Add support for handling the voltage transition ramp time when voltage transition is exponential.
---
This patch is continuation of discussion on patch
regulator: pwm: Fix regulator ramp delay for continuous mode
https://patchwork.kernel.org/patch/9216857/
where is it discussed to have separate property for PWM which has exponential voltage transition.
--- drivers/regulator/pwm-regulator.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/regulator/pwm-regulator.c +18 -0
@@ -47,6 +47,9 @@ struct pwm_regulator_data {/* Enable GPIO */ struct gpio_desc *enb_gpio; + +/* Voltage ramp time */ +u32 voltage_ramp_time; };struct pwm_voltages {
@@ -233,6 +236,14 @@ static int pwm_regulator_set_voltage(struct regulator_dev *rdev,return 0 ; } +static int pwm_regulator_set_voltage_time_sel (struct regulator_dev *rdev, +int old_uV,int new_uV) +{ +struct pwm_regulator_data *drvdata =rdev_get_drvdata (rdev); + +return drvdata->voltage_ramp_time; +} +static struct regulator_ops pwm_regulator_voltage_table_ops = { .set_voltage_sel = pwm_regulator_set_voltage_sel, .get_voltage_sel = pwm_regulator_get_voltage_sel,
@@ -305,6 +316,13 @@ static int pwm_regulator_init_continuous(struct platform_device *pdev,memcpy (&drvdata->ops, &pwm_regulator_voltage_continuous_ops,sizeof (drvdata->ops)); + +if (!of_property_read_u32 (pdev->dev.of_node, +"pwm-regulator-voltage-ramp-time-us" , + &drvdata->voltage_ramp_time)) + drvdata->ops.set_voltage_time = + pwm_regulator_set_voltage_time_sel; + drvdata->desc.ops = &drvdata->ops; drvdata->desc.continuous_voltage_range = true;
Signature · 1 line
2.1.4
Rob Herring
maintainerQuoted 28 lines · Laxman Dewangan
Some PWM regulator has the exponential transition in voltage change as opposite to fixed slew-rate linear transition on other regulators. For such PWM regulators, add the property for providing the delay from DT node.
Add DT binding details of the new property "pwm-regulator-voltage-ramp-time-us" added for providing voltage transition delay.
Signed-off-by Laxman Dewangan <[email protected]>CC Douglas Anderson <[email protected]>CC Aleksandr Frid <[email protected]>---
This patch is continuation of discussion on patch
regulator: pwm: Fix regulator ramp delay for continuous mode
https://patchwork.kernel.org/patch/9216857/
where is it discussed to have separate property for PWM which has exponential voltage transition.--- Documentation/devicetree/bindings/regulator/pwm-regulator.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)Documentation/devicetree/bindings/regulator/pwm-regulator.txt +0
-0
Documentation/devicetree/bindings/regulator/pwm-regulator.txt Optional properties: · line 57
Quoted 4 lines
Documentation/devicetree/bindings/regulator/pwm-regulator.txt +1
-0@@ -54,6 +54,16 @@ Optional properties: -------------------- - enable-gpios: GPIO to use to enable/disable the regulator +- pwm-regulator-voltage-ramp-time-us: Integer, voltage ramp time in
This is a really long name. Drop the 'pwm-regulator-' part as it is redundant. The fact that it is PWM reg specific is captured as it is documented that way.
Rob
Quoted 32 lines · Rob Herring
Quoted 31 lines · Laxman Dewangan
Some PWM regulator has the exponential transition in voltage change as opposite to fixed slew-rate linear transition on other regulators. For such PWM regulators, add the property for providing the delay from DT node.
Add DT binding details of the new property "pwm-regulator-voltage-ramp-time-us" added for providing voltage transition delay.
Signed-off-by Laxman Dewangan <[email protected]>CC Douglas Anderson <[email protected]>CC Aleksandr Frid <[email protected]>---
This patch is continuation of discussion on patch
regulator: pwm: Fix regulator ramp delay for continuous mode
https://patchwork.kernel.org/patch/9216857/
where is it discussed to have separate property for PWM which has exponential voltage transition.--- Documentation/devicetree/bindings/regulator/pwm-regulator.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)Documentation/devicetree/bindings/regulator/pwm-regulator.txt +0
-0@@ -54,6 +54,16 @@ Optional properties: -------------------- - enable-gpios: GPIO to use to enable/disable the regulator
Quoted 5 lines
Documentation/devicetree/bindings/regulator/pwm-regulator.txt Optional properties: · line 57
Quoted 1 line
Documentation/devicetree/bindings/regulator/pwm-regulator.txt +1
-0+- pwm-regulator-voltage-ramp-time-us: Integer, voltage ramp time inThis is a really long name. Drop the 'pwm-regulator-' part as it is redundant. The fact that it is PWM reg specific is captured as it is documented that way.
We already have the regulator-ramp-delay from the regulator core. Just wanted to make this (pwm-regulator-voltage-ramp-time-us) for pwm specific.
Can we have "pwm-regulator-ramp-delay" or "pwm-regulator-settling-time-us"?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Rob Herring
maintainerQuoted 46 lines · Laxman Dewangan
Quoted 27 lines · Rob Herring
Quoted 25 lines · Laxman Dewangan
Some PWM regulator has the exponential transition in voltage change as opposite to fixed slew-rate linear transition on other regulators. For such PWM regulators, add the property for providing the delay from DT node.
Add DT binding details of the new property "pwm-regulator-voltage-ramp-time-us" added for providing voltage transition delay.
Signed-off-by Laxman Dewangan <[email protected]>CC Douglas Anderson <[email protected]>CC Aleksandr Frid <[email protected]>---
This patch is continuation of discussion on patch
regulator: pwm: Fix regulator ramp delay for continuous mode
https://patchwork.kernel.org/patch/9216857/
where is it discussed to have separate property for PWM which has exponential voltage transition.--- Documentation/devicetree/bindings/regulator/pwm-regulator.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)Quoted 16 lines
Quoted 11 lines
diff --git
a/Documentation/devicetree/bindings/regulator/pwm-regulator.txtb/Documentation/devicetree/bindings/regulator/pwm-regulator.txtindex 3aeba9f..a163f42 100644Documentation/devicetree/bindings/regulator/pwm-regulator.txt +0
-0@@ -54,6 +54,16 @@ Optional properties: -------------------- - enable-gpios: GPIO to use to enable/disable theregulator
+- pwm-regulator-voltage-ramp-time-us: Integer, voltage ramp time inThis is a really long name. Drop the 'pwm-regulator-' part as it is redundant. The fact that it is PWM reg specific is captured as it is documented that way.
Quoted 3 lines
We already have the regulator-ramp-delay from the regulator core. Just wanted to make this (pwm-regulator-voltage-ramp-time-us) for pwm specific.
Neither of these are very clear that one is linear and one is exponential. Maybe you should use the existing property to express the time and just add a boolean property like "voltage-ramp-exponential"?
Quoted 1 line
Can we have "pwm-regulator-ramp-delay" or "pwm-regulator-settling-time-us"?
How are those better? Same comment applies.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Rob Herring
Quoted 9 lines · Laxman Dewangan
Quoted 8 lines · Rob Herring
Quoted 3 lines · Laxman Dewangan
regulator
+- pwm-regulator-voltage-ramp-time-us: Integer, voltage ramp time inThis is a really long name. Drop the 'pwm-regulator-' part as it is redundant. The fact that it is PWM reg specific is captured as it is documented that way.
Quoted 6 lines
Quoted 3 lines
We already have the regulator-ramp-delay from the regulator core. Just wanted to make this (pwm-regulator-voltage-ramp-time-us) for pwm specific.
Neither of these are very clear that one is linear and one is exponential. Maybe you should use the existing property to express the time and just add a boolean property like "voltage-ramp-exponential"?
OK, this can work.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html