Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+9 -5
+8 -4
drivers/regulator/da9052-regulator.c
··· 226 226 if (min_uV < info->min_uV) 227 227 min_uV = info->min_uV; 228 228 229 - *selector = (min_uV - info->min_uV) / info->step_uV; 229 + *selector = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV); 230 230 231 231 ret = da9052_list_voltage(rdev, *selector); 232 232 if (ret < 0) ··· 318 318 if ((regulator->da9052->chip_id == DA9052) && 319 319 (min_uV >= DA9052_CONST_3uV)) 320 320 *selector = DA9052_BUCK_PERI_REG_MAP_UPTO_3uV + 321 - ((min_uV - DA9052_CONST_3uV) / 322 - (DA9052_BUCK_PERI_3uV_STEP)); 321 + DIV_ROUND_UP(min_uV - DA9052_CONST_3uV, 322 + DA9052_BUCK_PERI_3uV_STEP); 323 323 else 324 - *selector = (min_uV - info->min_uV) / info->step_uV; 324 + *selector = DIV_ROUND_UP(min_uV - info->min_uV, info->step_uV); 325 325 326 326 ret = da9052_list_buckperi_voltage(rdev, *selector); 327 327 if (ret < 0) ··· 400 400 .ops = &da9052_ldo5_6_ops,\ 401 401 .type = REGULATOR_VOLTAGE,\ 402 402 .id = _id,\ 403 + .n_voltages = (max - min) / step + 1, \ 403 404 .owner = THIS_MODULE,\ 404 405 },\ 405 406 .min_uV = (min) * 1000,\ ··· 418 417 .ops = &da9052_ldo_ops,\ 419 418 .type = REGULATOR_VOLTAGE,\ 420 419 .id = _id,\ 420 + .n_voltages = (max - min) / step + 1, \ 421 421 .owner = THIS_MODULE,\ 422 422 },\ 423 423 .min_uV = (min) * 1000,\ ··· 436 434 .ops = &da9052_dcdc_ops,\ 437 435 .type = REGULATOR_VOLTAGE,\ 438 436 .id = _id,\ 437 + .n_voltages = (max - min) / step + 1, \ 439 438 .owner = THIS_MODULE,\ 440 439 },\ 441 440 .min_uV = (min) * 1000,\ ··· 454 451 .ops = &da9052_buckperi_ops,\ 455 452 .type = REGULATOR_VOLTAGE,\ 456 453 .id = _id,\ 454 + .n_voltages = (max - min) / step + 1, \ 457 455 .owner = THIS_MODULE,\ 458 456 },\ 459 457 .min_uV = (min) * 1000,\
+1 -1
drivers/regulator/tps6524x-regulator.c
··· 481 481 if (i >= info->n_voltages) 482 482 i = info->n_voltages - 1; 483 483 484 - *selector = info->voltages[i]; 484 + *selector = i; 485 485 486 486 return write_field(hw, &info->voltage, i); 487 487 }