]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Merge remote-tracking branch 'regulator/topic/min' into regulator-next
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Dec 2012 03:43:00 +0000 (12:43 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Dec 2012 03:43:00 +0000 (12:43 +0900)
1  2 
drivers/regulator/anatop-regulator.c
drivers/regulator/core.c
drivers/regulator/da9055-regulator.c
drivers/regulator/palmas-regulator.c
drivers/regulator/pcf50633-regulator.c
drivers/regulator/tps51632-regulator.c
include/linux/regulator/driver.h

Simple merge
Simple merge
index db59ce7534cdc12227dd837942718ef0e16d9a79,2253559703ced0eb2416524f801f289bcd48409a..a4b9cb8c43175343bdfaa2a04bc51038e4003c05
@@@ -187,55 -186,23 +186,20 @@@ static int da9055_buck_set_current_limi
  {
        struct da9055_regulator *regulator = rdev_get_drvdata(rdev);
        struct da9055_regulator_info *info = regulator->info;
 -      int i, val = 0;
 -
 -      if (min_uA > da9055_current_limits[DA9055_MAX_UA] ||
 -          max_uA < da9055_current_limits[DA9055_MIN_UA])
 -              return -EINVAL;
 -
 -      for (i = 0; i < ARRAY_SIZE(da9055_current_limits); i++) {
 -              if (min_uA <= da9055_current_limits[i]) {
 -                      val = i;
 -                      break;
 -              }
 +      int i;
 +
 +      for (i = ARRAY_SIZE(da9055_current_limits) - 1; i >= 0; i--) {
 +              if ((min_uA <= da9055_current_limits[i]) &&
 +                  (da9055_current_limits[i] <= max_uA))
 +                      return da9055_reg_update(regulator->da9055,
 +                                               DA9055_REG_BUCK_LIM,
 +                                               info->mode.mask,
 +                                               i << info->mode.shift);
        }
  
 -      return da9055_reg_update(regulator->da9055, DA9055_REG_BUCK_LIM,
 -                              info->mode.mask, val << info->mode.shift);
 +      return -EINVAL;
  }
  
- static int da9055_list_voltage(struct regulator_dev *rdev, unsigned selector)
- {
-       struct da9055_regulator *regulator = rdev_get_drvdata(rdev);
-       struct da9055_regulator_info *info = regulator->info;
-       if (selector >= rdev->desc->n_voltages)
-               return -EINVAL;
-       if (selector < info->volt.v_offset)
-               return 0;
-       selector -= info->volt.v_offset;
-       return rdev->desc->min_uV + (rdev->desc->uV_step * selector);
- }
- static int da9055_map_voltage(struct regulator_dev *rdev, int min_uV,
-                             int max_uV)
- {
-       struct da9055_regulator *regulator = rdev_get_drvdata(rdev);
-       struct da9055_regulator_info *info = regulator->info;
-       int sel, voltage;
-       if (min_uV < rdev->desc->min_uV)
-               min_uV = rdev->desc->min_uV;
-       sel = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step);
-       sel += info->volt.v_offset;
-       voltage = da9055_list_voltage(rdev, sel);
-       if (voltage < min_uV || voltage > max_uV)
-               return -EINVAL;
-       return sel;
- }
  static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev)
  {
        struct da9055_regulator *regulator = rdev_get_drvdata(rdev);
Simple merge
index d776f518aa0dc0a41259844dacd98bd5d92a377c,769272afff2aa3871c5d2fe4847fecbf91f6e89e..534075e13d6dba59e5f21b4db91fb3b0d9acdb25
@@@ -183,20 -52,31 +52,31 @@@ static struct regulator_ops pcf50633_re
  };
  
  static const struct regulator_desc regulators[] = {
-       [PCF50633_REGULATOR_AUTO] = PCF50633_REGULATOR("auto", AUTO, 128),
-       [PCF50633_REGULATOR_DOWN1] = PCF50633_REGULATOR("down1", DOWN1, 96),
-       [PCF50633_REGULATOR_DOWN2] = PCF50633_REGULATOR("down2", DOWN2, 96),
-       [PCF50633_REGULATOR_LDO1] = PCF50633_REGULATOR("ldo1", LDO1, 28),
-       [PCF50633_REGULATOR_LDO2] = PCF50633_REGULATOR("ldo2", LDO2, 28),
-       [PCF50633_REGULATOR_LDO3] = PCF50633_REGULATOR("ldo3", LDO3, 28),
-       [PCF50633_REGULATOR_LDO4] = PCF50633_REGULATOR("ldo4", LDO4, 28),
-       [PCF50633_REGULATOR_LDO5] = PCF50633_REGULATOR("ldo5", LDO5, 28),
-       [PCF50633_REGULATOR_LDO6] = PCF50633_REGULATOR("ldo6", LDO6, 28),
-       [PCF50633_REGULATOR_HCLDO] = PCF50633_REGULATOR("hcldo", HCLDO, 28),
-       [PCF50633_REGULATOR_MEMLDO] = PCF50633_REGULATOR("memldo", MEMLDO, 28),
+       [PCF50633_REGULATOR_AUTO] =
+               PCF50633_REGULATOR("auto", AUTO, 1800000, 25000, 0x2f, 128),
+       [PCF50633_REGULATOR_DOWN1] =
+               PCF50633_REGULATOR("down1", DOWN1, 625000, 25000, 0, 96),
+       [PCF50633_REGULATOR_DOWN2] =
+               PCF50633_REGULATOR("down2", DOWN2, 625000, 25000, 0, 96),
+       [PCF50633_REGULATOR_LDO1] =
+               PCF50633_REGULATOR("ldo1", LDO1, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_LDO2] =
+               PCF50633_REGULATOR("ldo2", LDO2, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_LDO3] =
+               PCF50633_REGULATOR("ldo3", LDO3, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_LDO4] =
+               PCF50633_REGULATOR("ldo4", LDO4, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_LDO5] =
+               PCF50633_REGULATOR("ldo5", LDO5, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_LDO6] =
+               PCF50633_REGULATOR("ldo6", LDO6, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_HCLDO] =
+               PCF50633_REGULATOR("hcldo", HCLDO, 900000, 100000, 0, 28),
+       [PCF50633_REGULATOR_MEMLDO] =
+               PCF50633_REGULATOR("memldo", MEMLDO, 900000, 100000, 0, 28),
  };
  
 -static int __devinit pcf50633_regulator_probe(struct platform_device *pdev)
 +static int pcf50633_regulator_probe(struct platform_device *pdev)
  {
        struct regulator_dev *rdev;
        struct pcf50633 *pcf;
Simple merge