2 * Driver for Regulator part of Palmas PMIC Chips
4 * Copyright 2011-2012 Texas Instruments Inc.
6 * Author: Graeme Gregory <gg@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.
15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/init.h>
18 #include <linux/err.h>
19 #include <linux/platform_device.h>
20 #include <linux/regulator/driver.h>
21 #include <linux/regulator/machine.h>
22 #include <linux/slab.h>
23 #include <linux/regmap.h>
24 #include <linux/mfd/palmas.h>
33 static const struct regs_info palmas_regs_info
[] = {
36 .vsel_addr
= PALMAS_SMPS12_VOLTAGE
,
37 .ctrl_addr
= PALMAS_SMPS12_CTRL
,
38 .tstep_addr
= PALMAS_SMPS12_TSTEP
,
42 .vsel_addr
= PALMAS_SMPS12_VOLTAGE
,
43 .ctrl_addr
= PALMAS_SMPS12_CTRL
,
44 .tstep_addr
= PALMAS_SMPS12_TSTEP
,
48 .vsel_addr
= PALMAS_SMPS3_VOLTAGE
,
49 .ctrl_addr
= PALMAS_SMPS3_CTRL
,
53 .vsel_addr
= PALMAS_SMPS45_VOLTAGE
,
54 .ctrl_addr
= PALMAS_SMPS45_CTRL
,
55 .tstep_addr
= PALMAS_SMPS45_TSTEP
,
59 .vsel_addr
= PALMAS_SMPS45_VOLTAGE
,
60 .ctrl_addr
= PALMAS_SMPS45_CTRL
,
61 .tstep_addr
= PALMAS_SMPS45_TSTEP
,
65 .vsel_addr
= PALMAS_SMPS6_VOLTAGE
,
66 .ctrl_addr
= PALMAS_SMPS6_CTRL
,
67 .tstep_addr
= PALMAS_SMPS6_TSTEP
,
71 .vsel_addr
= PALMAS_SMPS7_VOLTAGE
,
72 .ctrl_addr
= PALMAS_SMPS7_CTRL
,
76 .vsel_addr
= PALMAS_SMPS8_VOLTAGE
,
77 .ctrl_addr
= PALMAS_SMPS8_CTRL
,
78 .tstep_addr
= PALMAS_SMPS8_TSTEP
,
82 .vsel_addr
= PALMAS_SMPS9_VOLTAGE
,
83 .ctrl_addr
= PALMAS_SMPS9_CTRL
,
90 .vsel_addr
= PALMAS_LDO1_VOLTAGE
,
91 .ctrl_addr
= PALMAS_LDO1_CTRL
,
95 .vsel_addr
= PALMAS_LDO2_VOLTAGE
,
96 .ctrl_addr
= PALMAS_LDO2_CTRL
,
100 .vsel_addr
= PALMAS_LDO3_VOLTAGE
,
101 .ctrl_addr
= PALMAS_LDO3_CTRL
,
105 .vsel_addr
= PALMAS_LDO4_VOLTAGE
,
106 .ctrl_addr
= PALMAS_LDO4_CTRL
,
110 .vsel_addr
= PALMAS_LDO5_VOLTAGE
,
111 .ctrl_addr
= PALMAS_LDO5_CTRL
,
115 .vsel_addr
= PALMAS_LDO6_VOLTAGE
,
116 .ctrl_addr
= PALMAS_LDO6_CTRL
,
120 .vsel_addr
= PALMAS_LDO7_VOLTAGE
,
121 .ctrl_addr
= PALMAS_LDO7_CTRL
,
125 .vsel_addr
= PALMAS_LDO8_VOLTAGE
,
126 .ctrl_addr
= PALMAS_LDO8_CTRL
,
130 .vsel_addr
= PALMAS_LDO9_VOLTAGE
,
131 .ctrl_addr
= PALMAS_LDO9_CTRL
,
135 .vsel_addr
= PALMAS_LDOLN_VOLTAGE
,
136 .ctrl_addr
= PALMAS_LDOLN_CTRL
,
140 .vsel_addr
= PALMAS_LDOUSB_VOLTAGE
,
141 .ctrl_addr
= PALMAS_LDOUSB_CTRL
,
145 #define SMPS_CTRL_MODE_OFF 0x00
146 #define SMPS_CTRL_MODE_ON 0x01
147 #define SMPS_CTRL_MODE_ECO 0x02
148 #define SMPS_CTRL_MODE_PWM 0x03
150 /* These values are derived from the data sheet. And are the number of steps
151 * where there is a voltage change, the ranges at beginning and end of register
152 * max/min values where there are no change are ommitted.
154 * So they are basically (maxV-minV)/stepV
156 #define PALMAS_SMPS_NUM_VOLTAGES 116
157 #define PALMAS_SMPS10_NUM_VOLTAGES 2
158 #define PALMAS_LDO_NUM_VOLTAGES 50
160 #define SMPS10_VSEL (1<<3)
161 #define SMPS10_BOOST_EN (1<<2)
162 #define SMPS10_BYPASS_EN (1<<1)
163 #define SMPS10_SWITCH_EN (1<<0)
165 #define REGULATOR_SLAVE 0
167 static int palmas_smps_read(struct palmas
*palmas
, unsigned int reg
,
172 addr
= PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE
, reg
);
174 return regmap_read(palmas
->regmap
[REGULATOR_SLAVE
], addr
, dest
);
177 static int palmas_smps_write(struct palmas
*palmas
, unsigned int reg
,
182 addr
= PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE
, reg
);
184 return regmap_write(palmas
->regmap
[REGULATOR_SLAVE
], addr
, value
);
187 static int palmas_ldo_read(struct palmas
*palmas
, unsigned int reg
,
192 addr
= PALMAS_BASE_TO_REG(PALMAS_LDO_BASE
, reg
);
194 return regmap_read(palmas
->regmap
[REGULATOR_SLAVE
], addr
, dest
);
197 static int palmas_ldo_write(struct palmas
*palmas
, unsigned int reg
,
202 addr
= PALMAS_BASE_TO_REG(PALMAS_LDO_BASE
, reg
);
204 return regmap_write(palmas
->regmap
[REGULATOR_SLAVE
], addr
, value
);
207 static int palmas_is_enabled_smps(struct regulator_dev
*dev
)
209 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
210 int id
= rdev_get_id(dev
);
213 palmas_smps_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
215 reg
&= PALMAS_SMPS12_CTRL_STATUS_MASK
;
216 reg
>>= PALMAS_SMPS12_CTRL_STATUS_SHIFT
;
221 static int palmas_enable_smps(struct regulator_dev
*dev
)
223 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
224 int id
= rdev_get_id(dev
);
227 palmas_smps_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
229 reg
&= ~PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK
;
230 reg
|= SMPS_CTRL_MODE_ON
;
232 palmas_smps_write(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, reg
);
237 static int palmas_disable_smps(struct regulator_dev
*dev
)
239 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
240 int id
= rdev_get_id(dev
);
243 palmas_smps_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
245 reg
&= ~PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK
;
247 palmas_smps_write(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, reg
);
253 static int palmas_set_mode_smps(struct regulator_dev
*dev
, unsigned int mode
)
255 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
256 int id
= rdev_get_id(dev
);
259 palmas_smps_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
260 reg
&= ~PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK
;
263 case REGULATOR_MODE_NORMAL
:
264 reg
|= SMPS_CTRL_MODE_ON
;
266 case REGULATOR_MODE_IDLE
:
267 reg
|= SMPS_CTRL_MODE_ECO
;
269 case REGULATOR_MODE_FAST
:
270 reg
|= SMPS_CTRL_MODE_PWM
;
275 palmas_smps_write(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, reg
);
280 static unsigned int palmas_get_mode_smps(struct regulator_dev
*dev
)
282 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
283 int id
= rdev_get_id(dev
);
286 palmas_smps_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
287 reg
&= PALMAS_SMPS12_CTRL_STATUS_MASK
;
288 reg
>>= PALMAS_SMPS12_CTRL_STATUS_SHIFT
;
291 case SMPS_CTRL_MODE_ON
:
292 return REGULATOR_MODE_NORMAL
;
293 case SMPS_CTRL_MODE_ECO
:
294 return REGULATOR_MODE_IDLE
;
295 case SMPS_CTRL_MODE_PWM
:
296 return REGULATOR_MODE_FAST
;
302 static int palmas_list_voltage_smps(struct regulator_dev
*dev
,
305 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
306 int id
= rdev_get_id(dev
);
312 /* Read the multiplier set in VSEL register to return
313 * the correct voltage.
318 /* Voltage is (0.49V + (selector * 0.01V)) * RANGE
319 * as defined in data sheet. RANGE is either x1 or x2
321 return (490000 + (selector
* 10000)) * mult
;
324 static int palmas_get_voltage_smps_sel(struct regulator_dev
*dev
)
326 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
327 int id
= rdev_get_id(dev
);
332 addr
= palmas_regs_info
[id
].vsel_addr
;
334 palmas_smps_read(pmic
->palmas
, addr
, ®
);
336 selector
= reg
& PALMAS_SMPS12_VOLTAGE_VSEL_MASK
;
338 /* Adjust selector to match list_voltage ranges */
339 if ((selector
> 0) && (selector
< 6))
350 static int palmas_set_voltage_smps_sel(struct regulator_dev
*dev
,
353 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
354 int id
= rdev_get_id(dev
);
355 unsigned int reg
= 0;
358 addr
= palmas_regs_info
[id
].vsel_addr
;
360 /* Make sure we don't change the value of RANGE */
362 reg
|= PALMAS_SMPS12_VOLTAGE_RANGE
;
364 /* Adjust the linux selector into range used in VSEL register */
368 palmas_smps_write(pmic
->palmas
, addr
, reg
);
373 static int palmas_map_voltage_smps(struct regulator_dev
*rdev
,
374 int min_uV
, int max_uV
)
376 struct palmas_pmic
*pmic
= rdev_get_drvdata(rdev
);
377 int id
= rdev_get_id(rdev
);
383 if (pmic
->range
[id
]) { /* RANGE is x2 */
384 if (min_uV
< 1000000)
386 ret
= DIV_ROUND_UP(min_uV
- 1000000, 20000) + 1;
387 } else { /* RANGE is x1 */
390 ret
= DIV_ROUND_UP(min_uV
- 500000, 10000) + 1;
393 /* Map back into a voltage to verify we're still in bounds */
394 voltage
= palmas_list_voltage_smps(rdev
, ret
);
395 if (voltage
< min_uV
|| voltage
> max_uV
)
401 static struct regulator_ops palmas_ops_smps
= {
402 .is_enabled
= palmas_is_enabled_smps
,
403 .enable
= palmas_enable_smps
,
404 .disable
= palmas_disable_smps
,
405 .set_mode
= palmas_set_mode_smps
,
406 .get_mode
= palmas_get_mode_smps
,
407 .get_voltage_sel
= palmas_get_voltage_smps_sel
,
408 .set_voltage_sel
= palmas_set_voltage_smps_sel
,
409 .list_voltage
= palmas_list_voltage_smps
,
410 .map_voltage
= palmas_map_voltage_smps
,
413 static struct regulator_ops palmas_ops_smps10
= {
414 .is_enabled
= regulator_is_enabled_regmap
,
415 .enable
= regulator_enable_regmap
,
416 .disable
= regulator_disable_regmap
,
417 .get_voltage_sel
= regulator_get_voltage_sel_regmap
,
418 .set_voltage_sel
= regulator_set_voltage_sel_regmap
,
419 .list_voltage
= regulator_list_voltage_linear
,
420 .map_voltage
= regulator_map_voltage_linear
,
423 static int palmas_is_enabled_ldo(struct regulator_dev
*dev
)
425 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
426 int id
= rdev_get_id(dev
);
429 palmas_ldo_read(pmic
->palmas
, palmas_regs_info
[id
].ctrl_addr
, ®
);
431 reg
&= PALMAS_LDO1_CTRL_STATUS
;
436 static int palmas_list_voltage_ldo(struct regulator_dev
*dev
,
442 /* voltage is 0.85V + (selector * 0.05v) */
443 return 850000 + (selector
* 50000);
446 static int palmas_get_voltage_ldo_sel(struct regulator_dev
*dev
)
448 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
449 int id
= rdev_get_id(dev
);
454 addr
= palmas_regs_info
[id
].vsel_addr
;
456 palmas_ldo_read(pmic
->palmas
, addr
, ®
);
458 selector
= reg
& PALMAS_LDO1_VOLTAGE_VSEL_MASK
;
460 /* Adjust selector to match list_voltage ranges */
467 static int palmas_set_voltage_ldo_sel(struct regulator_dev
*dev
,
470 struct palmas_pmic
*pmic
= rdev_get_drvdata(dev
);
471 int id
= rdev_get_id(dev
);
472 unsigned int reg
= 0;
475 addr
= palmas_regs_info
[id
].vsel_addr
;
479 palmas_ldo_write(pmic
->palmas
, addr
, reg
);
484 static int palmas_map_voltage_ldo(struct regulator_dev
*rdev
,
485 int min_uV
, int max_uV
)
494 ret
= DIV_ROUND_UP(min_uV
- 900000, 50000) + 1;
496 /* Map back into a voltage to verify we're still in bounds */
497 voltage
= palmas_list_voltage_ldo(rdev
, ret
);
498 if (voltage
< min_uV
|| voltage
> max_uV
)
504 static struct regulator_ops palmas_ops_ldo
= {
505 .is_enabled
= palmas_is_enabled_ldo
,
506 .enable
= regulator_enable_regmap
,
507 .disable
= regulator_disable_regmap
,
508 .get_voltage_sel
= palmas_get_voltage_ldo_sel
,
509 .set_voltage_sel
= palmas_set_voltage_ldo_sel
,
510 .list_voltage
= palmas_list_voltage_ldo
,
511 .map_voltage
= palmas_map_voltage_ldo
,
515 * setup the hardware based sleep configuration of the SMPS/LDO regulators
516 * from the platform data. This is different to the software based control
517 * supported by the regulator framework as it is controlled by toggling
518 * pins on the PMIC such as PREQ, SYSEN, ...
520 static int palmas_smps_init(struct palmas
*palmas
, int id
,
521 struct palmas_reg_init
*reg_init
)
527 addr
= palmas_regs_info
[id
].ctrl_addr
;
529 ret
= palmas_smps_read(palmas
, addr
, ®
);
534 case PALMAS_REG_SMPS10
:
535 if (reg_init
->mode_sleep
) {
536 reg
&= ~PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK
;
537 reg
|= reg_init
->mode_sleep
<<
538 PALMAS_SMPS10_CTRL_MODE_SLEEP_SHIFT
;
542 if (reg_init
->warm_reset
)
543 reg
|= PALMAS_SMPS12_CTRL_WR_S
;
545 if (reg_init
->roof_floor
)
546 reg
|= PALMAS_SMPS12_CTRL_ROOF_FLOOR_EN
;
548 if (reg_init
->mode_sleep
) {
549 reg
&= ~PALMAS_SMPS12_CTRL_MODE_SLEEP_MASK
;
550 reg
|= reg_init
->mode_sleep
<<
551 PALMAS_SMPS12_CTRL_MODE_SLEEP_SHIFT
;
555 ret
= palmas_smps_write(palmas
, addr
, reg
);
559 if (palmas_regs_info
[id
].tstep_addr
&& reg_init
->tstep
) {
560 addr
= palmas_regs_info
[id
].tstep_addr
;
562 reg
= reg_init
->tstep
& PALMAS_SMPS12_TSTEP_TSTEP_MASK
;
564 ret
= palmas_smps_write(palmas
, addr
, reg
);
569 if (palmas_regs_info
[id
].vsel_addr
&& reg_init
->vsel
) {
570 addr
= palmas_regs_info
[id
].vsel_addr
;
572 reg
= reg_init
->vsel
;
574 ret
= palmas_smps_write(palmas
, addr
, reg
);
583 static int palmas_ldo_init(struct palmas
*palmas
, int id
,
584 struct palmas_reg_init
*reg_init
)
590 addr
= palmas_regs_info
[id
].ctrl_addr
;
592 ret
= palmas_ldo_read(palmas
, addr
, ®
);
596 if (reg_init
->warm_reset
)
597 reg
|= PALMAS_LDO1_CTRL_WR_S
;
599 if (reg_init
->mode_sleep
)
600 reg
|= PALMAS_LDO1_CTRL_MODE_SLEEP
;
602 ret
= palmas_ldo_write(palmas
, addr
, reg
);
609 static __devinit
int palmas_probe(struct platform_device
*pdev
)
611 struct palmas
*palmas
= dev_get_drvdata(pdev
->dev
.parent
);
612 struct palmas_pmic_platform_data
*pdata
= pdev
->dev
.platform_data
;
613 struct regulator_dev
*rdev
;
614 struct regulator_config config
= { };
615 struct palmas_pmic
*pmic
;
616 struct palmas_reg_init
*reg_init
;
618 unsigned int addr
, reg
;
622 if (!pdata
->reg_data
)
625 pmic
= devm_kzalloc(&pdev
->dev
, sizeof(*pmic
), GFP_KERNEL
);
629 pmic
->dev
= &pdev
->dev
;
630 pmic
->palmas
= palmas
;
632 platform_set_drvdata(pdev
, pmic
);
634 ret
= palmas_smps_read(palmas
, PALMAS_SMPS_CTRL
, ®
);
638 if (reg
& PALMAS_SMPS_CTRL_SMPS12_SMPS123_EN
)
641 if (reg
& PALMAS_SMPS_CTRL_SMPS45_SMPS457_EN
)
644 config
.regmap
= palmas
->regmap
[REGULATOR_SLAVE
];
645 config
.dev
= &pdev
->dev
;
646 config
.driver_data
= pmic
;
648 for (id
= 0; id
< PALMAS_REG_LDO1
; id
++) {
651 * Miss out regulators which are not available due
652 * to slaving configurations.
655 case PALMAS_REG_SMPS12
:
656 case PALMAS_REG_SMPS3
:
660 case PALMAS_REG_SMPS123
:
664 case PALMAS_REG_SMPS45
:
665 case PALMAS_REG_SMPS7
:
669 case PALMAS_REG_SMPS457
:
674 /* Register the regulators */
675 pmic
->desc
[id
].name
= palmas_regs_info
[id
].name
;
676 pmic
->desc
[id
].id
= id
;
679 case PALMAS_REG_SMPS10
:
680 pmic
->desc
[id
].n_voltages
= PALMAS_SMPS10_NUM_VOLTAGES
;
681 pmic
->desc
[id
].ops
= &palmas_ops_smps10
;
682 pmic
->desc
[id
].vsel_reg
=
683 PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE
,
685 pmic
->desc
[id
].vsel_mask
= SMPS10_VSEL
;
686 pmic
->desc
[id
].enable_reg
=
687 PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE
,
688 PALMAS_SMPS10_STATUS
);
689 pmic
->desc
[id
].enable_mask
= SMPS10_BOOST_EN
;
690 pmic
->desc
[id
].min_uV
= 3750000;
691 pmic
->desc
[id
].uV_step
= 1250000;
694 pmic
->desc
[id
].ops
= &palmas_ops_smps
;
695 pmic
->desc
[id
].n_voltages
= PALMAS_SMPS_NUM_VOLTAGES
;
698 pmic
->desc
[id
].type
= REGULATOR_VOLTAGE
;
699 pmic
->desc
[id
].owner
= THIS_MODULE
;
701 /* Initialise sleep/init values from platform data */
702 if (pdata
&& pdata
->reg_init
) {
703 reg_init
= pdata
->reg_init
[id
];
705 ret
= palmas_smps_init(palmas
, id
, reg_init
);
707 goto err_unregister_regulator
;
712 * read and store the RANGE bit for later use
713 * This must be done before regulator is probed otherwise
714 * we error in probe with unsuportable ranges.
716 if (id
!= PALMAS_REG_SMPS10
) {
717 addr
= palmas_regs_info
[id
].vsel_addr
;
719 ret
= palmas_smps_read(pmic
->palmas
, addr
, ®
);
721 goto err_unregister_regulator
;
722 if (reg
& PALMAS_SMPS12_VOLTAGE_RANGE
)
726 if (pdata
&& pdata
->reg_data
)
727 config
.init_data
= pdata
->reg_data
[id
];
729 config
.init_data
= NULL
;
731 rdev
= regulator_register(&pmic
->desc
[id
], &config
);
734 "failed to register %s regulator\n",
737 goto err_unregister_regulator
;
740 /* Save regulator for cleanup */
741 pmic
->rdev
[id
] = rdev
;
744 /* Start this loop from the id left from previous loop */
745 for (; id
< PALMAS_NUM_REGS
; id
++) {
747 /* Miss out regulators which are not available due
748 * to alternate functions.
751 /* Register the regulators */
752 pmic
->desc
[id
].name
= palmas_regs_info
[id
].name
;
753 pmic
->desc
[id
].id
= id
;
754 pmic
->desc
[id
].n_voltages
= PALMAS_LDO_NUM_VOLTAGES
;
756 pmic
->desc
[id
].ops
= &palmas_ops_ldo
;
758 pmic
->desc
[id
].type
= REGULATOR_VOLTAGE
;
759 pmic
->desc
[id
].owner
= THIS_MODULE
;
760 pmic
->desc
[id
].enable_reg
= PALMAS_BASE_TO_REG(PALMAS_LDO_BASE
,
761 palmas_regs_info
[id
].ctrl_addr
);
762 pmic
->desc
[id
].enable_mask
= PALMAS_LDO1_CTRL_MODE_ACTIVE
;
764 if (pdata
&& pdata
->reg_data
)
765 config
.init_data
= pdata
->reg_data
[id
];
767 config
.init_data
= NULL
;
769 rdev
= regulator_register(&pmic
->desc
[id
], &config
);
772 "failed to register %s regulator\n",
775 goto err_unregister_regulator
;
778 /* Save regulator for cleanup */
779 pmic
->rdev
[id
] = rdev
;
781 /* Initialise sleep/init values from platform data */
782 if (pdata
->reg_init
) {
783 reg_init
= pdata
->reg_init
[id
];
785 ret
= palmas_ldo_init(palmas
, id
, reg_init
);
787 regulator_unregister(pmic
->rdev
[id
]);
788 goto err_unregister_regulator
;
796 err_unregister_regulator
:
798 regulator_unregister(pmic
->rdev
[id
]);
802 static int __devexit
palmas_remove(struct platform_device
*pdev
)
804 struct palmas_pmic
*pmic
= platform_get_drvdata(pdev
);
807 for (id
= 0; id
< PALMAS_NUM_REGS
; id
++)
808 regulator_unregister(pmic
->rdev
[id
]);
812 static struct platform_driver palmas_driver
= {
814 .name
= "palmas-pmic",
815 .owner
= THIS_MODULE
,
817 .probe
= palmas_probe
,
818 .remove
= __devexit_p(palmas_remove
),
821 static int __init
palmas_init(void)
823 return platform_driver_register(&palmas_driver
);
825 subsys_initcall(palmas_init
);
827 static void __exit
palmas_exit(void)
829 platform_driver_unregister(&palmas_driver
);
831 module_exit(palmas_exit
);
833 MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
834 MODULE_DESCRIPTION("Palmas voltage regulator driver");
835 MODULE_LICENSE("GPL");
836 MODULE_ALIAS("platform:palmas-pmic");