aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 909c53b70375..c754eae18c4a 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -495,6 +495,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
495{ 495{
496 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 496 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
497 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 497 struct wm831x_pdata *pdata = wm831x->dev->platform_data;
498 struct regulator_config config = { };
498 int id; 499 int id;
499 struct wm831x_dcdc *dcdc; 500 struct wm831x_dcdc *dcdc;
500 struct resource *res; 501 struct resource *res;
@@ -553,8 +554,11 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
553 if (pdata->dcdc[id]) 554 if (pdata->dcdc[id])
554 wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data); 555 wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data);
555 556
556 dcdc->regulator = regulator_register(&dcdc->desc, &pdev->dev, 557 config.dev = pdev->dev.parent;
557 pdata->dcdc[id], dcdc, NULL); 558 config.init_data = pdata->dcdc[id];
559 config.driver_data = dcdc;
560
561 dcdc->regulator = regulator_register(&dcdc->desc, &config);
558 if (IS_ERR(dcdc->regulator)) { 562 if (IS_ERR(dcdc->regulator)) {
559 ret = PTR_ERR(dcdc->regulator); 563 ret = PTR_ERR(dcdc->regulator);
560 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n", 564 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
@@ -705,6 +709,7 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
705{ 709{
706 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 710 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
707 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 711 struct wm831x_pdata *pdata = wm831x->dev->platform_data;
712 struct regulator_config config = { };
708 int id; 713 int id;
709 struct wm831x_dcdc *dcdc; 714 struct wm831x_dcdc *dcdc;
710 struct resource *res; 715 struct resource *res;
@@ -746,8 +751,11 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
746 dcdc->desc.ops = &wm831x_buckp_ops; 751 dcdc->desc.ops = &wm831x_buckp_ops;
747 dcdc->desc.owner = THIS_MODULE; 752 dcdc->desc.owner = THIS_MODULE;
748 753
749 dcdc->regulator = regulator_register(&dcdc->desc, &pdev->dev, 754 config.dev = pdev->dev.parent;
750 pdata->dcdc[id], dcdc, NULL); 755 config.init_data = pdata->dcdc[id];
756 config.driver_data = dcdc;
757
758 dcdc->regulator = regulator_register(&dcdc->desc, &config);
751 if (IS_ERR(dcdc->regulator)) { 759 if (IS_ERR(dcdc->regulator)) {
752 ret = PTR_ERR(dcdc->regulator); 760 ret = PTR_ERR(dcdc->regulator);
753 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n", 761 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
@@ -838,6 +846,7 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
838{ 846{
839 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 847 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
840 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 848 struct wm831x_pdata *pdata = wm831x->dev->platform_data;
849 struct regulator_config config = { };
841 int id = pdev->id % ARRAY_SIZE(pdata->dcdc); 850 int id = pdev->id % ARRAY_SIZE(pdata->dcdc);
842 struct wm831x_dcdc *dcdc; 851 struct wm831x_dcdc *dcdc;
843 struct resource *res; 852 struct resource *res;
@@ -871,8 +880,11 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
871 dcdc->desc.ops = &wm831x_boostp_ops; 880 dcdc->desc.ops = &wm831x_boostp_ops;
872 dcdc->desc.owner = THIS_MODULE; 881 dcdc->desc.owner = THIS_MODULE;
873 882
874 dcdc->regulator = regulator_register(&dcdc->desc, &pdev->dev, 883 config.dev = pdev->dev.parent;
875 pdata->dcdc[id], dcdc, NULL); 884 config.init_data = pdata->dcdc[id];
885 config.driver_data = dcdc;
886
887 dcdc->regulator = regulator_register(&dcdc->desc, &config);
876 if (IS_ERR(dcdc->regulator)) { 888 if (IS_ERR(dcdc->regulator)) {
877 ret = PTR_ERR(dcdc->regulator); 889 ret = PTR_ERR(dcdc->regulator);
878 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n", 890 dev_err(wm831x->dev, "Failed to register DCDC%d: %d\n",
@@ -941,6 +953,7 @@ static __devinit int wm831x_epe_probe(struct platform_device *pdev)
941{ 953{
942 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 954 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
943 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 955 struct wm831x_pdata *pdata = wm831x->dev->platform_data;
956 struct regulator_config config = { };
944 int id = pdev->id % ARRAY_SIZE(pdata->epe); 957 int id = pdev->id % ARRAY_SIZE(pdata->epe);
945 struct wm831x_dcdc *dcdc; 958 struct wm831x_dcdc *dcdc;
946 int ret; 959 int ret;
@@ -968,8 +981,11 @@ static __devinit int wm831x_epe_probe(struct platform_device *pdev)
968 dcdc->desc.type = REGULATOR_VOLTAGE; 981 dcdc->desc.type = REGULATOR_VOLTAGE;
969 dcdc->desc.owner = THIS_MODULE; 982 dcdc->desc.owner = THIS_MODULE;
970 983
971 dcdc->regulator = regulator_register(&dcdc->desc, &pdev->dev, 984 config.dev = pdev->dev.parent;
972 pdata->epe[id], dcdc, NULL); 985 config.init_data = pdata->epe[id];
986 config.driver_data = dcdc;
987
988 dcdc->regulator = regulator_register(&dcdc->desc, &config);
973 if (IS_ERR(dcdc->regulator)) { 989 if (IS_ERR(dcdc->regulator)) {
974 ret = PTR_ERR(dcdc->regulator); 990 ret = PTR_ERR(dcdc->regulator);
975 dev_err(wm831x->dev, "Failed to register EPE%d: %d\n", 991 dev_err(wm831x->dev, "Failed to register EPE%d: %d\n",