diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/as3722-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/bcm590xx-regulator.c | 5 | ||||
-rw-r--r-- | drivers/regulator/ltc3589.c | 2 | ||||
-rw-r--r-- | drivers/regulator/palmas-regulator.c | 14 | ||||
-rw-r--r-- | drivers/regulator/tps65218-regulator.c | 3 |
5 files changed, 24 insertions, 2 deletions
diff --git a/drivers/regulator/as3722-regulator.c b/drivers/regulator/as3722-regulator.c index 85585219ce82..ad9e0c9b7daf 100644 --- a/drivers/regulator/as3722-regulator.c +++ b/drivers/regulator/as3722-regulator.c | |||
@@ -433,6 +433,7 @@ static struct regulator_ops as3722_ldo3_extcntrl_ops = { | |||
433 | }; | 433 | }; |
434 | 434 | ||
435 | static const struct regulator_linear_range as3722_ldo_ranges[] = { | 435 | static const struct regulator_linear_range as3722_ldo_ranges[] = { |
436 | REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0), | ||
436 | REGULATOR_LINEAR_RANGE(825000, 0x01, 0x24, 25000), | 437 | REGULATOR_LINEAR_RANGE(825000, 0x01, 0x24, 25000), |
437 | REGULATOR_LINEAR_RANGE(1725000, 0x40, 0x7F, 25000), | 438 | REGULATOR_LINEAR_RANGE(1725000, 0x40, 0x7F, 25000), |
438 | }; | 439 | }; |
@@ -609,6 +610,7 @@ static bool as3722_sd0_is_low_voltage(struct as3722_regulators *as3722_regs) | |||
609 | } | 610 | } |
610 | 611 | ||
611 | static const struct regulator_linear_range as3722_sd2345_ranges[] = { | 612 | static const struct regulator_linear_range as3722_sd2345_ranges[] = { |
613 | REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0), | ||
612 | REGULATOR_LINEAR_RANGE(612500, 0x01, 0x40, 12500), | 614 | REGULATOR_LINEAR_RANGE(612500, 0x01, 0x40, 12500), |
613 | REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000), | 615 | REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000), |
614 | REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7F, 50000), | 616 | REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7F, 50000), |
diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c index 57544e254a78..58ece59367ae 100644 --- a/drivers/regulator/bcm590xx-regulator.c +++ b/drivers/regulator/bcm590xx-regulator.c | |||
@@ -119,6 +119,10 @@ static const unsigned int ldo_c_table[] = { | |||
119 | 2900000, 3000000, 3300000, | 119 | 2900000, 3000000, 3300000, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | static const unsigned int ldo_vbus[] = { | ||
123 | 5000000, | ||
124 | }; | ||
125 | |||
122 | /* DCDC group CSR: supported voltages in microvolts */ | 126 | /* DCDC group CSR: supported voltages in microvolts */ |
123 | static const struct regulator_linear_range dcdc_csr_ranges[] = { | 127 | static const struct regulator_linear_range dcdc_csr_ranges[] = { |
124 | REGULATOR_LINEAR_RANGE(860000, 2, 50, 10000), | 128 | REGULATOR_LINEAR_RANGE(860000, 2, 50, 10000), |
@@ -192,6 +196,7 @@ static struct bcm590xx_info bcm590xx_regs[] = { | |||
192 | BCM590XX_REG_TABLE(gpldo4, ldo_a_table), | 196 | BCM590XX_REG_TABLE(gpldo4, ldo_a_table), |
193 | BCM590XX_REG_TABLE(gpldo5, ldo_a_table), | 197 | BCM590XX_REG_TABLE(gpldo5, ldo_a_table), |
194 | BCM590XX_REG_TABLE(gpldo6, ldo_a_table), | 198 | BCM590XX_REG_TABLE(gpldo6, ldo_a_table), |
199 | BCM590XX_REG_TABLE(vbus, ldo_vbus), | ||
195 | }; | 200 | }; |
196 | 201 | ||
197 | struct bcm590xx_reg { | 202 | struct bcm590xx_reg { |
diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c index 110a99ee1162..c8105182b8b8 100644 --- a/drivers/regulator/ltc3589.c +++ b/drivers/regulator/ltc3589.c | |||
@@ -255,7 +255,7 @@ static int ltc3589_parse_regulators_dt(struct ltc3589 *ltc3589) | |||
255 | struct device_node *node; | 255 | struct device_node *node; |
256 | int i, ret; | 256 | int i, ret; |
257 | 257 | ||
258 | node = of_find_node_by_name(dev->of_node, "regulators"); | 258 | node = of_get_child_by_name(dev->of_node, "regulators"); |
259 | if (!node) { | 259 | if (!node) { |
260 | dev_err(dev, "regulators node not found\n"); | 260 | dev_err(dev, "regulators node not found\n"); |
261 | return -EINVAL; | 261 | return -EINVAL; |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 864ed02ce4b7..93b4ad842901 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -37,12 +37,14 @@ struct regs_info { | |||
37 | }; | 37 | }; |
38 | 38 | ||
39 | static const struct regulator_linear_range smps_low_ranges[] = { | 39 | static const struct regulator_linear_range smps_low_ranges[] = { |
40 | REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), | ||
40 | REGULATOR_LINEAR_RANGE(500000, 0x1, 0x6, 0), | 41 | REGULATOR_LINEAR_RANGE(500000, 0x1, 0x6, 0), |
41 | REGULATOR_LINEAR_RANGE(510000, 0x7, 0x79, 10000), | 42 | REGULATOR_LINEAR_RANGE(510000, 0x7, 0x79, 10000), |
42 | REGULATOR_LINEAR_RANGE(1650000, 0x7A, 0x7f, 0), | 43 | REGULATOR_LINEAR_RANGE(1650000, 0x7A, 0x7f, 0), |
43 | }; | 44 | }; |
44 | 45 | ||
45 | static const struct regulator_linear_range smps_high_ranges[] = { | 46 | static const struct regulator_linear_range smps_high_ranges[] = { |
47 | REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0), | ||
46 | REGULATOR_LINEAR_RANGE(1000000, 0x1, 0x6, 0), | 48 | REGULATOR_LINEAR_RANGE(1000000, 0x1, 0x6, 0), |
47 | REGULATOR_LINEAR_RANGE(1020000, 0x7, 0x79, 20000), | 49 | REGULATOR_LINEAR_RANGE(1020000, 0x7, 0x79, 20000), |
48 | REGULATOR_LINEAR_RANGE(3300000, 0x7A, 0x7f, 0), | 50 | REGULATOR_LINEAR_RANGE(3300000, 0x7A, 0x7f, 0), |
@@ -323,6 +325,10 @@ static int palmas_set_mode_smps(struct regulator_dev *dev, unsigned int mode) | |||
323 | if (rail_enable) | 325 | if (rail_enable) |
324 | palmas_smps_write(pmic->palmas, | 326 | palmas_smps_write(pmic->palmas, |
325 | palmas_regs_info[id].ctrl_addr, reg); | 327 | palmas_regs_info[id].ctrl_addr, reg); |
328 | |||
329 | /* Switch the enable value to ensure this is used for enable */ | ||
330 | pmic->desc[id].enable_val = pmic->current_reg_mode[id]; | ||
331 | |||
326 | return 0; | 332 | return 0; |
327 | } | 333 | } |
328 | 334 | ||
@@ -962,6 +968,14 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
962 | return ret; | 968 | return ret; |
963 | pmic->current_reg_mode[id] = reg & | 969 | pmic->current_reg_mode[id] = reg & |
964 | PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; | 970 | PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; |
971 | |||
972 | pmic->desc[id].enable_reg = | ||
973 | PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, | ||
974 | palmas_regs_info[id].ctrl_addr); | ||
975 | pmic->desc[id].enable_mask = | ||
976 | PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK; | ||
977 | /* set_mode overrides this value */ | ||
978 | pmic->desc[id].enable_val = SMPS_CTRL_MODE_ON; | ||
965 | } | 979 | } |
966 | 980 | ||
967 | pmic->desc[id].type = REGULATOR_VOLTAGE; | 981 | pmic->desc[id].type = REGULATOR_VOLTAGE; |
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 69b4b7750410..9effe48c605e 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c | |||
@@ -209,7 +209,7 @@ static const struct regulator_desc regulators[] = { | |||
209 | 1, -1, -1, TPS65218_REG_ENABLE1, | 209 | 1, -1, -1, TPS65218_REG_ENABLE1, |
210 | TPS65218_ENABLE1_DC6_EN, NULL, NULL, 0, 0), | 210 | TPS65218_ENABLE1_DC6_EN, NULL, NULL, 0, 0), |
211 | TPS65218_REGULATOR("LDO1", TPS65218_LDO_1, tps65218_ldo1_dcdc34_ops, 64, | 211 | TPS65218_REGULATOR("LDO1", TPS65218_LDO_1, tps65218_ldo1_dcdc34_ops, 64, |
212 | TPS65218_REG_CONTROL_DCDC4, | 212 | TPS65218_REG_CONTROL_LDO1, |
213 | TPS65218_CONTROL_LDO1_MASK, TPS65218_REG_ENABLE2, | 213 | TPS65218_CONTROL_LDO1_MASK, TPS65218_REG_ENABLE2, |
214 | TPS65218_ENABLE2_LDO1_EN, NULL, ldo1_dcdc3_ranges, | 214 | TPS65218_ENABLE2_LDO1_EN, NULL, ldo1_dcdc3_ranges, |
215 | 2, 0), | 215 | 2, 0), |
@@ -240,6 +240,7 @@ static int tps65218_regulator_probe(struct platform_device *pdev) | |||
240 | config.init_data = init_data; | 240 | config.init_data = init_data; |
241 | config.driver_data = tps; | 241 | config.driver_data = tps; |
242 | config.regmap = tps->regmap; | 242 | config.regmap = tps->regmap; |
243 | config.of_node = pdev->dev.of_node; | ||
243 | 244 | ||
244 | rdev = devm_regulator_register(&pdev->dev, ®ulators[id], &config); | 245 | rdev = devm_regulator_register(&pdev->dev, ®ulators[id], &config); |
245 | if (IS_ERR(rdev)) { | 246 | if (IS_ERR(rdev)) { |