Revert "Revert "regulator: tps80031: rename regulator-name enums""
Simone Willett [Tue, 31 Jul 2012 23:32:09 +0000 (16:32 -0700)]
This reverts commit 70e40e9cf025c73fde46d1a5577547dc37182a64

Change-Id: Iaf390c0d3ea16686f619f321bceea572ee7434fc
Reviewed-on: http://git-master/r/119802
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/board-enterprise-power.c
drivers/regulator/tps80031-regulator.c
include/linux/regulator/tps80031-regulator.h

index 3cd6b44..2d95864 100644 (file)
@@ -340,7 +340,7 @@ static struct tps80031_bg_platform_data battery_gauge_data = {
 
 #define TPS_REG(_id, _data, _sname)                            \
        {                                                       \
-               .id      = TPS80031_ID_##_id,                   \
+               .id      = TPS80031_REGULATOR_##_id,                    \
                .name   = "tps80031-regulator",                 \
                .platform_data  = &pdata_##_data##_##_sname,    \
        }
index 33d4b62..9250123 100644 (file)
@@ -514,7 +514,7 @@ static int tps80031ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
        if (index == 0)
                return 0;
 
-       if ((ri->desc.id == TPS80031_ID_LDO2) &&
+       if ((ri->desc.id == TPS80031_REGULATOR_LDO2) &&
                        (ri->flags &  TRACK_MODE_ENABLE))
                return (ri->min_mV + (((index - 1) * 125))/10) * 1000;
 
@@ -572,7 +572,7 @@ static int __tps80031_ldo_set_voltage(struct device *parent,
        if ((min_uV/1000 < ri->min_mV) || (max_uV/1000 > ri->max_mV))
                return -EDOM;
 
-       if ((ri->desc.id == TPS80031_ID_LDO2) &&
+       if ((ri->desc.id == TPS80031_REGULATOR_LDO2) &&
                        (ri->flags &  TRACK_MODE_ENABLE))
                return __tps80031_ldo2_set_voltage_track_mode(parent, ri,
                                min_uV, max_uV);
@@ -608,7 +608,7 @@ static int tps80031ldo_get_voltage(struct regulator_dev *rdev)
        uint8_t vsel;
 
 
-       if ((ri->desc.id == TPS80031_ID_LDO2) &&
+       if ((ri->desc.id == TPS80031_REGULATOR_LDO2) &&
                        (ri->flags &  TRACK_MODE_ENABLE)) {
                vsel = ri->volt_reg_cache & 0x3F;
                return (ri->min_mV + (((vsel - 1) * 125))/10) * 1000;
@@ -756,12 +756,12 @@ static struct regulator_ops tps80031vbus_ops = {
        .force_reg = _force_reg,                                \
        .volt_reg = _volt_reg,                                  \
        .volt_id = _volt_id,                                    \
-       .id = TPS80031_ID_##_id,                                \
+       .id = TPS80031_REGULATOR_##_id,                         \
        .min_mV = min_mVolts,                                   \
        .max_mV = max_mVolts,                                   \
        .desc = {                                               \
                .name = tps80031_rails(_id),                    \
-               .id = TPS80031_ID_##_id,                        \
+               .id = TPS80031_REGULATOR_##_id,                 \
                .n_voltages = _n_volt,                          \
                .ops = &_ops,                                   \
                .type = REGULATOR_VOLTAGE,                      \
@@ -856,7 +856,7 @@ static int tps80031_regulator_preinit(struct device *parent,
        int ret = 0;
        uint8_t reg_val;
 
-       if (ri->desc.id == TPS80031_ID_LDOUSB) {
+       if (ri->desc.id == TPS80031_REGULATOR_LDOUSB) {
                if (ri->platform_flags & USBLDO_INPUT_VSYS)
                        ret = tps80031_update(parent, SLAVE_ID1,
                                TPS80031_MISC2_ADD,
@@ -872,7 +872,7 @@ static int tps80031_regulator_preinit(struct device *parent,
                }
        }
 
-       if (ri->desc.id == TPS80031_ID_LDO3) {
+       if (ri->desc.id == TPS80031_REGULATOR_LDO3) {
                if (ri->platform_flags & LDO3_OUTPUT_VIB)
                        ret = tps80031_update(parent, SLAVE_ID1,
                                TPS80031_MISC2_ADD,
@@ -961,22 +961,22 @@ static void check_smps_mode_mult(struct device *parent,
 {
        int mult_offset;
        switch (ri->desc.id) {
-       case TPS80031_ID_VIO:
+       case TPS80031_REGULATOR_VIO:
                mult_offset = SMPS_MULTOFFSET_VIO;
                break;
-       case TPS80031_ID_SMPS1:
+       case TPS80031_REGULATOR_SMPS1:
                mult_offset = SMPS_MULTOFFSET_SMPS1;
                break;
-       case TPS80031_ID_SMPS2:
+       case TPS80031_REGULATOR_SMPS2:
                mult_offset = SMPS_MULTOFFSET_SMPS2;
                break;
-       case TPS80031_ID_SMPS3:
+       case TPS80031_REGULATOR_SMPS3:
                mult_offset = SMPS_MULTOFFSET_SMPS3;
                break;
-       case TPS80031_ID_SMPS4:
+       case TPS80031_REGULATOR_SMPS4:
                mult_offset = SMPS_MULTOFFSET_SMPS4;
                break;
-       case TPS80031_ID_LDO2:
+       case TPS80031_REGULATOR_LDO2:
                ri->flags = (tps80031_get_smps_mult(parent) & (1 << 5)) ?
                                                TRACK_MODE_ENABLE : 0;
                /* TRACK mode the ldo2 varies from 600mV to 1300mV */
index 4dfdf79..1609eee 100644 (file)
 #define tps80031_rails(_name) "tps80031_"#_name
 
 enum {
-       TPS80031_ID_VIO,
-       TPS80031_ID_SMPS1,
-       TPS80031_ID_SMPS2,
-       TPS80031_ID_SMPS3,
-       TPS80031_ID_SMPS4,
-       TPS80031_ID_VANA,
-       TPS80031_ID_LDO1,
-       TPS80031_ID_LDO2,
-       TPS80031_ID_LDO3,
-       TPS80031_ID_LDO4,
-       TPS80031_ID_LDO5,
-       TPS80031_ID_LDO6,
-       TPS80031_ID_LDO7,
-       TPS80031_ID_LDOLN,
-       TPS80031_ID_LDOUSB,
-       TPS80031_ID_VBUS,
-       TPS80031_ID_CHARGER,
+       TPS80031_REGULATOR_VIO,
+       TPS80031_REGULATOR_SMPS1,
+       TPS80031_REGULATOR_SMPS2,
+       TPS80031_REGULATOR_SMPS3,
+       TPS80031_REGULATOR_SMPS4,
+       TPS80031_REGULATOR_VANA,
+       TPS80031_REGULATOR_LDO1,
+       TPS80031_REGULATOR_LDO2,
+       TPS80031_REGULATOR_LDO3,
+       TPS80031_REGULATOR_LDO4,
+       TPS80031_REGULATOR_LDO5,
+       TPS80031_REGULATOR_LDO6,
+       TPS80031_REGULATOR_LDO7,
+       TPS80031_REGULATOR_LDOLN,
+       TPS80031_REGULATOR_LDOUSB,
+       TPS80031_REGULATOR_VBUS,
+       TPS80031_REGULATOR_CHARGER,
 };