blob: ec609ab747ae42b5060ecd1dc2b332fad57298ee [file] [log] [blame]
Sundar R IYERc789ca22010-07-13 21:48:56 +05301/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 *
Bengt Jonssone1159e62010-12-10 11:08:44 +01006 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
Lee Jones547f3842013-03-28 16:11:14 +00008 * Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson
Sundar R IYERc789ca22010-07-13 21:48:56 +05309 *
10 * AB8500 peripheral regulators
11 *
Bengt Jonssone1159e62010-12-10 11:08:44 +010012 * AB8500 supports the following regulators:
Bengt Jonssonea05ef32011-03-10 14:43:31 +010013 * VAUX1/2/3, VINTCORE, VTVOUT, VUSB, VAUDIO, VAMIC1/2, VDMIC, VANA
Lee Jones547f3842013-03-28 16:11:14 +000014 *
15 * AB8505 supports the following regulators:
16 * VAUX1/2/3/4/5/6, VINTCORE, VADC, VUSB, VAUDIO, VAMIC1/2, VDMIC, VANA
Sundar R IYERc789ca22010-07-13 21:48:56 +053017 */
18#include <linux/init.h>
19#include <linux/kernel.h>
Paul Gortmaker65602c32011-07-17 16:28:23 -040020#include <linux/module.h>
Sundar R IYERc789ca22010-07-13 21:48:56 +053021#include <linux/err.h>
22#include <linux/platform_device.h>
Mattias Wallin47c16972010-09-10 17:47:56 +020023#include <linux/mfd/abx500.h>
Linus Walleijee66e652011-12-02 14:16:33 +010024#include <linux/mfd/abx500/ab8500.h>
Lee Jones3a8334b2012-05-17 14:45:16 +010025#include <linux/of.h>
26#include <linux/regulator/of_regulator.h>
Sundar R IYERc789ca22010-07-13 21:48:56 +053027#include <linux/regulator/driver.h>
28#include <linux/regulator/machine.h>
29#include <linux/regulator/ab8500.h>
Lee Jones3a8334b2012-05-17 14:45:16 +010030#include <linux/slab.h>
Sundar R IYERc789ca22010-07-13 21:48:56 +053031
32/**
33 * struct ab8500_regulator_info - ab8500 regulator information
Bengt Jonssone1159e62010-12-10 11:08:44 +010034 * @dev: device pointer
Sundar R IYERc789ca22010-07-13 21:48:56 +053035 * @desc: regulator description
Sundar R IYERc789ca22010-07-13 21:48:56 +053036 * @regulator_dev: regulator device
Emeric Vigierbd28a152013-03-21 15:58:59 +000037 * @is_enabled: status of regulator (on/off)
Bengt Jonsson7ce46692013-03-21 15:59:00 +000038 * @load_lp_uA: maximum load in idle (low power) mode
Mattias Wallin47c16972010-09-10 17:47:56 +020039 * @update_bank: bank to control on/off
Sundar R IYERc789ca22010-07-13 21:48:56 +053040 * @update_reg: register to control on/off
Emeric Vigierbd28a152013-03-21 15:58:59 +000041 * @update_mask: mask to enable/disable and set mode of regulator
42 * @update_val: bits holding the regulator current mode
43 * @update_val_idle: bits to enable the regulator in idle (low power) mode
44 * @update_val_normal: bits to enable the regulator in normal (high power) mode
Mattias Wallin47c16972010-09-10 17:47:56 +020045 * @voltage_bank: bank to control regulator voltage
Sundar R IYERc789ca22010-07-13 21:48:56 +053046 * @voltage_reg: register to control regulator voltage
47 * @voltage_mask: mask to control regulator voltage
Linus Walleija0a70142012-08-20 18:41:35 +020048 * @voltage_shift: shift to control regulator voltage
Sundar R IYERc789ca22010-07-13 21:48:56 +053049 */
50struct ab8500_regulator_info {
51 struct device *dev;
52 struct regulator_desc desc;
Sundar R IYERc789ca22010-07-13 21:48:56 +053053 struct regulator_dev *regulator;
Emeric Vigierbd28a152013-03-21 15:58:59 +000054 bool is_enabled;
Bengt Jonsson7ce46692013-03-21 15:59:00 +000055 int load_lp_uA;
Mattias Wallin47c16972010-09-10 17:47:56 +020056 u8 update_bank;
57 u8 update_reg;
Bengt Jonssone1159e62010-12-10 11:08:44 +010058 u8 update_mask;
Emeric Vigierbd28a152013-03-21 15:58:59 +000059 u8 update_val;
60 u8 update_val_idle;
61 u8 update_val_normal;
Mattias Wallin47c16972010-09-10 17:47:56 +020062 u8 voltage_bank;
63 u8 voltage_reg;
64 u8 voltage_mask;
Linus Walleija0a70142012-08-20 18:41:35 +020065 u8 voltage_shift;
Sundar R IYERc789ca22010-07-13 21:48:56 +053066};
67
68/* voltage tables for the vauxn/vintcore supplies */
Axel Linec1cc4d2012-05-20 10:33:35 +080069static const unsigned int ldo_vauxn_voltages[] = {
Sundar R IYERc789ca22010-07-13 21:48:56 +053070 1100000,
71 1200000,
72 1300000,
73 1400000,
74 1500000,
75 1800000,
76 1850000,
77 1900000,
78 2500000,
79 2650000,
80 2700000,
81 2750000,
82 2800000,
83 2900000,
84 3000000,
85 3300000,
86};
87
Axel Linec1cc4d2012-05-20 10:33:35 +080088static const unsigned int ldo_vaux3_voltages[] = {
Bengt Jonsson2b751512010-12-10 11:08:43 +010089 1200000,
90 1500000,
91 1800000,
92 2100000,
93 2500000,
94 2750000,
95 2790000,
96 2910000,
97};
98
Lee Jones547f3842013-03-28 16:11:14 +000099static const int ldo_vaux56_voltages[] = {
100 1800000,
101 1050000,
102 1100000,
103 1200000,
104 1500000,
105 2200000,
106 2500000,
107 2790000,
108};
109
Lee Jonesae0a9a32013-03-28 16:11:16 +0000110static const int ldo_vaux3_ab8540_voltages[] = {
111 1200000,
112 1500000,
113 1800000,
114 2100000,
115 2500000,
116 2750000,
117 2790000,
118 2910000,
119 3050000,
120};
121
Axel Linec1cc4d2012-05-20 10:33:35 +0800122static const unsigned int ldo_vintcore_voltages[] = {
Sundar R IYERc789ca22010-07-13 21:48:56 +0530123 1200000,
124 1225000,
125 1250000,
126 1275000,
127 1300000,
128 1325000,
129 1350000,
130};
131
Lee Jonesae0a9a32013-03-28 16:11:16 +0000132static const int ldo_sdio_voltages[] = {
133 1160000,
134 1050000,
135 1100000,
136 1500000,
137 1800000,
138 2200000,
139 2910000,
140 3050000,
141};
142
Sundar R IYERc789ca22010-07-13 21:48:56 +0530143static int ab8500_regulator_enable(struct regulator_dev *rdev)
144{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100145 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530146 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
147
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100148 if (info == NULL) {
149 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530150 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100151 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530152
Mattias Wallin47c16972010-09-10 17:47:56 +0200153 ret = abx500_mask_and_set_register_interruptible(info->dev,
Bengt Jonssone1159e62010-12-10 11:08:44 +0100154 info->update_bank, info->update_reg,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000155 info->update_mask, info->update_val);
Axel Linf71bf522013-03-26 16:13:14 +0800156 if (ret < 0) {
Sundar R IYERc789ca22010-07-13 21:48:56 +0530157 dev_err(rdev_get_dev(rdev),
158 "couldn't set enable bits for regulator\n");
Axel Linf71bf522013-03-26 16:13:14 +0800159 return ret;
160 }
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100161
Emeric Vigierbd28a152013-03-21 15:58:59 +0000162 info->is_enabled = true;
163
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100164 dev_vdbg(rdev_get_dev(rdev),
165 "%s-enable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
166 info->desc.name, info->update_bank, info->update_reg,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000167 info->update_mask, info->update_val);
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100168
Sundar R IYERc789ca22010-07-13 21:48:56 +0530169 return ret;
170}
171
172static int ab8500_regulator_disable(struct regulator_dev *rdev)
173{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100174 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530175 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
176
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100177 if (info == NULL) {
178 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530179 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100180 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530181
Mattias Wallin47c16972010-09-10 17:47:56 +0200182 ret = abx500_mask_and_set_register_interruptible(info->dev,
Bengt Jonssone1159e62010-12-10 11:08:44 +0100183 info->update_bank, info->update_reg,
184 info->update_mask, 0x0);
Axel Linf71bf522013-03-26 16:13:14 +0800185 if (ret < 0) {
Sundar R IYERc789ca22010-07-13 21:48:56 +0530186 dev_err(rdev_get_dev(rdev),
187 "couldn't set disable bits for regulator\n");
Axel Linf71bf522013-03-26 16:13:14 +0800188 return ret;
189 }
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100190
Emeric Vigierbd28a152013-03-21 15:58:59 +0000191 info->is_enabled = false;
192
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100193 dev_vdbg(rdev_get_dev(rdev),
194 "%s-disable (bank, reg, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
195 info->desc.name, info->update_bank, info->update_reg,
196 info->update_mask, 0x0);
197
Sundar R IYERc789ca22010-07-13 21:48:56 +0530198 return ret;
199}
200
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000201static unsigned int ab8500_regulator_get_optimum_mode(
202 struct regulator_dev *rdev, int input_uV,
203 int output_uV, int load_uA)
204{
205 unsigned int mode;
206
207 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
208
209 if (info == NULL) {
210 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
211 return -EINVAL;
212 }
213
214 if (load_uA <= info->load_lp_uA)
215 mode = REGULATOR_MODE_IDLE;
216 else
217 mode = REGULATOR_MODE_NORMAL;
218
219 return mode;
220}
221
Emeric Vigierbd28a152013-03-21 15:58:59 +0000222static int ab8500_regulator_set_mode(struct regulator_dev *rdev,
223 unsigned int mode)
224{
Axel Lin742a7322013-03-28 17:23:00 +0800225 int ret;
226 u8 update_val;
Emeric Vigierbd28a152013-03-21 15:58:59 +0000227 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
228
229 if (info == NULL) {
230 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
231 return -EINVAL;
232 }
233
234 switch (mode) {
235 case REGULATOR_MODE_NORMAL:
Axel Lin742a7322013-03-28 17:23:00 +0800236 update_val = info->update_val_normal;
Emeric Vigierbd28a152013-03-21 15:58:59 +0000237 break;
238 case REGULATOR_MODE_IDLE:
Axel Lin742a7322013-03-28 17:23:00 +0800239 update_val = info->update_val_idle;
Emeric Vigierbd28a152013-03-21 15:58:59 +0000240 break;
241 default:
242 return -EINVAL;
243 }
244
Axel Lin742a7322013-03-28 17:23:00 +0800245 /* ab8500 regulators share mode and enable in the same register bits.
246 off = 0b00
247 low power mode= 0b11
248 full powermode = 0b01
249 (HW control mode = 0b10)
250 Thus we don't write to the register when regulator is disabled.
251 */
Emeric Vigierbd28a152013-03-21 15:58:59 +0000252 if (info->is_enabled) {
253 ret = abx500_mask_and_set_register_interruptible(info->dev,
254 info->update_bank, info->update_reg,
Axel Lin742a7322013-03-28 17:23:00 +0800255 info->update_mask, update_val);
256 if (ret < 0) {
Emeric Vigierbd28a152013-03-21 15:58:59 +0000257 dev_err(rdev_get_dev(rdev),
258 "couldn't set regulator mode\n");
Axel Lin742a7322013-03-28 17:23:00 +0800259 return ret;
260 }
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000261
262 dev_vdbg(rdev_get_dev(rdev),
263 "%s-set_mode (bank, reg, mask, value): "
264 "0x%x, 0x%x, 0x%x, 0x%x\n",
265 info->desc.name, info->update_bank, info->update_reg,
Axel Lin742a7322013-03-28 17:23:00 +0800266 info->update_mask, update_val);
Emeric Vigierbd28a152013-03-21 15:58:59 +0000267 }
268
Axel Lin742a7322013-03-28 17:23:00 +0800269 info->update_val = update_val;
270
271 return 0;
Emeric Vigierbd28a152013-03-21 15:58:59 +0000272}
273
274static unsigned int ab8500_regulator_get_mode(struct regulator_dev *rdev)
275{
276 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
277 int ret;
278
279 if (info == NULL) {
280 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
281 return -EINVAL;
282 }
283
284 if (info->update_val == info->update_val_normal)
285 ret = REGULATOR_MODE_NORMAL;
286 else if (info->update_val == info->update_val_idle)
287 ret = REGULATOR_MODE_IDLE;
288 else
289 ret = -EINVAL;
290
291 return ret;
292}
293
Sundar R IYERc789ca22010-07-13 21:48:56 +0530294static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
295{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100296 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530297 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100298 u8 regval;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530299
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100300 if (info == NULL) {
301 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530302 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100303 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530304
Mattias Wallin47c16972010-09-10 17:47:56 +0200305 ret = abx500_get_register_interruptible(info->dev,
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100306 info->update_bank, info->update_reg, &regval);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530307 if (ret < 0) {
308 dev_err(rdev_get_dev(rdev),
309 "couldn't read 0x%x register\n", info->update_reg);
310 return ret;
311 }
312
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100313 dev_vdbg(rdev_get_dev(rdev),
314 "%s-is_enabled (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
315 " 0x%x\n",
316 info->desc.name, info->update_bank, info->update_reg,
317 info->update_mask, regval);
318
319 if (regval & info->update_mask)
Emeric Vigierbd28a152013-03-21 15:58:59 +0000320 info->is_enabled = true;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530321 else
Emeric Vigierbd28a152013-03-21 15:58:59 +0000322 info->is_enabled = false;
323
324 return info->is_enabled;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530325}
326
Axel Lin3bf6e902012-02-24 17:15:45 +0800327static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
Sundar R IYERc789ca22010-07-13 21:48:56 +0530328{
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100329 int ret, val;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530330 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100331 u8 regval;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530332
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100333 if (info == NULL) {
334 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530335 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100336 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530337
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100338 ret = abx500_get_register_interruptible(info->dev,
339 info->voltage_bank, info->voltage_reg, &regval);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530340 if (ret < 0) {
341 dev_err(rdev_get_dev(rdev),
342 "couldn't read voltage reg for regulator\n");
343 return ret;
344 }
345
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100346 dev_vdbg(rdev_get_dev(rdev),
Linus Walleija0a70142012-08-20 18:41:35 +0200347 "%s-get_voltage (bank, reg, mask, shift, value): "
348 "0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n",
349 info->desc.name, info->voltage_bank,
350 info->voltage_reg, info->voltage_mask,
351 info->voltage_shift, regval);
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100352
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100353 val = regval & info->voltage_mask;
Linus Walleija0a70142012-08-20 18:41:35 +0200354 return val >> info->voltage_shift;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530355}
356
Axel Linae713d32012-03-20 09:51:08 +0800357static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,
358 unsigned selector)
Sundar R IYERc789ca22010-07-13 21:48:56 +0530359{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100360 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530361 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100362 u8 regval;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530363
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100364 if (info == NULL) {
365 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530366 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100367 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530368
Sundar R IYERc789ca22010-07-13 21:48:56 +0530369 /* set the registers for the request */
Linus Walleija0a70142012-08-20 18:41:35 +0200370 regval = (u8)selector << info->voltage_shift;
Mattias Wallin47c16972010-09-10 17:47:56 +0200371 ret = abx500_mask_and_set_register_interruptible(info->dev,
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100372 info->voltage_bank, info->voltage_reg,
373 info->voltage_mask, regval);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530374 if (ret < 0)
375 dev_err(rdev_get_dev(rdev),
376 "couldn't set voltage reg for regulator\n");
377
Bengt Jonsson09aefa12010-12-10 11:08:46 +0100378 dev_vdbg(rdev_get_dev(rdev),
379 "%s-set_voltage (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
380 " 0x%x\n",
381 info->desc.name, info->voltage_bank, info->voltage_reg,
382 info->voltage_mask, regval);
383
Sundar R IYERc789ca22010-07-13 21:48:56 +0530384 return ret;
385}
386
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000387static struct regulator_ops ab8500_regulator_volt_mode_ops = {
388 .enable = ab8500_regulator_enable,
389 .disable = ab8500_regulator_disable,
390 .is_enabled = ab8500_regulator_is_enabled,
391 .get_optimum_mode = ab8500_regulator_get_optimum_mode,
392 .set_mode = ab8500_regulator_set_mode,
393 .get_mode = ab8500_regulator_get_mode,
394 .get_voltage_sel = ab8500_regulator_get_voltage_sel,
395 .set_voltage_sel = ab8500_regulator_set_voltage_sel,
396 .list_voltage = regulator_list_voltage_table,
Sundar R IYERc789ca22010-07-13 21:48:56 +0530397};
398
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000399static struct regulator_ops ab8500_regulator_mode_ops = {
400 .enable = ab8500_regulator_enable,
401 .disable = ab8500_regulator_disable,
402 .is_enabled = ab8500_regulator_is_enabled,
403 .get_optimum_mode = ab8500_regulator_get_optimum_mode,
404 .set_mode = ab8500_regulator_set_mode,
405 .get_mode = ab8500_regulator_get_mode,
406 .get_voltage_sel = ab8500_regulator_get_voltage_sel,
Axel Lin5689e832013-03-25 14:59:00 +0800407 .list_voltage = regulator_list_voltage_linear,
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000408};
409
410static struct regulator_ops ab8500_regulator_ops = {
411 .enable = ab8500_regulator_enable,
412 .disable = ab8500_regulator_disable,
413 .is_enabled = ab8500_regulator_is_enabled,
414 .get_voltage_sel = ab8500_regulator_get_voltage_sel,
Axel Lin5689e832013-03-25 14:59:00 +0800415 .list_voltage = regulator_list_voltage_linear,
Sundar R IYERc789ca22010-07-13 21:48:56 +0530416};
417
Lee Jones8e6a8d72013-03-28 16:11:11 +0000418/* AB8500 regulator information */
Bengt Jonsson6909b452010-12-10 11:08:47 +0100419static struct ab8500_regulator_info
420 ab8500_regulator_info[AB8500_NUM_REGULATORS] = {
Sundar R IYERc789ca22010-07-13 21:48:56 +0530421 /*
Bengt Jonssone1159e62010-12-10 11:08:44 +0100422 * Variable Voltage Regulators
423 * name, min mV, max mV,
424 * update bank, reg, mask, enable val
Axel Linec1cc4d2012-05-20 10:33:35 +0800425 * volt bank, reg, mask
Sundar R IYERc789ca22010-07-13 21:48:56 +0530426 */
Bengt Jonsson6909b452010-12-10 11:08:47 +0100427 [AB8500_LDO_AUX1] = {
428 .desc = {
429 .name = "LDO-AUX1",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000430 .ops = &ab8500_regulator_volt_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100431 .type = REGULATOR_VOLTAGE,
432 .id = AB8500_LDO_AUX1,
433 .owner = THIS_MODULE,
434 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
Axel Linec1cc4d2012-05-20 10:33:35 +0800435 .volt_table = ldo_vauxn_voltages,
Axel Lin530158b2013-03-27 17:47:22 +0800436 .enable_time = 200,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100437 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000438 .load_lp_uA = 5000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100439 .update_bank = 0x04,
440 .update_reg = 0x09,
441 .update_mask = 0x03,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000442 .update_val = 0x01,
443 .update_val_idle = 0x03,
444 .update_val_normal = 0x01,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100445 .voltage_bank = 0x04,
446 .voltage_reg = 0x1f,
447 .voltage_mask = 0x0f,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100448 },
449 [AB8500_LDO_AUX2] = {
450 .desc = {
451 .name = "LDO-AUX2",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000452 .ops = &ab8500_regulator_volt_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100453 .type = REGULATOR_VOLTAGE,
454 .id = AB8500_LDO_AUX2,
455 .owner = THIS_MODULE,
456 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
Axel Linec1cc4d2012-05-20 10:33:35 +0800457 .volt_table = ldo_vauxn_voltages,
Axel Lin530158b2013-03-27 17:47:22 +0800458 .enable_time = 200,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100459 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000460 .load_lp_uA = 5000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100461 .update_bank = 0x04,
462 .update_reg = 0x09,
463 .update_mask = 0x0c,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000464 .update_val = 0x04,
465 .update_val_idle = 0x0c,
466 .update_val_normal = 0x04,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100467 .voltage_bank = 0x04,
468 .voltage_reg = 0x20,
469 .voltage_mask = 0x0f,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100470 },
471 [AB8500_LDO_AUX3] = {
472 .desc = {
473 .name = "LDO-AUX3",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000474 .ops = &ab8500_regulator_volt_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100475 .type = REGULATOR_VOLTAGE,
476 .id = AB8500_LDO_AUX3,
477 .owner = THIS_MODULE,
478 .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
Axel Linec1cc4d2012-05-20 10:33:35 +0800479 .volt_table = ldo_vaux3_voltages,
Axel Lin530158b2013-03-27 17:47:22 +0800480 .enable_time = 450,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100481 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000482 .load_lp_uA = 5000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100483 .update_bank = 0x04,
484 .update_reg = 0x0a,
485 .update_mask = 0x03,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000486 .update_val = 0x01,
487 .update_val_idle = 0x03,
488 .update_val_normal = 0x01,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100489 .voltage_bank = 0x04,
490 .voltage_reg = 0x21,
491 .voltage_mask = 0x07,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100492 },
493 [AB8500_LDO_INTCORE] = {
494 .desc = {
495 .name = "LDO-INTCORE",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000496 .ops = &ab8500_regulator_volt_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100497 .type = REGULATOR_VOLTAGE,
498 .id = AB8500_LDO_INTCORE,
499 .owner = THIS_MODULE,
500 .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
Axel Linec1cc4d2012-05-20 10:33:35 +0800501 .volt_table = ldo_vintcore_voltages,
Axel Lin530158b2013-03-27 17:47:22 +0800502 .enable_time = 750,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100503 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000504 .load_lp_uA = 5000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100505 .update_bank = 0x03,
506 .update_reg = 0x80,
507 .update_mask = 0x44,
Lee Jonescc40dc22013-03-21 15:59:41 +0000508 .update_val = 0x44,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000509 .update_val_idle = 0x44,
510 .update_val_normal = 0x04,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100511 .voltage_bank = 0x03,
512 .voltage_reg = 0x80,
513 .voltage_mask = 0x38,
Linus Walleija0a70142012-08-20 18:41:35 +0200514 .voltage_shift = 3,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100515 },
Sundar R IYERc789ca22010-07-13 21:48:56 +0530516
517 /*
Bengt Jonssone1159e62010-12-10 11:08:44 +0100518 * Fixed Voltage Regulators
519 * name, fixed mV,
520 * update bank, reg, mask, enable val
Sundar R IYERc789ca22010-07-13 21:48:56 +0530521 */
Bengt Jonsson6909b452010-12-10 11:08:47 +0100522 [AB8500_LDO_TVOUT] = {
523 .desc = {
524 .name = "LDO-TVOUT",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000525 .ops = &ab8500_regulator_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100526 .type = REGULATOR_VOLTAGE,
527 .id = AB8500_LDO_TVOUT,
528 .owner = THIS_MODULE,
529 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800530 .min_uV = 2000000,
Lee Jonesed3c1382013-03-28 16:11:12 +0000531 .enable_time = 500,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100532 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000533 .load_lp_uA = 1000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100534 .update_bank = 0x03,
535 .update_reg = 0x80,
536 .update_mask = 0x82,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000537 .update_val = 0x02,
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000538 .update_val_idle = 0x82,
539 .update_val_normal = 0x02,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100540 },
541 [AB8500_LDO_AUDIO] = {
542 .desc = {
543 .name = "LDO-AUDIO",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000544 .ops = &ab8500_regulator_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100545 .type = REGULATOR_VOLTAGE,
546 .id = AB8500_LDO_AUDIO,
547 .owner = THIS_MODULE,
548 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800549 .min_uV = 2000000,
Axel Lin530158b2013-03-27 17:47:22 +0800550 .enable_time = 140,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100551 },
Bengt Jonsson6909b452010-12-10 11:08:47 +0100552 .update_bank = 0x03,
553 .update_reg = 0x83,
554 .update_mask = 0x02,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000555 .update_val = 0x02,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100556 },
557 [AB8500_LDO_ANAMIC1] = {
558 .desc = {
559 .name = "LDO-ANAMIC1",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000560 .ops = &ab8500_regulator_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100561 .type = REGULATOR_VOLTAGE,
562 .id = AB8500_LDO_ANAMIC1,
563 .owner = THIS_MODULE,
564 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800565 .min_uV = 2050000,
Axel Lin530158b2013-03-27 17:47:22 +0800566 .enable_time = 500,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100567 },
Bengt Jonsson6909b452010-12-10 11:08:47 +0100568 .update_bank = 0x03,
569 .update_reg = 0x83,
570 .update_mask = 0x08,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000571 .update_val = 0x08,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100572 },
573 [AB8500_LDO_ANAMIC2] = {
574 .desc = {
575 .name = "LDO-ANAMIC2",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000576 .ops = &ab8500_regulator_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100577 .type = REGULATOR_VOLTAGE,
578 .id = AB8500_LDO_ANAMIC2,
579 .owner = THIS_MODULE,
580 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800581 .min_uV = 2050000,
Axel Lin530158b2013-03-27 17:47:22 +0800582 .enable_time = 500,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100583 },
Bengt Jonsson6909b452010-12-10 11:08:47 +0100584 .update_bank = 0x03,
585 .update_reg = 0x83,
586 .update_mask = 0x10,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000587 .update_val = 0x10,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100588 },
589 [AB8500_LDO_DMIC] = {
590 .desc = {
591 .name = "LDO-DMIC",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000592 .ops = &ab8500_regulator_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100593 .type = REGULATOR_VOLTAGE,
594 .id = AB8500_LDO_DMIC,
595 .owner = THIS_MODULE,
596 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800597 .min_uV = 1800000,
Axel Lin530158b2013-03-27 17:47:22 +0800598 .enable_time = 420,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100599 },
Bengt Jonsson6909b452010-12-10 11:08:47 +0100600 .update_bank = 0x03,
601 .update_reg = 0x83,
602 .update_mask = 0x04,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000603 .update_val = 0x04,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100604 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000605
606 /*
607 * Regulators with fixed voltage and normal/idle modes
608 */
Bengt Jonsson6909b452010-12-10 11:08:47 +0100609 [AB8500_LDO_ANA] = {
610 .desc = {
611 .name = "LDO-ANA",
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000612 .ops = &ab8500_regulator_mode_ops,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100613 .type = REGULATOR_VOLTAGE,
614 .id = AB8500_LDO_ANA,
615 .owner = THIS_MODULE,
616 .n_voltages = 1,
Axel Lin7142e212012-06-08 10:27:49 +0800617 .min_uV = 1200000,
Axel Lin530158b2013-03-27 17:47:22 +0800618 .enable_time = 140,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100619 },
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000620 .load_lp_uA = 1000,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100621 .update_bank = 0x04,
622 .update_reg = 0x06,
623 .update_mask = 0x0c,
Emeric Vigierbd28a152013-03-21 15:58:59 +0000624 .update_val = 0x04,
Bengt Jonsson7ce46692013-03-21 15:59:00 +0000625 .update_val_idle = 0x0c,
626 .update_val_normal = 0x04,
Bengt Jonsson6909b452010-12-10 11:08:47 +0100627 },
Lee Jones8e6a8d72013-03-28 16:11:11 +0000628};
Bengt Jonsson6909b452010-12-10 11:08:47 +0100629
Lee Jones547f3842013-03-28 16:11:14 +0000630/* AB8505 regulator information */
631static struct ab8500_regulator_info
632 ab8505_regulator_info[AB8505_NUM_REGULATORS] = {
633 /*
634 * Variable Voltage Regulators
635 * name, min mV, max mV,
636 * update bank, reg, mask, enable val
637 * volt bank, reg, mask, table, table length
638 */
639 [AB8505_LDO_AUX1] = {
640 .desc = {
641 .name = "LDO-AUX1",
642 .ops = &ab8500_regulator_volt_mode_ops,
643 .type = REGULATOR_VOLTAGE,
644 .id = AB8500_LDO_AUX1,
645 .owner = THIS_MODULE,
646 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
647 },
648 .min_uV = 1100000,
649 .max_uV = 3300000,
650 .load_lp_uA = 5000,
651 .update_bank = 0x04,
652 .update_reg = 0x09,
653 .update_mask = 0x03,
654 .update_val = 0x01,
655 .update_val_idle = 0x03,
656 .update_val_normal = 0x01,
657 .voltage_bank = 0x04,
658 .voltage_reg = 0x1f,
659 .voltage_mask = 0x0f,
660 .voltages = ldo_vauxn_voltages,
661 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
662 },
663 [AB8505_LDO_AUX2] = {
664 .desc = {
665 .name = "LDO-AUX2",
666 .ops = &ab8500_regulator_volt_mode_ops,
667 .type = REGULATOR_VOLTAGE,
668 .id = AB8500_LDO_AUX2,
669 .owner = THIS_MODULE,
670 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
671 },
672 .min_uV = 1100000,
673 .max_uV = 3300000,
674 .load_lp_uA = 5000,
675 .update_bank = 0x04,
676 .update_reg = 0x09,
677 .update_mask = 0x0c,
678 .update_val = 0x04,
679 .update_val_idle = 0x0c,
680 .update_val_normal = 0x04,
681 .voltage_bank = 0x04,
682 .voltage_reg = 0x20,
683 .voltage_mask = 0x0f,
684 .voltages = ldo_vauxn_voltages,
685 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
686 },
687 [AB8505_LDO_AUX3] = {
688 .desc = {
689 .name = "LDO-AUX3",
690 .ops = &ab8500_regulator_volt_mode_ops,
691 .type = REGULATOR_VOLTAGE,
692 .id = AB8500_LDO_AUX3,
693 .owner = THIS_MODULE,
694 .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
695 },
696 .min_uV = 1100000,
697 .max_uV = 3300000,
698 .load_lp_uA = 5000,
699 .update_bank = 0x04,
700 .update_reg = 0x0a,
701 .update_mask = 0x03,
702 .update_val = 0x01,
703 .update_val_idle = 0x03,
704 .update_val_normal = 0x01,
705 .voltage_bank = 0x04,
706 .voltage_reg = 0x21,
707 .voltage_mask = 0x07,
708 .voltages = ldo_vaux3_voltages,
709 .voltages_len = ARRAY_SIZE(ldo_vaux3_voltages),
710 },
711 [AB8505_LDO_AUX4] = {
712 .desc = {
713 .name = "LDO-AUX4",
714 .ops = &ab8500_regulator_volt_mode_ops,
715 .type = REGULATOR_VOLTAGE,
716 .id = AB9540_LDO_AUX4,
717 .owner = THIS_MODULE,
718 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
719 },
720 .min_uV = 1100000,
721 .max_uV = 3300000,
722 .load_lp_uA = 5000,
723 /* values for Vaux4Regu register */
724 .update_bank = 0x04,
725 .update_reg = 0x2e,
726 .update_mask = 0x03,
727 .update_val = 0x01,
728 .update_val_idle = 0x03,
729 .update_val_normal = 0x01,
730 /* values for Vaux4SEL register */
731 .voltage_bank = 0x04,
732 .voltage_reg = 0x2f,
733 .voltage_mask = 0x0f,
734 .voltages = ldo_vauxn_voltages,
735 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
736 },
737 [AB8505_LDO_AUX5] = {
738 .desc = {
739 .name = "LDO-AUX5",
740 .ops = &ab8500_regulator_volt_mode_ops,
741 .type = REGULATOR_VOLTAGE,
742 .id = AB8505_LDO_AUX5,
743 .owner = THIS_MODULE,
744 .n_voltages = ARRAY_SIZE(ldo_vaux56_voltages),
745 },
746 .min_uV = 1050000,
747 .max_uV = 2790000,
748 .load_lp_uA = 2000,
749 /* values for CtrlVaux5 register */
750 .update_bank = 0x01,
751 .update_reg = 0x55,
Lee Jonesae0a9a32013-03-28 16:11:16 +0000752 .update_mask = 0x18,
753 .update_val = 0x10,
754 .update_val_idle = 0x18,
755 .update_val_normal = 0x10,
Lee Jones547f3842013-03-28 16:11:14 +0000756 .voltage_bank = 0x01,
757 .voltage_reg = 0x55,
758 .voltage_mask = 0x07,
759 .voltages = ldo_vaux56_voltages,
760 .voltages_len = ARRAY_SIZE(ldo_vaux56_voltages),
761 },
762 [AB8505_LDO_AUX6] = {
763 .desc = {
764 .name = "LDO-AUX6",
765 .ops = &ab8500_regulator_volt_mode_ops,
766 .type = REGULATOR_VOLTAGE,
767 .id = AB8505_LDO_AUX6,
768 .owner = THIS_MODULE,
769 .n_voltages = ARRAY_SIZE(ldo_vaux56_voltages),
770 },
771 .min_uV = 1050000,
772 .max_uV = 2790000,
773 .load_lp_uA = 2000,
774 /* values for CtrlVaux6 register */
775 .update_bank = 0x01,
776 .update_reg = 0x56,
Lee Jonesae0a9a32013-03-28 16:11:16 +0000777 .update_mask = 0x18,
778 .update_val = 0x10,
779 .update_val_idle = 0x18,
780 .update_val_normal = 0x10,
Lee Jones547f3842013-03-28 16:11:14 +0000781 .voltage_bank = 0x01,
782 .voltage_reg = 0x56,
783 .voltage_mask = 0x07,
784 .voltages = ldo_vaux56_voltages,
785 .voltages_len = ARRAY_SIZE(ldo_vaux56_voltages),
786 },
787 [AB8505_LDO_INTCORE] = {
788 .desc = {
789 .name = "LDO-INTCORE",
790 .ops = &ab8500_regulator_volt_mode_ops,
791 .type = REGULATOR_VOLTAGE,
792 .id = AB8500_LDO_INTCORE,
793 .owner = THIS_MODULE,
794 .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
795 },
796 .min_uV = 1100000,
797 .max_uV = 3300000,
798 .load_lp_uA = 5000,
799 .update_bank = 0x03,
800 .update_reg = 0x80,
801 .update_mask = 0x44,
802 .update_val = 0x04,
803 .update_val_idle = 0x44,
804 .update_val_normal = 0x04,
805 .voltage_bank = 0x03,
806 .voltage_reg = 0x80,
807 .voltage_mask = 0x38,
808 .voltages = ldo_vintcore_voltages,
809 .voltages_len = ARRAY_SIZE(ldo_vintcore_voltages),
810 .voltage_shift = 3,
811 },
812
813 /*
814 * Fixed Voltage Regulators
815 * name, fixed mV,
816 * update bank, reg, mask, enable val
817 */
818 [AB8505_LDO_ADC] = {
819 .desc = {
820 .name = "LDO-ADC",
821 .ops = &ab8500_regulator_mode_ops,
822 .type = REGULATOR_VOLTAGE,
823 .id = AB8505_LDO_ADC,
824 .owner = THIS_MODULE,
825 .n_voltages = 1,
826 },
827 .delay = 10000,
828 .fixed_uV = 2000000,
829 .load_lp_uA = 1000,
830 .update_bank = 0x03,
831 .update_reg = 0x80,
832 .update_mask = 0x82,
833 .update_val = 0x02,
834 .update_val_idle = 0x82,
835 .update_val_normal = 0x02,
836 },
837 [AB8505_LDO_USB] = {
838 .desc = {
839 .name = "LDO-USB",
840 .ops = &ab8500_regulator_mode_ops,
841 .type = REGULATOR_VOLTAGE,
842 .id = AB9540_LDO_USB,
843 .owner = THIS_MODULE,
844 .n_voltages = 1,
845 },
846 .fixed_uV = 3300000,
847 .update_bank = 0x03,
848 .update_reg = 0x82,
849 .update_mask = 0x03,
850 .update_val = 0x01,
851 .update_val_idle = 0x03,
852 .update_val_normal = 0x01,
853 },
854 [AB8505_LDO_AUDIO] = {
855 .desc = {
856 .name = "LDO-AUDIO",
857 .ops = &ab8500_regulator_ops,
858 .type = REGULATOR_VOLTAGE,
859 .id = AB8500_LDO_AUDIO,
860 .owner = THIS_MODULE,
861 .n_voltages = 1,
862 },
863 .fixed_uV = 2000000,
864 .update_bank = 0x03,
865 .update_reg = 0x83,
866 .update_mask = 0x02,
867 .update_val = 0x02,
868 },
869 [AB8505_LDO_ANAMIC1] = {
870 .desc = {
871 .name = "LDO-ANAMIC1",
872 .ops = &ab8500_regulator_ops,
873 .type = REGULATOR_VOLTAGE,
874 .id = AB8500_LDO_ANAMIC1,
875 .owner = THIS_MODULE,
876 .n_voltages = 1,
877 },
878 .fixed_uV = 2050000,
879 .update_bank = 0x03,
880 .update_reg = 0x83,
881 .update_mask = 0x08,
882 .update_val = 0x08,
883 },
884 [AB8505_LDO_ANAMIC2] = {
885 .desc = {
886 .name = "LDO-ANAMIC2",
887 .ops = &ab8500_regulator_ops,
888 .type = REGULATOR_VOLTAGE,
889 .id = AB8500_LDO_ANAMIC2,
890 .owner = THIS_MODULE,
891 .n_voltages = 1,
892 },
893 .fixed_uV = 2050000,
894 .update_bank = 0x03,
895 .update_reg = 0x83,
896 .update_mask = 0x10,
897 .update_val = 0x10,
898 },
899 [AB8505_LDO_AUX8] = {
900 .desc = {
901 .name = "LDO-AUX8",
902 .ops = &ab8500_regulator_ops,
903 .type = REGULATOR_VOLTAGE,
904 .id = AB8505_LDO_AUX8,
905 .owner = THIS_MODULE,
906 .n_voltages = 1,
907 },
908 .fixed_uV = 1800000,
909 .update_bank = 0x03,
910 .update_reg = 0x83,
911 .update_mask = 0x04,
912 .update_val = 0x04,
913 },
914 /*
915 * Regulators with fixed voltage and normal/idle modes
916 */
917 [AB8505_LDO_ANA] = {
918 .desc = {
919 .name = "LDO-ANA",
920 .ops = &ab8500_regulator_mode_ops,
921 .type = REGULATOR_VOLTAGE,
922 .id = AB8500_LDO_ANA,
923 .owner = THIS_MODULE,
924 .n_voltages = 1,
925 },
926 .fixed_uV = 1200000,
927 .load_lp_uA = 1000,
928 .update_bank = 0x04,
929 .update_reg = 0x06,
930 .update_mask = 0x0c,
931 .update_val = 0x04,
932 .update_val_idle = 0x0c,
933 .update_val_normal = 0x04,
934 },
935};
936
Lee Jones8e6a8d72013-03-28 16:11:11 +0000937/* AB9540 regulator information */
938static struct ab8500_regulator_info
939 ab9540_regulator_info[AB9540_NUM_REGULATORS] = {
940 /*
941 * Variable Voltage Regulators
942 * name, min mV, max mV,
943 * update bank, reg, mask, enable val
944 * volt bank, reg, mask, table, table length
945 */
946 [AB9540_LDO_AUX1] = {
947 .desc = {
948 .name = "LDO-AUX1",
949 .ops = &ab8500_regulator_volt_mode_ops,
950 .type = REGULATOR_VOLTAGE,
951 .id = AB8500_LDO_AUX1,
952 .owner = THIS_MODULE,
953 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
954 },
955 .min_uV = 1100000,
956 .max_uV = 3300000,
957 .load_lp_uA = 5000,
958 .update_bank = 0x04,
959 .update_reg = 0x09,
960 .update_mask = 0x03,
961 .update_val = 0x01,
962 .update_val_idle = 0x03,
963 .update_val_normal = 0x01,
964 .voltage_bank = 0x04,
965 .voltage_reg = 0x1f,
966 .voltage_mask = 0x0f,
967 .voltages = ldo_vauxn_voltages,
968 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
969 },
970 [AB9540_LDO_AUX2] = {
971 .desc = {
972 .name = "LDO-AUX2",
973 .ops = &ab8500_regulator_volt_mode_ops,
974 .type = REGULATOR_VOLTAGE,
975 .id = AB8500_LDO_AUX2,
976 .owner = THIS_MODULE,
977 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
978 },
979 .min_uV = 1100000,
980 .max_uV = 3300000,
981 .load_lp_uA = 5000,
982 .update_bank = 0x04,
983 .update_reg = 0x09,
984 .update_mask = 0x0c,
985 .update_val = 0x04,
986 .update_val_idle = 0x0c,
987 .update_val_normal = 0x04,
988 .voltage_bank = 0x04,
989 .voltage_reg = 0x20,
990 .voltage_mask = 0x0f,
991 .voltages = ldo_vauxn_voltages,
992 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
993 },
994 [AB9540_LDO_AUX3] = {
995 .desc = {
996 .name = "LDO-AUX3",
997 .ops = &ab8500_regulator_volt_mode_ops,
998 .type = REGULATOR_VOLTAGE,
999 .id = AB8500_LDO_AUX3,
1000 .owner = THIS_MODULE,
1001 .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
1002 },
1003 .min_uV = 1100000,
1004 .max_uV = 3300000,
1005 .load_lp_uA = 5000,
1006 .update_bank = 0x04,
1007 .update_reg = 0x0a,
1008 .update_mask = 0x03,
1009 .update_val = 0x01,
1010 .update_val_idle = 0x03,
1011 .update_val_normal = 0x01,
1012 .voltage_bank = 0x04,
1013 .voltage_reg = 0x21,
1014 .voltage_mask = 0x07,
1015 .voltages = ldo_vaux3_voltages,
1016 .voltages_len = ARRAY_SIZE(ldo_vaux3_voltages),
1017 },
1018 [AB9540_LDO_AUX4] = {
1019 .desc = {
1020 .name = "LDO-AUX4",
1021 .ops = &ab8500_regulator_volt_mode_ops,
1022 .type = REGULATOR_VOLTAGE,
1023 .id = AB9540_LDO_AUX4,
1024 .owner = THIS_MODULE,
1025 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
1026 },
1027 .min_uV = 1100000,
1028 .max_uV = 3300000,
1029 .load_lp_uA = 5000,
1030 /* values for Vaux4Regu register */
1031 .update_bank = 0x04,
1032 .update_reg = 0x2e,
1033 .update_mask = 0x03,
1034 .update_val = 0x01,
1035 .update_val_idle = 0x03,
1036 .update_val_normal = 0x01,
1037 /* values for Vaux4SEL register */
1038 .voltage_bank = 0x04,
1039 .voltage_reg = 0x2f,
1040 .voltage_mask = 0x0f,
1041 .voltages = ldo_vauxn_voltages,
1042 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
1043 },
1044 [AB9540_LDO_INTCORE] = {
1045 .desc = {
1046 .name = "LDO-INTCORE",
1047 .ops = &ab8500_regulator_volt_mode_ops,
1048 .type = REGULATOR_VOLTAGE,
1049 .id = AB8500_LDO_INTCORE,
1050 .owner = THIS_MODULE,
1051 .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
1052 },
1053 .min_uV = 1100000,
1054 .max_uV = 3300000,
1055 .load_lp_uA = 5000,
1056 .update_bank = 0x03,
1057 .update_reg = 0x80,
1058 .update_mask = 0x44,
1059 .update_val = 0x44,
1060 .update_val_idle = 0x44,
1061 .update_val_normal = 0x04,
1062 .voltage_bank = 0x03,
1063 .voltage_reg = 0x80,
1064 .voltage_mask = 0x38,
1065 .voltages = ldo_vintcore_voltages,
1066 .voltages_len = ARRAY_SIZE(ldo_vintcore_voltages),
1067 .voltage_shift = 3,
1068 },
Bengt Jonsson6909b452010-12-10 11:08:47 +01001069
Lee Jones8e6a8d72013-03-28 16:11:11 +00001070 /*
1071 * Fixed Voltage Regulators
1072 * name, fixed mV,
1073 * update bank, reg, mask, enable val
1074 */
1075 [AB9540_LDO_TVOUT] = {
1076 .desc = {
1077 .name = "LDO-TVOUT",
1078 .ops = &ab8500_regulator_mode_ops,
1079 .type = REGULATOR_VOLTAGE,
1080 .id = AB8500_LDO_TVOUT,
1081 .owner = THIS_MODULE,
1082 .n_voltages = 1,
1083 },
1084 .delay = 10000,
1085 .fixed_uV = 2000000,
1086 .load_lp_uA = 1000,
1087 .update_bank = 0x03,
1088 .update_reg = 0x80,
1089 .update_mask = 0x82,
1090 .update_val = 0x02,
1091 .update_val_idle = 0x82,
1092 .update_val_normal = 0x02,
1093 },
1094 [AB9540_LDO_USB] = {
1095 .desc = {
1096 .name = "LDO-USB",
1097 .ops = &ab8500_regulator_ops,
1098 .type = REGULATOR_VOLTAGE,
1099 .id = AB9540_LDO_USB,
1100 .owner = THIS_MODULE,
1101 .n_voltages = 1,
1102 },
1103 .fixed_uV = 3300000,
1104 .update_bank = 0x03,
1105 .update_reg = 0x82,
1106 .update_mask = 0x03,
1107 .update_val = 0x01,
1108 .update_val_idle = 0x03,
1109 .update_val_normal = 0x01,
1110 },
1111 [AB9540_LDO_AUDIO] = {
1112 .desc = {
1113 .name = "LDO-AUDIO",
1114 .ops = &ab8500_regulator_ops,
1115 .type = REGULATOR_VOLTAGE,
1116 .id = AB8500_LDO_AUDIO,
1117 .owner = THIS_MODULE,
1118 .n_voltages = 1,
1119 },
1120 .fixed_uV = 2000000,
1121 .update_bank = 0x03,
1122 .update_reg = 0x83,
1123 .update_mask = 0x02,
1124 .update_val = 0x02,
1125 },
1126 [AB9540_LDO_ANAMIC1] = {
1127 .desc = {
1128 .name = "LDO-ANAMIC1",
1129 .ops = &ab8500_regulator_ops,
1130 .type = REGULATOR_VOLTAGE,
1131 .id = AB8500_LDO_ANAMIC1,
1132 .owner = THIS_MODULE,
1133 .n_voltages = 1,
1134 },
1135 .fixed_uV = 2050000,
1136 .update_bank = 0x03,
1137 .update_reg = 0x83,
1138 .update_mask = 0x08,
1139 .update_val = 0x08,
1140 },
1141 [AB9540_LDO_ANAMIC2] = {
1142 .desc = {
1143 .name = "LDO-ANAMIC2",
1144 .ops = &ab8500_regulator_ops,
1145 .type = REGULATOR_VOLTAGE,
1146 .id = AB8500_LDO_ANAMIC2,
1147 .owner = THIS_MODULE,
1148 .n_voltages = 1,
1149 },
1150 .fixed_uV = 2050000,
1151 .update_bank = 0x03,
1152 .update_reg = 0x83,
1153 .update_mask = 0x10,
1154 .update_val = 0x10,
1155 },
1156 [AB9540_LDO_DMIC] = {
1157 .desc = {
1158 .name = "LDO-DMIC",
1159 .ops = &ab8500_regulator_ops,
1160 .type = REGULATOR_VOLTAGE,
1161 .id = AB8500_LDO_DMIC,
1162 .owner = THIS_MODULE,
1163 .n_voltages = 1,
1164 },
1165 .fixed_uV = 1800000,
1166 .update_bank = 0x03,
1167 .update_reg = 0x83,
1168 .update_mask = 0x04,
1169 .update_val = 0x04,
1170 },
1171
1172 /*
1173 * Regulators with fixed voltage and normal/idle modes
1174 */
1175 [AB9540_LDO_ANA] = {
1176 .desc = {
1177 .name = "LDO-ANA",
1178 .ops = &ab8500_regulator_mode_ops,
1179 .type = REGULATOR_VOLTAGE,
1180 .id = AB8500_LDO_ANA,
1181 .owner = THIS_MODULE,
1182 .n_voltages = 1,
1183 },
1184 .fixed_uV = 1200000,
1185 .load_lp_uA = 1000,
1186 .update_bank = 0x04,
1187 .update_reg = 0x06,
1188 .update_mask = 0x0c,
1189 .update_val = 0x08,
1190 .update_val_idle = 0x0c,
1191 .update_val_normal = 0x08,
1192 },
Sundar R IYERc789ca22010-07-13 21:48:56 +05301193};
1194
Lee Jonesae0a9a32013-03-28 16:11:16 +00001195/* AB8540 regulator information */
1196static struct ab8500_regulator_info
1197 ab8540_regulator_info[AB8540_NUM_REGULATORS] = {
1198 /*
1199 * Variable Voltage Regulators
1200 * name, min mV, max mV,
1201 * update bank, reg, mask, enable val
1202 * volt bank, reg, mask, table, table length
1203 */
1204 [AB8540_LDO_AUX1] = {
1205 .desc = {
1206 .name = "LDO-AUX1",
1207 .ops = &ab8500_regulator_volt_mode_ops,
1208 .type = REGULATOR_VOLTAGE,
1209 .id = AB8500_LDO_AUX1,
1210 .owner = THIS_MODULE,
1211 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
1212 },
1213 .load_lp_uA = 5000,
1214 .update_bank = 0x04,
1215 .update_reg = 0x09,
1216 .update_mask = 0x03,
1217 .update_val = 0x01,
1218 .update_val_idle = 0x03,
1219 .update_val_normal = 0x01,
1220 .voltage_bank = 0x04,
1221 .voltage_reg = 0x1f,
1222 .voltage_mask = 0x0f,
1223 .voltages = ldo_vauxn_voltages,
1224 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
1225 },
1226 [AB8540_LDO_AUX2] = {
1227 .desc = {
1228 .name = "LDO-AUX2",
1229 .ops = &ab8500_regulator_volt_mode_ops,
1230 .type = REGULATOR_VOLTAGE,
1231 .id = AB8500_LDO_AUX2,
1232 .owner = THIS_MODULE,
1233 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
1234 },
1235 .load_lp_uA = 5000,
1236 .update_bank = 0x04,
1237 .update_reg = 0x09,
1238 .update_mask = 0x0c,
1239 .update_val = 0x04,
1240 .update_val_idle = 0x0c,
1241 .update_val_normal = 0x04,
1242 .voltage_bank = 0x04,
1243 .voltage_reg = 0x20,
1244 .voltage_mask = 0x0f,
1245 .voltages = ldo_vauxn_voltages,
1246 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
1247 },
1248 [AB8540_LDO_AUX3] = {
1249 .desc = {
1250 .name = "LDO-AUX3",
1251 .ops = &ab8500_regulator_volt_mode_ops,
1252 .type = REGULATOR_VOLTAGE,
1253 .id = AB8500_LDO_AUX3,
1254 .owner = THIS_MODULE,
1255 .n_voltages = ARRAY_SIZE(ldo_vaux3_ab8540_voltages),
1256 },
1257 .load_lp_uA = 5000,
1258 .update_bank = 0x04,
1259 .update_reg = 0x0a,
1260 .update_mask = 0x03,
1261 .update_val = 0x01,
1262 .update_val_idle = 0x03,
1263 .update_val_normal = 0x01,
1264 .voltage_bank = 0x04,
1265 .voltage_reg = 0x21,
1266 .voltage_mask = 0x07,
1267 .voltages = ldo_vaux3_ab8540_voltages,
1268 .voltages_len = ARRAY_SIZE(ldo_vaux3_ab8540_voltages),
1269 },
1270 [AB8540_LDO_AUX4] = {
1271 .desc = {
1272 .name = "LDO-AUX4",
1273 .ops = &ab8500_regulator_volt_mode_ops,
1274 .type = REGULATOR_VOLTAGE,
1275 .id = AB9540_LDO_AUX4,
1276 .owner = THIS_MODULE,
1277 .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages),
1278 },
1279 .load_lp_uA = 5000,
1280 /* values for Vaux4Regu register */
1281 .update_bank = 0x04,
1282 .update_reg = 0x2e,
1283 .update_mask = 0x03,
1284 .update_val = 0x01,
1285 .update_val_idle = 0x03,
1286 .update_val_normal = 0x01,
1287 /* values for Vaux4SEL register */
1288 .voltage_bank = 0x04,
1289 .voltage_reg = 0x2f,
1290 .voltage_mask = 0x0f,
1291 .voltages = ldo_vauxn_voltages,
1292 .voltages_len = ARRAY_SIZE(ldo_vauxn_voltages),
1293 },
1294 [AB8540_LDO_INTCORE] = {
1295 .desc = {
1296 .name = "LDO-INTCORE",
1297 .ops = &ab8500_regulator_volt_mode_ops,
1298 .type = REGULATOR_VOLTAGE,
1299 .id = AB8500_LDO_INTCORE,
1300 .owner = THIS_MODULE,
1301 .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
1302 },
1303 .load_lp_uA = 5000,
1304 .update_bank = 0x03,
1305 .update_reg = 0x80,
1306 .update_mask = 0x44,
1307 .update_val = 0x44,
1308 .update_val_idle = 0x44,
1309 .update_val_normal = 0x04,
1310 .voltage_bank = 0x03,
1311 .voltage_reg = 0x80,
1312 .voltage_mask = 0x38,
1313 .voltages = ldo_vintcore_voltages,
1314 .voltages_len = ARRAY_SIZE(ldo_vintcore_voltages),
1315 .voltage_shift = 3,
1316 },
1317
1318 /*
1319 * Fixed Voltage Regulators
1320 * name, fixed mV,
1321 * update bank, reg, mask, enable val
1322 */
1323 [AB8540_LDO_TVOUT] = {
1324 .desc = {
1325 .name = "LDO-TVOUT",
1326 .ops = &ab8500_regulator_mode_ops,
1327 .type = REGULATOR_VOLTAGE,
1328 .id = AB8500_LDO_TVOUT,
1329 .owner = THIS_MODULE,
1330 .n_voltages = 1,
1331 },
1332 .delay = 10000,
1333 .load_lp_uA = 1000,
1334 .update_bank = 0x03,
1335 .update_reg = 0x80,
1336 .update_mask = 0x82,
1337 .update_val = 0x02,
1338 .update_val_idle = 0x82,
1339 .update_val_normal = 0x02,
1340 },
1341 [AB8540_LDO_AUDIO] = {
1342 .desc = {
1343 .name = "LDO-AUDIO",
1344 .ops = &ab8500_regulator_ops,
1345 .type = REGULATOR_VOLTAGE,
1346 .id = AB8500_LDO_AUDIO,
1347 .owner = THIS_MODULE,
1348 .n_voltages = 1,
1349 },
1350 .update_bank = 0x03,
1351 .update_reg = 0x83,
1352 .update_mask = 0x02,
1353 .update_val = 0x02,
1354 },
1355 [AB8540_LDO_ANAMIC1] = {
1356 .desc = {
1357 .name = "LDO-ANAMIC1",
1358 .ops = &ab8500_regulator_ops,
1359 .type = REGULATOR_VOLTAGE,
1360 .id = AB8500_LDO_ANAMIC1,
1361 .owner = THIS_MODULE,
1362 .n_voltages = 1,
1363 },
1364 .update_bank = 0x03,
1365 .update_reg = 0x83,
1366 .update_mask = 0x08,
1367 .update_val = 0x08,
1368 },
1369 [AB8540_LDO_ANAMIC2] = {
1370 .desc = {
1371 .name = "LDO-ANAMIC2",
1372 .ops = &ab8500_regulator_ops,
1373 .type = REGULATOR_VOLTAGE,
1374 .id = AB8500_LDO_ANAMIC2,
1375 .owner = THIS_MODULE,
1376 .n_voltages = 1,
1377 },
1378 .update_bank = 0x03,
1379 .update_reg = 0x83,
1380 .update_mask = 0x10,
1381 .update_val = 0x10,
1382 },
1383 [AB8540_LDO_DMIC] = {
1384 .desc = {
1385 .name = "LDO-DMIC",
1386 .ops = &ab8500_regulator_ops,
1387 .type = REGULATOR_VOLTAGE,
1388 .id = AB8500_LDO_DMIC,
1389 .owner = THIS_MODULE,
1390 .n_voltages = 1,
1391 },
1392 .update_bank = 0x03,
1393 .update_reg = 0x83,
1394 .update_mask = 0x04,
1395 .update_val = 0x04,
1396 },
1397
1398 /*
1399 * Regulators with fixed voltage and normal/idle modes
1400 */
1401 [AB8540_LDO_ANA] = {
1402 .desc = {
1403 .name = "LDO-ANA",
1404 .ops = &ab8500_regulator_mode_ops,
1405 .type = REGULATOR_VOLTAGE,
1406 .id = AB8500_LDO_ANA,
1407 .owner = THIS_MODULE,
1408 .n_voltages = 1,
1409 },
1410 .load_lp_uA = 1000,
1411 .update_bank = 0x04,
1412 .update_reg = 0x06,
1413 .update_mask = 0x0c,
1414 .update_val = 0x04,
1415 .update_val_idle = 0x0c,
1416 .update_val_normal = 0x04,
1417 },
1418 [AB8540_LDO_SDIO] = {
1419 .desc = {
1420 .name = "LDO-SDIO",
1421 .ops = &ab8500_regulator_volt_mode_ops,
1422 .type = REGULATOR_VOLTAGE,
1423 .id = AB8540_LDO_SDIO,
1424 .owner = THIS_MODULE,
1425 .n_voltages = ARRAY_SIZE(ldo_sdio_voltages),
1426 },
1427 .min_uV = 1050000,
1428 .max_uV = 3050000,
1429 .load_lp_uA = 5000,
1430 .update_bank = 0x03,
1431 .update_reg = 0x88,
1432 .update_mask = 0x30,
1433 .update_val = 0x10,
1434 .update_val_idle = 0x30,
1435 .update_val_normal = 0x10,
1436 .voltage_bank = 0x03,
1437 .voltage_reg = 0x88,
1438 .voltage_mask = 0x07,
1439 .voltages = ldo_sdio_voltages,
1440 .voltages_len = ARRAY_SIZE(ldo_sdio_voltages),
1441 },
1442};
1443
Bengt Jonsson79568b942011-03-11 11:54:46 +01001444struct ab8500_reg_init {
1445 u8 bank;
1446 u8 addr;
1447 u8 mask;
1448};
1449
1450#define REG_INIT(_id, _bank, _addr, _mask) \
1451 [_id] = { \
1452 .bank = _bank, \
1453 .addr = _addr, \
1454 .mask = _mask, \
1455 }
1456
Lee Jones8e6a8d72013-03-28 16:11:11 +00001457/* AB8500 register init */
Bengt Jonsson79568b942011-03-11 11:54:46 +01001458static struct ab8500_reg_init ab8500_reg_init[] = {
1459 /*
Lee Jones33bc8f42013-03-21 15:59:02 +00001460 * 0x30, VanaRequestCtrl
Bengt Jonsson79568b942011-03-11 11:54:46 +01001461 * 0xc0, VextSupply1RequestCtrl
1462 */
Lee Jones43a59112013-03-21 15:59:15 +00001463 REG_INIT(AB8500_REGUREQUESTCTRL2, 0x03, 0x04, 0xf0),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001464 /*
1465 * 0x03, VextSupply2RequestCtrl
1466 * 0x0c, VextSupply3RequestCtrl
1467 * 0x30, Vaux1RequestCtrl
1468 * 0xc0, Vaux2RequestCtrl
1469 */
1470 REG_INIT(AB8500_REGUREQUESTCTRL3, 0x03, 0x05, 0xff),
1471 /*
1472 * 0x03, Vaux3RequestCtrl
1473 * 0x04, SwHPReq
1474 */
1475 REG_INIT(AB8500_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
1476 /*
1477 * 0x08, VanaSysClkReq1HPValid
1478 * 0x20, Vaux1SysClkReq1HPValid
1479 * 0x40, Vaux2SysClkReq1HPValid
1480 * 0x80, Vaux3SysClkReq1HPValid
1481 */
Lee Jones43a59112013-03-21 15:59:15 +00001482 REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xe8),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001483 /*
1484 * 0x10, VextSupply1SysClkReq1HPValid
1485 * 0x20, VextSupply2SysClkReq1HPValid
1486 * 0x40, VextSupply3SysClkReq1HPValid
1487 */
Lee Jones43a59112013-03-21 15:59:15 +00001488 REG_INIT(AB8500_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x70),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001489 /*
1490 * 0x08, VanaHwHPReq1Valid
1491 * 0x20, Vaux1HwHPReq1Valid
1492 * 0x40, Vaux2HwHPReq1Valid
1493 * 0x80, Vaux3HwHPReq1Valid
1494 */
Lee Jones43a59112013-03-21 15:59:15 +00001495 REG_INIT(AB8500_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xe8),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001496 /*
1497 * 0x01, VextSupply1HwHPReq1Valid
1498 * 0x02, VextSupply2HwHPReq1Valid
1499 * 0x04, VextSupply3HwHPReq1Valid
1500 */
Lee Jones43a59112013-03-21 15:59:15 +00001501 REG_INIT(AB8500_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x07),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001502 /*
1503 * 0x08, VanaHwHPReq2Valid
1504 * 0x20, Vaux1HwHPReq2Valid
1505 * 0x40, Vaux2HwHPReq2Valid
1506 * 0x80, Vaux3HwHPReq2Valid
1507 */
Lee Jones43a59112013-03-21 15:59:15 +00001508 REG_INIT(AB8500_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xe8),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001509 /*
1510 * 0x01, VextSupply1HwHPReq2Valid
1511 * 0x02, VextSupply2HwHPReq2Valid
1512 * 0x04, VextSupply3HwHPReq2Valid
1513 */
Lee Jones43a59112013-03-21 15:59:15 +00001514 REG_INIT(AB8500_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x07),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001515 /*
1516 * 0x20, VanaSwHPReqValid
1517 * 0x80, Vaux1SwHPReqValid
1518 */
Lee Jones43a59112013-03-21 15:59:15 +00001519 REG_INIT(AB8500_REGUSWHPREQVALID1, 0x03, 0x0d, 0xa0),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001520 /*
1521 * 0x01, Vaux2SwHPReqValid
1522 * 0x02, Vaux3SwHPReqValid
1523 * 0x04, VextSupply1SwHPReqValid
1524 * 0x08, VextSupply2SwHPReqValid
1525 * 0x10, VextSupply3SwHPReqValid
1526 */
Lee Jones43a59112013-03-21 15:59:15 +00001527 REG_INIT(AB8500_REGUSWHPREQVALID2, 0x03, 0x0e, 0x1f),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001528 /*
1529 * 0x02, SysClkReq2Valid1
Lee Jones43a59112013-03-21 15:59:15 +00001530 * 0x04, SysClkReq3Valid1
1531 * 0x08, SysClkReq4Valid1
1532 * 0x10, SysClkReq5Valid1
1533 * 0x20, SysClkReq6Valid1
1534 * 0x40, SysClkReq7Valid1
Bengt Jonsson79568b942011-03-11 11:54:46 +01001535 * 0x80, SysClkReq8Valid1
1536 */
1537 REG_INIT(AB8500_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0xfe),
1538 /*
1539 * 0x02, SysClkReq2Valid2
Lee Jones43a59112013-03-21 15:59:15 +00001540 * 0x04, SysClkReq3Valid2
1541 * 0x08, SysClkReq4Valid2
1542 * 0x10, SysClkReq5Valid2
1543 * 0x20, SysClkReq6Valid2
1544 * 0x40, SysClkReq7Valid2
Bengt Jonsson79568b942011-03-11 11:54:46 +01001545 * 0x80, SysClkReq8Valid2
1546 */
1547 REG_INIT(AB8500_REGUSYSCLKREQVALID2, 0x03, 0x10, 0xfe),
1548 /*
1549 * 0x02, VTVoutEna
1550 * 0x04, Vintcore12Ena
1551 * 0x38, Vintcore12Sel
1552 * 0x40, Vintcore12LP
1553 * 0x80, VTVoutLP
1554 */
1555 REG_INIT(AB8500_REGUMISC1, 0x03, 0x80, 0xfe),
1556 /*
1557 * 0x02, VaudioEna
1558 * 0x04, VdmicEna
1559 * 0x08, Vamic1Ena
1560 * 0x10, Vamic2Ena
1561 */
1562 REG_INIT(AB8500_VAUDIOSUPPLY, 0x03, 0x83, 0x1e),
1563 /*
1564 * 0x01, Vamic1_dzout
1565 * 0x02, Vamic2_dzout
1566 */
1567 REG_INIT(AB8500_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
1568 /*
Lee Jones43a59112013-03-21 15:59:15 +00001569 * 0x03, VpllRegu (NOTE! PRCMU register bits)
Lee Jones33bc8f42013-03-21 15:59:02 +00001570 * 0x0c, VanaRegu
Bengt Jonsson79568b942011-03-11 11:54:46 +01001571 */
1572 REG_INIT(AB8500_VPLLVANAREGU, 0x04, 0x06, 0x0f),
1573 /*
1574 * 0x01, VrefDDREna
1575 * 0x02, VrefDDRSleepMode
1576 */
1577 REG_INIT(AB8500_VREFDDR, 0x04, 0x07, 0x03),
1578 /*
1579 * 0x03, VextSupply1Regu
1580 * 0x0c, VextSupply2Regu
1581 * 0x30, VextSupply3Regu
1582 * 0x40, ExtSupply2Bypass
1583 * 0x80, ExtSupply3Bypass
1584 */
1585 REG_INIT(AB8500_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
1586 /*
1587 * 0x03, Vaux1Regu
1588 * 0x0c, Vaux2Regu
1589 */
1590 REG_INIT(AB8500_VAUX12REGU, 0x04, 0x09, 0x0f),
1591 /*
1592 * 0x03, Vaux3Regu
1593 */
Lee Jones43a59112013-03-21 15:59:15 +00001594 REG_INIT(AB8500_VRF1VAUX3REGU, 0x04, 0x0a, 0x03),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001595 /*
1596 * 0x0f, Vaux1Sel
1597 */
1598 REG_INIT(AB8500_VAUX1SEL, 0x04, 0x1f, 0x0f),
1599 /*
1600 * 0x0f, Vaux2Sel
1601 */
1602 REG_INIT(AB8500_VAUX2SEL, 0x04, 0x20, 0x0f),
1603 /*
1604 * 0x07, Vaux3Sel
1605 */
Lee Jones43a59112013-03-21 15:59:15 +00001606 REG_INIT(AB8500_VRF1VAUX3SEL, 0x04, 0x21, 0x07),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001607 /*
1608 * 0x01, VextSupply12LP
1609 */
1610 REG_INIT(AB8500_REGUCTRL2SPARE, 0x04, 0x22, 0x01),
1611 /*
1612 * 0x04, Vaux1Disch
1613 * 0x08, Vaux2Disch
1614 * 0x10, Vaux3Disch
1615 * 0x20, Vintcore12Disch
1616 * 0x40, VTVoutDisch
1617 * 0x80, VaudioDisch
1618 */
Lee Jones43a59112013-03-21 15:59:15 +00001619 REG_INIT(AB8500_REGUCTRLDISCH, 0x04, 0x43, 0xfc),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001620 /*
1621 * 0x02, VanaDisch
1622 * 0x04, VdmicPullDownEna
1623 * 0x10, VdmicDisch
1624 */
Lee Jones43a59112013-03-21 15:59:15 +00001625 REG_INIT(AB8500_REGUCTRLDISCH2, 0x04, 0x44, 0x16),
Bengt Jonsson79568b942011-03-11 11:54:46 +01001626};
1627
Lee Jones547f3842013-03-28 16:11:14 +00001628/* AB8505 register init */
1629static struct ab8500_reg_init ab8505_reg_init[] = {
1630 /*
1631 * 0x03, VarmRequestCtrl
1632 * 0x0c, VsmpsCRequestCtrl
1633 * 0x30, VsmpsARequestCtrl
1634 * 0xc0, VsmpsBRequestCtrl
1635 */
1636 REG_INIT(AB8505_REGUREQUESTCTRL1, 0x03, 0x03, 0xff),
1637 /*
1638 * 0x03, VsafeRequestCtrl
1639 * 0x0c, VpllRequestCtrl
1640 * 0x30, VanaRequestCtrl
1641 */
1642 REG_INIT(AB8505_REGUREQUESTCTRL2, 0x03, 0x04, 0x3f),
1643 /*
1644 * 0x30, Vaux1RequestCtrl
1645 * 0xc0, Vaux2RequestCtrl
1646 */
1647 REG_INIT(AB8505_REGUREQUESTCTRL3, 0x03, 0x05, 0xf0),
1648 /*
1649 * 0x03, Vaux3RequestCtrl
1650 * 0x04, SwHPReq
1651 */
1652 REG_INIT(AB8505_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
1653 /*
1654 * 0x01, VsmpsASysClkReq1HPValid
1655 * 0x02, VsmpsBSysClkReq1HPValid
1656 * 0x04, VsafeSysClkReq1HPValid
1657 * 0x08, VanaSysClkReq1HPValid
1658 * 0x10, VpllSysClkReq1HPValid
1659 * 0x20, Vaux1SysClkReq1HPValid
1660 * 0x40, Vaux2SysClkReq1HPValid
1661 * 0x80, Vaux3SysClkReq1HPValid
1662 */
1663 REG_INIT(AB8505_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xff),
1664 /*
1665 * 0x01, VsmpsCSysClkReq1HPValid
1666 * 0x02, VarmSysClkReq1HPValid
1667 * 0x04, VbbSysClkReq1HPValid
1668 * 0x08, VsmpsMSysClkReq1HPValid
1669 */
1670 REG_INIT(AB8505_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x0f),
1671 /*
1672 * 0x01, VsmpsAHwHPReq1Valid
1673 * 0x02, VsmpsBHwHPReq1Valid
1674 * 0x04, VsafeHwHPReq1Valid
1675 * 0x08, VanaHwHPReq1Valid
1676 * 0x10, VpllHwHPReq1Valid
1677 * 0x20, Vaux1HwHPReq1Valid
1678 * 0x40, Vaux2HwHPReq1Valid
1679 * 0x80, Vaux3HwHPReq1Valid
1680 */
1681 REG_INIT(AB8505_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xff),
1682 /*
1683 * 0x08, VsmpsMHwHPReq1Valid
1684 */
1685 REG_INIT(AB8505_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x08),
1686 /*
1687 * 0x01, VsmpsAHwHPReq2Valid
1688 * 0x02, VsmpsBHwHPReq2Valid
1689 * 0x04, VsafeHwHPReq2Valid
1690 * 0x08, VanaHwHPReq2Valid
1691 * 0x10, VpllHwHPReq2Valid
1692 * 0x20, Vaux1HwHPReq2Valid
1693 * 0x40, Vaux2HwHPReq2Valid
1694 * 0x80, Vaux3HwHPReq2Valid
1695 */
1696 REG_INIT(AB8505_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xff),
1697 /*
1698 * 0x08, VsmpsMHwHPReq2Valid
1699 */
1700 REG_INIT(AB8505_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x08),
1701 /*
1702 * 0x01, VsmpsCSwHPReqValid
1703 * 0x02, VarmSwHPReqValid
1704 * 0x04, VsmpsASwHPReqValid
1705 * 0x08, VsmpsBSwHPReqValid
1706 * 0x10, VsafeSwHPReqValid
1707 * 0x20, VanaSwHPReqValid
1708 * 0x40, VpllSwHPReqValid
1709 * 0x80, Vaux1SwHPReqValid
1710 */
1711 REG_INIT(AB8505_REGUSWHPREQVALID1, 0x03, 0x0d, 0xff),
1712 /*
1713 * 0x01, Vaux2SwHPReqValid
1714 * 0x02, Vaux3SwHPReqValid
1715 * 0x20, VsmpsMSwHPReqValid
1716 */
1717 REG_INIT(AB8505_REGUSWHPREQVALID2, 0x03, 0x0e, 0x23),
1718 /*
1719 * 0x02, SysClkReq2Valid1
1720 * 0x04, SysClkReq3Valid1
1721 * 0x08, SysClkReq4Valid1
1722 */
1723 REG_INIT(AB8505_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0x0e),
1724 /*
1725 * 0x02, SysClkReq2Valid2
1726 * 0x04, SysClkReq3Valid2
1727 * 0x08, SysClkReq4Valid2
1728 */
1729 REG_INIT(AB8505_REGUSYSCLKREQVALID2, 0x03, 0x10, 0x0e),
1730 /*
1731 * 0x01, Vaux4SwHPReqValid
1732 * 0x02, Vaux4HwHPReq2Valid
1733 * 0x04, Vaux4HwHPReq1Valid
1734 * 0x08, Vaux4SysClkReq1HPValid
1735 */
1736 REG_INIT(AB8505_REGUVAUX4REQVALID, 0x03, 0x11, 0x0f),
1737 /*
1738 * 0x02, VadcEna
1739 * 0x04, VintCore12Ena
1740 * 0x38, VintCore12Sel
1741 * 0x40, VintCore12LP
1742 * 0x80, VadcLP
1743 */
1744 REG_INIT(AB8505_REGUMISC1, 0x03, 0x80, 0xfe),
1745 /*
1746 * 0x02, VaudioEna
1747 * 0x04, VdmicEna
1748 * 0x08, Vamic1Ena
1749 * 0x10, Vamic2Ena
1750 */
1751 REG_INIT(AB8505_VAUDIOSUPPLY, 0x03, 0x83, 0x1e),
1752 /*
1753 * 0x01, Vamic1_dzout
1754 * 0x02, Vamic2_dzout
1755 */
1756 REG_INIT(AB8505_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
1757 /*
1758 * 0x03, VsmpsARegu
1759 * 0x0c, VsmpsASelCtrl
1760 * 0x10, VsmpsAAutoMode
1761 * 0x20, VsmpsAPWMMode
1762 */
1763 REG_INIT(AB8505_VSMPSAREGU, 0x04, 0x03, 0x3f),
1764 /*
1765 * 0x03, VsmpsBRegu
1766 * 0x0c, VsmpsBSelCtrl
1767 * 0x10, VsmpsBAutoMode
1768 * 0x20, VsmpsBPWMMode
1769 */
1770 REG_INIT(AB8505_VSMPSBREGU, 0x04, 0x04, 0x3f),
1771 /*
1772 * 0x03, VsafeRegu
1773 * 0x0c, VsafeSelCtrl
1774 * 0x10, VsafeAutoMode
1775 * 0x20, VsafePWMMode
1776 */
1777 REG_INIT(AB8505_VSAFEREGU, 0x04, 0x05, 0x3f),
1778 /*
1779 * 0x03, VpllRegu (NOTE! PRCMU register bits)
1780 * 0x0c, VanaRegu
1781 */
1782 REG_INIT(AB8505_VPLLVANAREGU, 0x04, 0x06, 0x0f),
1783 /*
1784 * 0x03, VextSupply1Regu
1785 * 0x0c, VextSupply2Regu
1786 * 0x30, VextSupply3Regu
1787 * 0x40, ExtSupply2Bypass
1788 * 0x80, ExtSupply3Bypass
1789 */
1790 REG_INIT(AB8505_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
1791 /*
1792 * 0x03, Vaux1Regu
1793 * 0x0c, Vaux2Regu
1794 */
1795 REG_INIT(AB8505_VAUX12REGU, 0x04, 0x09, 0x0f),
1796 /*
1797 * 0x0f, Vaux3Regu
1798 */
1799 REG_INIT(AB8505_VRF1VAUX3REGU, 0x04, 0x0a, 0x0f),
1800 /*
1801 * 0x3f, VsmpsASel1
1802 */
1803 REG_INIT(AB8505_VSMPSASEL1, 0x04, 0x13, 0x3f),
1804 /*
1805 * 0x3f, VsmpsASel2
1806 */
1807 REG_INIT(AB8505_VSMPSASEL2, 0x04, 0x14, 0x3f),
1808 /*
1809 * 0x3f, VsmpsASel3
1810 */
1811 REG_INIT(AB8505_VSMPSASEL3, 0x04, 0x15, 0x3f),
1812 /*
1813 * 0x3f, VsmpsBSel1
1814 */
1815 REG_INIT(AB8505_VSMPSBSEL1, 0x04, 0x17, 0x3f),
1816 /*
1817 * 0x3f, VsmpsBSel2
1818 */
1819 REG_INIT(AB8505_VSMPSBSEL2, 0x04, 0x18, 0x3f),
1820 /*
1821 * 0x3f, VsmpsBSel3
1822 */
1823 REG_INIT(AB8505_VSMPSBSEL3, 0x04, 0x19, 0x3f),
1824 /*
1825 * 0x7f, VsafeSel1
1826 */
1827 REG_INIT(AB8505_VSAFESEL1, 0x04, 0x1b, 0x7f),
1828 /*
1829 * 0x3f, VsafeSel2
1830 */
1831 REG_INIT(AB8505_VSAFESEL2, 0x04, 0x1c, 0x7f),
1832 /*
1833 * 0x3f, VsafeSel3
1834 */
1835 REG_INIT(AB8505_VSAFESEL3, 0x04, 0x1d, 0x7f),
1836 /*
1837 * 0x0f, Vaux1Sel
1838 */
1839 REG_INIT(AB8505_VAUX1SEL, 0x04, 0x1f, 0x0f),
1840 /*
1841 * 0x0f, Vaux2Sel
1842 */
1843 REG_INIT(AB8505_VAUX2SEL, 0x04, 0x20, 0x0f),
1844 /*
1845 * 0x07, Vaux3Sel
1846 * 0x30, VRF1Sel
1847 */
1848 REG_INIT(AB8505_VRF1VAUX3SEL, 0x04, 0x21, 0x37),
1849 /*
1850 * 0x03, Vaux4RequestCtrl
1851 */
1852 REG_INIT(AB8505_VAUX4REQCTRL, 0x04, 0x2d, 0x03),
1853 /*
1854 * 0x03, Vaux4Regu
1855 */
1856 REG_INIT(AB8505_VAUX4REGU, 0x04, 0x2e, 0x03),
1857 /*
1858 * 0x0f, Vaux4Sel
1859 */
1860 REG_INIT(AB8505_VAUX4SEL, 0x04, 0x2f, 0x0f),
1861 /*
1862 * 0x04, Vaux1Disch
1863 * 0x08, Vaux2Disch
1864 * 0x10, Vaux3Disch
1865 * 0x20, Vintcore12Disch
1866 * 0x40, VTVoutDisch
1867 * 0x80, VaudioDisch
1868 */
1869 REG_INIT(AB8505_REGUCTRLDISCH, 0x04, 0x43, 0xfc),
1870 /*
1871 * 0x02, VanaDisch
1872 * 0x04, VdmicPullDownEna
1873 * 0x10, VdmicDisch
1874 */
1875 REG_INIT(AB8505_REGUCTRLDISCH2, 0x04, 0x44, 0x16),
1876 /*
1877 * 0x01, Vaux4Disch
1878 */
1879 REG_INIT(AB8505_REGUCTRLDISCH3, 0x04, 0x48, 0x01),
1880 /*
1881 * 0x07, Vaux5Sel
1882 * 0x08, Vaux5LP
1883 * 0x10, Vaux5Ena
1884 * 0x20, Vaux5Disch
1885 * 0x40, Vaux5DisSfst
1886 * 0x80, Vaux5DisPulld
1887 */
1888 REG_INIT(AB8505_CTRLVAUX5, 0x01, 0x55, 0xff),
1889 /*
1890 * 0x07, Vaux6Sel
1891 * 0x08, Vaux6LP
1892 * 0x10, Vaux6Ena
1893 * 0x80, Vaux6DisPulld
1894 */
1895 REG_INIT(AB8505_CTRLVAUX6, 0x01, 0x56, 0x9f),
1896};
1897
Lee Jones8e6a8d72013-03-28 16:11:11 +00001898/* AB9540 register init */
1899static struct ab8500_reg_init ab9540_reg_init[] = {
1900 /*
1901 * 0x03, VarmRequestCtrl
1902 * 0x0c, VapeRequestCtrl
1903 * 0x30, Vsmps1RequestCtrl
1904 * 0xc0, Vsmps2RequestCtrl
1905 */
1906 REG_INIT(AB9540_REGUREQUESTCTRL1, 0x03, 0x03, 0xff),
1907 /*
1908 * 0x03, Vsmps3RequestCtrl
1909 * 0x0c, VpllRequestCtrl
1910 * 0x30, VanaRequestCtrl
1911 * 0xc0, VextSupply1RequestCtrl
1912 */
1913 REG_INIT(AB9540_REGUREQUESTCTRL2, 0x03, 0x04, 0xff),
1914 /*
1915 * 0x03, VextSupply2RequestCtrl
1916 * 0x0c, VextSupply3RequestCtrl
1917 * 0x30, Vaux1RequestCtrl
1918 * 0xc0, Vaux2RequestCtrl
1919 */
1920 REG_INIT(AB9540_REGUREQUESTCTRL3, 0x03, 0x05, 0xff),
1921 /*
1922 * 0x03, Vaux3RequestCtrl
1923 * 0x04, SwHPReq
1924 */
1925 REG_INIT(AB9540_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
1926 /*
1927 * 0x01, Vsmps1SysClkReq1HPValid
1928 * 0x02, Vsmps2SysClkReq1HPValid
1929 * 0x04, Vsmps3SysClkReq1HPValid
1930 * 0x08, VanaSysClkReq1HPValid
1931 * 0x10, VpllSysClkReq1HPValid
1932 * 0x20, Vaux1SysClkReq1HPValid
1933 * 0x40, Vaux2SysClkReq1HPValid
1934 * 0x80, Vaux3SysClkReq1HPValid
1935 */
1936 REG_INIT(AB9540_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xff),
1937 /*
1938 * 0x01, VapeSysClkReq1HPValid
1939 * 0x02, VarmSysClkReq1HPValid
1940 * 0x04, VbbSysClkReq1HPValid
1941 * 0x08, VmodSysClkReq1HPValid
1942 * 0x10, VextSupply1SysClkReq1HPValid
1943 * 0x20, VextSupply2SysClkReq1HPValid
1944 * 0x40, VextSupply3SysClkReq1HPValid
1945 */
1946 REG_INIT(AB9540_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x7f),
1947 /*
1948 * 0x01, Vsmps1HwHPReq1Valid
1949 * 0x02, Vsmps2HwHPReq1Valid
1950 * 0x04, Vsmps3HwHPReq1Valid
1951 * 0x08, VanaHwHPReq1Valid
1952 * 0x10, VpllHwHPReq1Valid
1953 * 0x20, Vaux1HwHPReq1Valid
1954 * 0x40, Vaux2HwHPReq1Valid
1955 * 0x80, Vaux3HwHPReq1Valid
1956 */
1957 REG_INIT(AB9540_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xff),
1958 /*
1959 * 0x01, VextSupply1HwHPReq1Valid
1960 * 0x02, VextSupply2HwHPReq1Valid
1961 * 0x04, VextSupply3HwHPReq1Valid
1962 * 0x08, VmodHwHPReq1Valid
1963 */
1964 REG_INIT(AB9540_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x0f),
1965 /*
1966 * 0x01, Vsmps1HwHPReq2Valid
1967 * 0x02, Vsmps2HwHPReq2Valid
1968 * 0x03, Vsmps3HwHPReq2Valid
1969 * 0x08, VanaHwHPReq2Valid
1970 * 0x10, VpllHwHPReq2Valid
1971 * 0x20, Vaux1HwHPReq2Valid
1972 * 0x40, Vaux2HwHPReq2Valid
1973 * 0x80, Vaux3HwHPReq2Valid
1974 */
1975 REG_INIT(AB9540_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xff),
1976 /*
1977 * 0x01, VextSupply1HwHPReq2Valid
1978 * 0x02, VextSupply2HwHPReq2Valid
1979 * 0x04, VextSupply3HwHPReq2Valid
1980 * 0x08, VmodHwHPReq2Valid
1981 */
1982 REG_INIT(AB9540_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x0f),
1983 /*
1984 * 0x01, VapeSwHPReqValid
1985 * 0x02, VarmSwHPReqValid
1986 * 0x04, Vsmps1SwHPReqValid
1987 * 0x08, Vsmps2SwHPReqValid
1988 * 0x10, Vsmps3SwHPReqValid
1989 * 0x20, VanaSwHPReqValid
1990 * 0x40, VpllSwHPReqValid
1991 * 0x80, Vaux1SwHPReqValid
1992 */
1993 REG_INIT(AB9540_REGUSWHPREQVALID1, 0x03, 0x0d, 0xff),
1994 /*
1995 * 0x01, Vaux2SwHPReqValid
1996 * 0x02, Vaux3SwHPReqValid
1997 * 0x04, VextSupply1SwHPReqValid
1998 * 0x08, VextSupply2SwHPReqValid
1999 * 0x10, VextSupply3SwHPReqValid
2000 * 0x20, VmodSwHPReqValid
2001 */
2002 REG_INIT(AB9540_REGUSWHPREQVALID2, 0x03, 0x0e, 0x3f),
2003 /*
2004 * 0x02, SysClkReq2Valid1
2005 * ...
2006 * 0x80, SysClkReq8Valid1
2007 */
2008 REG_INIT(AB9540_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0xfe),
2009 /*
2010 * 0x02, SysClkReq2Valid2
2011 * ...
2012 * 0x80, SysClkReq8Valid2
2013 */
2014 REG_INIT(AB9540_REGUSYSCLKREQVALID2, 0x03, 0x10, 0xfe),
2015 /*
2016 * 0x01, Vaux4SwHPReqValid
2017 * 0x02, Vaux4HwHPReq2Valid
2018 * 0x04, Vaux4HwHPReq1Valid
2019 * 0x08, Vaux4SysClkReq1HPValid
2020 */
2021 REG_INIT(AB9540_REGUVAUX4REQVALID, 0x03, 0x11, 0x0f),
2022 /*
2023 * 0x02, VTVoutEna
2024 * 0x04, Vintcore12Ena
2025 * 0x38, Vintcore12Sel
2026 * 0x40, Vintcore12LP
2027 * 0x80, VTVoutLP
2028 */
2029 REG_INIT(AB9540_REGUMISC1, 0x03, 0x80, 0xfe),
2030 /*
2031 * 0x02, VaudioEna
2032 * 0x04, VdmicEna
2033 * 0x08, Vamic1Ena
2034 * 0x10, Vamic2Ena
2035 */
2036 REG_INIT(AB9540_VAUDIOSUPPLY, 0x03, 0x83, 0x1e),
2037 /*
2038 * 0x01, Vamic1_dzout
2039 * 0x02, Vamic2_dzout
2040 */
2041 REG_INIT(AB9540_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
2042 /*
2043 * 0x03, Vsmps1Regu
2044 * 0x0c, Vsmps1SelCtrl
2045 * 0x10, Vsmps1AutoMode
2046 * 0x20, Vsmps1PWMMode
2047 */
2048 REG_INIT(AB9540_VSMPS1REGU, 0x04, 0x03, 0x3f),
2049 /*
2050 * 0x03, Vsmps2Regu
2051 * 0x0c, Vsmps2SelCtrl
2052 * 0x10, Vsmps2AutoMode
2053 * 0x20, Vsmps2PWMMode
2054 */
2055 REG_INIT(AB9540_VSMPS2REGU, 0x04, 0x04, 0x3f),
2056 /*
2057 * 0x03, Vsmps3Regu
2058 * 0x0c, Vsmps3SelCtrl
2059 * NOTE! PRCMU register
2060 */
2061 REG_INIT(AB9540_VSMPS3REGU, 0x04, 0x05, 0x0f),
2062 /*
2063 * 0x03, VpllRegu
2064 * 0x0c, VanaRegu
2065 */
2066 REG_INIT(AB9540_VPLLVANAREGU, 0x04, 0x06, 0x0f),
2067 /*
2068 * 0x03, VextSupply1Regu
2069 * 0x0c, VextSupply2Regu
2070 * 0x30, VextSupply3Regu
2071 * 0x40, ExtSupply2Bypass
2072 * 0x80, ExtSupply3Bypass
2073 */
2074 REG_INIT(AB9540_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
2075 /*
2076 * 0x03, Vaux1Regu
2077 * 0x0c, Vaux2Regu
2078 */
2079 REG_INIT(AB9540_VAUX12REGU, 0x04, 0x09, 0x0f),
2080 /*
2081 * 0x0c, Vrf1Regu
2082 * 0x03, Vaux3Regu
2083 */
2084 REG_INIT(AB9540_VRF1VAUX3REGU, 0x04, 0x0a, 0x0f),
2085 /*
2086 * 0x3f, Vsmps1Sel1
2087 */
2088 REG_INIT(AB9540_VSMPS1SEL1, 0x04, 0x13, 0x3f),
2089 /*
2090 * 0x3f, Vsmps1Sel2
2091 */
2092 REG_INIT(AB9540_VSMPS1SEL2, 0x04, 0x14, 0x3f),
2093 /*
2094 * 0x3f, Vsmps1Sel3
2095 */
2096 REG_INIT(AB9540_VSMPS1SEL3, 0x04, 0x15, 0x3f),
2097 /*
2098 * 0x3f, Vsmps2Sel1
2099 */
2100 REG_INIT(AB9540_VSMPS2SEL1, 0x04, 0x17, 0x3f),
2101 /*
2102 * 0x3f, Vsmps2Sel2
2103 */
2104 REG_INIT(AB9540_VSMPS2SEL2, 0x04, 0x18, 0x3f),
2105 /*
2106 * 0x3f, Vsmps2Sel3
2107 */
2108 REG_INIT(AB9540_VSMPS2SEL3, 0x04, 0x19, 0x3f),
2109 /*
2110 * 0x7f, Vsmps3Sel1
2111 * NOTE! PRCMU register
2112 */
2113 REG_INIT(AB9540_VSMPS3SEL1, 0x04, 0x1b, 0x7f),
2114 /*
2115 * 0x7f, Vsmps3Sel2
2116 * NOTE! PRCMU register
2117 */
2118 REG_INIT(AB9540_VSMPS3SEL2, 0x04, 0x1c, 0x7f),
2119 /*
2120 * 0x0f, Vaux1Sel
2121 */
2122 REG_INIT(AB9540_VAUX1SEL, 0x04, 0x1f, 0x0f),
2123 /*
2124 * 0x0f, Vaux2Sel
2125 */
2126 REG_INIT(AB9540_VAUX2SEL, 0x04, 0x20, 0x0f),
2127 /*
2128 * 0x07, Vaux3Sel
2129 * 0x30, Vrf1Sel
2130 */
2131 REG_INIT(AB9540_VRF1VAUX3SEL, 0x04, 0x21, 0x37),
2132 /*
2133 * 0x01, VextSupply12LP
2134 */
2135 REG_INIT(AB9540_REGUCTRL2SPARE, 0x04, 0x22, 0x01),
2136 /*
2137 * 0x03, Vaux4RequestCtrl
2138 */
2139 REG_INIT(AB9540_VAUX4REQCTRL, 0x04, 0x2d, 0x03),
2140 /*
2141 * 0x03, Vaux4Regu
2142 */
2143 REG_INIT(AB9540_VAUX4REGU, 0x04, 0x2e, 0x03),
2144 /*
2145 * 0x08, Vaux4Sel
2146 */
2147 REG_INIT(AB9540_VAUX4SEL, 0x04, 0x2f, 0x0f),
2148 /*
2149 * 0x01, VpllDisch
2150 * 0x02, Vrf1Disch
2151 * 0x04, Vaux1Disch
2152 * 0x08, Vaux2Disch
2153 * 0x10, Vaux3Disch
2154 * 0x20, Vintcore12Disch
2155 * 0x40, VTVoutDisch
2156 * 0x80, VaudioDisch
2157 */
2158 REG_INIT(AB9540_REGUCTRLDISCH, 0x04, 0x43, 0xff),
2159 /*
2160 * 0x01, VsimDisch
2161 * 0x02, VanaDisch
2162 * 0x04, VdmicPullDownEna
2163 * 0x08, VpllPullDownEna
2164 * 0x10, VdmicDisch
2165 */
2166 REG_INIT(AB9540_REGUCTRLDISCH2, 0x04, 0x44, 0x1f),
2167 /*
2168 * 0x01, Vaux4Disch
2169 */
2170 REG_INIT(AB9540_REGUCTRLDISCH3, 0x04, 0x48, 0x01),
2171};
2172
Lee Jonesae0a9a32013-03-28 16:11:16 +00002173/* AB8540 register init */
2174static struct ab8500_reg_init ab8540_reg_init[] = {
2175 /*
2176 * 0x01, VSimSycClkReq1Valid
2177 * 0x02, VSimSycClkReq2Valid
2178 * 0x04, VSimSycClkReq3Valid
2179 * 0x08, VSimSycClkReq4Valid
2180 * 0x10, VSimSycClkReq5Valid
2181 * 0x20, VSimSycClkReq6Valid
2182 * 0x40, VSimSycClkReq7Valid
2183 * 0x80, VSimSycClkReq8Valid
2184 */
2185 REG_INIT(AB8540_VSIMSYSCLKCTRL, 0x02, 0x33, 0xff),
2186 /*
2187 * 0x03, VarmRequestCtrl
2188 * 0x0c, VapeRequestCtrl
2189 * 0x30, Vsmps1RequestCtrl
2190 * 0xc0, Vsmps2RequestCtrl
2191 */
2192 REG_INIT(AB8540_REGUREQUESTCTRL1, 0x03, 0x03, 0xff),
2193 /*
2194 * 0x03, Vsmps3RequestCtrl
2195 * 0x0c, VpllRequestCtrl
2196 * 0x30, VanaRequestCtrl
2197 * 0xc0, VextSupply1RequestCtrl
2198 */
2199 REG_INIT(AB8540_REGUREQUESTCTRL2, 0x03, 0x04, 0xff),
2200 /*
2201 * 0x03, VextSupply2RequestCtrl
2202 * 0x0c, VextSupply3RequestCtrl
2203 * 0x30, Vaux1RequestCtrl
2204 * 0xc0, Vaux2RequestCtrl
2205 */
2206 REG_INIT(AB8540_REGUREQUESTCTRL3, 0x03, 0x05, 0xff),
2207 /*
2208 * 0x03, Vaux3RequestCtrl
2209 * 0x04, SwHPReq
2210 */
2211 REG_INIT(AB8540_REGUREQUESTCTRL4, 0x03, 0x06, 0x07),
2212 /*
2213 * 0x01, Vsmps1SysClkReq1HPValid
2214 * 0x02, Vsmps2SysClkReq1HPValid
2215 * 0x04, Vsmps3SysClkReq1HPValid
2216 * 0x08, VanaSysClkReq1HPValid
2217 * 0x10, VpllSysClkReq1HPValid
2218 * 0x20, Vaux1SysClkReq1HPValid
2219 * 0x40, Vaux2SysClkReq1HPValid
2220 * 0x80, Vaux3SysClkReq1HPValid
2221 */
2222 REG_INIT(AB8540_REGUSYSCLKREQ1HPVALID1, 0x03, 0x07, 0xff),
2223 /*
2224 * 0x01, VapeSysClkReq1HPValid
2225 * 0x02, VarmSysClkReq1HPValid
2226 * 0x04, VbbSysClkReq1HPValid
2227 * 0x10, VextSupply1SysClkReq1HPValid
2228 * 0x20, VextSupply2SysClkReq1HPValid
2229 * 0x40, VextSupply3SysClkReq1HPValid
2230 */
2231 REG_INIT(AB8540_REGUSYSCLKREQ1HPVALID2, 0x03, 0x08, 0x77),
2232 /*
2233 * 0x01, Vsmps1HwHPReq1Valid
2234 * 0x02, Vsmps2HwHPReq1Valid
2235 * 0x04, Vsmps3HwHPReq1Valid
2236 * 0x08, VanaHwHPReq1Valid
2237 * 0x10, VpllHwHPReq1Valid
2238 * 0x20, Vaux1HwHPReq1Valid
2239 * 0x40, Vaux2HwHPReq1Valid
2240 * 0x80, Vaux3HwHPReq1Valid
2241 */
2242 REG_INIT(AB8540_REGUHWHPREQ1VALID1, 0x03, 0x09, 0xff),
2243 /*
2244 * 0x01, VextSupply1HwHPReq1Valid
2245 * 0x02, VextSupply2HwHPReq1Valid
2246 * 0x04, VextSupply3HwHPReq1Valid
2247 */
2248 REG_INIT(AB8540_REGUHWHPREQ1VALID2, 0x03, 0x0a, 0x07),
2249 /*
2250 * 0x01, Vsmps1HwHPReq2Valid
2251 * 0x02, Vsmps2HwHPReq2Valid
2252 * 0x03, Vsmps3HwHPReq2Valid
2253 * 0x08, VanaHwHPReq2Valid
2254 * 0x10, VpllHwHPReq2Valid
2255 * 0x20, Vaux1HwHPReq2Valid
2256 * 0x40, Vaux2HwHPReq2Valid
2257 * 0x80, Vaux3HwHPReq2Valid
2258 */
2259 REG_INIT(AB8540_REGUHWHPREQ2VALID1, 0x03, 0x0b, 0xff),
2260 /*
2261 * 0x01, VextSupply1HwHPReq2Valid
2262 * 0x02, VextSupply2HwHPReq2Valid
2263 * 0x04, VextSupply3HwHPReq2Valid
2264 */
2265 REG_INIT(AB8540_REGUHWHPREQ2VALID2, 0x03, 0x0c, 0x07),
2266 /*
2267 * 0x01, VapeSwHPReqValid
2268 * 0x02, VarmSwHPReqValid
2269 * 0x04, Vsmps1SwHPReqValid
2270 * 0x08, Vsmps2SwHPReqValid
2271 * 0x10, Vsmps3SwHPReqValid
2272 * 0x20, VanaSwHPReqValid
2273 * 0x40, VpllSwHPReqValid
2274 * 0x80, Vaux1SwHPReqValid
2275 */
2276 REG_INIT(AB8540_REGUSWHPREQVALID1, 0x03, 0x0d, 0xff),
2277 /*
2278 * 0x01, Vaux2SwHPReqValid
2279 * 0x02, Vaux3SwHPReqValid
2280 * 0x04, VextSupply1SwHPReqValid
2281 * 0x08, VextSupply2SwHPReqValid
2282 * 0x10, VextSupply3SwHPReqValid
2283 */
2284 REG_INIT(AB8540_REGUSWHPREQVALID2, 0x03, 0x0e, 0x1f),
2285 /*
2286 * 0x02, SysClkReq2Valid1
2287 * ...
2288 * 0x80, SysClkReq8Valid1
2289 */
2290 REG_INIT(AB8540_REGUSYSCLKREQVALID1, 0x03, 0x0f, 0xff),
2291 /*
2292 * 0x02, SysClkReq2Valid2
2293 * ...
2294 * 0x80, SysClkReq8Valid2
2295 */
2296 REG_INIT(AB8540_REGUSYSCLKREQVALID2, 0x03, 0x10, 0xff),
2297 /*
2298 * 0x01, Vaux4SwHPReqValid
2299 * 0x02, Vaux4HwHPReq2Valid
2300 * 0x04, Vaux4HwHPReq1Valid
2301 * 0x08, Vaux4SysClkReq1HPValid
2302 */
2303 REG_INIT(AB8540_REGUVAUX4REQVALID, 0x03, 0x11, 0x0f),
2304 /*
2305 * 0x01, Vaux5SwHPReqValid
2306 * 0x02, Vaux5HwHPReq2Valid
2307 * 0x04, Vaux5HwHPReq1Valid
2308 * 0x08, Vaux5SysClkReq1HPValid
2309 */
2310 REG_INIT(AB8540_REGUVAUX5REQVALID, 0x03, 0x12, 0x0f),
2311 /*
2312 * 0x01, Vaux6SwHPReqValid
2313 * 0x02, Vaux6HwHPReq2Valid
2314 * 0x04, Vaux6HwHPReq1Valid
2315 * 0x08, Vaux6SysClkReq1HPValid
2316 */
2317 REG_INIT(AB8540_REGUVAUX6REQVALID, 0x03, 0x13, 0x0f),
2318 /*
2319 * 0x01, VclkbSwHPReqValid
2320 * 0x02, VclkbHwHPReq2Valid
2321 * 0x04, VclkbHwHPReq1Valid
2322 * 0x08, VclkbSysClkReq1HPValid
2323 */
2324 REG_INIT(AB8540_REGUVCLKBREQVALID, 0x03, 0x14, 0x0f),
2325 /*
2326 * 0x01, Vrf1SwHPReqValid
2327 * 0x02, Vrf1HwHPReq2Valid
2328 * 0x04, Vrf1HwHPReq1Valid
2329 * 0x08, Vrf1SysClkReq1HPValid
2330 */
2331 REG_INIT(AB8540_REGUVRF1REQVALID, 0x03, 0x15, 0x0f),
2332 /*
2333 * 0x02, VTVoutEna
2334 * 0x04, Vintcore12Ena
2335 * 0x38, Vintcore12Sel
2336 * 0x40, Vintcore12LP
2337 * 0x80, VTVoutLP
2338 */
2339 REG_INIT(AB8540_REGUMISC1, 0x03, 0x80, 0xfe),
2340 /*
2341 * 0x02, VaudioEna
2342 * 0x04, VdmicEna
2343 * 0x08, Vamic1Ena
2344 * 0x10, Vamic2Ena
2345 * 0x20, Vamic12LP
2346 * 0xC0, VdmicSel
2347 */
2348 REG_INIT(AB8540_VAUDIOSUPPLY, 0x03, 0x83, 0xfe),
2349 /*
2350 * 0x01, Vamic1_dzout
2351 * 0x02, Vamic2_dzout
2352 */
2353 REG_INIT(AB8540_REGUCTRL1VAMIC, 0x03, 0x84, 0x03),
2354 /*
2355 * 0x07, VHSICSel
2356 * 0x08, VHSICOffState
2357 * 0x10, VHSIEna
2358 * 0x20, VHSICLP
2359 */
2360 REG_INIT(AB8540_VHSIC, 0x03, 0x87, 0x3f),
2361 /*
2362 * 0x07, VSDIOSel
2363 * 0x08, VSDIOOffState
2364 * 0x10, VSDIOEna
2365 * 0x20, VSDIOLP
2366 */
2367 REG_INIT(AB8540_VSDIO, 0x03, 0x88, 0x3f),
2368 /*
2369 * 0x03, Vsmps1Regu
2370 * 0x0c, Vsmps1SelCtrl
2371 * 0x10, Vsmps1AutoMode
2372 * 0x20, Vsmps1PWMMode
2373 */
2374 REG_INIT(AB8540_VSMPS1REGU, 0x04, 0x03, 0x3f),
2375 /*
2376 * 0x03, Vsmps2Regu
2377 * 0x0c, Vsmps2SelCtrl
2378 * 0x10, Vsmps2AutoMode
2379 * 0x20, Vsmps2PWMMode
2380 */
2381 REG_INIT(AB8540_VSMPS2REGU, 0x04, 0x04, 0x3f),
2382 /*
2383 * 0x03, Vsmps3Regu
2384 * 0x0c, Vsmps3SelCtrl
2385 * 0x10, Vsmps3AutoMode
2386 * 0x20, Vsmps3PWMMode
2387 * NOTE! PRCMU register
2388 */
2389 REG_INIT(AB8540_VSMPS3REGU, 0x04, 0x05, 0x0f),
2390 /*
2391 * 0x03, VpllRegu
2392 * 0x0c, VanaRegu
2393 */
2394 REG_INIT(AB8540_VPLLVANAREGU, 0x04, 0x06, 0x0f),
2395 /*
2396 * 0x03, VextSupply1Regu
2397 * 0x0c, VextSupply2Regu
2398 * 0x30, VextSupply3Regu
2399 * 0x40, ExtSupply2Bypass
2400 * 0x80, ExtSupply3Bypass
2401 */
2402 REG_INIT(AB8540_EXTSUPPLYREGU, 0x04, 0x08, 0xff),
2403 /*
2404 * 0x03, Vaux1Regu
2405 * 0x0c, Vaux2Regu
2406 */
2407 REG_INIT(AB8540_VAUX12REGU, 0x04, 0x09, 0x0f),
2408 /*
2409 * 0x0c, VRF1Regu
2410 * 0x03, Vaux3Regu
2411 */
2412 REG_INIT(AB8540_VRF1VAUX3REGU, 0x04, 0x0a, 0x0f),
2413 /*
2414 * 0x3f, Vsmps1Sel1
2415 */
2416 REG_INIT(AB8540_VSMPS1SEL1, 0x04, 0x13, 0x3f),
2417 /*
2418 * 0x3f, Vsmps1Sel2
2419 */
2420 REG_INIT(AB8540_VSMPS1SEL2, 0x04, 0x14, 0x3f),
2421 /*
2422 * 0x3f, Vsmps1Sel3
2423 */
2424 REG_INIT(AB8540_VSMPS1SEL3, 0x04, 0x15, 0x3f),
2425 /*
2426 * 0x3f, Vsmps2Sel1
2427 */
2428 REG_INIT(AB8540_VSMPS2SEL1, 0x04, 0x17, 0x3f),
2429 /*
2430 * 0x3f, Vsmps2Sel2
2431 */
2432 REG_INIT(AB8540_VSMPS2SEL2, 0x04, 0x18, 0x3f),
2433 /*
2434 * 0x3f, Vsmps2Sel3
2435 */
2436 REG_INIT(AB8540_VSMPS2SEL3, 0x04, 0x19, 0x3f),
2437 /*
2438 * 0x7f, Vsmps3Sel1
2439 * NOTE! PRCMU register
2440 */
2441 REG_INIT(AB8540_VSMPS3SEL1, 0x04, 0x1b, 0x7f),
2442 /*
2443 * 0x7f, Vsmps3Sel2
2444 * NOTE! PRCMU register
2445 */
2446 REG_INIT(AB8540_VSMPS3SEL2, 0x04, 0x1c, 0x7f),
2447 /*
2448 * 0x0f, Vaux1Sel
2449 */
2450 REG_INIT(AB8540_VAUX1SEL, 0x04, 0x1f, 0x0f),
2451 /*
2452 * 0x0f, Vaux2Sel
2453 */
2454 REG_INIT(AB8540_VAUX2SEL, 0x04, 0x20, 0x0f),
2455 /*
2456 * 0x07, Vaux3Sel
2457 * 0x70, Vrf1Sel
2458 */
2459 REG_INIT(AB8540_VRF1VAUX3SEL, 0x04, 0x21, 0x77),
2460 /*
2461 * 0x01, VextSupply12LP
2462 */
2463 REG_INIT(AB8540_REGUCTRL2SPARE, 0x04, 0x22, 0x01),
2464 /*
2465 * 0x07, Vanasel
2466 * 0x30, Vpllsel
2467 */
2468 REG_INIT(AB8540_VANAVPLLSEL, 0x04, 0x29, 0x37),
2469 /*
2470 * 0x03, Vaux4RequestCtrl
2471 */
2472 REG_INIT(AB8540_VAUX4REQCTRL, 0x04, 0x2d, 0x03),
2473 /*
2474 * 0x03, Vaux4Regu
2475 */
2476 REG_INIT(AB8540_VAUX4REGU, 0x04, 0x2e, 0x03),
2477 /*
2478 * 0x0f, Vaux4Sel
2479 */
2480 REG_INIT(AB8540_VAUX4SEL, 0x04, 0x2f, 0x0f),
2481 /*
2482 * 0x03, Vaux5RequestCtrl
2483 */
2484 REG_INIT(AB8540_VAUX5REQCTRL, 0x04, 0x31, 0x03),
2485 /*
2486 * 0x03, Vaux5Regu
2487 */
2488 REG_INIT(AB8540_VAUX5REGU, 0x04, 0x32, 0x03),
2489 /*
2490 * 0x3f, Vaux5Sel
2491 */
2492 REG_INIT(AB8540_VAUX5SEL, 0x04, 0x33, 0x3f),
2493 /*
2494 * 0x03, Vaux6RequestCtrl
2495 */
2496 REG_INIT(AB8540_VAUX6REQCTRL, 0x04, 0x34, 0x03),
2497 /*
2498 * 0x03, Vaux6Regu
2499 */
2500 REG_INIT(AB8540_VAUX6REGU, 0x04, 0x35, 0x03),
2501 /*
2502 * 0x3f, Vaux6Sel
2503 */
2504 REG_INIT(AB8540_VAUX6SEL, 0x04, 0x36, 0x3f),
2505 /*
2506 * 0x03, VCLKBRequestCtrl
2507 */
2508 REG_INIT(AB8540_VCLKBREQCTRL, 0x04, 0x37, 0x03),
2509 /*
2510 * 0x03, VCLKBRegu
2511 */
2512 REG_INIT(AB8540_VCLKBREGU, 0x04, 0x38, 0x03),
2513 /*
2514 * 0x07, VCLKBSel
2515 */
2516 REG_INIT(AB8540_VCLKBSEL, 0x04, 0x39, 0x07),
2517 /*
2518 * 0x03, Vrf1RequestCtrl
2519 */
2520 REG_INIT(AB8540_VRF1REQCTRL, 0x04, 0x3a, 0x03),
2521 /*
2522 * 0x01, VpllDisch
2523 * 0x02, Vrf1Disch
2524 * 0x04, Vaux1Disch
2525 * 0x08, Vaux2Disch
2526 * 0x10, Vaux3Disch
2527 * 0x20, Vintcore12Disch
2528 * 0x40, VTVoutDisch
2529 * 0x80, VaudioDisch
2530 */
2531 REG_INIT(AB8540_REGUCTRLDISCH, 0x04, 0x43, 0xff),
2532 /*
2533 * 0x02, VanaDisch
2534 * 0x04, VdmicPullDownEna
2535 * 0x08, VpllPullDownEna
2536 * 0x10, VdmicDisch
2537 */
2538 REG_INIT(AB8540_REGUCTRLDISCH2, 0x04, 0x44, 0x1e),
2539 /*
2540 * 0x01, Vaux4Disch
2541 */
2542 REG_INIT(AB8540_REGUCTRLDISCH3, 0x04, 0x48, 0x01),
2543 /*
2544 * 0x01, Vaux5Disch
2545 * 0x02, Vaux6Disch
2546 * 0x04, VCLKBDisch
2547 */
2548 REG_INIT(AB8540_REGUCTRLDISCH4, 0x04, 0x49, 0x07),
2549};
2550
Lee Jones3c1b8432013-03-21 15:59:01 +00002551static int ab8500_regulator_init_registers(struct platform_device *pdev,
Lee Jonesb54969a2013-03-28 16:11:10 +00002552 struct ab8500_reg_init *reg_init,
Lee Jones3c1b8432013-03-21 15:59:01 +00002553 int id, int mask, int value)
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002554{
2555 int err;
2556
Lee Jones3c1b8432013-03-21 15:59:01 +00002557 BUG_ON(value & ~mask);
Lee Jonesb54969a2013-03-28 16:11:10 +00002558 BUG_ON(mask & ~reg_init[id].mask);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002559
Lee Jones3c1b8432013-03-21 15:59:01 +00002560 /* initialize register */
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002561 err = abx500_mask_and_set_register_interruptible(
2562 &pdev->dev,
Lee Jonesb54969a2013-03-28 16:11:10 +00002563 reg_init[id].bank,
2564 reg_init[id].addr,
Lee Jones3c1b8432013-03-21 15:59:01 +00002565 mask, value);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002566 if (err < 0) {
2567 dev_err(&pdev->dev,
2568 "Failed to initialize 0x%02x, 0x%02x.\n",
Lee Jonesb54969a2013-03-28 16:11:10 +00002569 reg_init[id].bank,
2570 reg_init[id].addr);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002571 return err;
2572 }
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002573 dev_vdbg(&pdev->dev,
Lee Jones3c1b8432013-03-21 15:59:01 +00002574 " init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
Lee Jonesb54969a2013-03-28 16:11:10 +00002575 reg_init[id].bank,
2576 reg_init[id].addr,
Lee Jones3c1b8432013-03-21 15:59:01 +00002577 mask, value);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002578
2579 return 0;
2580}
2581
Bill Pembertona5023572012-11-19 13:22:22 -05002582static int ab8500_regulator_register(struct platform_device *pdev,
Lee Jonesb54969a2013-03-28 16:11:10 +00002583 struct regulator_init_data *init_data,
2584 struct ab8500_regulator_info *regulator_info,
2585 int id, struct device_node *np)
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002586{
Lee Jones8e6a8d72013-03-28 16:11:11 +00002587 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002588 struct ab8500_regulator_info *info = NULL;
2589 struct regulator_config config = { };
2590 int err;
2591
2592 /* assign per-regulator data */
Lee Jonesb54969a2013-03-28 16:11:10 +00002593 info = &regulator_info[id];
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002594 info->dev = &pdev->dev;
2595
2596 config.dev = &pdev->dev;
2597 config.init_data = init_data;
2598 config.driver_data = info;
2599 config.of_node = np;
2600
2601 /* fix for hardware before ab8500v2.0 */
Lee Jones8e6a8d72013-03-28 16:11:11 +00002602 if (is_ab8500_1p1_or_earlier(ab8500)) {
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002603 if (info->desc.id == AB8500_LDO_AUX3) {
2604 info->desc.n_voltages =
2605 ARRAY_SIZE(ldo_vauxn_voltages);
Axel Linec1cc4d2012-05-20 10:33:35 +08002606 info->desc.volt_table = ldo_vauxn_voltages;
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002607 info->voltage_mask = 0xf;
2608 }
2609 }
2610
2611 /* register regulator with framework */
2612 info->regulator = regulator_register(&info->desc, &config);
2613 if (IS_ERR(info->regulator)) {
2614 err = PTR_ERR(info->regulator);
2615 dev_err(&pdev->dev, "failed to register regulator %s\n",
2616 info->desc.name);
2617 /* when we fail, un-register all earlier regulators */
2618 while (--id >= 0) {
Lee Jonesb54969a2013-03-28 16:11:10 +00002619 info = &regulator_info[id];
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002620 regulator_unregister(info->regulator);
2621 }
2622 return err;
2623 }
2624
2625 return 0;
2626}
2627
Lee Jonesb54969a2013-03-28 16:11:10 +00002628static struct of_regulator_match ab8500_regulator_match[] = {
Lee Jones7e715b92012-05-30 12:47:26 +08002629 { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8500_LDO_AUX1, },
2630 { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8500_LDO_AUX2, },
2631 { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8500_LDO_AUX3, },
2632 { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8500_LDO_INTCORE, },
2633 { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, },
Lee Jones7e715b92012-05-30 12:47:26 +08002634 { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, },
2635 { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, },
2636 { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, },
2637 { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, },
2638 { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, },
Lee Jones3a8334b2012-05-17 14:45:16 +01002639};
2640
Lee Jones547f3842013-03-28 16:11:14 +00002641static struct of_regulator_match ab8505_regulator_match[] = {
2642 { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8505_LDO_AUX1, },
2643 { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8505_LDO_AUX2, },
2644 { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8505_LDO_AUX3, },
2645 { .name = "ab8500_ldo_aux4", .driver_data = (void *) AB8505_LDO_AUX4, },
2646 { .name = "ab8500_ldo_aux5", .driver_data = (void *) AB8505_LDO_AUX5, },
2647 { .name = "ab8500_ldo_aux6", .driver_data = (void *) AB8505_LDO_AUX6, },
2648 { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8505_LDO_INTCORE, },
2649 { .name = "ab8500_ldo_adc", .driver_data = (void *) AB8505_LDO_ADC, },
2650 { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8505_LDO_AUDIO, },
2651 { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8505_LDO_ANAMIC1, },
2652 { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8505_LDO_ANAMIC2, },
2653 { .name = "ab8500_ldo_aux8", .driver_data = (void *) AB8505_LDO_AUX8, },
2654 { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8505_LDO_ANA, },
2655};
2656
Lee Jonesae0a9a32013-03-28 16:11:16 +00002657static struct of_regulator_match ab8540_regulator_match[] = {
2658 { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8540_LDO_AUX1, },
2659 { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8540_LDO_AUX2, },
2660 { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8540_LDO_AUX3, },
2661 { .name = "ab8500_ldo_aux4", .driver_data = (void *) AB8540_LDO_AUX4, },
2662 { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8540_LDO_INTCORE, },
2663 { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8540_LDO_TVOUT, },
2664 { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8540_LDO_AUDIO, },
2665 { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8540_LDO_ANAMIC1, },
2666 { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8540_LDO_ANAMIC2, },
2667 { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8540_LDO_DMIC, },
2668 { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8540_LDO_ANA, },
2669 { .name = "ab8500_ldo_sdio", .driver_data = (void *) AB8540_LDO_SDIO, },
2670};
2671
Lee Jones8e6a8d72013-03-28 16:11:11 +00002672static struct of_regulator_match ab9540_regulator_match[] = {
2673 { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB9540_LDO_AUX1, },
2674 { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB9540_LDO_AUX2, },
2675 { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB9540_LDO_AUX3, },
2676 { .name = "ab8500_ldo_aux4", .driver_data = (void *) AB9540_LDO_AUX4, },
2677 { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB9540_LDO_INTCORE, },
2678 { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB9540_LDO_TVOUT, },
2679 { .name = "ab8500_ldo_audio", .driver_data = (void *) AB9540_LDO_AUDIO, },
2680 { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB9540_LDO_ANAMIC1, },
2681 { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB9540_LDO_ANAMIC2, },
2682 { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB9540_LDO_DMIC, },
2683 { .name = "ab8500_ldo_ana", .driver_data = (void *) AB9540_LDO_ANA, },
2684};
2685
Bill Pembertona5023572012-11-19 13:22:22 -05002686static int
Lee Jonesb54969a2013-03-28 16:11:10 +00002687ab8500_regulator_of_probe(struct platform_device *pdev,
2688 struct ab8500_regulator_info *regulator_info,
2689 int regulator_info_size,
2690 struct of_regulator_match *match,
2691 struct device_node *np)
Lee Jones3a8334b2012-05-17 14:45:16 +01002692{
2693 int err, i;
2694
Lee Jonesb54969a2013-03-28 16:11:10 +00002695 for (i = 0; i < regulator_info_size; i++) {
Lee Jones3a8334b2012-05-17 14:45:16 +01002696 err = ab8500_regulator_register(
Lee Jonesb54969a2013-03-28 16:11:10 +00002697 pdev, match[i].init_data, regulator_info,
2698 i, match[i].of_node);
Lee Jones3a8334b2012-05-17 14:45:16 +01002699 if (err)
2700 return err;
2701 }
2702
2703 return 0;
2704}
2705
Bill Pembertona5023572012-11-19 13:22:22 -05002706static int ab8500_regulator_probe(struct platform_device *pdev)
Sundar R IYERc789ca22010-07-13 21:48:56 +05302707{
2708 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
Lee Jones3a8334b2012-05-17 14:45:16 +01002709 struct device_node *np = pdev->dev.of_node;
Lee Jonesb54969a2013-03-28 16:11:10 +00002710 struct of_regulator_match *match;
Bengt Jonsson732805a2013-03-21 15:59:03 +00002711 struct ab8500_platform_data *ppdata;
2712 struct ab8500_regulator_platform_data *pdata;
Sundar R IYERc789ca22010-07-13 21:48:56 +05302713 int i, err;
Lee Jonesb54969a2013-03-28 16:11:10 +00002714 struct ab8500_regulator_info *regulator_info;
2715 int regulator_info_size;
2716 struct ab8500_reg_init *reg_init;
2717 int reg_init_size;
2718
Lee Jones8e6a8d72013-03-28 16:11:11 +00002719 if (is_ab9540(ab8500)) {
2720 regulator_info = ab9540_regulator_info;
2721 regulator_info_size = ARRAY_SIZE(ab9540_regulator_info);
2722 reg_init = ab9540_reg_init;
2723 reg_init_size = AB9540_NUM_REGULATOR_REGISTERS;
2724 match = ab9540_regulator_match;
2725 match_size = ARRAY_SIZE(ab9540_regulator_match)
Lee Jones547f3842013-03-28 16:11:14 +00002726 } else if (is_ab8505(ab8500)) {
2727 regulator_info = ab8505_regulator_info;
2728 regulator_info_size = ARRAY_SIZE(ab8505_regulator_info);
2729 reg_init = ab8505_reg_init;
2730 reg_init_size = AB8505_NUM_REGULATOR_REGISTERS;
Lee Jonesae0a9a32013-03-28 16:11:16 +00002731 } else if (is_ab8540(ab8500)) {
2732 regulator_info = ab8540_regulator_info;
2733 regulator_info_size = ARRAY_SIZE(ab8540_regulator_info);
2734 reg_init = ab8540_reg_init;
2735 reg_init_size = AB8540_NUM_REGULATOR_REGISTERS;
Lee Jones8e6a8d72013-03-28 16:11:11 +00002736 } else {
2737 regulator_info = ab8500_regulator_info;
2738 regulator_info_size = ARRAY_SIZE(ab8500_regulator_info);
2739 reg_init = ab8500_reg_init;
2740 reg_init_size = AB8500_NUM_REGULATOR_REGISTERS;
2741 match = ab8500_regulator_match;
2742 match_size = ARRAY_SIZE(ab8500_regulator_match)
2743 }
Sundar R IYERc789ca22010-07-13 21:48:56 +05302744
Lee Jones3a8334b2012-05-17 14:45:16 +01002745 if (np) {
Lee Jonesb54969a2013-03-28 16:11:10 +00002746 err = of_regulator_match(&pdev->dev, np, match, match_size);
Lee Jones3a8334b2012-05-17 14:45:16 +01002747 if (err < 0) {
2748 dev_err(&pdev->dev,
2749 "Error parsing regulator init data: %d\n", err);
2750 return err;
2751 }
2752
Lee Jonesb54969a2013-03-28 16:11:10 +00002753 err = ab8500_regulator_of_probe(pdev, regulator_info,
2754 regulator_info_size, match, np);
Lee Jones3a8334b2012-05-17 14:45:16 +01002755 return err;
2756 }
2757
Sundar R IYERc789ca22010-07-13 21:48:56 +05302758 if (!ab8500) {
2759 dev_err(&pdev->dev, "null mfd parent\n");
2760 return -EINVAL;
2761 }
Bengt Jonsson732805a2013-03-21 15:59:03 +00002762
2763 ppdata = dev_get_platdata(ab8500->dev);
2764 if (!ppdata) {
2765 dev_err(&pdev->dev, "null parent pdata\n");
2766 return -EINVAL;
2767 }
2768
2769 pdata = ppdata->regulator;
Bengt Jonssonfc24b422010-12-10 11:08:45 +01002770 if (!pdata) {
2771 dev_err(&pdev->dev, "null pdata\n");
2772 return -EINVAL;
2773 }
Sundar R IYERc789ca22010-07-13 21:48:56 +05302774
Bengt Jonssoncb189b02010-12-10 11:08:40 +01002775 /* make sure the platform data has the correct size */
Lee Jonesb54969a2013-03-28 16:11:10 +00002776 if (pdata->num_regulator != regulator_info_size) {
Bengt Jonsson79568b942011-03-11 11:54:46 +01002777 dev_err(&pdev->dev, "Configuration error: size mismatch.\n");
Bengt Jonssoncb189b02010-12-10 11:08:40 +01002778 return -EINVAL;
2779 }
2780
Lee Jonesda0b0c42013-03-28 16:11:09 +00002781 /* initialize debug (initial state is recorded with this call) */
2782 err = ab8500_regulator_debug_init(pdev);
2783 if (err)
2784 return err;
2785
Bengt Jonsson79568b942011-03-11 11:54:46 +01002786 /* initialize registers */
Bengt Jonsson732805a2013-03-21 15:59:03 +00002787 for (i = 0; i < pdata->num_reg_init; i++) {
Lee Jones3c1b8432013-03-21 15:59:01 +00002788 int id, mask, value;
Bengt Jonsson79568b942011-03-11 11:54:46 +01002789
Bengt Jonsson732805a2013-03-21 15:59:03 +00002790 id = pdata->reg_init[i].id;
2791 mask = pdata->reg_init[i].mask;
2792 value = pdata->reg_init[i].value;
Bengt Jonsson79568b942011-03-11 11:54:46 +01002793
2794 /* check for configuration errors */
Lee Jones3c1b8432013-03-21 15:59:01 +00002795 BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS);
Bengt Jonsson79568b942011-03-11 11:54:46 +01002796
Lee Jonesb54969a2013-03-28 16:11:10 +00002797 err = ab8500_regulator_init_registers(pdev, reg_init, id, mask, value);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002798 if (err < 0)
Bengt Jonsson79568b942011-03-11 11:54:46 +01002799 return err;
Bengt Jonsson79568b942011-03-11 11:54:46 +01002800 }
2801
Lee Jonesd1a82002013-03-28 16:11:01 +00002802 /* register external regulators (before Vaux1, 2 and 3) */
2803 err = ab8500_ext_regulator_init(pdev);
2804 if (err)
2805 return err;
2806
Sundar R IYERc789ca22010-07-13 21:48:56 +05302807 /* register all regulators */
Lee Jonesb54969a2013-03-28 16:11:10 +00002808 for (i = 0; i < regulator_info_size; i++) {
2809 err = ab8500_regulator_register(pdev, &pdata->regulator[i],
2810 regulator_info, i, NULL);
Lee Jonesa7ac1d92012-05-17 14:45:14 +01002811 if (err < 0)
Sundar R IYERc789ca22010-07-13 21:48:56 +05302812 return err;
Sundar R IYERc789ca22010-07-13 21:48:56 +05302813 }
2814
2815 return 0;
2816}
2817
Bill Pemberton8dc995f2012-11-19 13:26:10 -05002818static int ab8500_regulator_remove(struct platform_device *pdev)
Sundar R IYERc789ca22010-07-13 21:48:56 +05302819{
Lee Jonesd1a82002013-03-28 16:11:01 +00002820 int i, err;
Lee Jones8e6a8d72013-03-28 16:11:11 +00002821 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
Lee Jonesb54969a2013-03-28 16:11:10 +00002822 struct ab8500_regulator_info *regulator_info;
2823 int regulator_info_size;
Sundar R IYERc789ca22010-07-13 21:48:56 +05302824
Lee Jones8e6a8d72013-03-28 16:11:11 +00002825
2826 if (is_ab9540(ab8500)) {
2827 regulator_info = ab9540_regulator_info;
2828 regulator_info_size = ARRAY_SIZE(ab9540_regulator_info);
Lee Jones547f3842013-03-28 16:11:14 +00002829 } else if (is_ab8505(ab8500)) {
2830 regulator_info = ab8505_regulator_info;
2831 regulator_info_size = ARRAY_SIZE(ab8505_regulator_info);
Lee Jones8e6a8d72013-03-28 16:11:11 +00002832 } else {
2833 regulator_info = ab8500_regulator_info;
2834 regulator_info_size = ARRAY_SIZE(ab8500_regulator_info);
2835 }
Lee Jonesb54969a2013-03-28 16:11:10 +00002836
2837 for (i = 0; i < regulator_info_size; i++) {
Sundar R IYERc789ca22010-07-13 21:48:56 +05302838 struct ab8500_regulator_info *info = NULL;
Lee Jonesb54969a2013-03-28 16:11:10 +00002839 info = &regulator_info[i];
Bengt Jonsson09aefa12010-12-10 11:08:46 +01002840
2841 dev_vdbg(rdev_get_dev(info->regulator),
2842 "%s-remove\n", info->desc.name);
2843
Sundar R IYERc789ca22010-07-13 21:48:56 +05302844 regulator_unregister(info->regulator);
2845 }
2846
Lee Jonesd1a82002013-03-28 16:11:01 +00002847 /* remove external regulators (after Vaux1, 2 and 3) */
2848 err = ab8500_ext_regulator_exit(pdev);
2849 if (err)
2850 return err;
2851
Lee Jonesda0b0c42013-03-28 16:11:09 +00002852 /* remove regulator debug */
2853 err = ab8500_regulator_debug_exit(pdev);
2854 if (err)
2855 return err;
2856
Sundar R IYERc789ca22010-07-13 21:48:56 +05302857 return 0;
2858}
2859
2860static struct platform_driver ab8500_regulator_driver = {
2861 .probe = ab8500_regulator_probe,
Bill Pemberton5eb9f2b2012-11-19 13:20:42 -05002862 .remove = ab8500_regulator_remove,
Sundar R IYERc789ca22010-07-13 21:48:56 +05302863 .driver = {
2864 .name = "ab8500-regulator",
2865 .owner = THIS_MODULE,
Sundar R IYERc789ca22010-07-13 21:48:56 +05302866 },
2867};
2868
2869static int __init ab8500_regulator_init(void)
2870{
2871 int ret;
2872
2873 ret = platform_driver_register(&ab8500_regulator_driver);
2874 if (ret != 0)
2875 pr_err("Failed to register ab8500 regulator: %d\n", ret);
2876
2877 return ret;
2878}
2879subsys_initcall(ab8500_regulator_init);
2880
2881static void __exit ab8500_regulator_exit(void)
2882{
2883 platform_driver_unregister(&ab8500_regulator_driver);
2884}
2885module_exit(ab8500_regulator_exit);
2886
2887MODULE_LICENSE("GPL v2");
2888MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>");
Bengt Jonsson732805a2013-03-21 15:59:03 +00002889MODULE_AUTHOR("Bengt Jonsson <bengt.g.jonsson@stericsson.com>");
Lee Jones547f3842013-03-28 16:11:14 +00002890MODULE_AUTHOR("Daniel Willerud <daniel.willerud@stericsson.com>");
Sundar R IYERc789ca22010-07-13 21:48:56 +05302891MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC");
2892MODULE_ALIAS("platform:ab8500-regulator");