aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65910-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-06-20 10:40:10 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-21 05:35:10 -0400
commit01bc3a1400373a0f6bd79f2328eb822ca099c784 (patch)
tree38d3a7e8f1f659c3f4170c54a70f9ea9eccfce2d /drivers/regulator/tps65910-regulator.c
parentb667a45d9f8ed98d4da2bbbd1c9083aade0f3237 (diff)
regulator: tps65910: Convert to regulator_set_voltage_time_sel()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps65910-regulator.c')
-rw-r--r--drivers/regulator/tps65910-regulator.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index e1b01ec8230..373c529b379 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -824,31 +824,6 @@ static int tps65911_list_voltage(struct regulator_dev *dev, unsigned selector)
824 return (LDO_MIN_VOLT + selector * step_mv) * 1000; 824 return (LDO_MIN_VOLT + selector * step_mv) * 1000;
825} 825}
826 826
827static int tps65910_set_voltage_dcdc_time_sel(struct regulator_dev *dev,
828 unsigned int old_selector, unsigned int new_selector)
829{
830 int id = rdev_get_id(dev);
831 int old_volt, new_volt;
832
833 old_volt = tps65910_list_voltage_dcdc(dev, old_selector);
834 if (old_volt < 0)
835 return old_volt;
836
837 new_volt = tps65910_list_voltage_dcdc(dev, new_selector);
838 if (new_volt < 0)
839 return new_volt;
840
841 /* VDD1 and VDD2 are 12.5mV/us, VDDCTRL is 100mV/20us */
842 switch (id) {
843 case TPS65910_REG_VDD1:
844 case TPS65910_REG_VDD2:
845 return DIV_ROUND_UP(abs(old_volt - new_volt), 12500);
846 case TPS65911_REG_VDDCTRL:
847 return DIV_ROUND_UP(abs(old_volt - new_volt), 5000);
848 }
849 return -EINVAL;
850}
851
852/* Regulator ops (except VRTC) */ 827/* Regulator ops (except VRTC) */
853static struct regulator_ops tps65910_ops_dcdc = { 828static struct regulator_ops tps65910_ops_dcdc = {
854 .is_enabled = regulator_is_enabled_regmap, 829 .is_enabled = regulator_is_enabled_regmap,
@@ -859,7 +834,7 @@ static struct regulator_ops tps65910_ops_dcdc = {
859 .get_mode = tps65910_get_mode, 834 .get_mode = tps65910_get_mode,
860 .get_voltage_sel = tps65910_get_voltage_dcdc_sel, 835 .get_voltage_sel = tps65910_get_voltage_dcdc_sel,
861 .set_voltage_sel = tps65910_set_voltage_dcdc_sel, 836 .set_voltage_sel = tps65910_set_voltage_dcdc_sel,
862 .set_voltage_time_sel = tps65910_set_voltage_dcdc_time_sel, 837 .set_voltage_time_sel = regulator_set_voltage_time_sel,
863 .list_voltage = tps65910_list_voltage_dcdc, 838 .list_voltage = tps65910_list_voltage_dcdc,
864}; 839};
865 840
@@ -1236,11 +1211,14 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
1236 pmic->desc[i].ops = &tps65910_ops_dcdc; 1211 pmic->desc[i].ops = &tps65910_ops_dcdc;
1237 pmic->desc[i].n_voltages = VDD1_2_NUM_VOLT_FINE * 1212 pmic->desc[i].n_voltages = VDD1_2_NUM_VOLT_FINE *
1238 VDD1_2_NUM_VOLT_COARSE; 1213 VDD1_2_NUM_VOLT_COARSE;
1214 pmic->desc[i].ramp_delay = 12500;
1239 } else if (i == TPS65910_REG_VDD3) { 1215 } else if (i == TPS65910_REG_VDD3) {
1240 if (tps65910_chip_id(tps65910) == TPS65910) 1216 if (tps65910_chip_id(tps65910) == TPS65910) {
1241 pmic->desc[i].ops = &tps65910_ops_vdd3; 1217 pmic->desc[i].ops = &tps65910_ops_vdd3;
1242 else 1218 } else {
1243 pmic->desc[i].ops = &tps65910_ops_dcdc; 1219 pmic->desc[i].ops = &tps65910_ops_dcdc;
1220 pmic->desc[i].ramp_delay = 5000;
1221 }
1244 } else { 1222 } else {
1245 if (tps65910_chip_id(tps65910) == TPS65910) 1223 if (tps65910_chip_id(tps65910) == TPS65910)
1246 pmic->desc[i].ops = &tps65910_ops; 1224 pmic->desc[i].ops = &tps65910_ops;