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

regulator: rc5t583: Convert to regulator_set_voltage_sel_regmap and regulator_map_voltage_linear

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Axel Lin and committed by
Mark Brown
70e5f645 3209be17

+2 -27
+2 -27
drivers/regulator/rc5t583-regulator.c
··· 60 60 struct regulator_dev *rdev; 61 61 }; 62 62 63 - static int rc5t583_set_voltage(struct regulator_dev *rdev, 64 - int min_uV, int max_uV, unsigned *selector) 65 - { 66 - struct rc5t583_regulator *reg = rdev_get_drvdata(rdev); 67 - int sel, ret; 68 - 69 - if (min_uV < rdev->desc->min_uV) 70 - min_uV = rdev->desc->min_uV; 71 - 72 - sel = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step); 73 - 74 - if (sel >= rdev->desc->n_voltages) { 75 - dev_err(&rdev->dev, "Invalid selector 0x%02x\n", sel); 76 - return -EINVAL; 77 - } 78 - 79 - *selector = sel; 80 - 81 - ret = rc5t583_update(reg->mfd->dev, rdev->desc->vsel_reg, sel, 82 - rdev->desc->vsel_mask); 83 - if (ret < 0) 84 - dev_err(&rdev->dev, "Error in update voltage register 0x%02x\n", 85 - rdev->desc->vsel_reg); 86 - return ret; 87 - } 88 - 89 63 static int rc5t583_regulator_enable_time(struct regulator_dev *rdev) 90 64 { 91 65 struct rc5t583_regulator *reg = rdev_get_drvdata(rdev); ··· 94 120 .disable = regulator_disable_regmap, 95 121 .enable_time = rc5t583_regulator_enable_time, 96 122 .get_voltage_sel = regulator_get_voltage_sel_regmap, 97 - .set_voltage = rc5t583_set_voltage, 123 + .set_voltage_sel = regulator_set_voltage_sel_regmap, 98 124 .list_voltage = regulator_list_voltage_linear, 125 + .map_voltage = regulator_map_voltage_linear, 99 126 .set_voltage_time_sel = rc5t583_set_voltage_time_sel, 100 127 }; 101 128