regulator: fan53555: fill set_suspend_enable/disable callback
authorzhangqing <zhangqing@rock-chips.com>
Tue, 12 Jan 2016 11:05:56 +0000 (03:05 -0800)
committerMark Brown <broonie@kernel.org>
Fri, 15 Jan 2016 18:08:20 +0000 (18:08 +0000)
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>
drivers/regulator/fan53555.c

index 4940e8287df68090104a78cc6239ab90e22423c6..2cb5cc311610a12c467d518336dbdde814665667 100644 (file)
@@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
        return 0;
 }
 
+static int fan53555_set_suspend_enable(struct regulator_dev *rdev)
+{
+       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
+
+       return regmap_update_bits(di->regmap, di->sleep_reg,
+                                 VSEL_BUCK_EN, VSEL_BUCK_EN);
+}
+
+static int fan53555_set_suspend_disable(struct regulator_dev *rdev)
+{
+       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
+
+       return regmap_update_bits(di->regmap, di->sleep_reg,
+                                 VSEL_BUCK_EN, 0);
+}
+
 static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode)
 {
        struct fan53555_device_info *di = rdev_get_drvdata(rdev);
@@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = {
        .set_mode = fan53555_set_mode,
        .get_mode = fan53555_get_mode,
        .set_ramp_delay = fan53555_set_ramp,
+       .set_suspend_enable = fan53555_set_suspend_enable,
+       .set_suspend_disable = fan53555_set_suspend_disable,
 };
 
 static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)