aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ab8500.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/ab8500.c')
-rw-r--r--drivers/regulator/ab8500.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index c7784c4bff4f..f7d1f538c200 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -939,8 +939,9 @@ ab8500_regulator_of_probe(struct platform_device *pdev, struct device_node *np)
939static int ab8500_regulator_probe(struct platform_device *pdev) 939static int ab8500_regulator_probe(struct platform_device *pdev)
940{ 940{
941 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); 941 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
942 struct ab8500_platform_data *pdata;
943 struct device_node *np = pdev->dev.of_node; 942 struct device_node *np = pdev->dev.of_node;
943 struct ab8500_platform_data *ppdata;
944 struct ab8500_regulator_platform_data *pdata;
944 int i, err; 945 int i, err;
945 946
946 if (np) { 947 if (np) {
@@ -961,7 +962,14 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
961 dev_err(&pdev->dev, "null mfd parent\n"); 962 dev_err(&pdev->dev, "null mfd parent\n");
962 return -EINVAL; 963 return -EINVAL;
963 } 964 }
964 pdata = dev_get_platdata(ab8500->dev); 965
966 ppdata = dev_get_platdata(ab8500->dev);
967 if (!ppdata) {
968 dev_err(&pdev->dev, "null parent pdata\n");
969 return -EINVAL;
970 }
971
972 pdata = ppdata->regulator;
965 if (!pdata) { 973 if (!pdata) {
966 dev_err(&pdev->dev, "null pdata\n"); 974 dev_err(&pdev->dev, "null pdata\n");
967 return -EINVAL; 975 return -EINVAL;
@@ -974,12 +982,12 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
974 } 982 }
975 983
976 /* initialize registers */ 984 /* initialize registers */
977 for (i = 0; i < pdata->num_regulator_reg_init; i++) { 985 for (i = 0; i < pdata->num_reg_init; i++) {
978 int id, mask, value; 986 int id, mask, value;
979 987
980 id = pdata->regulator_reg_init[i].id; 988 id = pdata->reg_init[i].id;
981 mask = pdata->regulator_reg_init[i].mask; 989 mask = pdata->reg_init[i].mask;
982 value = pdata->regulator_reg_init[i].value; 990 value = pdata->reg_init[i].value;
983 991
984 /* check for configuration errors */ 992 /* check for configuration errors */
985 BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS); 993 BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS);
@@ -1045,5 +1053,6 @@ module_exit(ab8500_regulator_exit);
1045 1053
1046MODULE_LICENSE("GPL v2"); 1054MODULE_LICENSE("GPL v2");
1047MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>"); 1055MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>");
1056MODULE_AUTHOR("Bengt Jonsson <bengt.g.jonsson@stericsson.com>");
1048MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC"); 1057MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC");
1049MODULE_ALIAS("platform:ab8500-regulator"); 1058MODULE_ALIAS("platform:ab8500-regulator");