regulator: palmas: pass regulator voltage through descriptor
Laxman Dewangan [Wed, 11 Sep 2013 09:22:59 +0000 (14:22 +0530)]
In place of adding callback to get the rail voltage of fixed rail like
extreg, chargepmup, pass the regulator voltage through descriptor.

Change-Id: I028344f363584a66c8bb46dadacb53f35b51a210
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/273023
GVS: Gerrit_Virtual_Submit

drivers/regulator/palmas-regulator.c

index 2c2cff7..022f09c 100644 (file)
@@ -657,16 +657,6 @@ static struct regulator_ops palmas_ops_ldo_extctrl = {
        .map_voltage            = palmas_map_voltage_ldo,
 };
 
-static int palmas_getvoltage_chargepump(struct regulator_dev *rdev)
-{
-       return 5000;
-}
-
-static int palmas_getvoltage_extreg(struct regulator_dev *rdev)
-{
-       return 4300 * 1000;
-}
-
 static struct regulator_ops palmas_ops_extreg = {
        .is_enabled             = regulator_is_enabled_regmap,
        .enable                 = regulator_enable_regmap,
@@ -674,14 +664,12 @@ static struct regulator_ops palmas_ops_extreg = {
 };
 
 static struct regulator_ops palmas_ops_extreg_extctrl = {
-       .get_voltage            = palmas_getvoltage_extreg,
 };
 
 static struct regulator_ops palmas_ops_chargepump = {
        .is_enabled             = regulator_is_enabled_regmap,
        .enable                 = regulator_enable_regmap,
        .disable                = regulator_disable_regmap,
-       .get_voltage            = palmas_getvoltage_chargepump,
 };
 
 static int palmas_ldo5_tracking_init(struct palmas *palmas,
@@ -1585,6 +1573,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
                        pmic->desc[id].enable_mask =
                                        PALMAS_CHARGE_PUMP_CTRL_MODE_ACTIVE;
                        pmic->desc[id].ops = &palmas_ops_chargepump;
+                       pmic->desc[id].fixed_uV = 5000 * 1000;
                } else {
                        pmic->desc[id].n_voltages = 1;
                        if (roof_floor)
@@ -1596,6 +1585,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
                                                palmas_regs_info[id].ctrl_addr);
                        pmic->desc[id].enable_mask =
                                        PALMAS_REGEN1_CTRL_MODE_ACTIVE;
+                       pmic->desc[id].fixed_uV = 4300 * 1000;
                }
 
                if (pdata)