From 5a49b4a527e5b72ae3a4f64f078759f83fbd98b5 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 7 Jun 2013 17:11:26 +0100 Subject: regulator: ab8500-ext: Register as a device in its own right Some platforms don't support the AB8500 external regulators, so instead of having a list of is_() calls prior to calling ab8500_ext_regulator_init() from ab8500_regulator_probe(), we can only register as a platform device on platforms which require them. It means we also have more control over them when booting with Device Tree. Signed-off-by: Lee Jones Signed-off-by: Mark Brown --- drivers/regulator/ab8500.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'drivers/regulator/ab8500.c') diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index f6656b8c28b..dfc790196b3 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -3156,22 +3156,12 @@ static int ab8500_regulator_probe(struct platform_device *pdev) return err; } - if (!is_ab8505(ab8500)) { - /* register external regulators (before Vaux1, 2 and 3) */ - err = ab8500_ext_regulator_init(pdev); - if (err) - return err; - } - /* register all regulators */ for (i = 0; i < abx500_regulator.info_size; i++) { err = ab8500_regulator_register(pdev, &pdata->regulator[i], i, NULL); - if (err < 0) { - if (!is_ab8505(ab8500)) - ab8500_ext_regulator_exit(pdev); + if (err < 0) return err; - } } return 0; @@ -3180,7 +3170,6 @@ static int ab8500_regulator_probe(struct platform_device *pdev) static int ab8500_regulator_remove(struct platform_device *pdev) { int i, err; - struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); for (i = 0; i < abx500_regulator.info_size; i++) { struct ab8500_regulator_info *info = NULL; @@ -3192,10 +3181,6 @@ static int ab8500_regulator_remove(struct platform_device *pdev) regulator_unregister(info->regulator); } - /* remove external regulators (after Vaux1, 2 and 3) */ - if (!is_ab8505(ab8500)) - ab8500_ext_regulator_exit(pdev); - /* remove regulator debug */ err = ab8500_regulator_debug_exit(pdev); if (err) -- cgit v1.2.3-70-g09d2 From ce6f5ea3a7240c15e5775d5b9c5c57629943ca6c Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 7 Jun 2013 17:11:28 +0100 Subject: regulator: ab8500: Provide supply names for the AUX regulators On some platforms the AUX[1|2|3] regulators are supplied voltage by a separate regulator. For example on Snowball these are provided by the EXT3. If we list them here, we can supply voltage to them by simply listing them in as a consumer of EXT3 in the Snowball case. Signed-off-by: Lee Jones Signed-off-by: Mark Brown --- drivers/regulator/ab8500.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/regulator/ab8500.c') diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index dfc790196b3..bb02108c95e 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -719,6 +719,7 @@ static struct ab8500_regulator_info .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages), .volt_table = ldo_vauxn_voltages, .enable_time = 200, + .supply_name = "vin", }, .load_lp_uA = 5000, .update_bank = 0x04, @@ -741,6 +742,7 @@ static struct ab8500_regulator_info .n_voltages = ARRAY_SIZE(ldo_vauxn_voltages), .volt_table = ldo_vauxn_voltages, .enable_time = 200, + .supply_name = "vin", }, .load_lp_uA = 5000, .update_bank = 0x04, @@ -763,6 +765,7 @@ static struct ab8500_regulator_info .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages), .volt_table = ldo_vaux3_voltages, .enable_time = 450, + .supply_name = "vin", }, .load_lp_uA = 5000, .update_bank = 0x04, -- cgit v1.2.3-70-g09d2