regulator: DT: Add settling time property for non-linear voltage change
Subsystems (2)
PATCH v4 1/2 regulator: DT: Add settling time property for non-linear voltage change
Some regulators (some PWM regulators) have the voltage transition exponentially. On such cases, the settling time for voltage change is treated as constant time.
Add DT property for providing the settling time for any level of voltage change for non-linear voltage change.
---
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.
Changes from V1:
- Pass the flag to tell that voltage ramp is exponential instead of providing delay.
Changes from V2:
- Based on review comment from V1, make the settling time property independent of the regulator-ramp-delay and move this out of PWM regulator.
Changes from V3:
- The change was sent long back and resuming this patch.
- Added Rob's ack from V3 and content is same as V3.
https://lkml.org/lkml/2016/11/30/632
- Rebase on linux-next tag 20170330 for resend.
--- Documentation/devicetree/bindings/regulator/regulator.txt | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/regulator/regulator.txt +3 -0
@@ -21,6 +21,9 @@ Optional properties: design requires. This property describes the total system ramp time required due to the combination of internal ramping of the regulator itself, and board design issues such as trace capacitance and load on the supply. +- 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-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,
Signature · 6 lines
2.1.4 -- 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
PATCH v4 2/2 regulator: Add settling time for non-linear voltage transition
Some regulators (some PWM regulators) have the voltage transition non-linear i.e. exponentially. On such cases, the settling time for voltage transition can not be presented in the voltage-ramp-delay.
Add new property for non-linear voltage transition and handle this in getting the voltage settling time.
---
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.
Changes from V1:
- Use new DT property to finding that voltage ramp is exponential or not and use flag for having fixed delay for all voltage change.
Changes from V2:
- Based on review comment from V1, make the settling time property independent of the regulator-ramp-delay and move this to core framework instead of handling in PWM regulator.
Changes from V3:
- The change was sent long back and resuming this patch.
- Rebase on linux-next tag 20170330 for resend.
--- drivers/regulator/core.c | 2 ++ drivers/regulator/of_regulator.c | 4 ++++ include/linux/regulator/machine.h | 3 +++ 3 files changed, 9 insertions(+)
drivers/regulator/core.c +2 -0
@@ -2773,6 +2773,8 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev, ramp_delay = rdev->constraints->ramp_delay; else if (rdev->desc->ramp_delay) ramp_delay = rdev->desc->ramp_delay; + else if (rdev->constraints->settling_time) + return rdev->constraints->settling_time;if (ramp_delay ==0 ) {rdev_dbg (rdev,"ramp_delay not set\n" );
drivers/regulator/of_regulator.c +4 -0
@@ -86,6 +86,10 @@ static void of_get_regulation_constraints(struct device_node *np, constraints->ramp_disable = true; } + ret =of_property_read_u32 (np,"regulator-settling-time-us" , &pval); +if (!ret) + constraints->settling_time = pval; + ret =of_property_read_u32 (np,"regulator-enable-ramp-delay" , &pval);if (!ret) constraints->enable_time = pval;
include/linux/regulator/machine.h +3 -0
@@ -108,6 +108,8 @@ struct regulator_state {* @initial_state: Suspend state to set by default. * @initial_mode: Mode to set at startup. * @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). * @active_discharge: Enable/disable active discharge. The enum * regulator_active_discharge values are used for * initialisation.
@@ -149,6 +151,7 @@ struct regulation_constraints {unsigned int initial_mode;unsigned int ramp_delay; +unsigned int settling_time;unsigned int enable_time;unsigned int active_discharge;
Signature · 1 line
2.1.4
Mark Brown
maintainerApplied "regulator: Add settling time for non-linear voltage transition" to the regulator tree
The patch
regulator: Add settling time for non-linear voltage transition
has been applied to the regulator tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
d6c1dc3f52e3a65f35c58433ba57d14c0bad902fMon Sep 17 00:00:00 2001
From: Laxman Dewangan <[email protected]>
Date: Tue, 4 Apr 2017 18:59:50 +0530
Subject: [PATCH] regulator: Add settling time for non-linear voltage
transition
Some regulators (some PWM regulators) have the voltage transition non-linear i.e. exponentially. On such cases, the settling time for voltage transition can not be presented in the voltage-ramp-delay.
Add new property for non-linear voltage transition and handle this in getting the voltage settling time.
--- drivers/regulator/core.c | 2 ++ drivers/regulator/of_regulator.c | 4 ++++ include/linux/regulator/machine.h | 3 +++ 3 files changed, 9 insertions(+)
drivers/regulator/core.c +2 -0
@@ -2753,6 +2753,8 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev, ramp_delay = rdev->constraints->ramp_delay; else if (rdev->desc->ramp_delay) ramp_delay = rdev->desc->ramp_delay; + else if (rdev->constraints->settling_time) + return rdev->constraints->settling_time;if (ramp_delay ==0 ) {rdev_dbg (rdev,"ramp_delay not set\n" );
drivers/regulator/of_regulator.c +4 -0
@@ -86,6 +86,10 @@ static void of_get_regulation_constraints(struct device_node *np, constraints->ramp_disable = true; } + ret =of_property_read_u32 (np,"regulator-settling-time-us" , &pval); +if (!ret) + constraints->settling_time = pval; + ret =of_property_read_u32 (np,"regulator-enable-ramp-delay" , &pval);if (!ret) constraints->enable_time = pval;
include/linux/regulator/machine.h +3 -0
@@ -108,6 +108,8 @@ struct regulator_state {* @initial_state: Suspend state to set by default. * @initial_mode: Mode to set at startup. * @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). * @active_discharge: Enable/disable active discharge. The enum * regulator_active_discharge values are used for * initialisation.
@@ -149,6 +151,7 @@ struct regulation_constraints {unsigned int initial_mode;unsigned int ramp_delay; +unsigned int settling_time;unsigned int enable_time;unsigned int active_discharge;
Signature · 1 line
2.11.0