]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: twl: Convert twl6030ldo_ops to use regulator_list_voltage_linear
authorAxel Lin <axel.lin@gmail.com>
Mon, 4 Jun 2012 04:44:15 +0000 (12:44 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 11 Jun 2012 04:01:40 +0000 (12:01 +0800)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/twl-regulator.c

index c7390711d9547e2762e818ae13cbdb8784fc29f4..a1d07e517db330f70bbc8fed99b23f57a4c063f9 100644 (file)
@@ -577,13 +577,6 @@ static struct regulator_ops twl6030coresmps_ops = {
        .get_voltage    = twl6030coresmps_get_voltage,
 };
 
-static int twl6030ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
-{
-       struct twlreg_info      *info = rdev_get_drvdata(rdev);
-
-       return ((info->min_mV + (index * 100)) * 1000);
-}
-
 static int
 twl6030ldo_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
                       unsigned *selector)
@@ -621,7 +614,7 @@ static int twl6030ldo_get_voltage(struct regulator_dev *rdev)
 }
 
 static struct regulator_ops twl6030ldo_ops = {
-       .list_voltage   = twl6030ldo_list_voltage,
+       .list_voltage   = regulator_list_voltage_linear,
 
        .set_voltage    = twl6030ldo_set_voltage,
        .get_voltage    = twl6030ldo_get_voltage,
@@ -959,6 +952,8 @@ static struct twlreg_info TWL6030_INFO_##label = { \
                .ops = &twl6030ldo_ops, \
                .type = REGULATOR_VOLTAGE, \
                .owner = THIS_MODULE, \
+               .min_uV = min_mVolts * 1000, \
+               .uV_step = 100 * 1000, \
                }, \
        }
 
@@ -974,6 +969,8 @@ static struct twlreg_info TWL6025_INFO_##label = { \
                .ops = &twl6030ldo_ops, \
                .type = REGULATOR_VOLTAGE, \
                .owner = THIS_MODULE, \
+               .min_uV = min_mVolts * 1000, \
+               .uV_step = 100 * 1000, \
                }, \
        }