summaryrefslogtreecommitdiff
path: root/drivers/regulator/max77802.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-10-15 18:20:33 +0200
committerMark Brown <broonie@kernel.org>2014-10-20 12:23:50 +0100
commitb0615f1da543500f8442fa6e5adacb8c54b34c5f (patch)
tree9987d6cf11bb6c2f11f8df645be9098842b1dce4 /drivers/regulator/max77802.c
parente6fb2aac552ab229e01169776199c13e2524c318 (diff)
regulator: max77802: Split regulator operations for BUCKs
Not all the max77802 BUCKs regulators have the same functionality, for example BUCKs 2-4 support the output to be configured as normal or Low Power Mode by the PWRREQ enable pin while the other BUCKs only support their output to be set ON or OFF by PWRREQ. As a preparation for adding a set_suspend_mode function handler for all the regulators that support Low Power Mode by PWRREQ, split the operations for BUCKs regulators. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/max77802.c')
-rw-r--r--drivers/regulator/max77802.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
index 26f6963108e3..8425c0d520a8 100644
--- a/drivers/regulator/max77802.c
+++ b/drivers/regulator/max77802.c
@@ -286,7 +286,22 @@ static struct regulator_ops max77802_buck_16_dvs_ops = {
.set_suspend_disable = max77802_set_suspend_disable,
};
-/* BUCKs 2-4, 5, 7-10 */
+/* BUCKs 2-4 */
+static struct regulator_ops max77802_buck_234_ops = {
+ .list_voltage = regulator_list_voltage_linear,
+ .map_voltage = regulator_map_voltage_linear,
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = max77802_enable,
+ .disable = regulator_disable_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
+ .set_ramp_delay = max77802_set_ramp_delay_2bit,
+ .set_suspend_enable = max77802_enable,
+ .set_suspend_disable = max77802_set_suspend_disable,
+};
+
+/* BUCKs 5, 7-10 */
static struct regulator_ops max77802_buck_dvs_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
@@ -360,7 +375,7 @@ static struct regulator_ops max77802_buck_dvs_ops = {
.name = "BUCK"#num, \
.id = MAX77802_BUCK##num, \
.supply_name = "inb"#num, \
- .ops = &max77802_buck_dvs_ops, \
+ .ops = &max77802_buck_234_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = 600000, \