diff options
-rw-r--r-- | drivers/regulator/tps65910-regulator.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index aa11ce86ec64..f28f41aec284 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c | |||
@@ -89,11 +89,13 @@ struct tps_info { | |||
89 | unsigned max_uV; | 89 | unsigned max_uV; |
90 | u8 n_voltages; | 90 | u8 n_voltages; |
91 | const u16 *voltage_table; | 91 | const u16 *voltage_table; |
92 | int enable_time_us; | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | static struct tps_info tps65910_regs[] = { | 95 | static struct tps_info tps65910_regs[] = { |
95 | { | 96 | { |
96 | .name = "VRTC", | 97 | .name = "VRTC", |
98 | .enable_time_us = 2200, | ||
97 | }, | 99 | }, |
98 | { | 100 | { |
99 | .name = "VIO", | 101 | .name = "VIO", |
@@ -101,16 +103,19 @@ static struct tps_info tps65910_regs[] = { | |||
101 | .max_uV = 3300000, | 103 | .max_uV = 3300000, |
102 | .n_voltages = ARRAY_SIZE(VIO_VSEL_table), | 104 | .n_voltages = ARRAY_SIZE(VIO_VSEL_table), |
103 | .voltage_table = VIO_VSEL_table, | 105 | .voltage_table = VIO_VSEL_table, |
106 | .enable_time_us = 350, | ||
104 | }, | 107 | }, |
105 | { | 108 | { |
106 | .name = "VDD1", | 109 | .name = "VDD1", |
107 | .min_uV = 600000, | 110 | .min_uV = 600000, |
108 | .max_uV = 4500000, | 111 | .max_uV = 4500000, |
112 | .enable_time_us = 350, | ||
109 | }, | 113 | }, |
110 | { | 114 | { |
111 | .name = "VDD2", | 115 | .name = "VDD2", |
112 | .min_uV = 600000, | 116 | .min_uV = 600000, |
113 | .max_uV = 4500000, | 117 | .max_uV = 4500000, |
118 | .enable_time_us = 350, | ||
114 | }, | 119 | }, |
115 | { | 120 | { |
116 | .name = "VDD3", | 121 | .name = "VDD3", |
@@ -118,6 +123,7 @@ static struct tps_info tps65910_regs[] = { | |||
118 | .max_uV = 5000000, | 123 | .max_uV = 5000000, |
119 | .n_voltages = ARRAY_SIZE(VDD3_VSEL_table), | 124 | .n_voltages = ARRAY_SIZE(VDD3_VSEL_table), |
120 | .voltage_table = VDD3_VSEL_table, | 125 | .voltage_table = VDD3_VSEL_table, |
126 | .enable_time_us = 200, | ||
121 | }, | 127 | }, |
122 | { | 128 | { |
123 | .name = "VDIG1", | 129 | .name = "VDIG1", |
@@ -125,6 +131,7 @@ static struct tps_info tps65910_regs[] = { | |||
125 | .max_uV = 2700000, | 131 | .max_uV = 2700000, |
126 | .n_voltages = ARRAY_SIZE(VDIG1_VSEL_table), | 132 | .n_voltages = ARRAY_SIZE(VDIG1_VSEL_table), |
127 | .voltage_table = VDIG1_VSEL_table, | 133 | .voltage_table = VDIG1_VSEL_table, |
134 | .enable_time_us = 100, | ||
128 | }, | 135 | }, |
129 | { | 136 | { |
130 | .name = "VDIG2", | 137 | .name = "VDIG2", |
@@ -132,6 +139,7 @@ static struct tps_info tps65910_regs[] = { | |||
132 | .max_uV = 1800000, | 139 | .max_uV = 1800000, |
133 | .n_voltages = ARRAY_SIZE(VDIG2_VSEL_table), | 140 | .n_voltages = ARRAY_SIZE(VDIG2_VSEL_table), |
134 | .voltage_table = VDIG2_VSEL_table, | 141 | .voltage_table = VDIG2_VSEL_table, |
142 | .enable_time_us = 100, | ||
135 | }, | 143 | }, |
136 | { | 144 | { |
137 | .name = "VPLL", | 145 | .name = "VPLL", |
@@ -139,6 +147,7 @@ static struct tps_info tps65910_regs[] = { | |||
139 | .max_uV = 2500000, | 147 | .max_uV = 2500000, |
140 | .n_voltages = ARRAY_SIZE(VPLL_VSEL_table), | 148 | .n_voltages = ARRAY_SIZE(VPLL_VSEL_table), |
141 | .voltage_table = VPLL_VSEL_table, | 149 | .voltage_table = VPLL_VSEL_table, |
150 | .enable_time_us = 100, | ||
142 | }, | 151 | }, |
143 | { | 152 | { |
144 | .name = "VDAC", | 153 | .name = "VDAC", |
@@ -146,6 +155,7 @@ static struct tps_info tps65910_regs[] = { | |||
146 | .max_uV = 2850000, | 155 | .max_uV = 2850000, |
147 | .n_voltages = ARRAY_SIZE(VDAC_VSEL_table), | 156 | .n_voltages = ARRAY_SIZE(VDAC_VSEL_table), |
148 | .voltage_table = VDAC_VSEL_table, | 157 | .voltage_table = VDAC_VSEL_table, |
158 | .enable_time_us = 100, | ||
149 | }, | 159 | }, |
150 | { | 160 | { |
151 | .name = "VAUX1", | 161 | .name = "VAUX1", |
@@ -153,6 +163,7 @@ static struct tps_info tps65910_regs[] = { | |||
153 | .max_uV = 2850000, | 163 | .max_uV = 2850000, |
154 | .n_voltages = ARRAY_SIZE(VAUX1_VSEL_table), | 164 | .n_voltages = ARRAY_SIZE(VAUX1_VSEL_table), |
155 | .voltage_table = VAUX1_VSEL_table, | 165 | .voltage_table = VAUX1_VSEL_table, |
166 | .enable_time_us = 100, | ||
156 | }, | 167 | }, |
157 | { | 168 | { |
158 | .name = "VAUX2", | 169 | .name = "VAUX2", |
@@ -160,6 +171,7 @@ static struct tps_info tps65910_regs[] = { | |||
160 | .max_uV = 3300000, | 171 | .max_uV = 3300000, |
161 | .n_voltages = ARRAY_SIZE(VAUX2_VSEL_table), | 172 | .n_voltages = ARRAY_SIZE(VAUX2_VSEL_table), |
162 | .voltage_table = VAUX2_VSEL_table, | 173 | .voltage_table = VAUX2_VSEL_table, |
174 | .enable_time_us = 100, | ||
163 | }, | 175 | }, |
164 | { | 176 | { |
165 | .name = "VAUX33", | 177 | .name = "VAUX33", |
@@ -167,6 +179,7 @@ static struct tps_info tps65910_regs[] = { | |||
167 | .max_uV = 3300000, | 179 | .max_uV = 3300000, |
168 | .n_voltages = ARRAY_SIZE(VAUX33_VSEL_table), | 180 | .n_voltages = ARRAY_SIZE(VAUX33_VSEL_table), |
169 | .voltage_table = VAUX33_VSEL_table, | 181 | .voltage_table = VAUX33_VSEL_table, |
182 | .enable_time_us = 100, | ||
170 | }, | 183 | }, |
171 | { | 184 | { |
172 | .name = "VMMC", | 185 | .name = "VMMC", |
@@ -174,12 +187,14 @@ static struct tps_info tps65910_regs[] = { | |||
174 | .max_uV = 3300000, | 187 | .max_uV = 3300000, |
175 | .n_voltages = ARRAY_SIZE(VMMC_VSEL_table), | 188 | .n_voltages = ARRAY_SIZE(VMMC_VSEL_table), |
176 | .voltage_table = VMMC_VSEL_table, | 189 | .voltage_table = VMMC_VSEL_table, |
190 | .enable_time_us = 100, | ||
177 | }, | 191 | }, |
178 | }; | 192 | }; |
179 | 193 | ||
180 | static struct tps_info tps65911_regs[] = { | 194 | static struct tps_info tps65911_regs[] = { |
181 | { | 195 | { |
182 | .name = "VRTC", | 196 | .name = "VRTC", |
197 | .enable_time_us = 2200, | ||
183 | }, | 198 | }, |
184 | { | 199 | { |
185 | .name = "VIO", | 200 | .name = "VIO", |
@@ -187,72 +202,84 @@ static struct tps_info tps65911_regs[] = { | |||
187 | .max_uV = 3300000, | 202 | .max_uV = 3300000, |
188 | .n_voltages = ARRAY_SIZE(VIO_VSEL_table), | 203 | .n_voltages = ARRAY_SIZE(VIO_VSEL_table), |
189 | .voltage_table = VIO_VSEL_table, | 204 | .voltage_table = VIO_VSEL_table, |
205 | .enable_time_us = 350, | ||
190 | }, | 206 | }, |
191 | { | 207 | { |
192 | .name = "VDD1", | 208 | .name = "VDD1", |
193 | .min_uV = 600000, | 209 | .min_uV = 600000, |
194 | .max_uV = 4500000, | 210 | .max_uV = 4500000, |
195 | .n_voltages = 73, | 211 | .n_voltages = 73, |
212 | .enable_time_us = 350, | ||
196 | }, | 213 | }, |
197 | { | 214 | { |
198 | .name = "VDD2", | 215 | .name = "VDD2", |
199 | .min_uV = 600000, | 216 | .min_uV = 600000, |
200 | .max_uV = 4500000, | 217 | .max_uV = 4500000, |
201 | .n_voltages = 73, | 218 | .n_voltages = 73, |
219 | .enable_time_us = 350, | ||
202 | }, | 220 | }, |
203 | { | 221 | { |
204 | .name = "VDDCTRL", | 222 | .name = "VDDCTRL", |
205 | .min_uV = 600000, | 223 | .min_uV = 600000, |
206 | .max_uV = 1400000, | 224 | .max_uV = 1400000, |
207 | .n_voltages = 65, | 225 | .n_voltages = 65, |
226 | .enable_time_us = 900, | ||
208 | }, | 227 | }, |
209 | { | 228 | { |
210 | .name = "LDO1", | 229 | .name = "LDO1", |
211 | .min_uV = 1000000, | 230 | .min_uV = 1000000, |
212 | .max_uV = 3300000, | 231 | .max_uV = 3300000, |
213 | .n_voltages = 47, | 232 | .n_voltages = 47, |
233 | .enable_time_us = 420, | ||
214 | }, | 234 | }, |
215 | { | 235 | { |
216 | .name = "LDO2", | 236 | .name = "LDO2", |
217 | .min_uV = 1000000, | 237 | .min_uV = 1000000, |
218 | .max_uV = 3300000, | 238 | .max_uV = 3300000, |
219 | .n_voltages = 47, | 239 | .n_voltages = 47, |
240 | .enable_time_us = 420, | ||
220 | }, | 241 | }, |
221 | { | 242 | { |
222 | .name = "LDO3", | 243 | .name = "LDO3", |
223 | .min_uV = 1000000, | 244 | .min_uV = 1000000, |
224 | .max_uV = 3300000, | 245 | .max_uV = 3300000, |
225 | .n_voltages = 24, | 246 | .n_voltages = 24, |
247 | .enable_time_us = 230, | ||
226 | }, | 248 | }, |
227 | { | 249 | { |
228 | .name = "LDO4", | 250 | .name = "LDO4", |
229 | .min_uV = 1000000, | 251 | .min_uV = 1000000, |
230 | .max_uV = 3300000, | 252 | .max_uV = 3300000, |
231 | .n_voltages = 47, | 253 | .n_voltages = 47, |
254 | .enable_time_us = 230, | ||
232 | }, | 255 | }, |
233 | { | 256 | { |
234 | .name = "LDO5", | 257 | .name = "LDO5", |
235 | .min_uV = 1000000, | 258 | .min_uV = 1000000, |
236 | .max_uV = 3300000, | 259 | .max_uV = 3300000, |
237 | .n_voltages = 24, | 260 | .n_voltages = 24, |
261 | .enable_time_us = 230, | ||
238 | }, | 262 | }, |
239 | { | 263 | { |
240 | .name = "LDO6", | 264 | .name = "LDO6", |
241 | .min_uV = 1000000, | 265 | .min_uV = 1000000, |
242 | .max_uV = 3300000, | 266 | .max_uV = 3300000, |
243 | .n_voltages = 24, | 267 | .n_voltages = 24, |
268 | .enable_time_us = 230, | ||
244 | }, | 269 | }, |
245 | { | 270 | { |
246 | .name = "LDO7", | 271 | .name = "LDO7", |
247 | .min_uV = 1000000, | 272 | .min_uV = 1000000, |
248 | .max_uV = 3300000, | 273 | .max_uV = 3300000, |
249 | .n_voltages = 24, | 274 | .n_voltages = 24, |
275 | .enable_time_us = 230, | ||
250 | }, | 276 | }, |
251 | { | 277 | { |
252 | .name = "LDO8", | 278 | .name = "LDO8", |
253 | .min_uV = 1000000, | 279 | .min_uV = 1000000, |
254 | .max_uV = 3300000, | 280 | .max_uV = 3300000, |
255 | .n_voltages = 24, | 281 | .n_voltages = 24, |
282 | .enable_time_us = 230, | ||
256 | }, | 283 | }, |
257 | }; | 284 | }; |
258 | 285 | ||
@@ -482,6 +509,12 @@ static int tps65910_disable(struct regulator_dev *dev) | |||
482 | return tps65910_clear_bits(mfd, reg, TPS65910_SUPPLY_STATE_ENABLED); | 509 | return tps65910_clear_bits(mfd, reg, TPS65910_SUPPLY_STATE_ENABLED); |
483 | } | 510 | } |
484 | 511 | ||
512 | static int tps65910_enable_time(struct regulator_dev *dev) | ||
513 | { | ||
514 | struct tps65910_reg *pmic = rdev_get_drvdata(dev); | ||
515 | int id = rdev_get_id(dev); | ||
516 | return pmic->info[id]->enable_time_us; | ||
517 | } | ||
485 | 518 | ||
486 | static int tps65910_set_mode(struct regulator_dev *dev, unsigned int mode) | 519 | static int tps65910_set_mode(struct regulator_dev *dev, unsigned int mode) |
487 | { | 520 | { |
@@ -866,6 +899,7 @@ static struct regulator_ops tps65910_ops_dcdc = { | |||
866 | .is_enabled = tps65910_is_enabled, | 899 | .is_enabled = tps65910_is_enabled, |
867 | .enable = tps65910_enable, | 900 | .enable = tps65910_enable, |
868 | .disable = tps65910_disable, | 901 | .disable = tps65910_disable, |
902 | .enable_time = tps65910_enable_time, | ||
869 | .set_mode = tps65910_set_mode, | 903 | .set_mode = tps65910_set_mode, |
870 | .get_mode = tps65910_get_mode, | 904 | .get_mode = tps65910_get_mode, |
871 | .get_voltage = tps65910_get_voltage_dcdc, | 905 | .get_voltage = tps65910_get_voltage_dcdc, |
@@ -877,6 +911,7 @@ static struct regulator_ops tps65910_ops_vdd3 = { | |||
877 | .is_enabled = tps65910_is_enabled, | 911 | .is_enabled = tps65910_is_enabled, |
878 | .enable = tps65910_enable, | 912 | .enable = tps65910_enable, |
879 | .disable = tps65910_disable, | 913 | .disable = tps65910_disable, |
914 | .enable_time = tps65910_enable_time, | ||
880 | .set_mode = tps65910_set_mode, | 915 | .set_mode = tps65910_set_mode, |
881 | .get_mode = tps65910_get_mode, | 916 | .get_mode = tps65910_get_mode, |
882 | .get_voltage = tps65910_get_voltage_vdd3, | 917 | .get_voltage = tps65910_get_voltage_vdd3, |
@@ -887,6 +922,7 @@ static struct regulator_ops tps65910_ops = { | |||
887 | .is_enabled = tps65910_is_enabled, | 922 | .is_enabled = tps65910_is_enabled, |
888 | .enable = tps65910_enable, | 923 | .enable = tps65910_enable, |
889 | .disable = tps65910_disable, | 924 | .disable = tps65910_disable, |
925 | .enable_time = tps65910_enable_time, | ||
890 | .set_mode = tps65910_set_mode, | 926 | .set_mode = tps65910_set_mode, |
891 | .get_mode = tps65910_get_mode, | 927 | .get_mode = tps65910_get_mode, |
892 | .get_voltage = tps65910_get_voltage, | 928 | .get_voltage = tps65910_get_voltage, |
@@ -898,6 +934,7 @@ static struct regulator_ops tps65911_ops = { | |||
898 | .is_enabled = tps65910_is_enabled, | 934 | .is_enabled = tps65910_is_enabled, |
899 | .enable = tps65910_enable, | 935 | .enable = tps65910_enable, |
900 | .disable = tps65910_disable, | 936 | .disable = tps65910_disable, |
937 | .enable_time = tps65910_enable_time, | ||
901 | .set_mode = tps65910_set_mode, | 938 | .set_mode = tps65910_set_mode, |
902 | .get_mode = tps65910_get_mode, | 939 | .get_mode = tps65910_get_mode, |
903 | .get_voltage = tps65911_get_voltage, | 940 | .get_voltage = tps65911_get_voltage, |