2 * Split TWL6030 logic from twl-regulator.c:
3 * Copyright (C) 2008 David Brownell
5 * Copyright (C) 2016 Nicolae Rosia <nicolae.rosia@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
13 #include <linux/module.h>
14 #include <linux/string.h>
15 #include <linux/slab.h>
16 #include <linux/init.h>
17 #include <linux/err.h>
18 #include <linux/platform_device.h>
20 #include <linux/of_device.h>
21 #include <linux/regulator/driver.h>
22 #include <linux/regulator/machine.h>
23 #include <linux/regulator/of_regulator.h>
24 #include <linux/mfd/twl.h>
25 #include <linux/delay.h>
28 /* start of regulator's PM_RECEIVER control register bank */
31 /* twl resource ID, for resource control state machine */
34 /* chip constraints on regulator behavior */
39 /* used by regulator core */
40 struct regulator_desc desc;
42 /* chip specific features */
43 unsigned long features;
45 /* data passed from board for external get/set voltage */
50 /* LDO control registers ... offset is from the base of its register bank.
51 * The first three registers of all power resource banks help hardware to
52 * manage the various resource groups.
54 /* Common offset in TWL4030/6030 */
56 /* TWL6030 register offsets */
59 #define VREG_VOLTAGE 3
60 #define VREG_VOLTAGE_SMPS 4
61 /* TWL6030 Misc register offsets */
64 #define VREG_BC_PROC 3
65 #define VREG_BC_CLK_RST 4
67 /* TWL6030 LDO register values for CFG_STATE */
68 #define TWL6030_CFG_STATE_OFF 0x00
69 #define TWL6030_CFG_STATE_ON 0x01
70 #define TWL6030_CFG_STATE_OFF2 0x02
71 #define TWL6030_CFG_STATE_SLEEP 0x03
72 #define TWL6030_CFG_STATE_GRP_SHIFT 5
73 #define TWL6030_CFG_STATE_APP_SHIFT 2
74 #define TWL6030_CFG_STATE_MASK 0x03
75 #define TWL6030_CFG_STATE_APP_MASK (0x03 << TWL6030_CFG_STATE_APP_SHIFT)
76 #define TWL6030_CFG_STATE_APP(v) (((v) & TWL6030_CFG_STATE_APP_MASK) >>\
77 TWL6030_CFG_STATE_APP_SHIFT)
79 /* Flags for SMPS Voltage reading */
80 #define SMPS_OFFSET_EN BIT(0)
81 #define SMPS_EXTENDED_EN BIT(1)
83 /* twl6032 SMPS EPROM values */
84 #define TWL6030_SMPS_OFFSET 0xB0
85 #define TWL6030_SMPS_MULT 0xB3
86 #define SMPS_MULTOFFSET_SMPS4 BIT(0)
87 #define SMPS_MULTOFFSET_VIO BIT(1)
88 #define SMPS_MULTOFFSET_SMPS3 BIT(6)
91 twlreg_read(struct twlreg_info *info, unsigned slave_subgp, unsigned offset)
96 status = twl_i2c_read_u8(slave_subgp,
97 &value, info->base + offset);
98 return (status < 0) ? status : value;
102 twlreg_write(struct twlreg_info *info, unsigned slave_subgp, unsigned offset,
105 return twl_i2c_write_u8(slave_subgp,
106 value, info->base + offset);
109 /* generic power resource operations, which work on all regulators */
110 static int twlreg_grp(struct regulator_dev *rdev)
112 return twlreg_read(rdev_get_drvdata(rdev), TWL_MODULE_PM_RECEIVER,
117 * Enable/disable regulators by joining/leaving the P1 (processor) group.
118 * We assume nobody else is updating the DEV_GRP registers.
120 /* definition for 6030 family */
121 #define P3_GRP_6030 BIT(2) /* secondary processor, modem, etc */
122 #define P2_GRP_6030 BIT(1) /* "peripherals" */
123 #define P1_GRP_6030 BIT(0) /* CPU/Linux */
125 static int twl6030reg_is_enabled(struct regulator_dev *rdev)
127 struct twlreg_info *info = rdev_get_drvdata(rdev);
130 if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS))) {
131 grp = twlreg_grp(rdev);
135 val = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_STATE);
136 val = TWL6030_CFG_STATE_APP(val);
138 val = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_STATE);
139 val &= TWL6030_CFG_STATE_MASK;
143 return grp && (val == TWL6030_CFG_STATE_ON);
146 #define PB_I2C_BUSY BIT(0)
147 #define PB_I2C_BWEN BIT(1)
150 static int twl6030reg_enable(struct regulator_dev *rdev)
152 struct twlreg_info *info = rdev_get_drvdata(rdev);
156 if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS)))
157 grp = twlreg_grp(rdev);
161 ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
162 grp << TWL6030_CFG_STATE_GRP_SHIFT |
163 TWL6030_CFG_STATE_ON);
167 static int twl6030reg_disable(struct regulator_dev *rdev)
169 struct twlreg_info *info = rdev_get_drvdata(rdev);
173 if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS)))
174 grp = P1_GRP_6030 | P2_GRP_6030 | P3_GRP_6030;
176 /* For 6030, set the off state for all grps enabled */
177 ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE,
178 (grp) << TWL6030_CFG_STATE_GRP_SHIFT |
179 TWL6030_CFG_STATE_OFF);
184 static int twl6030reg_get_status(struct regulator_dev *rdev)
186 struct twlreg_info *info = rdev_get_drvdata(rdev);
189 val = twlreg_grp(rdev);
193 val = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_STATE);
195 if (info->features & TWL6032_SUBCLASS)
196 val &= TWL6030_CFG_STATE_MASK;
198 val = TWL6030_CFG_STATE_APP(val);
201 case TWL6030_CFG_STATE_ON:
202 return REGULATOR_STATUS_NORMAL;
204 case TWL6030_CFG_STATE_SLEEP:
205 return REGULATOR_STATUS_STANDBY;
207 case TWL6030_CFG_STATE_OFF:
208 case TWL6030_CFG_STATE_OFF2:
213 return REGULATOR_STATUS_OFF;
216 static int twl6030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
218 struct twlreg_info *info = rdev_get_drvdata(rdev);
222 if (!(twl_class_is_6030() && (info->features & TWL6032_SUBCLASS)))
223 grp = twlreg_grp(rdev);
228 /* Compose the state register settings */
229 val = grp << TWL6030_CFG_STATE_GRP_SHIFT;
230 /* We can only set the mode through state machine commands... */
232 case REGULATOR_MODE_NORMAL:
233 val |= TWL6030_CFG_STATE_ON;
235 case REGULATOR_MODE_STANDBY:
236 val |= TWL6030_CFG_STATE_SLEEP;
243 return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_STATE, val);
246 static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
247 int max_uV, unsigned *selector)
252 static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
257 static struct regulator_ops twl6030coresmps_ops = {
258 .set_voltage = twl6030coresmps_set_voltage,
259 .get_voltage = twl6030coresmps_get_voltage,
262 static int twl6030ldo_list_voltage(struct regulator_dev *rdev, unsigned sel)
264 struct twlreg_info *info = rdev_get_drvdata(rdev);
270 /* Linear mapping from 00000001 to 00011000:
271 * Absolute voltage value = 1.0 V + 0.1 V × (sel – 00000001)
273 return (info->min_mV + 100 * (sel - 1)) * 1000;
284 twl6030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
286 struct twlreg_info *info = rdev_get_drvdata(rdev);
288 return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE,
292 static int twl6030ldo_get_voltage_sel(struct regulator_dev *rdev)
294 struct twlreg_info *info = rdev_get_drvdata(rdev);
295 int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE);
300 static struct regulator_ops twl6030ldo_ops = {
301 .list_voltage = twl6030ldo_list_voltage,
303 .set_voltage_sel = twl6030ldo_set_voltage_sel,
304 .get_voltage_sel = twl6030ldo_get_voltage_sel,
306 .enable = twl6030reg_enable,
307 .disable = twl6030reg_disable,
308 .is_enabled = twl6030reg_is_enabled,
310 .set_mode = twl6030reg_set_mode,
312 .get_status = twl6030reg_get_status,
315 static struct regulator_ops twl6030fixed_ops = {
316 .list_voltage = regulator_list_voltage_linear,
318 .enable = twl6030reg_enable,
319 .disable = twl6030reg_disable,
320 .is_enabled = twl6030reg_is_enabled,
322 .set_mode = twl6030reg_set_mode,
324 .get_status = twl6030reg_get_status,
328 * SMPS status and control
331 static int twl6030smps_list_voltage(struct regulator_dev *rdev, unsigned index)
333 struct twlreg_info *info = rdev_get_drvdata(rdev);
337 switch (info->flags) {
347 voltage = 1350 * 1000;
350 voltage = 1500 * 1000;
353 voltage = 1800 * 1000;
356 voltage = 1900 * 1000;
359 voltage = 2100 * 1000;
362 voltage += (600000 + (12500 * (index - 1)));
365 case SMPS_EXTENDED_EN:
371 voltage = 2084 * 1000;
374 voltage = 2315 * 1000;
377 voltage = 2778 * 1000;
380 voltage = 2932 * 1000;
383 voltage = 3241 * 1000;
386 voltage = (1852000 + (38600 * (index - 1)));
389 case SMPS_OFFSET_EN | SMPS_EXTENDED_EN:
395 voltage = 4167 * 1000;
398 voltage = 2315 * 1000;
401 voltage = 2778 * 1000;
404 voltage = 2932 * 1000;
407 voltage = 3241 * 1000;
410 voltage = (2161000 + (38600 * (index - 1)));
418 static int twl6030smps_map_voltage(struct regulator_dev *rdev, int min_uV,
421 struct twlreg_info *info = rdev_get_drvdata(rdev);
424 switch (info->flags) {
428 else if ((min_uV >= 600000) && (min_uV <= 1300000)) {
429 vsel = DIV_ROUND_UP(min_uV - 600000, 12500);
432 /* Values 1..57 for vsel are linear and can be calculated
433 * values 58..62 are non linear.
435 else if ((min_uV > 1900000) && (min_uV <= 2100000))
437 else if ((min_uV > 1800000) && (min_uV <= 1900000))
439 else if ((min_uV > 1500000) && (min_uV <= 1800000))
441 else if ((min_uV > 1350000) && (min_uV <= 1500000))
443 else if ((min_uV > 1300000) && (min_uV <= 1350000))
451 else if ((min_uV >= 700000) && (min_uV <= 1420000)) {
452 vsel = DIV_ROUND_UP(min_uV - 700000, 12500);
455 /* Values 1..57 for vsel are linear and can be calculated
456 * values 58..62 are non linear.
458 else if ((min_uV > 1900000) && (min_uV <= 2100000))
460 else if ((min_uV > 1800000) && (min_uV <= 1900000))
462 else if ((min_uV > 1500000) && (min_uV <= 1800000))
464 else if ((min_uV > 1350000) && (min_uV <= 1500000))
469 case SMPS_EXTENDED_EN:
472 } else if ((min_uV >= 1852000) && (max_uV <= 4013600)) {
473 vsel = DIV_ROUND_UP(min_uV - 1852000, 38600);
477 case SMPS_OFFSET_EN|SMPS_EXTENDED_EN:
480 } else if ((min_uV >= 2161000) && (min_uV <= 4321000)) {
481 vsel = DIV_ROUND_UP(min_uV - 2161000, 38600);
490 static int twl6030smps_set_voltage_sel(struct regulator_dev *rdev,
491 unsigned int selector)
493 struct twlreg_info *info = rdev_get_drvdata(rdev);
495 return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE_SMPS,
499 static int twl6030smps_get_voltage_sel(struct regulator_dev *rdev)
501 struct twlreg_info *info = rdev_get_drvdata(rdev);
503 return twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE_SMPS);
506 static struct regulator_ops twlsmps_ops = {
507 .list_voltage = twl6030smps_list_voltage,
508 .map_voltage = twl6030smps_map_voltage,
510 .set_voltage_sel = twl6030smps_set_voltage_sel,
511 .get_voltage_sel = twl6030smps_get_voltage_sel,
513 .enable = twl6030reg_enable,
514 .disable = twl6030reg_disable,
515 .is_enabled = twl6030reg_is_enabled,
517 .set_mode = twl6030reg_set_mode,
519 .get_status = twl6030reg_get_status,
522 /*----------------------------------------------------------------------*/
524 #define TWL6030_ADJUSTABLE_SMPS(label) \
525 static const struct twlreg_info TWL6030_INFO_##label = { \
528 .id = TWL6030_REG_##label, \
529 .ops = &twl6030coresmps_ops, \
530 .type = REGULATOR_VOLTAGE, \
531 .owner = THIS_MODULE, \
535 #define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts) \
536 static const struct twlreg_info TWL6030_INFO_##label = { \
538 .min_mV = min_mVolts, \
541 .id = TWL6030_REG_##label, \
543 .ops = &twl6030ldo_ops, \
544 .type = REGULATOR_VOLTAGE, \
545 .owner = THIS_MODULE, \
549 #define TWL6032_ADJUSTABLE_LDO(label, offset, min_mVolts) \
550 static const struct twlreg_info TWL6032_INFO_##label = { \
552 .min_mV = min_mVolts, \
555 .id = TWL6032_REG_##label, \
557 .ops = &twl6030ldo_ops, \
558 .type = REGULATOR_VOLTAGE, \
559 .owner = THIS_MODULE, \
563 #define TWL6030_FIXED_LDO(label, offset, mVolts, turnon_delay) \
564 static const struct twlreg_info TWLFIXED_INFO_##label = { \
570 .id = TWL6030##_REG_##label, \
572 .ops = &twl6030fixed_ops, \
573 .type = REGULATOR_VOLTAGE, \
574 .owner = THIS_MODULE, \
575 .min_uV = mVolts * 1000, \
576 .enable_time = turnon_delay, \
577 .of_map_mode = NULL, \
581 #define TWL6032_ADJUSTABLE_SMPS(label, offset) \
582 static const struct twlreg_info TWLSMPS_INFO_##label = { \
587 .id = TWL6032_REG_##label, \
589 .ops = &twlsmps_ops, \
590 .type = REGULATOR_VOLTAGE, \
591 .owner = THIS_MODULE, \
595 /* VUSBCP is managed *only* by the USB subchip */
596 /* 6030 REG with base as PMC Slave Misc : 0x0030 */
597 /* Turnon-delay and remap configuration values for 6030 are not
598 verified since the specification is not public */
599 TWL6030_ADJUSTABLE_SMPS(VDD1);
600 TWL6030_ADJUSTABLE_SMPS(VDD2);
601 TWL6030_ADJUSTABLE_SMPS(VDD3);
602 TWL6030_ADJUSTABLE_LDO(VAUX1_6030, 0x54, 1000);
603 TWL6030_ADJUSTABLE_LDO(VAUX2_6030, 0x58, 1000);
604 TWL6030_ADJUSTABLE_LDO(VAUX3_6030, 0x5c, 1000);
605 TWL6030_ADJUSTABLE_LDO(VMMC, 0x68, 1000);
606 TWL6030_ADJUSTABLE_LDO(VPP, 0x6c, 1000);
607 TWL6030_ADJUSTABLE_LDO(VUSIM, 0x74, 1000);
608 /* 6025 are renamed compared to 6030 versions */
609 TWL6032_ADJUSTABLE_LDO(LDO2, 0x54, 1000);
610 TWL6032_ADJUSTABLE_LDO(LDO4, 0x58, 1000);
611 TWL6032_ADJUSTABLE_LDO(LDO3, 0x5c, 1000);
612 TWL6032_ADJUSTABLE_LDO(LDO5, 0x68, 1000);
613 TWL6032_ADJUSTABLE_LDO(LDO1, 0x6c, 1000);
614 TWL6032_ADJUSTABLE_LDO(LDO7, 0x74, 1000);
615 TWL6032_ADJUSTABLE_LDO(LDO6, 0x60, 1000);
616 TWL6032_ADJUSTABLE_LDO(LDOLN, 0x64, 1000);
617 TWL6032_ADJUSTABLE_LDO(LDOUSB, 0x70, 1000);
618 TWL6030_FIXED_LDO(VANA, 0x50, 2100, 0);
619 TWL6030_FIXED_LDO(VCXIO, 0x60, 1800, 0);
620 TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 0);
621 TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 0);
622 TWL6030_FIXED_LDO(V1V8, 0x16, 1800, 0);
623 TWL6030_FIXED_LDO(V2V1, 0x1c, 2100, 0);
624 TWL6032_ADJUSTABLE_SMPS(SMPS3, 0x34);
625 TWL6032_ADJUSTABLE_SMPS(SMPS4, 0x10);
626 TWL6032_ADJUSTABLE_SMPS(VIO, 0x16);
628 static u8 twl_get_smps_offset(void)
632 twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &value,
633 TWL6030_SMPS_OFFSET);
637 static u8 twl_get_smps_mult(void)
641 twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &value,
646 #define TWL_OF_MATCH(comp, family, label) \
648 .compatible = comp, \
649 .data = &family##_INFO_##label, \
652 #define TWL6030_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6030, label)
653 #define TWL6032_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6032, label)
654 #define TWLFIXED_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLFIXED, label)
655 #define TWLSMPS_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLSMPS, label)
657 static const struct of_device_id twl_of_match[] = {
658 TWL6030_OF_MATCH("ti,twl6030-vdd1", VDD1),
659 TWL6030_OF_MATCH("ti,twl6030-vdd2", VDD2),
660 TWL6030_OF_MATCH("ti,twl6030-vdd3", VDD3),
661 TWL6030_OF_MATCH("ti,twl6030-vaux1", VAUX1_6030),
662 TWL6030_OF_MATCH("ti,twl6030-vaux2", VAUX2_6030),
663 TWL6030_OF_MATCH("ti,twl6030-vaux3", VAUX3_6030),
664 TWL6030_OF_MATCH("ti,twl6030-vmmc", VMMC),
665 TWL6030_OF_MATCH("ti,twl6030-vpp", VPP),
666 TWL6030_OF_MATCH("ti,twl6030-vusim", VUSIM),
667 TWL6032_OF_MATCH("ti,twl6032-ldo2", LDO2),
668 TWL6032_OF_MATCH("ti,twl6032-ldo4", LDO4),
669 TWL6032_OF_MATCH("ti,twl6032-ldo3", LDO3),
670 TWL6032_OF_MATCH("ti,twl6032-ldo5", LDO5),
671 TWL6032_OF_MATCH("ti,twl6032-ldo1", LDO1),
672 TWL6032_OF_MATCH("ti,twl6032-ldo7", LDO7),
673 TWL6032_OF_MATCH("ti,twl6032-ldo6", LDO6),
674 TWL6032_OF_MATCH("ti,twl6032-ldoln", LDOLN),
675 TWL6032_OF_MATCH("ti,twl6032-ldousb", LDOUSB),
676 TWLFIXED_OF_MATCH("ti,twl6030-vana", VANA),
677 TWLFIXED_OF_MATCH("ti,twl6030-vcxio", VCXIO),
678 TWLFIXED_OF_MATCH("ti,twl6030-vdac", VDAC),
679 TWLFIXED_OF_MATCH("ti,twl6030-vusb", VUSB),
680 TWLFIXED_OF_MATCH("ti,twl6030-v1v8", V1V8),
681 TWLFIXED_OF_MATCH("ti,twl6030-v2v1", V2V1),
682 TWLSMPS_OF_MATCH("ti,twl6032-smps3", SMPS3),
683 TWLSMPS_OF_MATCH("ti,twl6032-smps4", SMPS4),
684 TWLSMPS_OF_MATCH("ti,twl6032-vio", VIO),
687 MODULE_DEVICE_TABLE(of, twl_of_match);
689 static int twlreg_probe(struct platform_device *pdev)
692 struct twlreg_info *info;
693 const struct twlreg_info *template;
694 struct regulator_init_data *initdata;
695 struct regulation_constraints *c;
696 struct regulator_dev *rdev;
697 const struct of_device_id *match;
698 struct regulator_config config = { };
700 match = of_match_device(twl_of_match, &pdev->dev);
704 template = match->data;
708 id = template->desc.id;
709 initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
714 info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL);
718 /* Constrain board-specific capabilities according to what
719 * this driver and the chip itself can actually do.
721 c = &initdata->constraints;
722 c->valid_modes_mask &= REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY;
723 c->valid_ops_mask &= REGULATOR_CHANGE_VOLTAGE
724 | REGULATOR_CHANGE_MODE
725 | REGULATOR_CHANGE_STATUS;
728 case TWL6032_REG_SMPS3:
729 if (twl_get_smps_mult() & SMPS_MULTOFFSET_SMPS3)
730 info->flags |= SMPS_EXTENDED_EN;
731 if (twl_get_smps_offset() & SMPS_MULTOFFSET_SMPS3)
732 info->flags |= SMPS_OFFSET_EN;
734 case TWL6032_REG_SMPS4:
735 if (twl_get_smps_mult() & SMPS_MULTOFFSET_SMPS4)
736 info->flags |= SMPS_EXTENDED_EN;
737 if (twl_get_smps_offset() & SMPS_MULTOFFSET_SMPS4)
738 info->flags |= SMPS_OFFSET_EN;
740 case TWL6032_REG_VIO:
741 if (twl_get_smps_mult() & SMPS_MULTOFFSET_VIO)
742 info->flags |= SMPS_EXTENDED_EN;
743 if (twl_get_smps_offset() & SMPS_MULTOFFSET_VIO)
744 info->flags |= SMPS_OFFSET_EN;
748 config.dev = &pdev->dev;
749 config.init_data = initdata;
750 config.driver_data = info;
751 config.of_node = pdev->dev.of_node;
753 rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
755 dev_err(&pdev->dev, "can't register %s, %ld\n",
756 info->desc.name, PTR_ERR(rdev));
757 return PTR_ERR(rdev);
759 platform_set_drvdata(pdev, rdev);
761 /* NOTE: many regulators support short-circuit IRQs (presentable
762 * as REGULATOR_OVER_CURRENT notifications?) configured via:
764 * - SC_DETECT1 (vintana2, vmmc1/2, vaux1/2/3/4)
765 * - SC_DETECT2 (vusb, vdac, vio, vdd1/2, vpll2)
772 MODULE_ALIAS("platform:twl6030_reg");
774 static struct platform_driver twlreg_driver = {
775 .probe = twlreg_probe,
776 /* NOTE: short name, to work around driver model truncation of
777 * "twl_regulator.12" (and friends) to "twl_regulator.1".
780 .name = "twl6030_reg",
781 .of_match_table = of_match_ptr(twl_of_match),
785 static int __init twlreg_init(void)
787 return platform_driver_register(&twlreg_driver);
789 subsys_initcall(twlreg_init);
791 static void __exit twlreg_exit(void)
793 platform_driver_unregister(&twlreg_driver);
795 module_exit(twlreg_exit)
797 MODULE_DESCRIPTION("TWL6030 regulator driver");
798 MODULE_LICENSE("GPL");