diff options
author | zhangqing <zhangqing@rock-chips.com> | 2016-01-12 06:05:56 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-15 13:08:20 -0500 |
commit | ab7cad331155bab5e81381b5e34a333220718385 (patch) | |
tree | 22bff959bd07daa6e9214246434f0eebeedd733a | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) |
regulator: fan53555: fill set_suspend_enable/disable callback
Setting the set_suspend_enable/disable callback to support
enable and disable the dcdc when system is suspend.
Signed-off-by: zhangqing <zhangqing@rock-chips.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/fan53555.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index 4940e8287df6..2cb5cc311610 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c | |||
@@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV) | |||
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | static int fan53555_set_suspend_enable(struct regulator_dev *rdev) | ||
118 | { | ||
119 | struct fan53555_device_info *di = rdev_get_drvdata(rdev); | ||
120 | |||
121 | return regmap_update_bits(di->regmap, di->sleep_reg, | ||
122 | VSEL_BUCK_EN, VSEL_BUCK_EN); | ||
123 | } | ||
124 | |||
125 | static int fan53555_set_suspend_disable(struct regulator_dev *rdev) | ||
126 | { | ||
127 | struct fan53555_device_info *di = rdev_get_drvdata(rdev); | ||
128 | |||
129 | return regmap_update_bits(di->regmap, di->sleep_reg, | ||
130 | VSEL_BUCK_EN, 0); | ||
131 | } | ||
132 | |||
117 | static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode) | 133 | static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode) |
118 | { | 134 | { |
119 | struct fan53555_device_info *di = rdev_get_drvdata(rdev); | 135 | struct fan53555_device_info *di = rdev_get_drvdata(rdev); |
@@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = { | |||
192 | .set_mode = fan53555_set_mode, | 208 | .set_mode = fan53555_set_mode, |
193 | .get_mode = fan53555_get_mode, | 209 | .get_mode = fan53555_get_mode, |
194 | .set_ramp_delay = fan53555_set_ramp, | 210 | .set_ramp_delay = fan53555_set_ramp, |
211 | .set_suspend_enable = fan53555_set_suspend_enable, | ||
212 | .set_suspend_disable = fan53555_set_suspend_disable, | ||
195 | }; | 213 | }; |
196 | 214 | ||
197 | static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di) | 215 | static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di) |