summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-05-01 08:17:21 +0200
committerMark Brown <broonie@kernel.org>2015-05-04 16:07:32 +0200
commit6986f44c4c339fc9646a01f5eb296cba7c4efde7 (patch)
treedc33f6c366fbfdea2b09280b7b39d9488995bf9e /drivers/regulator
parentregulator: max77843: Fix enable_mask for max77843 charger (diff)
downloadlinux-6986f44c4c339fc9646a01f5eb296cba7c4efde7.tar.xz
linux-6986f44c4c339fc9646a01f5eb296cba7c4efde7.zip
regulator: max77843: Convert to use regulator_is_enabled_regmap
Use regulator_is_enabled_regmap() to replace max77843_reg_is_enabled(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max77843.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/regulator/max77843.c b/drivers/regulator/max77843.c
index 3ae2a9b39828..f4fd0d3cfa6e 100644
--- a/drivers/regulator/max77843.c
+++ b/drivers/regulator/max77843.c
@@ -33,21 +33,6 @@ static const unsigned int max77843_safeout_voltage_table[] = {
3300000,
};
-static int max77843_reg_is_enabled(struct regulator_dev *rdev)
-{
- struct regmap *regmap = rdev->regmap;
- int ret;
- unsigned int reg;
-
- ret = regmap_read(regmap, rdev->desc->enable_reg, &reg);
- if (ret) {
- dev_err(&rdev->dev, "Fialed to read charger register\n");
- return ret;
- }
-
- return (reg & rdev->desc->enable_mask) == rdev->desc->enable_mask;
-}
-
static int max77843_reg_get_current_limit(struct regulator_dev *rdev)
{
struct regmap *regmap = rdev->regmap;
@@ -96,7 +81,7 @@ static int max77843_reg_set_current_limit(struct regulator_dev *rdev,
}
static struct regulator_ops max77843_charger_ops = {
- .is_enabled = max77843_reg_is_enabled,
+ .is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.get_current_limit = max77843_reg_get_current_limit,
@@ -141,6 +126,7 @@ static const struct regulator_desc max77843_supported_regulators[] = {
.owner = THIS_MODULE,
.enable_reg = MAX77843_CHG_REG_CHG_CNFG_00,
.enable_mask = MAX77843_CHG_MASK | MAX77843_CHG_BUCK_MASK,
+ .enable_val = MAX77843_CHG_MASK | MAX77843_CHG_BUCK_MASK,
},
};