Skip to content

Commit

Permalink
regulator: pbias: Fix is_enabled callback implementation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 14, 2014
1 parent c9eaa44 commit 1cb7b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/pbias-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 1cb7b43

Please sign in to comment.