2 * tps65912.c -- TI tps65912
4 * Copyright 2011 Texas Instruments Inc.
6 * Author: Margarita Olaya Cabrera <magi@slimlogic.co.uk>
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.
13 * This driver is based on wm8350 implementation.
16 #include <linux/kernel.h>
17 #include <linux/module.h>
18 #include <linux/init.h>
19 #include <linux/err.h>
20 #include <linux/platform_device.h>
21 #include <linux/regulator/driver.h>
22 #include <linux/regulator/machine.h>
23 #include <linux/delay.h>
24 #include <linux/slab.h>
25 #include <linux/gpio.h>
26 #include <linux/mfd/tps65912.h>
29 #define TPS65912_REG_DCDC1 0
30 #define TPS65912_REG_DCDC2 1
31 #define TPS65912_REG_DCDC3 2
32 #define TPS65912_REG_DCDC4 3
35 #define TPS65912_REG_LDO1 4
36 #define TPS65912_REG_LDO2 5
37 #define TPS65912_REG_LDO3 6
38 #define TPS65912_REG_LDO4 7
39 #define TPS65912_REG_LDO5 8
40 #define TPS65912_REG_LDO6 9
41 #define TPS65912_REG_LDO7 10
42 #define TPS65912_REG_LDO8 11
43 #define TPS65912_REG_LDO9 12
44 #define TPS65912_REG_LDO10 13
46 #define TPS65912_MAX_REG_ID TPS65912_REG_LDO_10
48 /* Number of step-down converters available */
49 #define TPS65912_NUM_DCDC 4
51 /* Number of LDO voltage regulators available */
52 #define TPS65912_NUM_LDO 10
54 /* Number of total regulators available */
55 #define TPS65912_NUM_REGULATOR (TPS65912_NUM_DCDC + TPS65912_NUM_LDO)
57 #define TPS65912_REG_ENABLED 0x80
58 #define OP_SELREG_MASK 0x40
59 #define OP_SELREG_SHIFT 6
65 static struct tps_info tps65912_regs
[] = {
110 struct tps65912_reg
{
111 struct regulator_desc desc
[TPS65912_NUM_REGULATOR
];
112 struct tps65912
*mfd
;
113 struct regulator_dev
*rdev
[TPS65912_NUM_REGULATOR
];
114 struct tps_info
*info
[TPS65912_NUM_REGULATOR
];
115 /* for read/write access */
116 struct mutex io_lock
;
118 int (*get_ctrl_reg
)(int);
127 static int tps65912_get_range(struct tps65912_reg
*pmic
, int id
)
129 struct tps65912
*mfd
= pmic
->mfd
;
131 if (id
> TPS65912_REG_DCDC4
)
135 case TPS65912_REG_DCDC1
:
136 pmic
->dcdc1_range
= tps65912_reg_read(mfd
,
137 TPS65912_DCDC1_LIMIT
);
138 if (pmic
->dcdc1_range
< 0)
139 return pmic
->dcdc1_range
;
140 pmic
->dcdc1_range
= (pmic
->dcdc1_range
&
141 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
142 return pmic
->dcdc1_range
;
143 case TPS65912_REG_DCDC2
:
144 pmic
->dcdc2_range
= tps65912_reg_read(mfd
,
145 TPS65912_DCDC2_LIMIT
);
146 if (pmic
->dcdc2_range
< 0)
147 return pmic
->dcdc2_range
;
148 pmic
->dcdc2_range
= (pmic
->dcdc2_range
&
149 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
150 return pmic
->dcdc2_range
;
151 case TPS65912_REG_DCDC3
:
152 pmic
->dcdc3_range
= tps65912_reg_read(mfd
,
153 TPS65912_DCDC3_LIMIT
);
154 if (pmic
->dcdc3_range
< 0)
155 return pmic
->dcdc3_range
;
156 pmic
->dcdc3_range
= (pmic
->dcdc3_range
&
157 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
158 return pmic
->dcdc3_range
;
159 case TPS65912_REG_DCDC4
:
160 pmic
->dcdc4_range
= tps65912_reg_read(mfd
,
161 TPS65912_DCDC4_LIMIT
);
162 if (pmic
->dcdc4_range
< 0)
163 return pmic
->dcdc4_range
;
164 pmic
->dcdc4_range
= (pmic
->dcdc4_range
&
165 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
166 return pmic
->dcdc4_range
;
172 static unsigned long tps65912_vsel_to_uv_range0(u8 vsel
)
176 uv
= ((vsel
* 12500) + 500000);
180 static unsigned long tps65912_vsel_to_uv_range1(u8 vsel
)
184 uv
= ((vsel
* 12500) + 700000);
188 static unsigned long tps65912_vsel_to_uv_range2(u8 vsel
)
192 uv
= ((vsel
* 25000) + 500000);
196 static unsigned long tps65912_vsel_to_uv_range3(u8 vsel
)
203 uv
= ((vsel
* 50000) + 500000);
208 static unsigned long tps65912_vsel_to_uv_ldo(u8 vsel
)
210 unsigned long uv
= 0;
213 uv
= ((vsel
* 25000) + 800000);
214 else if (vsel
> 32 && vsel
<= 60)
215 uv
= (((vsel
- 32) * 50000) + 1600000);
217 uv
= (((vsel
- 60) * 100000) + 3000000);
222 static int tps65912_get_ctrl_register(int id
)
225 case TPS65912_REG_DCDC1
:
226 return TPS65912_DCDC1_AVS
;
227 case TPS65912_REG_DCDC2
:
228 return TPS65912_DCDC2_AVS
;
229 case TPS65912_REG_DCDC3
:
230 return TPS65912_DCDC3_AVS
;
231 case TPS65912_REG_DCDC4
:
232 return TPS65912_DCDC4_AVS
;
233 case TPS65912_REG_LDO1
:
234 return TPS65912_LDO1_AVS
;
235 case TPS65912_REG_LDO2
:
236 return TPS65912_LDO2_AVS
;
237 case TPS65912_REG_LDO3
:
238 return TPS65912_LDO3_AVS
;
239 case TPS65912_REG_LDO4
:
240 return TPS65912_LDO4_AVS
;
241 case TPS65912_REG_LDO5
:
242 return TPS65912_LDO5
;
243 case TPS65912_REG_LDO6
:
244 return TPS65912_LDO6
;
245 case TPS65912_REG_LDO7
:
246 return TPS65912_LDO7
;
247 case TPS65912_REG_LDO8
:
248 return TPS65912_LDO8
;
249 case TPS65912_REG_LDO9
:
250 return TPS65912_LDO9
;
251 case TPS65912_REG_LDO10
:
252 return TPS65912_LDO10
;
258 static int tps65912_get_dcdc_sel_register(struct tps65912_reg
*pmic
, int id
)
260 struct tps65912
*mfd
= pmic
->mfd
;
261 int opvsel
= 0, sr
= 0;
264 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_DCDC4
)
268 case TPS65912_REG_DCDC1
:
269 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_OP
);
270 sr
= ((opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
);
272 reg
= TPS65912_DCDC1_AVS
;
274 reg
= TPS65912_DCDC1_OP
;
276 case TPS65912_REG_DCDC2
:
277 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_OP
);
278 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
280 reg
= TPS65912_DCDC2_AVS
;
282 reg
= TPS65912_DCDC2_OP
;
284 case TPS65912_REG_DCDC3
:
285 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_OP
);
286 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
288 reg
= TPS65912_DCDC3_AVS
;
290 reg
= TPS65912_DCDC3_OP
;
292 case TPS65912_REG_DCDC4
:
293 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_OP
);
294 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
296 reg
= TPS65912_DCDC4_AVS
;
298 reg
= TPS65912_DCDC4_OP
;
304 static int tps65912_get_ldo_sel_register(struct tps65912_reg
*pmic
, int id
)
306 struct tps65912
*mfd
= pmic
->mfd
;
307 int opvsel
= 0, sr
= 0;
310 if (id
< TPS65912_REG_LDO1
|| id
> TPS65912_REG_LDO10
)
314 case TPS65912_REG_LDO1
:
315 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO1_OP
);
316 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
318 reg
= TPS65912_LDO1_AVS
;
320 reg
= TPS65912_LDO1_OP
;
322 case TPS65912_REG_LDO2
:
323 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO2_OP
);
324 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
326 reg
= TPS65912_LDO2_AVS
;
328 reg
= TPS65912_LDO2_OP
;
330 case TPS65912_REG_LDO3
:
331 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO3_OP
);
332 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
334 reg
= TPS65912_LDO3_AVS
;
336 reg
= TPS65912_LDO3_OP
;
338 case TPS65912_REG_LDO4
:
339 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO4_OP
);
340 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
342 reg
= TPS65912_LDO4_AVS
;
344 reg
= TPS65912_LDO4_OP
;
346 case TPS65912_REG_LDO5
:
349 case TPS65912_REG_LDO6
:
352 case TPS65912_REG_LDO7
:
355 case TPS65912_REG_LDO8
:
358 case TPS65912_REG_LDO9
:
361 case TPS65912_REG_LDO10
:
362 reg
= TPS65912_LDO10
;
369 static int tps65912_get_mode_regiters(struct tps65912_reg
*pmic
, int id
)
372 case TPS65912_REG_DCDC1
:
373 pmic
->pwm_mode_reg
= TPS65912_DCDC1_CTRL
;
374 pmic
->eco_reg
= TPS65912_DCDC1_AVS
;
376 case TPS65912_REG_DCDC2
:
377 pmic
->pwm_mode_reg
= TPS65912_DCDC2_CTRL
;
378 pmic
->eco_reg
= TPS65912_DCDC2_AVS
;
380 case TPS65912_REG_DCDC3
:
381 pmic
->pwm_mode_reg
= TPS65912_DCDC3_CTRL
;
382 pmic
->eco_reg
= TPS65912_DCDC3_AVS
;
384 case TPS65912_REG_DCDC4
:
385 pmic
->pwm_mode_reg
= TPS65912_DCDC4_CTRL
;
386 pmic
->eco_reg
= TPS65912_DCDC4_AVS
;
395 static int tps65912_reg_is_enabled(struct regulator_dev
*dev
)
397 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
398 struct tps65912
*mfd
= pmic
->mfd
;
399 int reg
, value
, id
= rdev_get_id(dev
);
401 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_LDO10
)
404 reg
= pmic
->get_ctrl_reg(id
);
408 value
= tps65912_reg_read(mfd
, reg
);
412 return value
& TPS65912_REG_ENABLED
;
415 static int tps65912_reg_enable(struct regulator_dev
*dev
)
417 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
418 struct tps65912
*mfd
= pmic
->mfd
;
419 int id
= rdev_get_id(dev
);
422 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_LDO10
)
425 reg
= pmic
->get_ctrl_reg(id
);
429 return tps65912_set_bits(mfd
, reg
, TPS65912_REG_ENABLED
);
432 static int tps65912_reg_disable(struct regulator_dev
*dev
)
434 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
435 struct tps65912
*mfd
= pmic
->mfd
;
436 int id
= rdev_get_id(dev
), reg
;
438 reg
= pmic
->get_ctrl_reg(id
);
442 return tps65912_clear_bits(mfd
, reg
, TPS65912_REG_ENABLED
);
445 static int tps65912_set_mode(struct regulator_dev
*dev
, unsigned int mode
)
447 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
448 struct tps65912
*mfd
= pmic
->mfd
;
449 int pwm_mode
, eco
, id
= rdev_get_id(dev
);
451 tps65912_get_mode_regiters(pmic
, id
);
453 pwm_mode
= tps65912_reg_read(mfd
, pmic
->pwm_mode_reg
);
454 eco
= tps65912_reg_read(mfd
, pmic
->eco_reg
);
456 pwm_mode
&= DCDCCTRL_DCDC_MODE_MASK
;
457 eco
&= DCDC_AVS_ECO_MASK
;
460 case REGULATOR_MODE_FAST
:
461 /* Verify if mode alredy set */
462 if (pwm_mode
&& !eco
)
464 tps65912_set_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
465 tps65912_clear_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
467 case REGULATOR_MODE_NORMAL
:
468 case REGULATOR_MODE_IDLE
:
469 if (!pwm_mode
&& !eco
)
471 tps65912_clear_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
472 tps65912_clear_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
474 case REGULATOR_MODE_STANDBY
:
475 if (!pwm_mode
&& eco
)
477 tps65912_clear_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
478 tps65912_set_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
487 static unsigned int tps65912_get_mode(struct regulator_dev
*dev
)
489 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
490 struct tps65912
*mfd
= pmic
->mfd
;
491 int pwm_mode
, eco
, mode
= 0, id
= rdev_get_id(dev
);
493 tps65912_get_mode_regiters(pmic
, id
);
495 pwm_mode
= tps65912_reg_read(mfd
, pmic
->pwm_mode_reg
);
496 eco
= tps65912_reg_read(mfd
, pmic
->eco_reg
);
498 pwm_mode
&= DCDCCTRL_DCDC_MODE_MASK
;
499 eco
&= DCDC_AVS_ECO_MASK
;
501 if (pwm_mode
&& !eco
)
502 mode
= REGULATOR_MODE_FAST
;
503 else if (!pwm_mode
&& !eco
)
504 mode
= REGULATOR_MODE_NORMAL
;
505 else if (!pwm_mode
&& eco
)
506 mode
= REGULATOR_MODE_STANDBY
;
511 static int tps65912_get_voltage_dcdc(struct regulator_dev
*dev
)
513 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
514 struct tps65912
*mfd
= pmic
->mfd
;
515 int id
= rdev_get_id(dev
), voltage
= 0, range
;
516 int opvsel
= 0, avsel
= 0, sr
, vsel
;
519 case TPS65912_REG_DCDC1
:
520 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_OP
);
521 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_AVS
);
522 range
= pmic
->dcdc1_range
;
524 case TPS65912_REG_DCDC2
:
525 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_OP
);
526 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_AVS
);
527 range
= pmic
->dcdc2_range
;
529 case TPS65912_REG_DCDC3
:
530 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_OP
);
531 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_AVS
);
532 range
= pmic
->dcdc3_range
;
534 case TPS65912_REG_DCDC4
:
535 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_OP
);
536 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_AVS
);
537 range
= pmic
->dcdc4_range
;
543 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
552 /* 0.5 - 1.2875V in 12.5mV steps */
553 voltage
= tps65912_vsel_to_uv_range0(vsel
);
556 /* 0.7 - 1.4875V in 12.5mV steps */
557 voltage
= tps65912_vsel_to_uv_range1(vsel
);
560 /* 0.5 - 2.075V in 25mV steps */
561 voltage
= tps65912_vsel_to_uv_range2(vsel
);
564 /* 0.5 - 3.8V in 50mV steps */
565 voltage
= tps65912_vsel_to_uv_range3(vsel
);
571 static int tps65912_set_voltage_dcdc(struct regulator_dev
*dev
,
574 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
575 struct tps65912
*mfd
= pmic
->mfd
;
576 int id
= rdev_get_id(dev
);
580 reg
= tps65912_get_dcdc_sel_register(pmic
, id
);
581 value
= tps65912_reg_read(mfd
, reg
);
583 return tps65912_reg_write(mfd
, reg
, selector
| value
);
586 static int tps65912_get_voltage_ldo(struct regulator_dev
*dev
)
588 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
589 struct tps65912
*mfd
= pmic
->mfd
;
590 int id
= rdev_get_id(dev
);
594 reg
= tps65912_get_ldo_sel_register(pmic
, id
);
595 vsel
= tps65912_reg_read(mfd
, reg
);
598 return tps65912_vsel_to_uv_ldo(vsel
);
601 static int tps65912_set_voltage_ldo(struct regulator_dev
*dev
,
604 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
605 struct tps65912
*mfd
= pmic
->mfd
;
606 int id
= rdev_get_id(dev
), reg
, value
;
608 reg
= tps65912_get_ldo_sel_register(pmic
, id
);
609 value
= tps65912_reg_read(mfd
, reg
);
611 return tps65912_reg_write(mfd
, reg
, selector
| value
);
614 static int tps65912_list_voltage_dcdc(struct regulator_dev
*dev
,
617 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
618 int range
, voltage
= 0, id
= rdev_get_id(dev
);
621 case TPS65912_REG_DCDC1
:
622 range
= pmic
->dcdc1_range
;
624 case TPS65912_REG_DCDC2
:
625 range
= pmic
->dcdc2_range
;
627 case TPS65912_REG_DCDC3
:
628 range
= pmic
->dcdc3_range
;
630 case TPS65912_REG_DCDC4
:
631 range
= pmic
->dcdc4_range
;
639 /* 0.5 - 1.2875V in 12.5mV steps */
640 voltage
= tps65912_vsel_to_uv_range0(selector
);
643 /* 0.7 - 1.4875V in 12.5mV steps */
644 voltage
= tps65912_vsel_to_uv_range1(selector
);
647 /* 0.5 - 2.075V in 25mV steps */
648 voltage
= tps65912_vsel_to_uv_range2(selector
);
651 /* 0.5 - 3.8V in 50mV steps */
652 voltage
= tps65912_vsel_to_uv_range3(selector
);
658 static int tps65912_list_voltage_ldo(struct regulator_dev
*dev
,
661 int ldo
= rdev_get_id(dev
);
663 if (ldo
< TPS65912_REG_LDO1
|| ldo
> TPS65912_REG_LDO10
)
666 return tps65912_vsel_to_uv_ldo(selector
);
669 /* Operations permitted on DCDCx */
670 static struct regulator_ops tps65912_ops_dcdc
= {
671 .is_enabled
= tps65912_reg_is_enabled
,
672 .enable
= tps65912_reg_enable
,
673 .disable
= tps65912_reg_disable
,
674 .set_mode
= tps65912_set_mode
,
675 .get_mode
= tps65912_get_mode
,
676 .get_voltage
= tps65912_get_voltage_dcdc
,
677 .set_voltage_sel
= tps65912_set_voltage_dcdc
,
678 .list_voltage
= tps65912_list_voltage_dcdc
,
681 /* Operations permitted on LDOx */
682 static struct regulator_ops tps65912_ops_ldo
= {
683 .is_enabled
= tps65912_reg_is_enabled
,
684 .enable
= tps65912_reg_enable
,
685 .disable
= tps65912_reg_disable
,
686 .get_voltage
= tps65912_get_voltage_ldo
,
687 .set_voltage_sel
= tps65912_set_voltage_ldo
,
688 .list_voltage
= tps65912_list_voltage_ldo
,
691 static __devinit
int tps65912_probe(struct platform_device
*pdev
)
693 struct tps65912
*tps65912
= dev_get_drvdata(pdev
->dev
.parent
);
694 struct tps_info
*info
;
695 struct regulator_init_data
*reg_data
;
696 struct regulator_dev
*rdev
;
697 struct tps65912_reg
*pmic
;
698 struct tps65912_board
*pmic_plat_data
;
701 pmic_plat_data
= dev_get_platdata(tps65912
->dev
);
705 reg_data
= pmic_plat_data
->tps65912_pmic_init_data
;
707 pmic
= kzalloc(sizeof(*pmic
), GFP_KERNEL
);
711 mutex_init(&pmic
->io_lock
);
712 pmic
->mfd
= tps65912
;
713 platform_set_drvdata(pdev
, pmic
);
715 pmic
->get_ctrl_reg
= &tps65912_get_ctrl_register
;
716 info
= tps65912_regs
;
718 for (i
= 0; i
< TPS65912_NUM_REGULATOR
; i
++, info
++, reg_data
++) {
720 /* Register the regulators */
721 pmic
->info
[i
] = info
;
723 pmic
->desc
[i
].name
= info
->name
;
724 pmic
->desc
[i
].id
= i
;
725 pmic
->desc
[i
].n_voltages
= 64;
726 pmic
->desc
[i
].ops
= (i
> TPS65912_REG_DCDC4
?
727 &tps65912_ops_ldo
: &tps65912_ops_dcdc
);
728 pmic
->desc
[i
].type
= REGULATOR_VOLTAGE
;
729 pmic
->desc
[i
].owner
= THIS_MODULE
;
730 range
= tps65912_get_range(pmic
, i
);
731 rdev
= regulator_register(&pmic
->desc
[i
],
732 tps65912
->dev
, reg_data
, pmic
);
734 dev_err(tps65912
->dev
,
735 "failed to register %s regulator\n",
741 /* Save regulator for cleanup */
742 pmic
->rdev
[i
] = rdev
;
748 regulator_unregister(pmic
->rdev
[i
]);
754 static int __devexit
tps65912_remove(struct platform_device
*pdev
)
756 struct tps65912_reg
*tps65912_reg
= platform_get_drvdata(pdev
);
759 for (i
= 0; i
< TPS65912_NUM_REGULATOR
; i
++)
760 regulator_unregister(tps65912_reg
->rdev
[i
]);
766 static struct platform_driver tps65912_driver
= {
768 .name
= "tps65912-pmic",
769 .owner
= THIS_MODULE
,
771 .probe
= tps65912_probe
,
772 .remove
= __devexit_p(tps65912_remove
),
778 * Module init function
780 static int __init
tps65912_init(void)
782 return platform_driver_register(&tps65912_driver
);
784 subsys_initcall(tps65912_init
);
789 * Module exit function
791 static void __exit
tps65912_cleanup(void)
793 platform_driver_unregister(&tps65912_driver
);
795 module_exit(tps65912_cleanup
);
797 MODULE_AUTHOR("Margarita Olaya Cabrera <magi@slimlogic.co.uk>");
798 MODULE_DESCRIPTION("TPS65912 voltage regulator driver");
799 MODULE_LICENSE("GPL v2");
800 MODULE_ALIAS("platform:tps65912-pmic");