aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ab8500.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-12-03 09:08:22 -0500
committerMark Brown <broonie@linaro.org>2013-12-03 10:09:06 -0500
commit34c040ce1a9d9c13121c95101164383ce516ddd6 (patch)
treeced4be8bf9442c5627937a3a7f6c82d174e5a064 /drivers/regulator/ab8500.c
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
regulator: ab8500: delete non-devicetree probe path
The Ux500 platform has been converted to do device-tree only boots, no longer supports platform data passing, so this probe path is unused. Delete it, simplifying the driver a whole lot. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/ab8500.c')
-rw-r--r--drivers/regulator/ab8500.c102
1 files changed, 8 insertions, 94 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 603f192e84f1..0f86695b737a 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -2998,37 +2998,6 @@ static void abx500_get_regulator_info(struct ab8500 *ab8500)
2998 } 2998 }
2999} 2999}
3000 3000
3001static int ab8500_regulator_init_registers(struct platform_device *pdev,
3002 int id, int mask, int value)
3003{
3004 struct ab8500_reg_init *reg_init = abx500_regulator.init;
3005 int err;
3006
3007 BUG_ON(value & ~mask);
3008 BUG_ON(mask & ~reg_init[id].mask);
3009
3010 /* initialize register */
3011 err = abx500_mask_and_set_register_interruptible(
3012 &pdev->dev,
3013 reg_init[id].bank,
3014 reg_init[id].addr,
3015 mask, value);
3016 if (err < 0) {
3017 dev_err(&pdev->dev,
3018 "Failed to initialize 0x%02x, 0x%02x.\n",
3019 reg_init[id].bank,
3020 reg_init[id].addr);
3021 return err;
3022 }
3023 dev_vdbg(&pdev->dev,
3024 " init: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
3025 reg_init[id].bank,
3026 reg_init[id].addr,
3027 mask, value);
3028
3029 return 0;
3030}
3031
3032static int ab8500_regulator_register(struct platform_device *pdev, 3001static int ab8500_regulator_register(struct platform_device *pdev,
3033 struct regulator_init_data *init_data, 3002 struct regulator_init_data *init_data,
3034 int id, struct device_node *np) 3003 int id, struct device_node *np)
@@ -3095,9 +3064,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
3095{ 3064{
3096 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); 3065 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
3097 struct device_node *np = pdev->dev.of_node; 3066 struct device_node *np = pdev->dev.of_node;
3098 struct ab8500_platform_data *ppdata; 3067 int err;
3099 struct ab8500_regulator_platform_data *pdata;
3100 int i, err;
3101 3068
3102 if (!ab8500) { 3069 if (!ab8500) {
3103 dev_err(&pdev->dev, "null mfd parent\n"); 3070 dev_err(&pdev->dev, "null mfd parent\n");
@@ -3106,68 +3073,15 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
3106 3073
3107 abx500_get_regulator_info(ab8500); 3074 abx500_get_regulator_info(ab8500);
3108 3075
3109 if (np) { 3076 err = of_regulator_match(&pdev->dev, np,
3110 err = of_regulator_match(&pdev->dev, np, 3077 abx500_regulator.match,
3111 abx500_regulator.match, 3078 abx500_regulator.match_size);
3112 abx500_regulator.match_size); 3079 if (err < 0) {
3113 if (err < 0) { 3080 dev_err(&pdev->dev,
3114 dev_err(&pdev->dev, 3081 "Error parsing regulator init data: %d\n", err);
3115 "Error parsing regulator init data: %d\n", err);
3116 return err;
3117 }
3118
3119 err = ab8500_regulator_of_probe(pdev, np);
3120 return err;
3121 }
3122
3123 ppdata = dev_get_platdata(ab8500->dev);
3124 if (!ppdata) {
3125 dev_err(&pdev->dev, "null parent pdata\n");
3126 return -EINVAL;
3127 }
3128
3129 pdata = ppdata->regulator;
3130 if (!pdata) {
3131 dev_err(&pdev->dev, "null pdata\n");
3132 return -EINVAL;
3133 }
3134
3135 /* make sure the platform data has the correct size */
3136 if (pdata->num_regulator != abx500_regulator.info_size) {
3137 dev_err(&pdev->dev, "Configuration error: size mismatch.\n");
3138 return -EINVAL;
3139 }
3140
3141 /* initialize debug (initial state is recorded with this call) */
3142 err = ab8500_regulator_debug_init(pdev);
3143 if (err)
3144 return err; 3082 return err;
3145
3146 /* initialize registers */
3147 for (i = 0; i < pdata->num_reg_init; i++) {
3148 int id, mask, value;
3149
3150 id = pdata->reg_init[i].id;
3151 mask = pdata->reg_init[i].mask;
3152 value = pdata->reg_init[i].value;
3153
3154 /* check for configuration errors */
3155 BUG_ON(id >= abx500_regulator.init_size);
3156
3157 err = ab8500_regulator_init_registers(pdev, id, mask, value);
3158 if (err < 0)
3159 return err;
3160 }
3161
3162 /* register all regulators */
3163 for (i = 0; i < abx500_regulator.info_size; i++) {
3164 err = ab8500_regulator_register(pdev, &pdata->regulator[i],
3165 i, NULL);
3166 if (err < 0)
3167 return err;
3168 } 3083 }
3169 3084 return ab8500_regulator_of_probe(pdev, np);
3170 return 0;
3171} 3085}
3172 3086
3173static int ab8500_regulator_remove(struct platform_device *pdev) 3087static int ab8500_regulator_remove(struct platform_device *pdev)