aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r--drivers/mfd/twl-core.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index c1e4f1a277e9..6cb10610a161 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -621,6 +621,8 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
621 unsigned num_consumers, unsigned long features) 621 unsigned num_consumers, unsigned long features)
622{ 622{
623 unsigned sub_chip_id; 623 unsigned sub_chip_id;
624 struct twl_regulator_driver_data drv_data;
625
624 /* regulator framework demands init_data ... */ 626 /* regulator framework demands init_data ... */
625 if (!pdata) 627 if (!pdata)
626 return NULL; 628 return NULL;
@@ -630,7 +632,19 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
630 pdata->num_consumer_supplies = num_consumers; 632 pdata->num_consumer_supplies = num_consumers;
631 } 633 }
632 634
633 pdata->driver_data = (void *)features; 635 if (pdata->driver_data) {
636 /* If we have existing drv_data, just add the flags */
637 struct twl_regulator_driver_data *tmp;
638 tmp = pdata->driver_data;
639 tmp->features |= features;
640 } else {
641 /* add new driver data struct, used only during init */
642 drv_data.features = features;
643 drv_data.set_voltage = NULL;
644 drv_data.get_voltage = NULL;
645 drv_data.data = NULL;
646 pdata->driver_data = &drv_data;
647 }
634 648
635 /* NOTE: we currently ignore regulator IRQs, e.g. for short circuits */ 649 /* NOTE: we currently ignore regulator IRQs, e.g. for short circuits */
636 sub_chip_id = twl_map[TWL_MODULE_PM_MASTER].sid; 650 sub_chip_id = twl_map[TWL_MODULE_PM_MASTER].sid;
@@ -937,6 +951,31 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
937 /* twl6030 regulators */ 951 /* twl6030 regulators */
938 if (twl_has_regulator() && twl_class_is_6030() && 952 if (twl_has_regulator() && twl_class_is_6030() &&
939 !(features & TWL6025_SUBCLASS)) { 953 !(features & TWL6025_SUBCLASS)) {
954 child = add_regulator(TWL6030_REG_VDD1, pdata->vdd1,
955 features);
956 if (IS_ERR(child))
957 return PTR_ERR(child);
958
959 child = add_regulator(TWL6030_REG_VDD2, pdata->vdd2,
960 features);
961 if (IS_ERR(child))
962 return PTR_ERR(child);
963
964 child = add_regulator(TWL6030_REG_VDD3, pdata->vdd3,
965 features);
966 if (IS_ERR(child))
967 return PTR_ERR(child);
968
969 child = add_regulator(TWL6030_REG_V1V8, pdata->v1v8,
970 features);
971 if (IS_ERR(child))
972 return PTR_ERR(child);
973
974 child = add_regulator(TWL6030_REG_V2V1, pdata->v2v1,
975 features);
976 if (IS_ERR(child))
977 return PTR_ERR(child);
978
940 child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc, 979 child = add_regulator(TWL6030_REG_VMMC, pdata->vmmc,
941 features); 980 features);
942 if (IS_ERR(child)) 981 if (IS_ERR(child))