blob: e43ed4d93f71afad8f40ae2047d65619ac5aa6e1 [file] [log] [blame]
Axel Lin3cad5fc2019-04-17 22:16:30 +08001// SPDX-License-Identifier: GPL-2.0+
2//
3// wm831x-dcdc.c -- DC-DC buck converter driver for the WM831x series
4//
5// Copyright 2009 Wolfson Microelectronics PLC.
6//
7// Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Browne4ee8312009-07-28 15:21:49 +01008
9#include <linux/module.h>
10#include <linux/moduleparam.h>
11#include <linux/init.h>
12#include <linux/bitops.h>
13#include <linux/err.h>
14#include <linux/i2c.h>
15#include <linux/platform_device.h>
16#include <linux/regulator/driver.h>
Mark Browne24a04c2009-09-22 08:47:11 -070017#include <linux/regulator/machine.h>
Linus Walleij9a5ed0b2019-06-12 09:42:22 +020018#include <linux/gpio/consumer.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090019#include <linux/slab.h>
Mark Browne4ee8312009-07-28 15:21:49 +010020
21#include <linux/mfd/wm831x/core.h>
22#include <linux/mfd/wm831x/regulator.h>
23#include <linux/mfd/wm831x/pdata.h>
24
25#define WM831X_BUCKV_MAX_SELECTOR 0x68
26#define WM831X_BUCKP_MAX_SELECTOR 0x66
27
28#define WM831X_DCDC_MODE_FAST 0
29#define WM831X_DCDC_MODE_NORMAL 1
30#define WM831X_DCDC_MODE_IDLE 2
31#define WM831X_DCDC_MODE_STANDBY 3
32
Mark Brown82caa972012-03-28 21:40:42 +010033#define WM831X_DCDC_MAX_NAME 9
Mark Browne4ee8312009-07-28 15:21:49 +010034
35/* Register offsets in control block */
36#define WM831X_DCDC_CONTROL_1 0
37#define WM831X_DCDC_CONTROL_2 1
38#define WM831X_DCDC_ON_CONFIG 2
39#define WM831X_DCDC_SLEEP_CONTROL 3
Mark Browne24a04c2009-09-22 08:47:11 -070040#define WM831X_DCDC_DVS_CONTROL 4
Mark Browne4ee8312009-07-28 15:21:49 +010041
42/*
43 * Shared
44 */
45
46struct wm831x_dcdc {
47 char name[WM831X_DCDC_MAX_NAME];
Mark Brown82caa972012-03-28 21:40:42 +010048 char supply_name[WM831X_DCDC_MAX_NAME];
Mark Browne4ee8312009-07-28 15:21:49 +010049 struct regulator_desc desc;
50 int base;
51 struct wm831x *wm831x;
52 struct regulator_dev *regulator;
Linus Walleij9a5ed0b2019-06-12 09:42:22 +020053 struct gpio_desc *dvs_gpiod;
Mark Browne24a04c2009-09-22 08:47:11 -070054 int dvs_gpio_state;
55 int on_vsel;
56 int dvs_vsel;
Mark Browne4ee8312009-07-28 15:21:49 +010057};
58
Mark Browne4ee8312009-07-28 15:21:49 +010059static unsigned int wm831x_dcdc_get_mode(struct regulator_dev *rdev)
60
61{
62 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
63 struct wm831x *wm831x = dcdc->wm831x;
64 u16 reg = dcdc->base + WM831X_DCDC_ON_CONFIG;
65 int val;
66
67 val = wm831x_reg_read(wm831x, reg);
68 if (val < 0)
69 return val;
70
71 val = (val & WM831X_DC1_ON_MODE_MASK) >> WM831X_DC1_ON_MODE_SHIFT;
72
73 switch (val) {
74 case WM831X_DCDC_MODE_FAST:
75 return REGULATOR_MODE_FAST;
76 case WM831X_DCDC_MODE_NORMAL:
77 return REGULATOR_MODE_NORMAL;
78 case WM831X_DCDC_MODE_STANDBY:
79 return REGULATOR_MODE_STANDBY;
80 case WM831X_DCDC_MODE_IDLE:
81 return REGULATOR_MODE_IDLE;
82 default:
83 BUG();
Mark Brown9ee291a2011-02-02 20:17:22 +000084 return -EINVAL;
Mark Browne4ee8312009-07-28 15:21:49 +010085 }
86}
87
88static int wm831x_dcdc_set_mode_int(struct wm831x *wm831x, int reg,
89 unsigned int mode)
90{
91 int val;
92
93 switch (mode) {
94 case REGULATOR_MODE_FAST:
95 val = WM831X_DCDC_MODE_FAST;
96 break;
97 case REGULATOR_MODE_NORMAL:
98 val = WM831X_DCDC_MODE_NORMAL;
99 break;
100 case REGULATOR_MODE_STANDBY:
101 val = WM831X_DCDC_MODE_STANDBY;
102 break;
103 case REGULATOR_MODE_IDLE:
104 val = WM831X_DCDC_MODE_IDLE;
105 break;
106 default:
107 return -EINVAL;
108 }
109
110 return wm831x_set_bits(wm831x, reg, WM831X_DC1_ON_MODE_MASK,
111 val << WM831X_DC1_ON_MODE_SHIFT);
112}
113
114static int wm831x_dcdc_set_mode(struct regulator_dev *rdev, unsigned int mode)
115{
116 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
117 struct wm831x *wm831x = dcdc->wm831x;
118 u16 reg = dcdc->base + WM831X_DCDC_ON_CONFIG;
119
120 return wm831x_dcdc_set_mode_int(wm831x, reg, mode);
121}
122
123static int wm831x_dcdc_set_suspend_mode(struct regulator_dev *rdev,
124 unsigned int mode)
125{
126 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
127 struct wm831x *wm831x = dcdc->wm831x;
128 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL;
129
130 return wm831x_dcdc_set_mode_int(wm831x, reg, mode);
131}
132
133static int wm831x_dcdc_get_status(struct regulator_dev *rdev)
134{
135 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
136 struct wm831x *wm831x = dcdc->wm831x;
137 int ret;
138
139 /* First, check for errors */
140 ret = wm831x_reg_read(wm831x, WM831X_DCDC_UV_STATUS);
141 if (ret < 0)
142 return ret;
143
144 if (ret & (1 << rdev_get_id(rdev))) {
145 dev_dbg(wm831x->dev, "DCDC%d under voltage\n",
146 rdev_get_id(rdev) + 1);
147 return REGULATOR_STATUS_ERROR;
148 }
149
150 /* DCDC1 and DCDC2 can additionally detect high voltage/current */
151 if (rdev_get_id(rdev) < 2) {
152 if (ret & (WM831X_DC1_OV_STS << rdev_get_id(rdev))) {
153 dev_dbg(wm831x->dev, "DCDC%d over voltage\n",
154 rdev_get_id(rdev) + 1);
155 return REGULATOR_STATUS_ERROR;
156 }
157
158 if (ret & (WM831X_DC1_HC_STS << rdev_get_id(rdev))) {
159 dev_dbg(wm831x->dev, "DCDC%d over current\n",
160 rdev_get_id(rdev) + 1);
161 return REGULATOR_STATUS_ERROR;
162 }
163 }
164
165 /* Is the regulator on? */
166 ret = wm831x_reg_read(wm831x, WM831X_DCDC_STATUS);
167 if (ret < 0)
168 return ret;
169 if (!(ret & (1 << rdev_get_id(rdev))))
170 return REGULATOR_STATUS_OFF;
171
172 /* TODO: When we handle hardware control modes so we can report the
173 * current mode. */
174 return REGULATOR_STATUS_ON;
175}
176
177static irqreturn_t wm831x_dcdc_uv_irq(int irq, void *data)
178{
179 struct wm831x_dcdc *dcdc = data;
180
181 regulator_notifier_call_chain(dcdc->regulator,
182 REGULATOR_EVENT_UNDER_VOLTAGE,
183 NULL);
184
185 return IRQ_HANDLED;
186}
187
188static irqreturn_t wm831x_dcdc_oc_irq(int irq, void *data)
189{
190 struct wm831x_dcdc *dcdc = data;
191
192 regulator_notifier_call_chain(dcdc->regulator,
193 REGULATOR_EVENT_OVER_CURRENT,
194 NULL);
195
196 return IRQ_HANDLED;
197}
198
199/*
200 * BUCKV specifics
201 */
202
Matti Vaittinen60ab7f42020-05-08 18:43:36 +0300203static const struct linear_range wm831x_buckv_ranges[] = {
Axel Linccffcb82019-01-20 15:33:56 +0800204 REGULATOR_LINEAR_RANGE(600000, 0, 0x7, 0),
205 REGULATOR_LINEAR_RANGE(600000, 0x8, 0x68, 12500),
206};
Mark Browne24a04c2009-09-22 08:47:11 -0700207
Mark Browne24a04c2009-09-22 08:47:11 -0700208static int wm831x_buckv_set_dvs(struct regulator_dev *rdev, int state)
209{
210 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
211
212 if (state == dcdc->dvs_gpio_state)
213 return 0;
214
215 dcdc->dvs_gpio_state = state;
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200216 gpiod_set_value(dcdc->dvs_gpiod, state);
Mark Browne24a04c2009-09-22 08:47:11 -0700217
218 /* Should wait for DVS state change to be asserted if we have
219 * a GPIO for it, for now assume the device is configured
220 * for the fastest possible transition.
221 */
222
223 return 0;
Mark Browne4ee8312009-07-28 15:21:49 +0100224}
225
Axel Linb5fb77e2012-06-13 20:29:17 +0800226static int wm831x_buckv_set_voltage_sel(struct regulator_dev *rdev,
227 unsigned vsel)
Mark Browne4ee8312009-07-28 15:21:49 +0100228{
229 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
Mark Browne24a04c2009-09-22 08:47:11 -0700230 struct wm831x *wm831x = dcdc->wm831x;
231 int on_reg = dcdc->base + WM831X_DCDC_ON_CONFIG;
232 int dvs_reg = dcdc->base + WM831X_DCDC_DVS_CONTROL;
Axel Linb5fb77e2012-06-13 20:29:17 +0800233 int ret;
Mark Brown3a93f2a2010-11-10 14:38:29 +0000234
Mark Browne24a04c2009-09-22 08:47:11 -0700235 /* If this value is already set then do a GPIO update if we can */
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200236 if (dcdc->dvs_gpiod && dcdc->on_vsel == vsel)
Mark Browne24a04c2009-09-22 08:47:11 -0700237 return wm831x_buckv_set_dvs(rdev, 0);
238
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200239 if (dcdc->dvs_gpiod && dcdc->dvs_vsel == vsel)
Mark Browne24a04c2009-09-22 08:47:11 -0700240 return wm831x_buckv_set_dvs(rdev, 1);
241
242 /* Always set the ON status to the minimum voltage */
243 ret = wm831x_set_bits(wm831x, on_reg, WM831X_DC1_ON_VSEL_MASK, vsel);
244 if (ret < 0)
245 return ret;
246 dcdc->on_vsel = vsel;
247
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200248 if (!dcdc->dvs_gpiod)
Mark Browne24a04c2009-09-22 08:47:11 -0700249 return ret;
250
251 /* Kick the voltage transition now */
252 ret = wm831x_buckv_set_dvs(rdev, 0);
253 if (ret < 0)
254 return ret;
255
Mark Brown88cda602011-07-25 22:20:34 +0100256 /*
257 * If this VSEL is higher than the last one we've seen then
258 * remember it as the DVS VSEL. This is optimised for CPUfreq
259 * usage where we want to get to the highest voltage very
260 * quickly.
261 */
262 if (vsel > dcdc->dvs_vsel) {
263 ret = wm831x_set_bits(wm831x, dvs_reg,
264 WM831X_DC1_DVS_VSEL_MASK,
Mark Brown13ae6332012-11-20 10:02:06 +0900265 vsel);
Mark Brown88cda602011-07-25 22:20:34 +0100266 if (ret == 0)
267 dcdc->dvs_vsel = vsel;
268 else
269 dev_warn(wm831x->dev,
270 "Failed to set DCDC DVS VSEL: %d\n", ret);
Mark Browne24a04c2009-09-22 08:47:11 -0700271 }
272
Mark Browne24a04c2009-09-22 08:47:11 -0700273 return 0;
Mark Browne4ee8312009-07-28 15:21:49 +0100274}
275
276static int wm831x_buckv_set_suspend_voltage(struct regulator_dev *rdev,
Mark Browne24a04c2009-09-22 08:47:11 -0700277 int uV)
Mark Browne4ee8312009-07-28 15:21:49 +0100278{
279 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
Mark Browne24a04c2009-09-22 08:47:11 -0700280 struct wm831x *wm831x = dcdc->wm831x;
Mark Browne4ee8312009-07-28 15:21:49 +0100281 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL;
Mark Browne24a04c2009-09-22 08:47:11 -0700282 int vsel;
Mark Browne4ee8312009-07-28 15:21:49 +0100283
Axel Linccffcb82019-01-20 15:33:56 +0800284 vsel = regulator_map_voltage_linear_range(rdev, uV, uV);
Mark Browne24a04c2009-09-22 08:47:11 -0700285 if (vsel < 0)
286 return vsel;
287
288 return wm831x_set_bits(wm831x, reg, WM831X_DC1_SLP_VSEL_MASK, vsel);
Mark Browne4ee8312009-07-28 15:21:49 +0100289}
290
Mark Brownafb8bb82010-12-10 17:28:08 +0000291static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev)
Mark Browne4ee8312009-07-28 15:21:49 +0100292{
293 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
Mark Browne4ee8312009-07-28 15:21:49 +0100294
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200295 if (dcdc->dvs_gpiod && dcdc->dvs_gpio_state)
Mark Brownafb8bb82010-12-10 17:28:08 +0000296 return dcdc->dvs_vsel;
Mark Browne24a04c2009-09-22 08:47:11 -0700297 else
Mark Brownafb8bb82010-12-10 17:28:08 +0000298 return dcdc->on_vsel;
Mark Browne4ee8312009-07-28 15:21:49 +0100299}
300
301/* Current limit options */
Axel Linc25d4782019-02-24 21:16:51 +0800302static const unsigned int wm831x_dcdc_ilim[] = {
303 125000, 250000, 375000, 500000, 625000, 750000, 875000, 1000000
Mark Browne4ee8312009-07-28 15:21:49 +0100304};
305
Julia Lawallb0d6dd32015-12-19 16:31:24 +0100306static const struct regulator_ops wm831x_buckv_ops = {
Axel Linb5fb77e2012-06-13 20:29:17 +0800307 .set_voltage_sel = wm831x_buckv_set_voltage_sel,
Mark Brownafb8bb82010-12-10 17:28:08 +0000308 .get_voltage_sel = wm831x_buckv_get_voltage_sel,
Axel Linccffcb82019-01-20 15:33:56 +0800309 .list_voltage = regulator_list_voltage_linear_range,
310 .map_voltage = regulator_map_voltage_linear_range,
Mark Browne4ee8312009-07-28 15:21:49 +0100311 .set_suspend_voltage = wm831x_buckv_set_suspend_voltage,
Axel Lin20eb6412019-02-28 21:40:22 +0800312 .set_current_limit = regulator_set_current_limit_regmap,
313 .get_current_limit = regulator_get_current_limit_regmap,
Mark Browne4ee8312009-07-28 15:21:49 +0100314
Mark Brown3d138fc2012-04-15 12:38:42 +0100315 .is_enabled = regulator_is_enabled_regmap,
316 .enable = regulator_enable_regmap,
317 .disable = regulator_disable_regmap,
Mark Browne4ee8312009-07-28 15:21:49 +0100318 .get_status = wm831x_dcdc_get_status,
319 .get_mode = wm831x_dcdc_get_mode,
320 .set_mode = wm831x_dcdc_set_mode,
321 .set_suspend_mode = wm831x_dcdc_set_suspend_mode,
322};
323
Mark Browne24a04c2009-09-22 08:47:11 -0700324/*
325 * Set up DVS control. We just log errors since we can still run
326 * (with reduced performance) if we fail.
327 */
Mark Brown1aa20d22013-08-31 11:42:46 +0100328static void wm831x_buckv_dvs_init(struct platform_device *pdev,
329 struct wm831x_dcdc *dcdc,
330 struct wm831x_buckv_pdata *pdata)
Mark Browne24a04c2009-09-22 08:47:11 -0700331{
332 struct wm831x *wm831x = dcdc->wm831x;
333 int ret;
334 u16 ctrl;
335
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200336 if (!pdata)
Mark Browne24a04c2009-09-22 08:47:11 -0700337 return;
338
Mark Browne24a04c2009-09-22 08:47:11 -0700339 /* gpiolib won't let us read the GPIO status so pick the higher
340 * of the two existing voltages so we take it as platform data.
341 */
342 dcdc->dvs_gpio_state = pdata->dvs_init_state;
343
Linus Walleij9a5ed0b2019-06-12 09:42:22 +0200344 dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs",
345 dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
346 if (IS_ERR(dcdc->dvs_gpiod)) {
347 dev_err(wm831x->dev, "Failed to get %s DVS GPIO: %ld\n",
348 dcdc->name, PTR_ERR(dcdc->dvs_gpiod));
Mark Browne24a04c2009-09-22 08:47:11 -0700349 return;
350 }
351
Mark Brownb47ba9fd2011-07-25 22:20:32 +0100352 switch (pdata->dvs_control_src) {
353 case 1:
354 ctrl = 2 << WM831X_DC1_DVS_SRC_SHIFT;
355 break;
356 case 2:
357 ctrl = 3 << WM831X_DC1_DVS_SRC_SHIFT;
358 break;
359 default:
360 dev_err(wm831x->dev, "Invalid DVS control source %d for %s\n",
361 pdata->dvs_control_src, dcdc->name);
362 return;
363 }
364
Mark Brownc439b8f2011-07-25 22:20:33 +0100365 /* If DVS_VSEL is set to the minimum value then raise it to ON_VSEL
366 * to make bootstrapping a bit smoother.
367 */
368 if (!dcdc->dvs_vsel) {
369 ret = wm831x_set_bits(wm831x,
370 dcdc->base + WM831X_DCDC_DVS_CONTROL,
371 WM831X_DC1_DVS_VSEL_MASK, dcdc->on_vsel);
372 if (ret == 0)
373 dcdc->dvs_vsel = dcdc->on_vsel;
374 else
375 dev_warn(wm831x->dev, "Failed to set DVS_VSEL: %d\n",
376 ret);
377 }
378
Mark Brownb47ba9fd2011-07-25 22:20:32 +0100379 ret = wm831x_set_bits(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL,
380 WM831X_DC1_DVS_SRC_MASK, ctrl);
381 if (ret < 0) {
382 dev_err(wm831x->dev, "Failed to set %s DVS source: %d\n",
383 dcdc->name, ret);
384 }
Mark Browne24a04c2009-09-22 08:47:11 -0700385}
386
Bill Pembertona5023572012-11-19 13:22:22 -0500387static int wm831x_buckv_probe(struct platform_device *pdev)
Mark Browne4ee8312009-07-28 15:21:49 +0100388{
389 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
Jingoo Handff91d02013-07-30 17:20:47 +0900390 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
Mark Brownc172708d2012-04-04 00:50:22 +0100391 struct regulator_config config = { };
Mark Brown137a6352011-07-25 22:20:29 +0100392 int id;
Mark Browne4ee8312009-07-28 15:21:49 +0100393 struct wm831x_dcdc *dcdc;
394 struct resource *res;
395 int ret, irq;
396
Mark Brown137a6352011-07-25 22:20:29 +0100397 if (pdata && pdata->wm831x_num)
398 id = (pdata->wm831x_num * 10) + 1;
399 else
400 id = 0;
401 id = pdev->id - id;
402
Mark Browne4ee8312009-07-28 15:21:49 +0100403 dev_dbg(&pdev->dev, "Probing DCDC%d\n", id + 1);
404
Mark Brownfded2f42011-12-15 02:11:14 +0800405 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc),
406 GFP_KERNEL);
Sachin Kamat5730aa52014-02-20 14:23:20 +0530407 if (!dcdc)
Mark Browne4ee8312009-07-28 15:21:49 +0100408 return -ENOMEM;
Mark Browne4ee8312009-07-28 15:21:49 +0100409
410 dcdc->wm831x = wm831x;
411
Mark Brown56560982012-08-07 19:42:47 +0100412 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
Mark Browne4ee8312009-07-28 15:21:49 +0100413 if (res == NULL) {
Mark Brown56560982012-08-07 19:42:47 +0100414 dev_err(&pdev->dev, "No REG resource\n");
Mark Browne4ee8312009-07-28 15:21:49 +0100415 ret = -EINVAL;
416 goto err;
417 }
418 dcdc->base = res->start;
419
420 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1);
421 dcdc->desc.name = dcdc->name;
Mark Brown82caa972012-03-28 21:40:42 +0100422
423 snprintf(dcdc->supply_name, sizeof(dcdc->supply_name),
424 "DC%dVDD", id + 1);
425 dcdc->desc.supply_name = dcdc->supply_name;
426
Mark Browne4ee8312009-07-28 15:21:49 +0100427 dcdc->desc.id = id;
428 dcdc->desc.type = REGULATOR_VOLTAGE;
429 dcdc->desc.n_voltages = WM831X_BUCKV_MAX_SELECTOR + 1;
Axel Linccffcb82019-01-20 15:33:56 +0800430 dcdc->desc.linear_ranges = wm831x_buckv_ranges;
431 dcdc->desc.n_linear_ranges = ARRAY_SIZE(wm831x_buckv_ranges);
Mark Browne4ee8312009-07-28 15:21:49 +0100432 dcdc->desc.ops = &wm831x_buckv_ops;
433 dcdc->desc.owner = THIS_MODULE;
Mark Brown3d138fc2012-04-15 12:38:42 +0100434 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE;
435 dcdc->desc.enable_mask = 1 << id;
Axel Lin20eb6412019-02-28 21:40:22 +0800436 dcdc->desc.csel_reg = dcdc->base + WM831X_DCDC_CONTROL_2;
437 dcdc->desc.csel_mask = WM831X_DC1_HC_THR_MASK;
438 dcdc->desc.n_current_limits = ARRAY_SIZE(wm831x_dcdc_ilim);
439 dcdc->desc.curr_table = wm831x_dcdc_ilim;
Mark Browne4ee8312009-07-28 15:21:49 +0100440
Mark Browne24a04c2009-09-22 08:47:11 -0700441 ret = wm831x_reg_read(wm831x, dcdc->base + WM831X_DCDC_ON_CONFIG);
442 if (ret < 0) {
443 dev_err(wm831x->dev, "Failed to read ON VSEL: %d\n", ret);
444 goto err;
445 }
446 dcdc->on_vsel = ret & WM831X_DC1_ON_VSEL_MASK;
447
Mark Browna1b81dd2011-07-25 22:20:30 +0100448 ret = wm831x_reg_read(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL);
Mark Browne24a04c2009-09-22 08:47:11 -0700449 if (ret < 0) {
450 dev_err(wm831x->dev, "Failed to read DVS VSEL: %d\n", ret);
451 goto err;
452 }
453 dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK;
454
Mark Brownf0b067d2012-05-14 11:37:09 +0100455 if (pdata && pdata->dcdc[id])
Mark Brown1aa20d22013-08-31 11:42:46 +0100456 wm831x_buckv_dvs_init(pdev, dcdc,
457 pdata->dcdc[id]->driver_data);
Mark Browne24a04c2009-09-22 08:47:11 -0700458
Mark Brownc172708d2012-04-04 00:50:22 +0100459 config.dev = pdev->dev.parent;
Mark Brownb7ca8782012-05-10 00:41:02 +0100460 if (pdata)
461 config.init_data = pdata->dcdc[id];
Mark Brownc172708d2012-04-04 00:50:22 +0100462 config.driver_data = dcdc;
Mark Brown3d138fc2012-04-15 12:38:42 +0100463 config.regmap = wm831x->regmap;
Mark Brownc172708d2012-04-04 00:50:22 +0100464
Mark Brownd73b4cb2013-08-31 11:58:40 +0100465 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc,
466 &config);
Mark Browne4ee8312009-07-28 15:21:49 +0100467 if (IS_ERR(dcdc->regulator)) {
468 ret = PTR_ERR(dcdc->regulator);
469 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
470 id + 1, ret);
471 goto err;
472 }
473
Mark Browncd997582012-05-14 23:14:24 +0200474 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
Mark Brownb0c4c0c2013-08-31 11:47:39 +0100475 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
476 wm831x_dcdc_uv_irq,
Fabio Estevam29454732015-06-01 22:33:53 -0300477 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
478 dcdc->name, dcdc);
Mark Browne4ee8312009-07-28 15:21:49 +0100479 if (ret != 0) {
480 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
481 irq, ret);
Mark Brownd73b4cb2013-08-31 11:58:40 +0100482 goto err;
Mark Browne4ee8312009-07-28 15:21:49 +0100483 }
484
Mark Browncd997582012-05-14 23:14:24 +0200485 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "HC"));
Mark Brownb0c4c0c2013-08-31 11:47:39 +0100486 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
487 wm831x_dcdc_oc_irq,
Fabio Estevam29454732015-06-01 22:33:53 -0300488 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
489 dcdc->name, dcdc);
Mark Browne4ee8312009-07-28 15:21:49 +0100490 if (ret != 0) {
491 dev_err(&pdev->dev, "Failed to request HC IRQ %d: %d\n",
492 irq, ret);
Mark Brownd73b4cb2013-08-31 11:58:40 +0100493 goto err;
Mark Browne4ee8312009-07-28 15:21:49 +0100494 }
495
496 platform_set_drvdata(pdev, dcdc);
497
498 return 0;
499
Mark Browne4ee8312009-07-28 15:21:49 +0100500err:
Mark Browne4ee8312009-07-28 15:21:49 +0100501 return ret;
502}
503
Mark Browne4ee8312009-07-28 15:21:49 +0100504static struct platform_driver wm831x_buckv_driver = {
505 .probe = wm831x_buckv_probe,
Mark Browne4ee8312009-07-28 15:21:49 +0100506 .driver = {
507 .name = "wm831x-buckv",
508 },
509};
510
511/*
512 * BUCKP specifics
513 */
514
Axel Lind580cb52012-06-13 20:27:58 +0800515static int wm831x_buckp_set_suspend_voltage(struct regulator_dev *rdev, int uV)
Mark Browne4ee8312009-07-28 15:21:49 +0100516{
517 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
518 struct wm831x *wm831x = dcdc->wm831x;
Mark Browne4ee8312009-07-28 15:21:49 +0100519 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL;
Axel Lind580cb52012-06-13 20:27:58 +0800520 int sel;
Mark Browne4ee8312009-07-28 15:21:49 +0100521
Axel Lind580cb52012-06-13 20:27:58 +0800522 sel = regulator_map_voltage_linear(rdev, uV, uV);
523 if (sel < 0)
524 return sel;
525
526 return wm831x_set_bits(wm831x, reg, WM831X_DC3_ON_VSEL_MASK, sel);
Mark Browne4ee8312009-07-28 15:21:49 +0100527}
528
Julia Lawallb0d6dd32015-12-19 16:31:24 +0100529static const struct regulator_ops wm831x_buckp_ops = {
Axel Lind580cb52012-06-13 20:27:58 +0800530 .set_voltage_sel = regulator_set_voltage_sel_regmap,
Mark Brown817436e2012-04-15 11:55:34 +0100531 .get_voltage_sel = regulator_get_voltage_sel_regmap,
Axel Linc70ad9d2012-06-13 20:27:14 +0800532 .list_voltage = regulator_list_voltage_linear,
Axel Lind580cb52012-06-13 20:27:58 +0800533 .map_voltage = regulator_map_voltage_linear,
Mark Browne4ee8312009-07-28 15:21:49 +0100534 .set_suspend_voltage = wm831x_buckp_set_suspend_voltage,
535
Mark Brown3d138fc2012-04-15 12:38:42 +0100536 .is_enabled = regulator_is_enabled_regmap,
537 .enable = regulator_enable_regmap,
538 .disable = regulator_disable_regmap,
Mark Browne4ee8312009-07-28 15:21:49 +0100539 .get_status = wm831x_dcdc_get_status,
540 .get_mode = wm831x_dcdc_get_mode,
541 .set_mode = wm831x_dcdc_set_mode,
542 .set_suspend_mode = wm831x_dcdc_set_suspend_mode,
543};
544
Bill Pembertona5023572012-11-19 13:22:22 -0500545static int wm831x_buckp_probe(struct platform_device *pdev)
Mark Browne4ee8312009-07-28 15:21:49 +0100546{
547 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
Jingoo Handff91d02013-07-30 17:20:47 +0900548 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
Mark Brownc172708d2012-04-04 00:50:22 +0100549 struct regulator_config config = { };
Mark Brown137a6352011-07-25 22:20:29 +0100550 int id;
Mark Browne4ee8312009-07-28 15:21:49 +0100551 struct wm831x_dcdc *dcdc;
552 struct resource *res;
553 int ret, irq;
554
Mark Brown137a6352011-07-25 22:20:29 +0100555 if (pdata && pdata->wm831x_num)
556 id = (pdata->wm831x_num * 10) + 1;
557 else
558 id = 0;
559 id = pdev->id - id;
560
Mark Browne4ee8312009-07-28 15:21:49 +0100561 dev_dbg(&pdev->dev, "Probing DCDC%d\n", id + 1);
562
Mark Brownfded2f42011-12-15 02:11:14 +0800563 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc),
564 GFP_KERNEL);
Sachin Kamat5730aa52014-02-20 14:23:20 +0530565 if (!dcdc)
Mark Browne4ee8312009-07-28 15:21:49 +0100566 return -ENOMEM;
Mark Browne4ee8312009-07-28 15:21:49 +0100567
568 dcdc->wm831x = wm831x;
569
Mark Brown56560982012-08-07 19:42:47 +0100570 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
Mark Browne4ee8312009-07-28 15:21:49 +0100571 if (res == NULL) {
Mark Brown56560982012-08-07 19:42:47 +0100572 dev_err(&pdev->dev, "No REG resource\n");
Mark Browne4ee8312009-07-28 15:21:49 +0100573 ret = -EINVAL;
574 goto err;
575 }
576 dcdc->base = res->start;
577
578 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1);
579 dcdc->desc.name = dcdc->name;
Mark Brown82caa972012-03-28 21:40:42 +0100580
581 snprintf(dcdc->supply_name, sizeof(dcdc->supply_name),
582 "DC%dVDD", id + 1);
583 dcdc->desc.supply_name = dcdc->supply_name;
584
Mark Browne4ee8312009-07-28 15:21:49 +0100585 dcdc->desc.id = id;
586 dcdc->desc.type = REGULATOR_VOLTAGE;
587 dcdc->desc.n_voltages = WM831X_BUCKP_MAX_SELECTOR + 1;
588 dcdc->desc.ops = &wm831x_buckp_ops;
589 dcdc->desc.owner = THIS_MODULE;
Mark Brown817436e2012-04-15 11:55:34 +0100590 dcdc->desc.vsel_reg = dcdc->base + WM831X_DCDC_ON_CONFIG;
591 dcdc->desc.vsel_mask = WM831X_DC3_ON_VSEL_MASK;
Mark Brown3d138fc2012-04-15 12:38:42 +0100592 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE;
593 dcdc->desc.enable_mask = 1 << id;
Axel Linc70ad9d2012-06-13 20:27:14 +0800594 dcdc->desc.min_uV = 850000;
595 dcdc->desc.uV_step = 25000;
Mark Browne4ee8312009-07-28 15:21:49 +0100596
Mark Brownc172708d2012-04-04 00:50:22 +0100597 config.dev = pdev->dev.parent;
Mark Brownb7ca8782012-05-10 00:41:02 +0100598 if (pdata)
599 config.init_data = pdata->dcdc[id];
Mark Brownc172708d2012-04-04 00:50:22 +0100600 config.driver_data = dcdc;
Mark Brown817436e2012-04-15 11:55:34 +0100601 config.regmap = wm831x->regmap;
Mark Brownc172708d2012-04-04 00:50:22 +0100602
Mark Brownd73b4cb2013-08-31 11:58:40 +0100603 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc,
604 &config);
Mark Browne4ee8312009-07-28 15:21:49 +0100605 if (IS_ERR(dcdc->regulator)) {
606 ret = PTR_ERR(dcdc->regulator);
607 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
608 id + 1, ret);
609 goto err;
610 }
611
Mark Browncd997582012-05-14 23:14:24 +0200612 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
Mark Brownb0c4c0c2013-08-31 11:47:39 +0100613 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
614 wm831x_dcdc_uv_irq,
Fabio Estevam29454732015-06-01 22:33:53 -0300615 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
616 dcdc->name, dcdc);
Mark Browne4ee8312009-07-28 15:21:49 +0100617 if (ret != 0) {
618 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
619 irq, ret);
Mark Brownd73b4cb2013-08-31 11:58:40 +0100620 goto err;
Mark Browne4ee8312009-07-28 15:21:49 +0100621 }
622
623 platform_set_drvdata(pdev, dcdc);
624
625 return 0;
626
Mark Browne4ee8312009-07-28 15:21:49 +0100627err:
Mark Browne4ee8312009-07-28 15:21:49 +0100628 return ret;
629}
630
Mark Browne4ee8312009-07-28 15:21:49 +0100631static struct platform_driver wm831x_buckp_driver = {
632 .probe = wm831x_buckp_probe,
Mark Browne4ee8312009-07-28 15:21:49 +0100633 .driver = {
634 .name = "wm831x-buckp",
635 },
636};
637
Mark Brown8267a9b2009-07-28 15:22:23 +0100638/*
Mark Brown13048502009-07-28 15:23:16 +0100639 * DCDC boost convertors
640 */
641
642static int wm831x_boostp_get_status(struct regulator_dev *rdev)
643{
644 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
645 struct wm831x *wm831x = dcdc->wm831x;
646 int ret;
647
648 /* First, check for errors */
649 ret = wm831x_reg_read(wm831x, WM831X_DCDC_UV_STATUS);
650 if (ret < 0)
651 return ret;
652
653 if (ret & (1 << rdev_get_id(rdev))) {
654 dev_dbg(wm831x->dev, "DCDC%d under voltage\n",
655 rdev_get_id(rdev) + 1);
656 return REGULATOR_STATUS_ERROR;
657 }
658
659 /* Is the regulator on? */
660 ret = wm831x_reg_read(wm831x, WM831X_DCDC_STATUS);
661 if (ret < 0)
662 return ret;
663 if (ret & (1 << rdev_get_id(rdev)))
664 return REGULATOR_STATUS_ON;
665 else
666 return REGULATOR_STATUS_OFF;
667}
668
Julia Lawallb0d6dd32015-12-19 16:31:24 +0100669static const struct regulator_ops wm831x_boostp_ops = {
Mark Brown13048502009-07-28 15:23:16 +0100670 .get_status = wm831x_boostp_get_status,
671
Mark Brown3d138fc2012-04-15 12:38:42 +0100672 .is_enabled = regulator_is_enabled_regmap,
673 .enable = regulator_enable_regmap,
674 .disable = regulator_disable_regmap,
Mark Brown13048502009-07-28 15:23:16 +0100675};
676
Bill Pembertona5023572012-11-19 13:22:22 -0500677static int wm831x_boostp_probe(struct platform_device *pdev)
Mark Brown13048502009-07-28 15:23:16 +0100678{
679 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
Jingoo Handff91d02013-07-30 17:20:47 +0900680 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
Mark Brownc172708d2012-04-04 00:50:22 +0100681 struct regulator_config config = { };
Mark Brown13048502009-07-28 15:23:16 +0100682 int id = pdev->id % ARRAY_SIZE(pdata->dcdc);
683 struct wm831x_dcdc *dcdc;
684 struct resource *res;
685 int ret, irq;
686
687 dev_dbg(&pdev->dev, "Probing DCDC%d\n", id + 1);
688
689 if (pdata == NULL || pdata->dcdc[id] == NULL)
690 return -ENODEV;
691
Axel Lin4c601652012-03-23 17:00:01 +0800692 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), GFP_KERNEL);
Sachin Kamat5730aa52014-02-20 14:23:20 +0530693 if (!dcdc)
Mark Brown13048502009-07-28 15:23:16 +0100694 return -ENOMEM;
Mark Brown13048502009-07-28 15:23:16 +0100695
696 dcdc->wm831x = wm831x;
697
Mark Brown56560982012-08-07 19:42:47 +0100698 res = platform_get_resource(pdev, IORESOURCE_REG, 0);
Mark Brown13048502009-07-28 15:23:16 +0100699 if (res == NULL) {
Mark Brown56560982012-08-07 19:42:47 +0100700 dev_err(&pdev->dev, "No REG resource\n");
Fabio Estevam477b2ba2013-12-30 18:03:24 -0200701 return -EINVAL;
Mark Brown13048502009-07-28 15:23:16 +0100702 }
703 dcdc->base = res->start;
704
705 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1);
706 dcdc->desc.name = dcdc->name;
707 dcdc->desc.id = id;
708 dcdc->desc.type = REGULATOR_VOLTAGE;
709 dcdc->desc.ops = &wm831x_boostp_ops;
710 dcdc->desc.owner = THIS_MODULE;
Mark Brown3d138fc2012-04-15 12:38:42 +0100711 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE;
712 dcdc->desc.enable_mask = 1 << id;
Mark Brown13048502009-07-28 15:23:16 +0100713
Mark Brownc172708d2012-04-04 00:50:22 +0100714 config.dev = pdev->dev.parent;
Mark Brownf0b067d2012-05-14 11:37:09 +0100715 if (pdata)
716 config.init_data = pdata->dcdc[id];
Mark Brownc172708d2012-04-04 00:50:22 +0100717 config.driver_data = dcdc;
Mark Brown3d138fc2012-04-15 12:38:42 +0100718 config.regmap = wm831x->regmap;
Mark Brownc172708d2012-04-04 00:50:22 +0100719
Mark Brownd73b4cb2013-08-31 11:58:40 +0100720 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc,
721 &config);
Mark Brown13048502009-07-28 15:23:16 +0100722 if (IS_ERR(dcdc->regulator)) {
723 ret = PTR_ERR(dcdc->regulator);
724 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
725 id + 1, ret);
Fabio Estevam477b2ba2013-12-30 18:03:24 -0200726 return ret;
Mark Brown13048502009-07-28 15:23:16 +0100727 }
728
Mark Browncd997582012-05-14 23:14:24 +0200729 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
Mark Brownb0c4c0c2013-08-31 11:47:39 +0100730 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
731 wm831x_dcdc_uv_irq,
Fabio Estevam29454732015-06-01 22:33:53 -0300732 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
733 dcdc->name,
Mark Brownb0c4c0c2013-08-31 11:47:39 +0100734 dcdc);
Mark Brown13048502009-07-28 15:23:16 +0100735 if (ret != 0) {
736 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
737 irq, ret);
Fabio Estevam477b2ba2013-12-30 18:03:24 -0200738 return ret;
Mark Brown13048502009-07-28 15:23:16 +0100739 }
740
741 platform_set_drvdata(pdev, dcdc);
742
743 return 0;
Mark Brown13048502009-07-28 15:23:16 +0100744}
745
Mark Brown13048502009-07-28 15:23:16 +0100746static struct platform_driver wm831x_boostp_driver = {
747 .probe = wm831x_boostp_probe,
Mark Brown13048502009-07-28 15:23:16 +0100748 .driver = {
749 .name = "wm831x-boostp",
750 },
751};
752
753/*
Mark Brown8267a9b2009-07-28 15:22:23 +0100754 * External Power Enable
755 *
756 * These aren't actually DCDCs but look like them in hardware so share
757 * code.
758 */
759
760#define WM831X_EPE_BASE 6
761
Julia Lawallb0d6dd32015-12-19 16:31:24 +0100762static const struct regulator_ops wm831x_epe_ops = {
Mark Brown3d138fc2012-04-15 12:38:42 +0100763 .is_enabled = regulator_is_enabled_regmap,
764 .enable = regulator_enable_regmap,
765 .disable = regulator_disable_regmap,
Mark Brown8267a9b2009-07-28 15:22:23 +0100766 .get_status = wm831x_dcdc_get_status,
767};
768
Bill Pembertona5023572012-11-19 13:22:22 -0500769static int wm831x_epe_probe(struct platform_device *pdev)
Mark Brown8267a9b2009-07-28 15:22:23 +0100770{
771 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
Jingoo Handff91d02013-07-30 17:20:47 +0900772 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
Mark Brownc172708d2012-04-04 00:50:22 +0100773 struct regulator_config config = { };
Mark Brown8267a9b2009-07-28 15:22:23 +0100774 int id = pdev->id % ARRAY_SIZE(pdata->epe);
775 struct wm831x_dcdc *dcdc;
776 int ret;
777
778 dev_dbg(&pdev->dev, "Probing EPE%d\n", id + 1);
779
Axel Lin4c601652012-03-23 17:00:01 +0800780 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), GFP_KERNEL);
Sachin Kamat5730aa52014-02-20 14:23:20 +0530781 if (!dcdc)
Mark Brown8267a9b2009-07-28 15:22:23 +0100782 return -ENOMEM;
Mark Brown8267a9b2009-07-28 15:22:23 +0100783
784 dcdc->wm831x = wm831x;
785
786 /* For current parts this is correct; probably need to revisit
787 * in future.
788 */
789 snprintf(dcdc->name, sizeof(dcdc->name), "EPE%d", id + 1);
790 dcdc->desc.name = dcdc->name;
791 dcdc->desc.id = id + WM831X_EPE_BASE; /* Offset in DCDC registers */
792 dcdc->desc.ops = &wm831x_epe_ops;
793 dcdc->desc.type = REGULATOR_VOLTAGE;
794 dcdc->desc.owner = THIS_MODULE;
Mark Brown3d138fc2012-04-15 12:38:42 +0100795 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE;
796 dcdc->desc.enable_mask = 1 << dcdc->desc.id;
Mark Brown8267a9b2009-07-28 15:22:23 +0100797
Mark Brownc172708d2012-04-04 00:50:22 +0100798 config.dev = pdev->dev.parent;
Mark Brownb7ca8782012-05-10 00:41:02 +0100799 if (pdata)
800 config.init_data = pdata->epe[id];
Mark Brownc172708d2012-04-04 00:50:22 +0100801 config.driver_data = dcdc;
Mark Brown3d138fc2012-04-15 12:38:42 +0100802 config.regmap = wm831x->regmap;
Mark Brownc172708d2012-04-04 00:50:22 +0100803
Mark Brownd73b4cb2013-08-31 11:58:40 +0100804 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc,
805 &config);
Mark Brown8267a9b2009-07-28 15:22:23 +0100806 if (IS_ERR(dcdc->regulator)) {
807 ret = PTR_ERR(dcdc->regulator);
808 dev_err(wm831x->dev, "Failed to register EPE%d: %d\n",
809 id + 1, ret);
810 goto err;
811 }
812
813 platform_set_drvdata(pdev, dcdc);
814
815 return 0;
816
817err:
Mark Brown8267a9b2009-07-28 15:22:23 +0100818 return ret;
819}
820
Mark Brown8267a9b2009-07-28 15:22:23 +0100821static struct platform_driver wm831x_epe_driver = {
822 .probe = wm831x_epe_probe,
Mark Brown8267a9b2009-07-28 15:22:23 +0100823 .driver = {
824 .name = "wm831x-epe",
825 },
826};
827
Thierry Reding55e03e9c2015-12-02 17:32:52 +0100828static struct platform_driver * const drivers[] = {
829 &wm831x_buckv_driver,
830 &wm831x_buckp_driver,
831 &wm831x_boostp_driver,
832 &wm831x_epe_driver,
833};
834
Mark Browne4ee8312009-07-28 15:21:49 +0100835static int __init wm831x_dcdc_init(void)
836{
Thierry Reding55e03e9c2015-12-02 17:32:52 +0100837 return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
Mark Browne4ee8312009-07-28 15:21:49 +0100838}
839subsys_initcall(wm831x_dcdc_init);
840
841static void __exit wm831x_dcdc_exit(void)
842{
Thierry Reding55e03e9c2015-12-02 17:32:52 +0100843 platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
Mark Browne4ee8312009-07-28 15:21:49 +0100844}
845module_exit(wm831x_dcdc_exit);
846
847/* Module information */
848MODULE_AUTHOR("Mark Brown");
849MODULE_DESCRIPTION("WM831x DC-DC convertor driver");
850MODULE_LICENSE("GPL");
851MODULE_ALIAS("platform:wm831x-buckv");
852MODULE_ALIAS("platform:wm831x-buckp");
Axel Lin43f1f212012-11-30 20:39:53 +0800853MODULE_ALIAS("platform:wm831x-boostp");
Mark Brown24b43152011-07-25 22:20:31 +0100854MODULE_ALIAS("platform:wm831x-epe");