From: 张晴 Date: Mon, 31 Mar 2014 05:51:48 +0000 (+0800) Subject: rk3288:rk808:support two switch enable and disable as ldo X-Git-Tag: firefly_0821_release~5702 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ea8feec5dbde5fe6f7b7c2595201794475f8a33a;p=firefly-linux-kernel-4.4.55.git rk3288:rk808:support two switch enable and disable as ldo --- diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index 788feb5610f7..f5f2c2e45d6e 100755 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -171,7 +171,12 @@ static int rk808_ldo_enable(struct regulator_dev *dev) struct rk808 *rk808 = rdev_get_drvdata(dev); int ldo= rdev_get_id(dev) - RK808_LDO1; - return rk808_set_bits(rk808, RK808_LDO_EN_REG, 1 << ldo, 1 << ldo); + if(ldo == 8) + return rk808_set_bits(rk808, RK808_DCDC_EN_REG, 1 << 5, 1 << 5); + else if(ldo ==9) + return rk808_set_bits(rk808, RK808_DCDC_EN_REG, 1 << 6, 1 << 6); + else + return rk808_set_bits(rk808, RK808_LDO_EN_REG, 1 << ldo, 1 << ldo); } static int rk808_ldo_disable(struct regulator_dev *dev) @@ -179,7 +184,12 @@ static int rk808_ldo_disable(struct regulator_dev *dev) struct rk808 *rk808 = rdev_get_drvdata(dev); int ldo= rdev_get_id(dev) - RK808_LDO1; - return rk808_set_bits(rk808, RK808_LDO_EN_REG, 1 << ldo, 0); + if(ldo == 8) + return rk808_set_bits(rk808, RK808_DCDC_EN_REG, 1 << 5, 0); + else if(ldo ==9) + return rk808_set_bits(rk808, RK808_DCDC_EN_REG, 1 << 6, 0); + else + return rk808_set_bits(rk808, RK808_LDO_EN_REG, 1 << ldo, 0); } static int rk808_ldo_suspend_enable(struct regulator_dev *dev)