From f7b1a8dc1c1ca30d6a9ceb1f23f0e9847668600b Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 21 Mar 2014 16:15:20 +0800 Subject: regulator: s2mpa01: Don't check enable_shift before setting enable ramp rate Current code misses updating the register when enable_shift is 0. e.g. S2MPA01_BUCK4_RAMP_EN_SHIFT is 0. Signed-off-by: Axel Lin Acked-by: Sachin Kamat Signed-off-by: Mark Brown --- drivers/regulator/s2mpa01.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c index 808b3aa7a42c..f19a30f0fb42 100644 --- a/drivers/regulator/s2mpa01.c +++ b/drivers/regulator/s2mpa01.c @@ -192,13 +192,11 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) if (!ramp_enable) goto ramp_disable; - if (enable_shift) { - ret = regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, - 1 << enable_shift, 1 << enable_shift); - if (ret) { - dev_err(&rdev->dev, "failed to enable ramp rate\n"); - return ret; - } + ret = regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, + 1 << enable_shift, 1 << enable_shift); + if (ret) { + dev_err(&rdev->dev, "failed to enable ramp rate\n"); + return ret; } ramp_val = get_ramp_delay(ramp_delay); -- cgit v1.2.3 From b96244fad9530a707b732c3650d349aed2c9cfcd Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 21 Mar 2014 16:16:24 +0800 Subject: regulator: s2mps11: Don't check enable_shift before setting enable ramp rate Current code misses updating the register when enable_shift is 0. e.g. S2MPS11_BUCK9_RAMP_SHIFT and S2MPS11_BUCK6_RAMP_EN_SHIFT are 0. Signed-off-by: Axel Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- drivers/regulator/s2mps11.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/regulator') diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index 68fd54702edb..e713c162fbd4 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c @@ -202,13 +202,11 @@ static int s2mps11_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) if (!ramp_enable) goto ramp_disable; - if (enable_shift) { - ret = regmap_update_bits(rdev->regmap, S2MPS11_REG_RAMP, - 1 << enable_shift, 1 << enable_shift); - if (ret) { - dev_err(&rdev->dev, "failed to enable ramp rate\n"); - return ret; - } + ret = regmap_update_bits(rdev->regmap, S2MPS11_REG_RAMP, + 1 << enable_shift, 1 << enable_shift); + if (ret) { + dev_err(&rdev->dev, "failed to enable ramp rate\n"); + return ret; } ramp_val = get_ramp_delay(ramp_delay); -- cgit v1.2.3 From f4fbb3ce342bc1c13455209cb9ea63b9f678d159 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Mon, 7 Apr 2014 14:15:23 +0200 Subject: regulator: s5m8767: Fix carried over ena_gpio assignment During registration of regulators if external control for regulator was set in DTS the ena_gpio and ena_gpio_flags fields of regulator_config were set to proper values. However the same regulator_config was used in next iterations of loop so the ena_gpio fields carried over to next regulators. The issue was not observed as ena_gpio is supported only for Buck9 regulator which is often the last regulator parsed from DTS. Be sure to clear ena_gpio config fields before registering the regulator. Fixes: ee1e0994ab1bd (regulator: s5m8767: Use GPIO for controlling Buck9/eMMC) Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- drivers/regulator/s5m8767.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/regulator') diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index f05badabd69e..92f19a005dc3 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -964,6 +964,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) config.driver_data = s5m8767; config.regmap = iodev->regmap_pmic; config.of_node = pdata->regulators[i].reg_node; + config.ena_gpio = config.ena_gpio_flags = 0; if (pdata->regulators[i].ext_control_gpio) s5m8767_regulator_config_ext_control(s5m8767, &pdata->regulators[i], &config); -- cgit v1.2.3 From 1e7914058e3533d905618dd00a36499c8d29e7be Mon Sep 17 00:00:00 2001 From: Tim Kryger Date: Thu, 10 Apr 2014 13:04:00 -0700 Subject: regulator: bcm590xx: Set n_voltages for linear reg Fix the macro used to define linear range regulators to include the number of voltages. Signed-off-by: Tim Kryger Acked-by: Matt Porter Signed-off-by: Mark Brown --- drivers/regulator/bcm590xx-regulator.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/regulator') diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c index ab08ca7cfb08..c3750c5b382b 100644 --- a/drivers/regulator/bcm590xx-regulator.c +++ b/drivers/regulator/bcm590xx-regulator.c @@ -123,6 +123,7 @@ struct bcm590xx_info { #define BCM590XX_REG_RANGES(_name, _ranges) \ { \ .name = #_name, \ + .n_voltages = 64, \ .n_linear_ranges = ARRAY_SIZE(_ranges), \ .linear_ranges = _ranges, \ } -- cgit v1.2.3