Another small batch of driver specific bug fixes, a couple more errors

in the da9052 driver and a bad return value in the tps6524x driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPXQ3AAAoJEBus8iNuMP3d9acP/3kzJUFGoqFjNRf1YjAmaOOX
 JSGHv6FmrHLlax/tVelrKS6JtCgdM8OiEwlPMIELTLxk7uIkAKgLqv+bt3SiAklG
 L0rKPWcYT2ORPmthIUQ8zaS9ceY2mpJJ5hc2+0JZJHQC+FoKMmjTZXUJACj4YW/n
 n4qsvHxoZS3tHYPTWmP6HcB8DQ6A9Z0MDKNFPTPa5yPl9hTOp9yYduyrr4W5bSfA
 dIeNYSA3RGup59Q+2gxVDOAb8p4jPOX2mTc9HMkzTr7SAGkdb8yBMiSFeNP0AbSS
 HshbqId0LqTp75+M8hz0DX1iIAP+3tvxZ/3Jebejt+BTUPaUp5DezjwdVALyGFk6
 R0sawirPJ2Ckfst7NhtbOdmQEaVQ7GIcku3IhVHKxWFdgPe7roY/Yih+PmbS2Ain
 TUuGF4sbnN6l5MR5zX9TiHRr2FeDroFTNk0g5P81ze4pMCVHUVJHiaRMLySMisva
 x/Sbl/68NL9SDm+l1pN7w9gm5q0zSQPxsPBkYJmh5Y657DaMO4/qV3sWpROgGEIT
 yfnsVaLZUSpENColnQmmFN+iFXgLut1qerV8fHvwMlp1xrVaSa/2UPO5DyIh5tda
 4wqyCz7Mp01XkMqWzBORB1PX9tqG6SxOPWv7GXv08MeBndB217eWSCvdTvH0k74G
 O1Doh+6ffT9t8jQq/lAN
 =NzBr
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "Another small batch of driver specific bug fixes, a couple more errors
  in the da9052 driver and a bad return value in the tps6524x driver."

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: da9052: Ensure the selected voltage falls within the specified range
  regulator: Set n_voltages for da9052 regulators
  regulator: Fix setting selector in tps6524x set_voltage function
This commit is contained in:
Linus Torvalds 2012-03-14 17:16:02 -07:00
commit ff398c45b0
2 changed files with 9 additions and 5 deletions

View file

@ -226,7 +226,7 @@ static int da9052_regulator_set_voltage_int(struct regulator_dev *rdev,
if (min_uV < info->min_uV)
min_uV = info->min_uV;
*selector = (min_uV - info->min_uV) / info->step_uV;
*selector = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
ret = da9052_list_voltage(rdev, *selector);
if (ret < 0)
@ -318,10 +318,10 @@ static int da9052_set_buckperi_voltage(struct regulator_dev *rdev, int min_uV,
if ((regulator->da9052->chip_id == DA9052) &&
(min_uV >= DA9052_CONST_3uV))
*selector = DA9052_BUCK_PERI_REG_MAP_UPTO_3uV +
((min_uV - DA9052_CONST_3uV) /
(DA9052_BUCK_PERI_3uV_STEP));
DIV_ROUND_UP(min_uV - DA9052_CONST_3uV,
DA9052_BUCK_PERI_3uV_STEP);
else
*selector = (min_uV - info->min_uV) / info->step_uV;
*selector = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV);
ret = da9052_list_buckperi_voltage(rdev, *selector);
if (ret < 0)
@ -400,6 +400,7 @@ static struct regulator_ops da9052_ldo_ops = {
.ops = &da9052_ldo5_6_ops,\
.type = REGULATOR_VOLTAGE,\
.id = _id,\
.n_voltages = (max - min) / step + 1, \
.owner = THIS_MODULE,\
},\
.min_uV = (min) * 1000,\
@ -417,6 +418,7 @@ static struct regulator_ops da9052_ldo_ops = {
.ops = &da9052_ldo_ops,\
.type = REGULATOR_VOLTAGE,\
.id = _id,\
.n_voltages = (max - min) / step + 1, \
.owner = THIS_MODULE,\
},\
.min_uV = (min) * 1000,\
@ -434,6 +436,7 @@ static struct regulator_ops da9052_ldo_ops = {
.ops = &da9052_dcdc_ops,\
.type = REGULATOR_VOLTAGE,\
.id = _id,\
.n_voltages = (max - min) / step + 1, \
.owner = THIS_MODULE,\
},\
.min_uV = (min) * 1000,\
@ -451,6 +454,7 @@ static struct regulator_ops da9052_ldo_ops = {
.ops = &da9052_buckperi_ops,\
.type = REGULATOR_VOLTAGE,\
.id = _id,\
.n_voltages = (max - min) / step + 1, \
.owner = THIS_MODULE,\
},\
.min_uV = (min) * 1000,\

View file

@ -481,7 +481,7 @@ static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
if (i >= info->n_voltages)
i = info->n_voltages - 1;
*selector = info->voltages[i];
*selector = i;
return write_field(hw, &info->voltage, i);
}