diff options
Diffstat (limited to 'drivers/regulator/tps65218-regulator.c')
-rw-r--r-- | drivers/regulator/tps65218-regulator.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index 9effe48c605e..f0a40281b9c1 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b/drivers/regulator/tps65218-regulator.c | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
30 | enum tps65218_regulators { DCDC1, DCDC2, DCDC3, DCDC4, DCDC5, DCDC6, LDO1 }; | 30 | enum tps65218_regulators { DCDC1, DCDC2, DCDC3, DCDC4, DCDC5, DCDC6, LDO1 }; |
31 | 31 | ||
32 | #define TPS65218_REGULATOR(_name, _id, _ops, _n, _vr, _vm, _er, _em, _t, \ | 32 | #define TPS65218_REGULATOR(_name, _id, _ops, _n, _vr, _vm, _er, _em, \ |
33 | _lr, _nlr, _delay) \ | 33 | _lr, _nlr, _delay, _fuv) \ |
34 | { \ | 34 | { \ |
35 | .name = _name, \ | 35 | .name = _name, \ |
36 | .id = _id, \ | 36 | .id = _id, \ |
@@ -42,14 +42,15 @@ enum tps65218_regulators { DCDC1, DCDC2, DCDC3, DCDC4, DCDC5, DCDC6, LDO1 }; | |||
42 | .vsel_mask = _vm, \ | 42 | .vsel_mask = _vm, \ |
43 | .enable_reg = _er, \ | 43 | .enable_reg = _er, \ |
44 | .enable_mask = _em, \ | 44 | .enable_mask = _em, \ |
45 | .volt_table = _t, \ | 45 | .volt_table = NULL, \ |
46 | .linear_ranges = _lr, \ | 46 | .linear_ranges = _lr, \ |
47 | .n_linear_ranges = _nlr, \ | 47 | .n_linear_ranges = _nlr, \ |
48 | .ramp_delay = _delay, \ | 48 | .ramp_delay = _delay, \ |
49 | .fixed_uV = _fuv \ | ||
49 | } \ | 50 | } \ |
50 | 51 | ||
51 | #define TPS65218_INFO(_id, _nm, _min, _max) \ | 52 | #define TPS65218_INFO(_id, _nm, _min, _max) \ |
52 | { \ | 53 | [_id] = { \ |
53 | .id = _id, \ | 54 | .id = _id, \ |
54 | .name = _nm, \ | 55 | .name = _nm, \ |
55 | .min_uV = _min, \ | 56 | .min_uV = _min, \ |
@@ -68,17 +69,17 @@ static const struct regulator_linear_range ldo1_dcdc3_ranges[] = { | |||
68 | 69 | ||
69 | static const struct regulator_linear_range dcdc4_ranges[] = { | 70 | static const struct regulator_linear_range dcdc4_ranges[] = { |
70 | REGULATOR_LINEAR_RANGE(1175000, 0x0, 0xf, 25000), | 71 | REGULATOR_LINEAR_RANGE(1175000, 0x0, 0xf, 25000), |
71 | REGULATOR_LINEAR_RANGE(1550000, 0x10, 0x34, 50000), | 72 | REGULATOR_LINEAR_RANGE(1600000, 0x10, 0x34, 50000), |
72 | }; | 73 | }; |
73 | 74 | ||
74 | static struct tps_info tps65218_pmic_regs[] = { | 75 | static struct tps_info tps65218_pmic_regs[] = { |
75 | TPS65218_INFO(0, "DCDC1", 850000, 167500), | 76 | TPS65218_INFO(DCDC1, "DCDC1", 850000, 167500), |
76 | TPS65218_INFO(1, "DCDC2", 850000, 1675000), | 77 | TPS65218_INFO(DCDC2, "DCDC2", 850000, 1675000), |
77 | TPS65218_INFO(2, "DCDC3", 900000, 3400000), | 78 | TPS65218_INFO(DCDC3, "DCDC3", 900000, 3400000), |
78 | TPS65218_INFO(3, "DCDC4", 1175000, 3400000), | 79 | TPS65218_INFO(DCDC4, "DCDC4", 1175000, 3400000), |
79 | TPS65218_INFO(4, "DCDC5", 1000000, 1000000), | 80 | TPS65218_INFO(DCDC5, "DCDC5", 1000000, 1000000), |
80 | TPS65218_INFO(5, "DCDC6", 1800000, 1800000), | 81 | TPS65218_INFO(DCDC6, "DCDC6", 1800000, 1800000), |
81 | TPS65218_INFO(6, "LDO1", 900000, 3400000), | 82 | TPS65218_INFO(LDO1, "LDO1", 900000, 3400000), |
82 | }; | 83 | }; |
83 | 84 | ||
84 | #define TPS65218_OF_MATCH(comp, label) \ | 85 | #define TPS65218_OF_MATCH(comp, label) \ |
@@ -127,7 +128,7 @@ static int tps65218_pmic_set_voltage_sel(struct regulator_dev *dev, | |||
127 | static int tps65218_pmic_enable(struct regulator_dev *dev) | 128 | static int tps65218_pmic_enable(struct regulator_dev *dev) |
128 | { | 129 | { |
129 | struct tps65218 *tps = rdev_get_drvdata(dev); | 130 | struct tps65218 *tps = rdev_get_drvdata(dev); |
130 | unsigned int rid = rdev_get_id(dev); | 131 | int rid = rdev_get_id(dev); |
131 | 132 | ||
132 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | 133 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) |
133 | return -EINVAL; | 134 | return -EINVAL; |
@@ -141,7 +142,7 @@ static int tps65218_pmic_enable(struct regulator_dev *dev) | |||
141 | static int tps65218_pmic_disable(struct regulator_dev *dev) | 142 | static int tps65218_pmic_disable(struct regulator_dev *dev) |
142 | { | 143 | { |
143 | struct tps65218 *tps = rdev_get_drvdata(dev); | 144 | struct tps65218 *tps = rdev_get_drvdata(dev); |
144 | unsigned int rid = rdev_get_id(dev); | 145 | int rid = rdev_get_id(dev); |
145 | 146 | ||
146 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) | 147 | if (rid < TPS65218_DCDC_1 || rid > TPS65218_LDO_1) |
147 | return -EINVAL; | 148 | return -EINVAL; |
@@ -185,34 +186,33 @@ static const struct regulator_desc regulators[] = { | |||
185 | TPS65218_REGULATOR("DCDC1", TPS65218_DCDC_1, tps65218_dcdc12_ops, 64, | 186 | TPS65218_REGULATOR("DCDC1", TPS65218_DCDC_1, tps65218_dcdc12_ops, 64, |
186 | TPS65218_REG_CONTROL_DCDC1, | 187 | TPS65218_REG_CONTROL_DCDC1, |
187 | TPS65218_CONTROL_DCDC1_MASK, | 188 | TPS65218_CONTROL_DCDC1_MASK, |
188 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC1_EN, NULL, | 189 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC1_EN, |
189 | dcdc1_dcdc2_ranges, 2, 4000), | 190 | dcdc1_dcdc2_ranges, 2, 4000, 0), |
190 | TPS65218_REGULATOR("DCDC2", TPS65218_DCDC_2, tps65218_dcdc12_ops, 64, | 191 | TPS65218_REGULATOR("DCDC2", TPS65218_DCDC_2, tps65218_dcdc12_ops, 64, |
191 | TPS65218_REG_CONTROL_DCDC2, | 192 | TPS65218_REG_CONTROL_DCDC2, |
192 | TPS65218_CONTROL_DCDC2_MASK, | 193 | TPS65218_CONTROL_DCDC2_MASK, |
193 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC2_EN, NULL, | 194 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC2_EN, |
194 | dcdc1_dcdc2_ranges, 2, 4000), | 195 | dcdc1_dcdc2_ranges, 2, 4000, 0), |
195 | TPS65218_REGULATOR("DCDC3", TPS65218_DCDC_3, tps65218_ldo1_dcdc34_ops, | 196 | TPS65218_REGULATOR("DCDC3", TPS65218_DCDC_3, tps65218_ldo1_dcdc34_ops, |
196 | 64, TPS65218_REG_CONTROL_DCDC3, | 197 | 64, TPS65218_REG_CONTROL_DCDC3, |
197 | TPS65218_CONTROL_DCDC3_MASK, TPS65218_REG_ENABLE1, | 198 | TPS65218_CONTROL_DCDC3_MASK, TPS65218_REG_ENABLE1, |
198 | TPS65218_ENABLE1_DC3_EN, NULL, | 199 | TPS65218_ENABLE1_DC3_EN, ldo1_dcdc3_ranges, 2, 0, 0), |
199 | ldo1_dcdc3_ranges, 2, 0), | ||
200 | TPS65218_REGULATOR("DCDC4", TPS65218_DCDC_4, tps65218_ldo1_dcdc34_ops, | 200 | TPS65218_REGULATOR("DCDC4", TPS65218_DCDC_4, tps65218_ldo1_dcdc34_ops, |
201 | 53, TPS65218_REG_CONTROL_DCDC4, | 201 | 53, TPS65218_REG_CONTROL_DCDC4, |
202 | TPS65218_CONTROL_DCDC4_MASK, | 202 | TPS65218_CONTROL_DCDC4_MASK, |
203 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC4_EN, NULL, | 203 | TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC4_EN, |
204 | dcdc4_ranges, 2, 0), | 204 | dcdc4_ranges, 2, 0, 0), |
205 | TPS65218_REGULATOR("DCDC5", TPS65218_DCDC_5, tps65218_dcdc56_pmic_ops, | 205 | TPS65218_REGULATOR("DCDC5", TPS65218_DCDC_5, tps65218_dcdc56_pmic_ops, |
206 | 1, -1, -1, TPS65218_REG_ENABLE1, | 206 | 1, -1, -1, TPS65218_REG_ENABLE1, |
207 | TPS65218_ENABLE1_DC5_EN, NULL, NULL, 0, 0), | 207 | TPS65218_ENABLE1_DC5_EN, NULL, 0, 0, 1000000), |
208 | TPS65218_REGULATOR("DCDC6", TPS65218_DCDC_6, tps65218_dcdc56_pmic_ops, | 208 | TPS65218_REGULATOR("DCDC6", TPS65218_DCDC_6, tps65218_dcdc56_pmic_ops, |
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, 0, 0, 1800000), |
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_LDO1, | 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, ldo1_dcdc3_ranges, |
215 | 2, 0), | 215 | 2, 0, 0), |
216 | }; | 216 | }; |
217 | 217 | ||
218 | static int tps65218_regulator_probe(struct platform_device *pdev) | 218 | static int tps65218_regulator_probe(struct platform_device *pdev) |