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 /* Number of step-down converters available */
47 #define TPS65912_NUM_DCDC 4
49 /* Number of LDO voltage regulators available */
50 #define TPS65912_NUM_LDO 10
52 /* Number of total regulators available */
53 #define TPS65912_NUM_REGULATOR (TPS65912_NUM_DCDC + TPS65912_NUM_LDO)
55 #define TPS65912_REG_ENABLED 0x80
56 #define OP_SELREG_MASK 0x40
57 #define OP_SELREG_SHIFT 6
63 static struct tps_info tps65912_regs
[] = {
108 struct tps65912_reg
{
109 struct regulator_desc desc
[TPS65912_NUM_REGULATOR
];
110 struct tps65912
*mfd
;
111 struct regulator_dev
*rdev
[TPS65912_NUM_REGULATOR
];
112 struct tps_info
*info
[TPS65912_NUM_REGULATOR
];
113 /* for read/write access */
114 struct mutex io_lock
;
116 int (*get_ctrl_reg
)(int);
125 static int tps65912_get_range(struct tps65912_reg
*pmic
, int id
)
127 struct tps65912
*mfd
= pmic
->mfd
;
129 if (id
> TPS65912_REG_DCDC4
)
133 case TPS65912_REG_DCDC1
:
134 pmic
->dcdc1_range
= tps65912_reg_read(mfd
,
135 TPS65912_DCDC1_LIMIT
);
136 if (pmic
->dcdc1_range
< 0)
137 return pmic
->dcdc1_range
;
138 pmic
->dcdc1_range
= (pmic
->dcdc1_range
&
139 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
140 return pmic
->dcdc1_range
;
141 case TPS65912_REG_DCDC2
:
142 pmic
->dcdc2_range
= tps65912_reg_read(mfd
,
143 TPS65912_DCDC2_LIMIT
);
144 if (pmic
->dcdc2_range
< 0)
145 return pmic
->dcdc2_range
;
146 pmic
->dcdc2_range
= (pmic
->dcdc2_range
&
147 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
148 return pmic
->dcdc2_range
;
149 case TPS65912_REG_DCDC3
:
150 pmic
->dcdc3_range
= tps65912_reg_read(mfd
,
151 TPS65912_DCDC3_LIMIT
);
152 if (pmic
->dcdc3_range
< 0)
153 return pmic
->dcdc3_range
;
154 pmic
->dcdc3_range
= (pmic
->dcdc3_range
&
155 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
156 return pmic
->dcdc3_range
;
157 case TPS65912_REG_DCDC4
:
158 pmic
->dcdc4_range
= tps65912_reg_read(mfd
,
159 TPS65912_DCDC4_LIMIT
);
160 if (pmic
->dcdc4_range
< 0)
161 return pmic
->dcdc4_range
;
162 pmic
->dcdc4_range
= (pmic
->dcdc4_range
&
163 DCDC_LIMIT_RANGE_MASK
) >> DCDC_LIMIT_RANGE_SHIFT
;
164 return pmic
->dcdc4_range
;
170 static unsigned long tps65912_vsel_to_uv_range0(u8 vsel
)
174 uv
= ((vsel
* 12500) + 500000);
178 static unsigned long tps65912_vsel_to_uv_range1(u8 vsel
)
182 uv
= ((vsel
* 12500) + 700000);
186 static unsigned long tps65912_vsel_to_uv_range2(u8 vsel
)
190 uv
= ((vsel
* 25000) + 500000);
194 static unsigned long tps65912_vsel_to_uv_range3(u8 vsel
)
201 uv
= ((vsel
* 50000) + 500000);
206 static unsigned long tps65912_vsel_to_uv_ldo(u8 vsel
)
208 unsigned long uv
= 0;
211 uv
= ((vsel
* 25000) + 800000);
212 else if (vsel
> 32 && vsel
<= 60)
213 uv
= (((vsel
- 32) * 50000) + 1600000);
215 uv
= (((vsel
- 60) * 100000) + 3000000);
220 static int tps65912_get_ctrl_register(int id
)
223 case TPS65912_REG_DCDC1
:
224 return TPS65912_DCDC1_AVS
;
225 case TPS65912_REG_DCDC2
:
226 return TPS65912_DCDC2_AVS
;
227 case TPS65912_REG_DCDC3
:
228 return TPS65912_DCDC3_AVS
;
229 case TPS65912_REG_DCDC4
:
230 return TPS65912_DCDC4_AVS
;
231 case TPS65912_REG_LDO1
:
232 return TPS65912_LDO1_AVS
;
233 case TPS65912_REG_LDO2
:
234 return TPS65912_LDO2_AVS
;
235 case TPS65912_REG_LDO3
:
236 return TPS65912_LDO3_AVS
;
237 case TPS65912_REG_LDO4
:
238 return TPS65912_LDO4_AVS
;
239 case TPS65912_REG_LDO5
:
240 return TPS65912_LDO5
;
241 case TPS65912_REG_LDO6
:
242 return TPS65912_LDO6
;
243 case TPS65912_REG_LDO7
:
244 return TPS65912_LDO7
;
245 case TPS65912_REG_LDO8
:
246 return TPS65912_LDO8
;
247 case TPS65912_REG_LDO9
:
248 return TPS65912_LDO9
;
249 case TPS65912_REG_LDO10
:
250 return TPS65912_LDO10
;
256 static int tps65912_get_dcdc_sel_register(struct tps65912_reg
*pmic
, int id
)
258 struct tps65912
*mfd
= pmic
->mfd
;
259 int opvsel
= 0, sr
= 0;
262 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_DCDC4
)
266 case TPS65912_REG_DCDC1
:
267 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_OP
);
268 sr
= ((opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
);
270 reg
= TPS65912_DCDC1_AVS
;
272 reg
= TPS65912_DCDC1_OP
;
274 case TPS65912_REG_DCDC2
:
275 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_OP
);
276 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
278 reg
= TPS65912_DCDC2_AVS
;
280 reg
= TPS65912_DCDC2_OP
;
282 case TPS65912_REG_DCDC3
:
283 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_OP
);
284 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
286 reg
= TPS65912_DCDC3_AVS
;
288 reg
= TPS65912_DCDC3_OP
;
290 case TPS65912_REG_DCDC4
:
291 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_OP
);
292 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
294 reg
= TPS65912_DCDC4_AVS
;
296 reg
= TPS65912_DCDC4_OP
;
302 static int tps65912_get_ldo_sel_register(struct tps65912_reg
*pmic
, int id
)
304 struct tps65912
*mfd
= pmic
->mfd
;
305 int opvsel
= 0, sr
= 0;
308 if (id
< TPS65912_REG_LDO1
|| id
> TPS65912_REG_LDO10
)
312 case TPS65912_REG_LDO1
:
313 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO1_OP
);
314 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
316 reg
= TPS65912_LDO1_AVS
;
318 reg
= TPS65912_LDO1_OP
;
320 case TPS65912_REG_LDO2
:
321 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO2_OP
);
322 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
324 reg
= TPS65912_LDO2_AVS
;
326 reg
= TPS65912_LDO2_OP
;
328 case TPS65912_REG_LDO3
:
329 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO3_OP
);
330 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
332 reg
= TPS65912_LDO3_AVS
;
334 reg
= TPS65912_LDO3_OP
;
336 case TPS65912_REG_LDO4
:
337 opvsel
= tps65912_reg_read(mfd
, TPS65912_LDO4_OP
);
338 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
340 reg
= TPS65912_LDO4_AVS
;
342 reg
= TPS65912_LDO4_OP
;
344 case TPS65912_REG_LDO5
:
347 case TPS65912_REG_LDO6
:
350 case TPS65912_REG_LDO7
:
353 case TPS65912_REG_LDO8
:
356 case TPS65912_REG_LDO9
:
359 case TPS65912_REG_LDO10
:
360 reg
= TPS65912_LDO10
;
367 static int tps65912_get_mode_regiters(struct tps65912_reg
*pmic
, int id
)
370 case TPS65912_REG_DCDC1
:
371 pmic
->pwm_mode_reg
= TPS65912_DCDC1_CTRL
;
372 pmic
->eco_reg
= TPS65912_DCDC1_AVS
;
374 case TPS65912_REG_DCDC2
:
375 pmic
->pwm_mode_reg
= TPS65912_DCDC2_CTRL
;
376 pmic
->eco_reg
= TPS65912_DCDC2_AVS
;
378 case TPS65912_REG_DCDC3
:
379 pmic
->pwm_mode_reg
= TPS65912_DCDC3_CTRL
;
380 pmic
->eco_reg
= TPS65912_DCDC3_AVS
;
382 case TPS65912_REG_DCDC4
:
383 pmic
->pwm_mode_reg
= TPS65912_DCDC4_CTRL
;
384 pmic
->eco_reg
= TPS65912_DCDC4_AVS
;
393 static int tps65912_reg_is_enabled(struct regulator_dev
*dev
)
395 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
396 struct tps65912
*mfd
= pmic
->mfd
;
397 int reg
, value
, id
= rdev_get_id(dev
);
399 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_LDO10
)
402 reg
= pmic
->get_ctrl_reg(id
);
406 value
= tps65912_reg_read(mfd
, reg
);
410 return value
& TPS65912_REG_ENABLED
;
413 static int tps65912_reg_enable(struct regulator_dev
*dev
)
415 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
416 struct tps65912
*mfd
= pmic
->mfd
;
417 int id
= rdev_get_id(dev
);
420 if (id
< TPS65912_REG_DCDC1
|| id
> TPS65912_REG_LDO10
)
423 reg
= pmic
->get_ctrl_reg(id
);
427 return tps65912_set_bits(mfd
, reg
, TPS65912_REG_ENABLED
);
430 static int tps65912_reg_disable(struct regulator_dev
*dev
)
432 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
433 struct tps65912
*mfd
= pmic
->mfd
;
434 int id
= rdev_get_id(dev
), reg
;
436 reg
= pmic
->get_ctrl_reg(id
);
440 return tps65912_clear_bits(mfd
, reg
, TPS65912_REG_ENABLED
);
443 static int tps65912_set_mode(struct regulator_dev
*dev
, unsigned int mode
)
445 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
446 struct tps65912
*mfd
= pmic
->mfd
;
447 int pwm_mode
, eco
, id
= rdev_get_id(dev
);
449 tps65912_get_mode_regiters(pmic
, id
);
451 pwm_mode
= tps65912_reg_read(mfd
, pmic
->pwm_mode_reg
);
452 eco
= tps65912_reg_read(mfd
, pmic
->eco_reg
);
454 pwm_mode
&= DCDCCTRL_DCDC_MODE_MASK
;
455 eco
&= DCDC_AVS_ECO_MASK
;
458 case REGULATOR_MODE_FAST
:
459 /* Verify if mode alredy set */
460 if (pwm_mode
&& !eco
)
462 tps65912_set_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
463 tps65912_clear_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
465 case REGULATOR_MODE_NORMAL
:
466 case REGULATOR_MODE_IDLE
:
467 if (!pwm_mode
&& !eco
)
469 tps65912_clear_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
470 tps65912_clear_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
472 case REGULATOR_MODE_STANDBY
:
473 if (!pwm_mode
&& eco
)
475 tps65912_clear_bits(mfd
, pmic
->pwm_mode_reg
, DCDCCTRL_DCDC_MODE_MASK
);
476 tps65912_set_bits(mfd
, pmic
->eco_reg
, DCDC_AVS_ECO_MASK
);
485 static unsigned int tps65912_get_mode(struct regulator_dev
*dev
)
487 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
488 struct tps65912
*mfd
= pmic
->mfd
;
489 int pwm_mode
, eco
, mode
= 0, id
= rdev_get_id(dev
);
491 tps65912_get_mode_regiters(pmic
, id
);
493 pwm_mode
= tps65912_reg_read(mfd
, pmic
->pwm_mode_reg
);
494 eco
= tps65912_reg_read(mfd
, pmic
->eco_reg
);
496 pwm_mode
&= DCDCCTRL_DCDC_MODE_MASK
;
497 eco
&= DCDC_AVS_ECO_MASK
;
499 if (pwm_mode
&& !eco
)
500 mode
= REGULATOR_MODE_FAST
;
501 else if (!pwm_mode
&& !eco
)
502 mode
= REGULATOR_MODE_NORMAL
;
503 else if (!pwm_mode
&& eco
)
504 mode
= REGULATOR_MODE_STANDBY
;
509 static int tps65912_get_voltage_dcdc(struct regulator_dev
*dev
)
511 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
512 struct tps65912
*mfd
= pmic
->mfd
;
513 int id
= rdev_get_id(dev
), voltage
= 0, range
;
514 int opvsel
= 0, avsel
= 0, sr
, vsel
;
517 case TPS65912_REG_DCDC1
:
518 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_OP
);
519 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC1_AVS
);
520 range
= pmic
->dcdc1_range
;
522 case TPS65912_REG_DCDC2
:
523 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_OP
);
524 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC2_AVS
);
525 range
= pmic
->dcdc2_range
;
527 case TPS65912_REG_DCDC3
:
528 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_OP
);
529 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC3_AVS
);
530 range
= pmic
->dcdc3_range
;
532 case TPS65912_REG_DCDC4
:
533 opvsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_OP
);
534 avsel
= tps65912_reg_read(mfd
, TPS65912_DCDC4_AVS
);
535 range
= pmic
->dcdc4_range
;
541 sr
= (opvsel
& OP_SELREG_MASK
) >> OP_SELREG_SHIFT
;
550 /* 0.5 - 1.2875V in 12.5mV steps */
551 voltage
= tps65912_vsel_to_uv_range0(vsel
);
554 /* 0.7 - 1.4875V in 12.5mV steps */
555 voltage
= tps65912_vsel_to_uv_range1(vsel
);
558 /* 0.5 - 2.075V in 25mV steps */
559 voltage
= tps65912_vsel_to_uv_range2(vsel
);
562 /* 0.5 - 3.8V in 50mV steps */
563 voltage
= tps65912_vsel_to_uv_range3(vsel
);
569 static int tps65912_set_voltage_dcdc(struct regulator_dev
*dev
,
572 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
573 struct tps65912
*mfd
= pmic
->mfd
;
574 int id
= rdev_get_id(dev
);
578 reg
= tps65912_get_dcdc_sel_register(pmic
, id
);
579 value
= tps65912_reg_read(mfd
, reg
);
581 return tps65912_reg_write(mfd
, reg
, selector
| value
);
584 static int tps65912_get_voltage_ldo(struct regulator_dev
*dev
)
586 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
587 struct tps65912
*mfd
= pmic
->mfd
;
588 int id
= rdev_get_id(dev
);
592 reg
= tps65912_get_ldo_sel_register(pmic
, id
);
593 vsel
= tps65912_reg_read(mfd
, reg
);
596 return tps65912_vsel_to_uv_ldo(vsel
);
599 static int tps65912_set_voltage_ldo(struct regulator_dev
*dev
,
602 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
603 struct tps65912
*mfd
= pmic
->mfd
;
604 int id
= rdev_get_id(dev
), reg
, value
;
606 reg
= tps65912_get_ldo_sel_register(pmic
, id
);
607 value
= tps65912_reg_read(mfd
, reg
);
609 return tps65912_reg_write(mfd
, reg
, selector
| value
);
612 static int tps65912_list_voltage_dcdc(struct regulator_dev
*dev
,
615 struct tps65912_reg
*pmic
= rdev_get_drvdata(dev
);
616 int range
, voltage
= 0, id
= rdev_get_id(dev
);
619 case TPS65912_REG_DCDC1
:
620 range
= pmic
->dcdc1_range
;
622 case TPS65912_REG_DCDC2
:
623 range
= pmic
->dcdc2_range
;
625 case TPS65912_REG_DCDC3
:
626 range
= pmic
->dcdc3_range
;
628 case TPS65912_REG_DCDC4
:
629 range
= pmic
->dcdc4_range
;
637 /* 0.5 - 1.2875V in 12.5mV steps */
638 voltage
= tps65912_vsel_to_uv_range0(selector
);
641 /* 0.7 - 1.4875V in 12.5mV steps */
642 voltage
= tps65912_vsel_to_uv_range1(selector
);
645 /* 0.5 - 2.075V in 25mV steps */
646 voltage
= tps65912_vsel_to_uv_range2(selector
);
649 /* 0.5 - 3.8V in 50mV steps */
650 voltage
= tps65912_vsel_to_uv_range3(selector
);
656 static int tps65912_list_voltage_ldo(struct regulator_dev
*dev
,
659 int ldo
= rdev_get_id(dev
);
661 if (ldo
< TPS65912_REG_LDO1
|| ldo
> TPS65912_REG_LDO10
)
664 return tps65912_vsel_to_uv_ldo(selector
);
667 /* Operations permitted on DCDCx */
668 static struct regulator_ops tps65912_ops_dcdc
= {
669 .is_enabled
= tps65912_reg_is_enabled
,
670 .enable
= tps65912_reg_enable
,
671 .disable
= tps65912_reg_disable
,
672 .set_mode
= tps65912_set_mode
,
673 .get_mode
= tps65912_get_mode
,
674 .get_voltage
= tps65912_get_voltage_dcdc
,
675 .set_voltage_sel
= tps65912_set_voltage_dcdc
,
676 .list_voltage
= tps65912_list_voltage_dcdc
,
679 /* Operations permitted on LDOx */
680 static struct regulator_ops tps65912_ops_ldo
= {
681 .is_enabled
= tps65912_reg_is_enabled
,
682 .enable
= tps65912_reg_enable
,
683 .disable
= tps65912_reg_disable
,
684 .get_voltage
= tps65912_get_voltage_ldo
,
685 .set_voltage_sel
= tps65912_set_voltage_ldo
,
686 .list_voltage
= tps65912_list_voltage_ldo
,
689 static __devinit
int tps65912_probe(struct platform_device
*pdev
)
691 struct tps65912
*tps65912
= dev_get_drvdata(pdev
->dev
.parent
);
692 struct tps_info
*info
;
693 struct regulator_init_data
*reg_data
;
694 struct regulator_dev
*rdev
;
695 struct tps65912_reg
*pmic
;
696 struct tps65912_board
*pmic_plat_data
;
699 pmic_plat_data
= dev_get_platdata(tps65912
->dev
);
703 reg_data
= pmic_plat_data
->tps65912_pmic_init_data
;
705 pmic
= kzalloc(sizeof(*pmic
), GFP_KERNEL
);
709 mutex_init(&pmic
->io_lock
);
710 pmic
->mfd
= tps65912
;
711 platform_set_drvdata(pdev
, pmic
);
713 pmic
->get_ctrl_reg
= &tps65912_get_ctrl_register
;
714 info
= tps65912_regs
;
716 for (i
= 0; i
< TPS65912_NUM_REGULATOR
; i
++, info
++, reg_data
++) {
718 /* Register the regulators */
719 pmic
->info
[i
] = info
;
721 pmic
->desc
[i
].name
= info
->name
;
722 pmic
->desc
[i
].id
= i
;
723 pmic
->desc
[i
].n_voltages
= 64;
724 pmic
->desc
[i
].ops
= (i
> TPS65912_REG_DCDC4
?
725 &tps65912_ops_ldo
: &tps65912_ops_dcdc
);
726 pmic
->desc
[i
].type
= REGULATOR_VOLTAGE
;
727 pmic
->desc
[i
].owner
= THIS_MODULE
;
728 range
= tps65912_get_range(pmic
, i
);
729 rdev
= regulator_register(&pmic
->desc
[i
],
730 tps65912
->dev
, reg_data
, pmic
, NULL
);
732 dev_err(tps65912
->dev
,
733 "failed to register %s regulator\n",
739 /* Save regulator for cleanup */
740 pmic
->rdev
[i
] = rdev
;
746 regulator_unregister(pmic
->rdev
[i
]);
752 static int __devexit
tps65912_remove(struct platform_device
*pdev
)
754 struct tps65912_reg
*tps65912_reg
= platform_get_drvdata(pdev
);
757 for (i
= 0; i
< TPS65912_NUM_REGULATOR
; i
++)
758 regulator_unregister(tps65912_reg
->rdev
[i
]);
764 static struct platform_driver tps65912_driver
= {
766 .name
= "tps65912-pmic",
767 .owner
= THIS_MODULE
,
769 .probe
= tps65912_probe
,
770 .remove
= __devexit_p(tps65912_remove
),
776 * Module init function
778 static int __init
tps65912_init(void)
780 return platform_driver_register(&tps65912_driver
);
782 subsys_initcall(tps65912_init
);
787 * Module exit function
789 static void __exit
tps65912_cleanup(void)
791 platform_driver_unregister(&tps65912_driver
);
793 module_exit(tps65912_cleanup
);
795 MODULE_AUTHOR("Margarita Olaya Cabrera <magi@slimlogic.co.uk>");
796 MODULE_DESCRIPTION("TPS65912 voltage regulator driver");
797 MODULE_LICENSE("GPL v2");
798 MODULE_ALIAS("platform:tps65912-pmic");