blob: 2a15b6300e1804c3a5340d2931598b31b8344ffb [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
Sundar R IYERc789ca22010-07-13 21:48:56 +05308 *
9 * AB8500 peripheral regulators
10 *
Bengt Jonssone1159e62010-12-10 11:08:44 +010011 * AB8500 supports the following regulators:
12 * VAUX1/2/3, VINTCORE, VTVOUT, VAUDIO, VAMIC1/2, VDMIC, VANA
Sundar R IYERc789ca22010-07-13 21:48:56 +053013 */
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/err.h>
17#include <linux/platform_device.h>
18#include <linux/mfd/ab8500.h>
Mattias Wallin47c16972010-09-10 17:47:56 +020019#include <linux/mfd/abx500.h>
Sundar R IYERc789ca22010-07-13 21:48:56 +053020#include <linux/regulator/driver.h>
21#include <linux/regulator/machine.h>
22#include <linux/regulator/ab8500.h>
23
24/**
25 * struct ab8500_regulator_info - ab8500 regulator information
Bengt Jonssone1159e62010-12-10 11:08:44 +010026 * @dev: device pointer
Sundar R IYERc789ca22010-07-13 21:48:56 +053027 * @desc: regulator description
Sundar R IYERc789ca22010-07-13 21:48:56 +053028 * @regulator_dev: regulator device
29 * @max_uV: maximum voltage (for variable voltage supplies)
30 * @min_uV: minimum voltage (for variable voltage supplies)
31 * @fixed_uV: typical voltage (for fixed voltage supplies)
Mattias Wallin47c16972010-09-10 17:47:56 +020032 * @update_bank: bank to control on/off
Sundar R IYERc789ca22010-07-13 21:48:56 +053033 * @update_reg: register to control on/off
Bengt Jonssone1159e62010-12-10 11:08:44 +010034 * @update_mask: mask to enable/disable regulator
35 * @update_val_enable: bits to enable the regulator in normal (high power) mode
Mattias Wallin47c16972010-09-10 17:47:56 +020036 * @voltage_bank: bank to control regulator voltage
Sundar R IYERc789ca22010-07-13 21:48:56 +053037 * @voltage_reg: register to control regulator voltage
38 * @voltage_mask: mask to control regulator voltage
Bengt Jonssone1159e62010-12-10 11:08:44 +010039 * @voltages: supported voltage table
Sundar R IYERc789ca22010-07-13 21:48:56 +053040 * @voltages_len: number of supported voltages for the regulator
41 */
42struct ab8500_regulator_info {
43 struct device *dev;
44 struct regulator_desc desc;
Sundar R IYERc789ca22010-07-13 21:48:56 +053045 struct regulator_dev *regulator;
46 int max_uV;
47 int min_uV;
48 int fixed_uV;
Mattias Wallin47c16972010-09-10 17:47:56 +020049 u8 update_bank;
50 u8 update_reg;
Bengt Jonssone1159e62010-12-10 11:08:44 +010051 u8 update_mask;
52 u8 update_val_enable;
Mattias Wallin47c16972010-09-10 17:47:56 +020053 u8 voltage_bank;
54 u8 voltage_reg;
55 u8 voltage_mask;
Bengt Jonssone1159e62010-12-10 11:08:44 +010056 int const *voltages;
Sundar R IYERc789ca22010-07-13 21:48:56 +053057 int voltages_len;
58};
59
60/* voltage tables for the vauxn/vintcore supplies */
61static const int ldo_vauxn_voltages[] = {
62 1100000,
63 1200000,
64 1300000,
65 1400000,
66 1500000,
67 1800000,
68 1850000,
69 1900000,
70 2500000,
71 2650000,
72 2700000,
73 2750000,
74 2800000,
75 2900000,
76 3000000,
77 3300000,
78};
79
Bengt Jonsson2b751512010-12-10 11:08:43 +010080static const int ldo_vaux3_voltages[] = {
81 1200000,
82 1500000,
83 1800000,
84 2100000,
85 2500000,
86 2750000,
87 2790000,
88 2910000,
89};
90
Sundar R IYERc789ca22010-07-13 21:48:56 +053091static const int ldo_vintcore_voltages[] = {
92 1200000,
93 1225000,
94 1250000,
95 1275000,
96 1300000,
97 1325000,
98 1350000,
99};
100
101static int ab8500_regulator_enable(struct regulator_dev *rdev)
102{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100103 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530104 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
105
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100106 if (info == NULL) {
107 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530108 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100109 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530110
Mattias Wallin47c16972010-09-10 17:47:56 +0200111 ret = abx500_mask_and_set_register_interruptible(info->dev,
Bengt Jonssone1159e62010-12-10 11:08:44 +0100112 info->update_bank, info->update_reg,
113 info->update_mask, info->update_val_enable);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530114 if (ret < 0)
115 dev_err(rdev_get_dev(rdev),
116 "couldn't set enable bits for regulator\n");
117 return ret;
118}
119
120static int ab8500_regulator_disable(struct regulator_dev *rdev)
121{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100122 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530123 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
124
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100125 if (info == NULL) {
126 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530127 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100128 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530129
Mattias Wallin47c16972010-09-10 17:47:56 +0200130 ret = abx500_mask_and_set_register_interruptible(info->dev,
Bengt Jonssone1159e62010-12-10 11:08:44 +0100131 info->update_bank, info->update_reg,
132 info->update_mask, 0x0);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530133 if (ret < 0)
134 dev_err(rdev_get_dev(rdev),
135 "couldn't set disable bits for regulator\n");
136 return ret;
137}
138
139static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
140{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100141 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530142 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
Mattias Wallin47c16972010-09-10 17:47:56 +0200143 u8 value;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530144
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100145 if (info == NULL) {
146 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530147 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100148 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530149
Mattias Wallin47c16972010-09-10 17:47:56 +0200150 ret = abx500_get_register_interruptible(info->dev,
151 info->update_bank, info->update_reg, &value);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530152 if (ret < 0) {
153 dev_err(rdev_get_dev(rdev),
154 "couldn't read 0x%x register\n", info->update_reg);
155 return ret;
156 }
157
Bengt Jonssone1159e62010-12-10 11:08:44 +0100158 if (value & info->update_mask)
Sundar R IYERc789ca22010-07-13 21:48:56 +0530159 return true;
160 else
161 return false;
162}
163
164static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
165{
Sundar R IYERc789ca22010-07-13 21:48:56 +0530166 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
167
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100168 if (info == NULL) {
169 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530170 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100171 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530172
173 /* return the uV for the fixed regulators */
174 if (info->fixed_uV)
175 return info->fixed_uV;
176
Axel Lin49990e62010-09-04 23:06:41 +0800177 if (selector >= info->voltages_len)
Sundar R IYERc789ca22010-07-13 21:48:56 +0530178 return -EINVAL;
179
Bengt Jonssone1159e62010-12-10 11:08:44 +0100180 return info->voltages[selector];
Sundar R IYERc789ca22010-07-13 21:48:56 +0530181}
182
183static int ab8500_regulator_get_voltage(struct regulator_dev *rdev)
184{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100185 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530186 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
Mattias Wallin47c16972010-09-10 17:47:56 +0200187 u8 value;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530188
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100189 if (info == NULL) {
190 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530191 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100192 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530193
Mattias Wallin47c16972010-09-10 17:47:56 +0200194 ret = abx500_get_register_interruptible(info->dev, info->voltage_bank,
195 info->voltage_reg, &value);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530196 if (ret < 0) {
197 dev_err(rdev_get_dev(rdev),
198 "couldn't read voltage reg for regulator\n");
199 return ret;
200 }
201
202 /* vintcore has a different layout */
Mattias Wallin47c16972010-09-10 17:47:56 +0200203 value &= info->voltage_mask;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100204 if (info->desc.id == AB8500_LDO_INTCORE)
Bengt Jonssone1159e62010-12-10 11:08:44 +0100205 ret = info->voltages[value >> 0x3];
Sundar R IYERc789ca22010-07-13 21:48:56 +0530206 else
Bengt Jonssone1159e62010-12-10 11:08:44 +0100207 ret = info->voltages[value];
Sundar R IYERc789ca22010-07-13 21:48:56 +0530208
209 return ret;
210}
211
212static int ab8500_get_best_voltage_index(struct regulator_dev *rdev,
213 int min_uV, int max_uV)
214{
215 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
216 int i;
217
218 /* check the supported voltage */
219 for (i = 0; i < info->voltages_len; i++) {
Bengt Jonssone1159e62010-12-10 11:08:44 +0100220 if ((info->voltages[i] >= min_uV) &&
221 (info->voltages[i] <= max_uV))
Sundar R IYERc789ca22010-07-13 21:48:56 +0530222 return i;
223 }
224
225 return -EINVAL;
226}
227
228static int ab8500_regulator_set_voltage(struct regulator_dev *rdev,
Mark Brown3a93f2a2010-11-10 14:38:29 +0000229 int min_uV, int max_uV,
230 unsigned *selector)
Sundar R IYERc789ca22010-07-13 21:48:56 +0530231{
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100232 int ret;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530233 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
234
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100235 if (info == NULL) {
236 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530237 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100238 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530239
240 /* get the appropriate voltages within the range */
241 ret = ab8500_get_best_voltage_index(rdev, min_uV, max_uV);
242 if (ret < 0) {
243 dev_err(rdev_get_dev(rdev),
244 "couldn't get best voltage for regulator\n");
245 return ret;
246 }
247
Mark Brown3a93f2a2010-11-10 14:38:29 +0000248 *selector = ret;
249
Sundar R IYERc789ca22010-07-13 21:48:56 +0530250 /* set the registers for the request */
Mattias Wallin47c16972010-09-10 17:47:56 +0200251 ret = abx500_mask_and_set_register_interruptible(info->dev,
252 info->voltage_bank, info->voltage_reg,
253 info->voltage_mask, (u8)ret);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530254 if (ret < 0)
255 dev_err(rdev_get_dev(rdev),
256 "couldn't set voltage reg for regulator\n");
257
258 return ret;
259}
260
261static struct regulator_ops ab8500_regulator_ops = {
262 .enable = ab8500_regulator_enable,
263 .disable = ab8500_regulator_disable,
264 .is_enabled = ab8500_regulator_is_enabled,
265 .get_voltage = ab8500_regulator_get_voltage,
266 .set_voltage = ab8500_regulator_set_voltage,
267 .list_voltage = ab8500_list_voltage,
268};
269
270static int ab8500_fixed_get_voltage(struct regulator_dev *rdev)
271{
Sundar R IYERc789ca22010-07-13 21:48:56 +0530272 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
273
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100274 if (info == NULL) {
275 dev_err(rdev_get_dev(rdev), "regulator info null pointer\n");
Sundar R IYERc789ca22010-07-13 21:48:56 +0530276 return -EINVAL;
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100277 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530278
279 return info->fixed_uV;
280}
281
282static struct regulator_ops ab8500_ldo_fixed_ops = {
283 .enable = ab8500_regulator_enable,
284 .disable = ab8500_regulator_disable,
285 .is_enabled = ab8500_regulator_is_enabled,
286 .get_voltage = ab8500_fixed_get_voltage,
287 .list_voltage = ab8500_list_voltage,
288};
289
Bengt Jonssone1159e62010-12-10 11:08:44 +0100290#define AB8500_LDO(_id, _min_mV, _max_mV, \
291 _u_bank, _u_reg, _u_mask, _u_val_enable, \
292 _v_bank, _v_reg, _v_mask, _v_table, _v_table_len) \
293[AB8500_LDO_##_id] = { \
Sundar R IYERc789ca22010-07-13 21:48:56 +0530294 .desc = { \
Bengt Jonssone1159e62010-12-10 11:08:44 +0100295 .name = "LDO-" #_id, \
296 .ops = &ab8500_regulator_ops, \
297 .type = REGULATOR_VOLTAGE, \
298 .id = AB8500_LDO_##_id, \
299 .owner = THIS_MODULE, \
Sundar R IYERc789ca22010-07-13 21:48:56 +0530300 }, \
Bengt Jonssone1159e62010-12-10 11:08:44 +0100301 .min_uV = (_min_mV) * 1000, \
302 .max_uV = (_max_mV) * 1000, \
303 .update_bank = _u_bank, \
304 .update_reg = _u_reg, \
305 .update_mask = _u_mask, \
306 .update_val_enable = _u_val_enable, \
307 .voltage_bank = _v_bank, \
308 .voltage_reg = _v_reg, \
309 .voltage_mask = _v_mask, \
310 .voltages = _v_table, \
311 .voltages_len = _v_table_len, \
312 .fixed_uV = 0, \
Sundar R IYERc789ca22010-07-13 21:48:56 +0530313}
314
Bengt Jonssone1159e62010-12-10 11:08:44 +0100315#define AB8500_FIXED_LDO(_id, _fixed_mV, \
316 _u_bank, _u_reg, _u_mask, _u_val_enable) \
317[AB8500_LDO_##_id] = { \
318 .desc = { \
319 .name = "LDO-" #_id, \
320 .ops = &ab8500_ldo_fixed_ops, \
321 .type = REGULATOR_VOLTAGE, \
322 .id = AB8500_LDO_##_id, \
323 .owner = THIS_MODULE, \
324 }, \
325 .fixed_uV = (_fixed_mV) * 1000, \
326 .update_bank = _u_bank, \
327 .update_reg = _u_reg, \
328 .update_mask = _u_mask, \
329 .update_val_enable = _u_val_enable, \
Sundar R IYERc789ca22010-07-13 21:48:56 +0530330}
331
332static struct ab8500_regulator_info ab8500_regulator_info[] = {
333 /*
Bengt Jonssone1159e62010-12-10 11:08:44 +0100334 * Variable Voltage Regulators
335 * name, min mV, max mV,
336 * update bank, reg, mask, enable val
337 * volt bank, reg, mask, table, table length
Sundar R IYERc789ca22010-07-13 21:48:56 +0530338 */
Bengt Jonssone1159e62010-12-10 11:08:44 +0100339 AB8500_LDO(AUX1, 1100, 3300,
340 0x04, 0x09, 0x03, 0x01, 0x04, 0x1f, 0x0f,
341 ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)),
342 AB8500_LDO(AUX2, 1100, 3300,
343 0x04, 0x09, 0x0c, 0x04, 0x04, 0x20, 0x0f,
344 ldo_vauxn_voltages, ARRAY_SIZE(ldo_vauxn_voltages)),
345 AB8500_LDO(AUX3, 1100, 3300,
346 0x04, 0x0a, 0x03, 0x01, 0x04, 0x21, 0x07,
347 ldo_vaux3_voltages, ARRAY_SIZE(ldo_vaux3_voltages)),
348 AB8500_LDO(INTCORE, 1100, 3300,
349 0x03, 0x80, 0x44, 0x04, 0x03, 0x80, 0x38,
Sundar R IYERc789ca22010-07-13 21:48:56 +0530350 ldo_vintcore_voltages, ARRAY_SIZE(ldo_vintcore_voltages)),
351
352 /*
Bengt Jonssone1159e62010-12-10 11:08:44 +0100353 * Fixed Voltage Regulators
354 * name, fixed mV,
355 * update bank, reg, mask, enable val
Sundar R IYERc789ca22010-07-13 21:48:56 +0530356 */
Bengt Jonssone1159e62010-12-10 11:08:44 +0100357 AB8500_FIXED_LDO(TVOUT, 2000, 0x03, 0x80, 0x82, 0x02),
358 AB8500_FIXED_LDO(AUDIO, 2000, 0x03, 0x83, 0x02, 0x02),
359 AB8500_FIXED_LDO(ANAMIC1, 2050, 0x03, 0x83, 0x08, 0x08),
360 AB8500_FIXED_LDO(ANAMIC2, 2050, 0x03, 0x83, 0x10, 0x10),
361 AB8500_FIXED_LDO(DMIC, 1800, 0x03, 0x83, 0x04, 0x04),
362 AB8500_FIXED_LDO(ANA, 1200, 0x04, 0x06, 0x0c, 0x04),
Sundar R IYERc789ca22010-07-13 21:48:56 +0530363};
364
Sundar R IYERc789ca22010-07-13 21:48:56 +0530365static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
366{
367 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
Dan Carpenteraf54dec2010-08-14 11:03:16 +0200368 struct ab8500_platform_data *pdata;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530369 int i, err;
370
371 if (!ab8500) {
372 dev_err(&pdev->dev, "null mfd parent\n");
373 return -EINVAL;
374 }
Dan Carpenteraf54dec2010-08-14 11:03:16 +0200375 pdata = dev_get_platdata(ab8500->dev);
Bengt Jonssonfc24b422010-12-10 11:08:45 +0100376 if (!pdata) {
377 dev_err(&pdev->dev, "null pdata\n");
378 return -EINVAL;
379 }
Sundar R IYERc789ca22010-07-13 21:48:56 +0530380
Bengt Jonssoncb189b02010-12-10 11:08:40 +0100381 /* make sure the platform data has the correct size */
382 if (pdata->num_regulator != ARRAY_SIZE(ab8500_regulator_info)) {
383 dev_err(&pdev->dev, "platform configuration error\n");
384 return -EINVAL;
385 }
386
Sundar R IYERc789ca22010-07-13 21:48:56 +0530387 /* register all regulators */
388 for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
389 struct ab8500_regulator_info *info = NULL;
390
391 /* assign per-regulator data */
392 info = &ab8500_regulator_info[i];
393 info->dev = &pdev->dev;
Sundar R IYERc789ca22010-07-13 21:48:56 +0530394
Bengt Jonsson2b751512010-12-10 11:08:43 +0100395 /* fix for hardware before ab8500v2.0 */
396 if (abx500_get_chip_id(info->dev) < 0x20) {
397 if (info->desc.id == AB8500_LDO_AUX3) {
398 info->desc.n_voltages =
399 ARRAY_SIZE(ldo_vauxn_voltages);
Bengt Jonssone1159e62010-12-10 11:08:44 +0100400 info->voltages = ldo_vauxn_voltages;
Bengt Jonsson2b751512010-12-10 11:08:43 +0100401 info->voltages_len =
402 ARRAY_SIZE(ldo_vauxn_voltages);
403 info->voltage_mask = 0xf;
404 }
405 }
406
407 /* register regulator with framework */
Sundar R IYERc789ca22010-07-13 21:48:56 +0530408 info->regulator = regulator_register(&info->desc, &pdev->dev,
Bengt Jonssoncb189b02010-12-10 11:08:40 +0100409 &pdata->regulator[i], info);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530410 if (IS_ERR(info->regulator)) {
411 err = PTR_ERR(info->regulator);
412 dev_err(&pdev->dev, "failed to register regulator %s\n",
413 info->desc.name);
414 /* when we fail, un-register all earlier regulators */
Axel Lind4876a32010-08-14 21:44:04 +0800415 while (--i >= 0) {
Sundar R IYERc789ca22010-07-13 21:48:56 +0530416 info = &ab8500_regulator_info[i];
417 regulator_unregister(info->regulator);
Sundar R IYERc789ca22010-07-13 21:48:56 +0530418 }
419 return err;
420 }
421 }
422
423 return 0;
424}
425
426static __devexit int ab8500_regulator_remove(struct platform_device *pdev)
427{
428 int i;
429
430 for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
431 struct ab8500_regulator_info *info = NULL;
432 info = &ab8500_regulator_info[i];
433 regulator_unregister(info->regulator);
434 }
435
436 return 0;
437}
438
439static struct platform_driver ab8500_regulator_driver = {
440 .probe = ab8500_regulator_probe,
441 .remove = __devexit_p(ab8500_regulator_remove),
442 .driver = {
443 .name = "ab8500-regulator",
444 .owner = THIS_MODULE,
445 },
446};
447
448static int __init ab8500_regulator_init(void)
449{
450 int ret;
451
452 ret = platform_driver_register(&ab8500_regulator_driver);
453 if (ret != 0)
454 pr_err("Failed to register ab8500 regulator: %d\n", ret);
455
456 return ret;
457}
458subsys_initcall(ab8500_regulator_init);
459
460static void __exit ab8500_regulator_exit(void)
461{
462 platform_driver_unregister(&ab8500_regulator_driver);
463}
464module_exit(ab8500_regulator_exit);
465
466MODULE_LICENSE("GPL v2");
467MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>");
468MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC");
469MODULE_ALIAS("platform:ab8500-regulator");