Skip to content

Commit ea38d13

Browse files
AxelLinbroonie
authored andcommitted
regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 parent 398715a commit ea38d13

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

Documentation/devicetree/bindings/regulator/regulator.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Optional properties:
1010
- regulator-always-on: boolean, regulator should never be disabled
1111
- regulator-boot-on: bootloader/firmware enabled regulator
1212
- <name>-supply: phandle to the parent supply/regulator node
13-
- regulator-ramp-delay: ramp delay for regulator(in mV/uS)
13+
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
1414

1515
Example:
1616

drivers/regulator/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,11 +2319,11 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
23192319
if (rdev->desc->uV_step) {
23202320
return DIV_ROUND_UP(rdev->desc->uV_step *
23212321
abs(new_selector - old_selector),
2322-
ramp_delay * 1000);
2322+
ramp_delay);
23232323
} else if (rdev->desc->volt_table) {
23242324
return DIV_ROUND_UP(abs(rdev->desc->volt_table[new_selector] -
23252325
rdev->desc->volt_table[old_selector]),
2326-
ramp_delay * 1000);
2326+
ramp_delay);
23272327
} else {
23282328
rdev_warn(rdev, "Unsupported voltage mapping settings\n");
23292329
}

include/linux/regulator/driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ enum regulator_type {
173173
*
174174
* @min_uV: Voltage given by the lowest selector (if linear mapping)
175175
* @uV_step: Voltage increase with each selector (if linear mapping)
176-
* @ramp_delay: Time to settle down after voltage change (unit: mV/us)
176+
* @ramp_delay: Time to settle down after voltage change (unit: uV/us)
177177
* @volt_table: Voltage mapping table (if table based mapping)
178178
*
179179
* @vsel_reg: Register for selector when using regulator_regmap_X_voltage_

include/linux/regulator/machine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct regulator_state {
9292
* mode.
9393
* @initial_state: Suspend state to set by default.
9494
* @initial_mode: Mode to set at startup.
95-
* @ramp_delay: Time to settle down after voltage change (unit: mV/us)
95+
* @ramp_delay: Time to settle down after voltage change (unit: uV/us)
9696
*/
9797
struct regulation_constraints {
9898

0 commit comments

Comments
 (0)