]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
regulator: pbias: Fix is_enabled callback implementation
authorAxel Lin <axel.lin@ingics.com>
Sat, 8 Mar 2014 03:55:29 +0000 (11:55 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 14 Apr 2014 21:16:25 +0000 (22:16 +0100)
The is_enabled implementation is wrong in some cases:
e.g. for pbias_mmc_omap5: enable_mask is : BIT(27) | BIT(25) | BIT(26)
However, pbias_regulator_enable() only sets BIT(27) | BIT(26) bits.
So is_enabled callback will always return false in this case.
Fix the logic to compare the register value with info->enable rather than
info->enable_mask.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/pbias-regulator.c

index ded3b35742091dac92192c45f1c0e7f24565f924..d89a1d8615c7c814adbc76c50564c3a495a46fab 100644 (file)
@@ -108,7 +108,7 @@ static int pbias_regulator_is_enable(struct regulator_dev *rdev)
 
        regmap_read(data->syscon, data->pbias_reg, &value);
 
-       return (value & info->enable_mask) == info->enable_mask;
+       return (value & info->enable_mask) == info->enable;
 }
 
 static struct regulator_ops pbias_regulator_voltage_ops = {