PM / sleep: Asynchronous threads for suspend_noirq
[linux/fpc-iii.git] / drivers / regulator / wm831x-ldo.c
blob46d6700467b57007fbb277283207cfbbc4456fc0
1 /*
2 * wm831x-ldo.c -- LDO driver for the WM831x series
4 * Copyright 2009 Wolfson Microelectronics PLC.
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
14 #include <linux/module.h>
15 #include <linux/moduleparam.h>
16 #include <linux/init.h>
17 #include <linux/bitops.h>
18 #include <linux/err.h>
19 #include <linux/i2c.h>
20 #include <linux/platform_device.h>
21 #include <linux/regulator/driver.h>
22 #include <linux/slab.h>
24 #include <linux/mfd/wm831x/core.h>
25 #include <linux/mfd/wm831x/regulator.h>
26 #include <linux/mfd/wm831x/pdata.h>
28 #define WM831X_LDO_MAX_NAME 9
30 #define WM831X_LDO_CONTROL 0
31 #define WM831X_LDO_ON_CONTROL 1
32 #define WM831X_LDO_SLEEP_CONTROL 2
34 #define WM831X_ALIVE_LDO_ON_CONTROL 0
35 #define WM831X_ALIVE_LDO_SLEEP_CONTROL 1
37 struct wm831x_ldo {
38 char name[WM831X_LDO_MAX_NAME];
39 char supply_name[WM831X_LDO_MAX_NAME];
40 struct regulator_desc desc;
41 int base;
42 struct wm831x *wm831x;
43 struct regulator_dev *regulator;
47 * Shared
50 static irqreturn_t wm831x_ldo_uv_irq(int irq, void *data)
52 struct wm831x_ldo *ldo = data;
54 regulator_notifier_call_chain(ldo->regulator,
55 REGULATOR_EVENT_UNDER_VOLTAGE,
56 NULL);
58 return IRQ_HANDLED;
62 * General purpose LDOs
65 static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = {
66 REGULATOR_LINEAR_RANGE(900000, 0, 14, 50000),
67 REGULATOR_LINEAR_RANGE(1700000, 15, 31, 100000),
70 static int wm831x_gp_ldo_set_suspend_voltage(struct regulator_dev *rdev,
71 int uV)
73 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
74 struct wm831x *wm831x = ldo->wm831x;
75 int sel, reg = ldo->base + WM831X_LDO_SLEEP_CONTROL;
77 sel = regulator_map_voltage_linear_range(rdev, uV, uV);
78 if (sel < 0)
79 return sel;
81 return wm831x_set_bits(wm831x, reg, WM831X_LDO1_ON_VSEL_MASK, sel);
84 static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev)
86 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
87 struct wm831x *wm831x = ldo->wm831x;
88 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
89 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
90 int ret;
92 ret = wm831x_reg_read(wm831x, on_reg);
93 if (ret < 0)
94 return ret;
96 if (!(ret & WM831X_LDO1_ON_MODE))
97 return REGULATOR_MODE_NORMAL;
99 ret = wm831x_reg_read(wm831x, ctrl_reg);
100 if (ret < 0)
101 return ret;
103 if (ret & WM831X_LDO1_LP_MODE)
104 return REGULATOR_MODE_STANDBY;
105 else
106 return REGULATOR_MODE_IDLE;
109 static int wm831x_gp_ldo_set_mode(struct regulator_dev *rdev,
110 unsigned int mode)
112 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
113 struct wm831x *wm831x = ldo->wm831x;
114 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
115 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
116 int ret;
119 switch (mode) {
120 case REGULATOR_MODE_NORMAL:
121 ret = wm831x_set_bits(wm831x, on_reg,
122 WM831X_LDO1_ON_MODE, 0);
123 if (ret < 0)
124 return ret;
125 break;
127 case REGULATOR_MODE_IDLE:
128 ret = wm831x_set_bits(wm831x, ctrl_reg,
129 WM831X_LDO1_LP_MODE, 0);
130 if (ret < 0)
131 return ret;
133 ret = wm831x_set_bits(wm831x, on_reg,
134 WM831X_LDO1_ON_MODE,
135 WM831X_LDO1_ON_MODE);
136 if (ret < 0)
137 return ret;
138 break;
140 case REGULATOR_MODE_STANDBY:
141 ret = wm831x_set_bits(wm831x, ctrl_reg,
142 WM831X_LDO1_LP_MODE,
143 WM831X_LDO1_LP_MODE);
144 if (ret < 0)
145 return ret;
147 ret = wm831x_set_bits(wm831x, on_reg,
148 WM831X_LDO1_ON_MODE,
149 WM831X_LDO1_ON_MODE);
150 if (ret < 0)
151 return ret;
152 break;
154 default:
155 return -EINVAL;
158 return 0;
161 static int wm831x_gp_ldo_get_status(struct regulator_dev *rdev)
163 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
164 struct wm831x *wm831x = ldo->wm831x;
165 int mask = 1 << rdev_get_id(rdev);
166 int ret;
168 /* Is the regulator on? */
169 ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
170 if (ret < 0)
171 return ret;
172 if (!(ret & mask))
173 return REGULATOR_STATUS_OFF;
175 /* Is it reporting under voltage? */
176 ret = wm831x_reg_read(wm831x, WM831X_LDO_UV_STATUS);
177 if (ret < 0)
178 return ret;
179 if (ret & mask)
180 return REGULATOR_STATUS_ERROR;
182 ret = wm831x_gp_ldo_get_mode(rdev);
183 if (ret < 0)
184 return ret;
185 else
186 return regulator_mode_to_status(ret);
189 static unsigned int wm831x_gp_ldo_get_optimum_mode(struct regulator_dev *rdev,
190 int input_uV,
191 int output_uV, int load_uA)
193 if (load_uA < 20000)
194 return REGULATOR_MODE_STANDBY;
195 if (load_uA < 50000)
196 return REGULATOR_MODE_IDLE;
197 return REGULATOR_MODE_NORMAL;
201 static struct regulator_ops wm831x_gp_ldo_ops = {
202 .list_voltage = regulator_list_voltage_linear_range,
203 .map_voltage = regulator_map_voltage_linear_range,
204 .get_voltage_sel = regulator_get_voltage_sel_regmap,
205 .set_voltage_sel = regulator_set_voltage_sel_regmap,
206 .set_suspend_voltage = wm831x_gp_ldo_set_suspend_voltage,
207 .get_mode = wm831x_gp_ldo_get_mode,
208 .set_mode = wm831x_gp_ldo_set_mode,
209 .get_status = wm831x_gp_ldo_get_status,
210 .get_optimum_mode = wm831x_gp_ldo_get_optimum_mode,
211 .get_bypass = regulator_get_bypass_regmap,
212 .set_bypass = regulator_set_bypass_regmap,
214 .is_enabled = regulator_is_enabled_regmap,
215 .enable = regulator_enable_regmap,
216 .disable = regulator_disable_regmap,
219 static int wm831x_gp_ldo_probe(struct platform_device *pdev)
221 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
222 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
223 struct regulator_config config = { };
224 int id;
225 struct wm831x_ldo *ldo;
226 struct resource *res;
227 int ret, irq;
229 if (pdata && pdata->wm831x_num)
230 id = (pdata->wm831x_num * 10) + 1;
231 else
232 id = 0;
233 id = pdev->id - id;
235 dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
237 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
238 if (ldo == NULL) {
239 dev_err(&pdev->dev, "Unable to allocate private data\n");
240 return -ENOMEM;
243 ldo->wm831x = wm831x;
245 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
246 if (res == NULL) {
247 dev_err(&pdev->dev, "No REG resource\n");
248 ret = -EINVAL;
249 goto err;
251 ldo->base = res->start;
253 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
254 ldo->desc.name = ldo->name;
256 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
257 "LDO%dVDD", id + 1);
258 ldo->desc.supply_name = ldo->supply_name;
260 ldo->desc.id = id;
261 ldo->desc.type = REGULATOR_VOLTAGE;
262 ldo->desc.n_voltages = 32;
263 ldo->desc.ops = &wm831x_gp_ldo_ops;
264 ldo->desc.owner = THIS_MODULE;
265 ldo->desc.vsel_reg = ldo->base + WM831X_LDO_ON_CONTROL;
266 ldo->desc.vsel_mask = WM831X_LDO1_ON_VSEL_MASK;
267 ldo->desc.enable_reg = WM831X_LDO_ENABLE;
268 ldo->desc.enable_mask = 1 << id;
269 ldo->desc.bypass_reg = ldo->base;
270 ldo->desc.bypass_mask = WM831X_LDO1_SWI;
271 ldo->desc.linear_ranges = wm831x_gp_ldo_ranges;
272 ldo->desc.n_linear_ranges = ARRAY_SIZE(wm831x_gp_ldo_ranges);
274 config.dev = pdev->dev.parent;
275 if (pdata)
276 config.init_data = pdata->ldo[id];
277 config.driver_data = ldo;
278 config.regmap = wm831x->regmap;
280 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
281 &config);
282 if (IS_ERR(ldo->regulator)) {
283 ret = PTR_ERR(ldo->regulator);
284 dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
285 id + 1, ret);
286 goto err;
289 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
290 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
291 wm831x_ldo_uv_irq,
292 IRQF_TRIGGER_RISING, ldo->name,
293 ldo);
294 if (ret != 0) {
295 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
296 irq, ret);
297 goto err;
300 platform_set_drvdata(pdev, ldo);
302 return 0;
304 err:
305 return ret;
308 static struct platform_driver wm831x_gp_ldo_driver = {
309 .probe = wm831x_gp_ldo_probe,
310 .driver = {
311 .name = "wm831x-ldo",
312 .owner = THIS_MODULE,
317 * Analogue LDOs
320 static const struct regulator_linear_range wm831x_aldo_ranges[] = {
321 REGULATOR_LINEAR_RANGE(1000000, 0, 12, 50000),
322 REGULATOR_LINEAR_RANGE(1700000, 13, 31, 100000),
325 static int wm831x_aldo_set_suspend_voltage(struct regulator_dev *rdev,
326 int uV)
328 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
329 struct wm831x *wm831x = ldo->wm831x;
330 int sel, reg = ldo->base + WM831X_LDO_SLEEP_CONTROL;
332 sel = regulator_map_voltage_linear_range(rdev, uV, uV);
333 if (sel < 0)
334 return sel;
336 return wm831x_set_bits(wm831x, reg, WM831X_LDO7_ON_VSEL_MASK, sel);
339 static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev)
341 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
342 struct wm831x *wm831x = ldo->wm831x;
343 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
344 int ret;
346 ret = wm831x_reg_read(wm831x, on_reg);
347 if (ret < 0)
348 return 0;
350 if (ret & WM831X_LDO7_ON_MODE)
351 return REGULATOR_MODE_IDLE;
352 else
353 return REGULATOR_MODE_NORMAL;
356 static int wm831x_aldo_set_mode(struct regulator_dev *rdev,
357 unsigned int mode)
359 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
360 struct wm831x *wm831x = ldo->wm831x;
361 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
362 int ret;
365 switch (mode) {
366 case REGULATOR_MODE_NORMAL:
367 ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE, 0);
368 if (ret < 0)
369 return ret;
370 break;
372 case REGULATOR_MODE_IDLE:
373 ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE,
374 WM831X_LDO7_ON_MODE);
375 if (ret < 0)
376 return ret;
377 break;
379 default:
380 return -EINVAL;
383 return 0;
386 static int wm831x_aldo_get_status(struct regulator_dev *rdev)
388 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
389 struct wm831x *wm831x = ldo->wm831x;
390 int mask = 1 << rdev_get_id(rdev);
391 int ret;
393 /* Is the regulator on? */
394 ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
395 if (ret < 0)
396 return ret;
397 if (!(ret & mask))
398 return REGULATOR_STATUS_OFF;
400 /* Is it reporting under voltage? */
401 ret = wm831x_reg_read(wm831x, WM831X_LDO_UV_STATUS);
402 if (ret < 0)
403 return ret;
404 if (ret & mask)
405 return REGULATOR_STATUS_ERROR;
407 ret = wm831x_aldo_get_mode(rdev);
408 if (ret < 0)
409 return ret;
410 else
411 return regulator_mode_to_status(ret);
414 static struct regulator_ops wm831x_aldo_ops = {
415 .list_voltage = regulator_list_voltage_linear_range,
416 .map_voltage = regulator_map_voltage_linear_range,
417 .get_voltage_sel = regulator_get_voltage_sel_regmap,
418 .set_voltage_sel = regulator_set_voltage_sel_regmap,
419 .set_suspend_voltage = wm831x_aldo_set_suspend_voltage,
420 .get_mode = wm831x_aldo_get_mode,
421 .set_mode = wm831x_aldo_set_mode,
422 .get_status = wm831x_aldo_get_status,
423 .set_bypass = regulator_set_bypass_regmap,
424 .get_bypass = regulator_get_bypass_regmap,
426 .is_enabled = regulator_is_enabled_regmap,
427 .enable = regulator_enable_regmap,
428 .disable = regulator_disable_regmap,
431 static int wm831x_aldo_probe(struct platform_device *pdev)
433 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
434 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
435 struct regulator_config config = { };
436 int id;
437 struct wm831x_ldo *ldo;
438 struct resource *res;
439 int ret, irq;
441 if (pdata && pdata->wm831x_num)
442 id = (pdata->wm831x_num * 10) + 1;
443 else
444 id = 0;
445 id = pdev->id - id;
447 dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
449 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
450 if (ldo == NULL) {
451 dev_err(&pdev->dev, "Unable to allocate private data\n");
452 return -ENOMEM;
455 ldo->wm831x = wm831x;
457 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
458 if (res == NULL) {
459 dev_err(&pdev->dev, "No REG resource\n");
460 ret = -EINVAL;
461 goto err;
463 ldo->base = res->start;
465 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
466 ldo->desc.name = ldo->name;
468 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
469 "LDO%dVDD", id + 1);
470 ldo->desc.supply_name = ldo->supply_name;
472 ldo->desc.id = id;
473 ldo->desc.type = REGULATOR_VOLTAGE;
474 ldo->desc.n_voltages = 32;
475 ldo->desc.linear_ranges = wm831x_aldo_ranges;
476 ldo->desc.n_linear_ranges = ARRAY_SIZE(wm831x_aldo_ranges);
477 ldo->desc.ops = &wm831x_aldo_ops;
478 ldo->desc.owner = THIS_MODULE;
479 ldo->desc.vsel_reg = ldo->base + WM831X_LDO_ON_CONTROL;
480 ldo->desc.vsel_mask = WM831X_LDO7_ON_VSEL_MASK;
481 ldo->desc.enable_reg = WM831X_LDO_ENABLE;
482 ldo->desc.enable_mask = 1 << id;
483 ldo->desc.bypass_reg = ldo->base;
484 ldo->desc.bypass_mask = WM831X_LDO7_SWI;
486 config.dev = pdev->dev.parent;
487 if (pdata)
488 config.init_data = pdata->ldo[id];
489 config.driver_data = ldo;
490 config.regmap = wm831x->regmap;
492 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
493 &config);
494 if (IS_ERR(ldo->regulator)) {
495 ret = PTR_ERR(ldo->regulator);
496 dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
497 id + 1, ret);
498 goto err;
501 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
502 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
503 wm831x_ldo_uv_irq,
504 IRQF_TRIGGER_RISING, ldo->name, ldo);
505 if (ret != 0) {
506 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
507 irq, ret);
508 goto err;
511 platform_set_drvdata(pdev, ldo);
513 return 0;
515 err:
516 return ret;
519 static struct platform_driver wm831x_aldo_driver = {
520 .probe = wm831x_aldo_probe,
521 .driver = {
522 .name = "wm831x-aldo",
523 .owner = THIS_MODULE,
528 * Alive LDO
531 #define WM831X_ALIVE_LDO_MAX_SELECTOR 0xf
533 static int wm831x_alive_ldo_set_suspend_voltage(struct regulator_dev *rdev,
534 int uV)
536 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
537 struct wm831x *wm831x = ldo->wm831x;
538 int sel, reg = ldo->base + WM831X_ALIVE_LDO_SLEEP_CONTROL;
540 sel = regulator_map_voltage_linear(rdev, uV, uV);
541 if (sel < 0)
542 return sel;
544 return wm831x_set_bits(wm831x, reg, WM831X_LDO11_ON_VSEL_MASK, sel);
547 static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev)
549 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
550 struct wm831x *wm831x = ldo->wm831x;
551 int mask = 1 << rdev_get_id(rdev);
552 int ret;
554 /* Is the regulator on? */
555 ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
556 if (ret < 0)
557 return ret;
558 if (ret & mask)
559 return REGULATOR_STATUS_ON;
560 else
561 return REGULATOR_STATUS_OFF;
564 static struct regulator_ops wm831x_alive_ldo_ops = {
565 .list_voltage = regulator_list_voltage_linear,
566 .map_voltage = regulator_map_voltage_linear,
567 .get_voltage_sel = regulator_get_voltage_sel_regmap,
568 .set_voltage_sel = regulator_set_voltage_sel_regmap,
569 .set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage,
570 .get_status = wm831x_alive_ldo_get_status,
572 .is_enabled = regulator_is_enabled_regmap,
573 .enable = regulator_enable_regmap,
574 .disable = regulator_disable_regmap,
577 static int wm831x_alive_ldo_probe(struct platform_device *pdev)
579 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
580 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
581 struct regulator_config config = { };
582 int id;
583 struct wm831x_ldo *ldo;
584 struct resource *res;
585 int ret;
587 if (pdata && pdata->wm831x_num)
588 id = (pdata->wm831x_num * 10) + 1;
589 else
590 id = 0;
591 id = pdev->id - id;
594 dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
596 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
597 if (ldo == NULL) {
598 dev_err(&pdev->dev, "Unable to allocate private data\n");
599 return -ENOMEM;
602 ldo->wm831x = wm831x;
604 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
605 if (res == NULL) {
606 dev_err(&pdev->dev, "No REG resource\n");
607 ret = -EINVAL;
608 goto err;
610 ldo->base = res->start;
612 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
613 ldo->desc.name = ldo->name;
615 snprintf(ldo->supply_name, sizeof(ldo->supply_name),
616 "LDO%dVDD", id + 1);
617 ldo->desc.supply_name = ldo->supply_name;
619 ldo->desc.id = id;
620 ldo->desc.type = REGULATOR_VOLTAGE;
621 ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1;
622 ldo->desc.ops = &wm831x_alive_ldo_ops;
623 ldo->desc.owner = THIS_MODULE;
624 ldo->desc.vsel_reg = ldo->base + WM831X_ALIVE_LDO_ON_CONTROL;
625 ldo->desc.vsel_mask = WM831X_LDO11_ON_VSEL_MASK;
626 ldo->desc.enable_reg = WM831X_LDO_ENABLE;
627 ldo->desc.enable_mask = 1 << id;
628 ldo->desc.min_uV = 800000;
629 ldo->desc.uV_step = 50000;
630 ldo->desc.enable_time = 1000;
632 config.dev = pdev->dev.parent;
633 if (pdata)
634 config.init_data = pdata->ldo[id];
635 config.driver_data = ldo;
636 config.regmap = wm831x->regmap;
638 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
639 &config);
640 if (IS_ERR(ldo->regulator)) {
641 ret = PTR_ERR(ldo->regulator);
642 dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
643 id + 1, ret);
644 goto err;
647 platform_set_drvdata(pdev, ldo);
649 return 0;
651 err:
652 return ret;
655 static struct platform_driver wm831x_alive_ldo_driver = {
656 .probe = wm831x_alive_ldo_probe,
657 .driver = {
658 .name = "wm831x-alive-ldo",
659 .owner = THIS_MODULE,
663 static int __init wm831x_ldo_init(void)
665 int ret;
667 ret = platform_driver_register(&wm831x_gp_ldo_driver);
668 if (ret != 0)
669 pr_err("Failed to register WM831x GP LDO driver: %d\n", ret);
671 ret = platform_driver_register(&wm831x_aldo_driver);
672 if (ret != 0)
673 pr_err("Failed to register WM831x ALDO driver: %d\n", ret);
675 ret = platform_driver_register(&wm831x_alive_ldo_driver);
676 if (ret != 0)
677 pr_err("Failed to register WM831x alive LDO driver: %d\n",
678 ret);
680 return 0;
682 subsys_initcall(wm831x_ldo_init);
684 static void __exit wm831x_ldo_exit(void)
686 platform_driver_unregister(&wm831x_alive_ldo_driver);
687 platform_driver_unregister(&wm831x_aldo_driver);
688 platform_driver_unregister(&wm831x_gp_ldo_driver);
690 module_exit(wm831x_ldo_exit);
692 /* Module information */
693 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
694 MODULE_DESCRIPTION("WM831x LDO driver");
695 MODULE_LICENSE("GPL");
696 MODULE_ALIAS("platform:wm831x-ldo");
697 MODULE_ALIAS("platform:wm831x-aldo");
698 MODULE_ALIAS("platform:wm831x-aliveldo");