* [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints
@ 2012-06-18 5:59 Axel Lin
2012-06-18 6:03 ` [PATCH 2/2] regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS Axel Lin
2012-06-18 9:44 ` [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2012-06-18 5:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Yadwinder Singh Brar, Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/of_regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index e2a7310..68dc3d4 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -63,7 +63,7 @@ static void of_get_regulation_constraints(struct device_node *np,
ramp_delay = of_get_property(np, "regulator-ramp-delay", NULL);
if (ramp_delay)
- constraints->min_uV = be32_to_cpu(*ramp_delay);
+ constraints->ramp_delay = be32_to_cpu(*ramp_delay);
}
/**
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS
2012-06-18 5:59 [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Axel Lin
@ 2012-06-18 6:03 ` Axel Lin
2012-06-18 9:50 ` Mark Brown
2012-06-18 9:44 ` [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2012-06-18 6:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Yadwinder Singh Brar, Liam Girdwood, Mark Brown
This change makes it possible to set ramp_delay with 0.xxx mV/uS without
truncation issue.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
This patch is on top of the patch I sent earlier:
http://www.kernelhub.org/?msg=85659&p=2
Axel
.../devicetree/bindings/regulator/regulator.txt | 2 +-
drivers/regulator/core.c | 4 ++--
include/linux/regulator/driver.h | 2 +-
include/linux/regulator/machine.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index d0a7b12..bec5d57 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -10,7 +10,7 @@ Optional properties:
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- <name>-supply: phandle to the parent supply/regulator node
-- regulator-ramp-delay: ramp delay for regulator(in mV/uS)
+- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
Example:
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index bf0306f..81a0ecf 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2328,11 +2328,11 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
if (rdev->desc->uV_step) {
return DIV_ROUND_UP(rdev->desc->uV_step *
abs(new_selector - old_selector),
- ramp_delay * 1000);
+ ramp_delay);
} else if (rdev->desc->volt_table) {
return DIV_ROUND_UP(abs(rdev->desc->volt_table[new_selector] -
rdev->desc->volt_table[old_selector]),
- ramp_delay * 1000);
+ ramp_delay);
} else {
rdev_warn(rdev, "Unsupported voltage mapping settings\n");
}
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index ddc155d..84f999ed 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -173,7 +173,7 @@ enum regulator_type {
*
* @min_uV: Voltage given by the lowest selector (if linear mapping)
* @uV_step: Voltage increase with each selector (if linear mapping)
- * @ramp_delay: Time to settle down after voltage change (unit: mV/us)
+ * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
* @volt_table: Voltage mapping table (if table based mapping)
*
* @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 5f37ad3..40dd0a3 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -92,7 +92,7 @@ struct regulator_state {
* mode.
* @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: mV/us)
+ * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
*/
struct regulation_constraints {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints
2012-06-18 5:59 [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Axel Lin
2012-06-18 6:03 ` [PATCH 2/2] regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS Axel Lin
@ 2012-06-18 9:44 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-06-18 9:44 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Yadwinder Singh Brar, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 128 bytes --]
On Mon, Jun 18, 2012 at 01:59:02PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Applied both, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-18 9:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18 5:59 [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Axel Lin
2012-06-18 6:03 ` [PATCH 2/2] regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS Axel Lin
2012-06-18 9:50 ` Mark Brown
2012-06-18 9:44 ` [PATCH 1/2] regulator: Fix setting constraints->ramp_delay in of_get_regulation_constraints Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox