Merge remote-tracking branch 'regulator/topic/twl' into v3.9-rc8
authorMark Brown <broonie@sirena.org.uk>
Sun, 28 Apr 2013 01:13:49 +0000 (02:13 +0100)
committerMark Brown <broonie@sirena.org.uk>
Sun, 28 Apr 2013 01:13:49 +0000 (02:13 +0100)
1  2 
drivers/regulator/twl-regulator.c

index f705d25b437ccfc57a144a600d6993ce926869c1,cb872bfd344293f84ab718eeababb497cf7002a2..fb6e67d74ffbf98a9d977158635497542bc8580d
@@@ -441,12 -441,6 +441,6 @@@ static const u16 VSIM_VSEL_table[] = 
  static const u16 VDAC_VSEL_table[] = {
        1200, 1300, 1800, 1800,
  };
- static const u16 VDD1_VSEL_table[] = {
-       800, 1450,
- };
- static const u16 VDD2_VSEL_table[] = {
-       800, 1450, 1500,
- };
  static const u16 VIO_VSEL_table[] = {
        1800, 1850,
  };
@@@ -471,23 -465,24 +465,23 @@@ twl4030ldo_set_voltage_sel(struct regul
                            selector);
  }
  
 -static int twl4030ldo_get_voltage(struct regulator_dev *rdev)
 +static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev)
  {
        struct twlreg_info      *info = rdev_get_drvdata(rdev);
 -      int             vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER,
 -                                                              VREG_VOLTAGE);
 +      int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE);
  
        if (vsel < 0)
                return vsel;
  
        vsel &= info->table_len - 1;
 -      return LDO_MV(info->table[vsel]) * 1000;
 +      return vsel;
  }
  
  static struct regulator_ops twl4030ldo_ops = {
        .list_voltage   = twl4030ldo_list_voltage,
  
        .set_voltage_sel = twl4030ldo_set_voltage_sel,
 -      .get_voltage    = twl4030ldo_get_voltage,
 +      .get_voltage_sel = twl4030ldo_get_voltage_sel,
  
        .enable         = twl4030reg_enable,
        .disable        = twl4030reg_disable,
@@@ -615,18 -610,8 +609,8 @@@ static struct regulator_ops twl6030ldo_
  
  /*----------------------------------------------------------------------*/
  
- /*
-  * Fixed voltage LDOs don't have a VSEL field to update.
-  */
- static int twlfixed_list_voltage(struct regulator_dev *rdev, unsigned index)
- {
-       struct twlreg_info      *info = rdev_get_drvdata(rdev);
-       return info->min_mV * 1000;
- }
  static struct regulator_ops twl4030fixed_ops = {
-       .list_voltage   = twlfixed_list_voltage,
+       .list_voltage   = regulator_list_voltage_linear,
  
        .enable         = twl4030reg_enable,
        .disable        = twl4030reg_disable,
  };
  
  static struct regulator_ops twl6030fixed_ops = {
-       .list_voltage   = twlfixed_list_voltage,
+       .list_voltage   = regulator_list_voltage_linear,
  
        .enable         = twl6030reg_enable,
        .disable        = twl6030reg_disable,
@@@ -944,19 -929,7 +928,7 @@@ static const struct twlreg_info TWLFIXE
                .ops = &operations, \
                .type = REGULATOR_VOLTAGE, \
                .owner = THIS_MODULE, \
-               .enable_time = turnon_delay, \
-               }, \
-       }
- #define TWL6030_FIXED_RESOURCE(label, offset, turnon_delay) \
- static struct twlreg_info TWLRES_INFO_##label = { \
-       .base = offset, \
-       .desc = { \
-               .name = #label, \
-               .id = TWL6030_REG_##label, \
-               .ops = &twl6030_fixed_resource, \
-               .type = REGULATOR_VOLTAGE, \
-               .owner = THIS_MODULE, \
+               .min_uV = mVolts * 1000, \
                .enable_time = turnon_delay, \
                }, \
        }