[PATCH 1/2] regulator: pfuze100: add enable/disable for switch

From: Anson Huang
Date: Thu May 17 2018 - 02:34:06 EST


Add enable/disable support for switch regulator on pfuze100.

Based on Robin Gong's patch from the NXP kernel tree.

Signed-off-by: Anson Huang <Anson.Huang@xxxxxxx>
---
drivers/regulator/pfuze100-regulator.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index 680f076..053eb1e 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -155,6 +155,9 @@ static const struct regulator_ops pfuze100_fixed_regulator_ops = {
};

static const struct regulator_ops pfuze100_sw_regulator_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
@@ -200,6 +203,11 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = {
.uV_step = (step), \
.vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
.vsel_mask = 0x3f, \
+ .enable_reg = (base) + PFUZE100_MODE_OFFSET, \
+ .enable_val = 0xc, \
+ .disable_val = 0x0, \
+ .enable_mask = 0xf, \
+ .enable_time = 500, \
}, \
.stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
.stby_mask = 0x3f, \
--
2.7.4