summaryrefslogtreecommitdiff
path: root/drivers/regulator/mc13xxx-regulator-core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 16:19:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 16:19:15 -0700
commit91c2ff7708d4edf73ef1f0abb3ea4a44b4b0cf1d (patch)
tree43ddc350e2ee5e0f20b5273accdcc597b89da1f6 /drivers/regulator/mc13xxx-regulator-core.c
parent1325b6550a7b9cda52ee4c0da04fa9f93d2618fc (diff)
parentf955c8ba265540617da67d528ea74e50d48ad2be (diff)
Merge tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "A couple of nice new features this month, the ability to map regulators in order to allow voltage control by external coprocessors is something people have been asking for for a long time. - improved support for switch only "regulators", allowing current state to be read from the parent regulator but no setting. - support for obtaining the register access method used to set voltages, for use in systems which can offload control of this to a coprocessor (typically for DVFS). - support for Active-Semi AC8846, Dialog DA9211 and Texas Instruments TPS65917" * tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (58 commits) regulator: act8865: fix build when OF is not enabled regulator: act8865: add act8846 to DT binding documentation regulator: act8865: add support for act8846 regulator: act8865: prepare support for other act88xx devices regulator: act8865: set correct number of regulators in pdata regulator: act8865: Remove error variable in act8865_pmic_probe regulator: act8865: fix parsing of platform data regulator: tps65090: Set voltage for fixed regulators regulator: core: Allow to get voltage count and list from parent regulator: core: Get voltage from parent if not available regulator: Add missing statics and inlines for stub functions regulator: lp872x: Don't set constraints within the regulator driver regmap: Fix return code for stub regmap_get_device() regulator: s2mps11: Update module description and Kconfig to add S2MPU02 support regulator: Add helpers for low-level register access regmap: Allow regmap_get_device() to be used by modules regmap: Add regmap_get_device regulator: da9211: Remove unnecessary devm_regulator_unregister() calls regulator: Add DT bindings for tps65218 PMIC regulators. regulator: da9211: new regulator driver ...
Diffstat (limited to 'drivers/regulator/mc13xxx-regulator-core.c')
-rw-r--r--drivers/regulator/mc13xxx-regulator-core.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index 05b971726ffa..afba024953e1 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -33,17 +33,12 @@ static int mc13xxx_regulator_enable(struct regulator_dev *rdev)
struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
int id = rdev_get_id(rdev);
- int ret;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
- mc13xxx_lock(priv->mc13xxx);
- ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
- mc13xxx_regulators[id].enable_bit,
- mc13xxx_regulators[id].enable_bit);
- mc13xxx_unlock(priv->mc13xxx);
-
- return ret;
+ return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
+ mc13xxx_regulators[id].enable_bit,
+ mc13xxx_regulators[id].enable_bit);
}
static int mc13xxx_regulator_disable(struct regulator_dev *rdev)
@@ -51,16 +46,11 @@ static int mc13xxx_regulator_disable(struct regulator_dev *rdev)
struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
int id = rdev_get_id(rdev);
- int ret;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
- mc13xxx_lock(priv->mc13xxx);
- ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
- mc13xxx_regulators[id].enable_bit, 0);
- mc13xxx_unlock(priv->mc13xxx);
-
- return ret;
+ return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
+ mc13xxx_regulators[id].enable_bit, 0);
}
static int mc13xxx_regulator_is_enabled(struct regulator_dev *rdev)
@@ -70,10 +60,7 @@ static int mc13xxx_regulator_is_enabled(struct regulator_dev *rdev)
int ret, id = rdev_get_id(rdev);
unsigned int val;
- mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(priv->mc13xxx, mc13xxx_regulators[id].reg, &val);
- mc13xxx_unlock(priv->mc13xxx);
-
if (ret)
return ret;
@@ -86,15 +73,10 @@ static int mc13xxx_regulator_set_voltage_sel(struct regulator_dev *rdev,
struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
int id = rdev_get_id(rdev);
- int ret;
- mc13xxx_lock(priv->mc13xxx);
- ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].vsel_reg,
- mc13xxx_regulators[id].vsel_mask,
- selector << mc13xxx_regulators[id].vsel_shift);
- mc13xxx_unlock(priv->mc13xxx);
-
- return ret;
+ return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].vsel_reg,
+ mc13xxx_regulators[id].vsel_mask,
+ selector << mc13xxx_regulators[id].vsel_shift);
}
static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
@@ -106,11 +88,8 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
- mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(priv->mc13xxx,
mc13xxx_regulators[id].vsel_reg, &val);
- mc13xxx_unlock(priv->mc13xxx);
-
if (ret)
return ret;