ARM64: rockchip: syr82x: support syr82x regulator
authorzhangqing <zhangqing@rock-chips.com>
Mon, 11 Jan 2016 16:36:58 +0000 (08:36 -0800)
committerzhangqing <zhangqing@rock-chips.com>
Mon, 11 Jan 2016 17:58:07 +0000 (09:58 -0800)
Add suspend/resume enable/disable setting function.
Silergy SYR82x regulators share the exact same functionality and register
layout as the Fairchild FAN53555 regulators.
The fan53555 is upstreamed.
Therefore use fan53555.c for support syr82x.

Change-Id: If1d72a34d26c705796bc4d33de7187116edf4aa8
Signed-off-by: zhangqing <zhangqing@rock-chips.com>
arch/arm64/configs/rockchip_defconfig
drivers/regulator/fan53555.c

index 5a2a9c51c32bb665b659dbadf3342c4bca5e3034..f51b836358b6e0c7fc3009fa993aaf6ab6d2e846 100644 (file)
@@ -286,7 +286,7 @@ CONFIG_MFD_RK808=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_ACT8865=y
-CONFIG_REGULATOR_SYR82X=y
+CONFIG_REGULATOR_FAN53555=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_MEDIA_RC_SUPPORT=y
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)