diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-11-16 17:01:05 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:50:13 -0800 |
commit | dd39062c182bf99df2549c3de65e8c04a1623118 (patch) | |
tree | 06f7eb160d2ee51225a7967db11a57251d8a7dd9 /drivers | |
parent | 1b033e7882422714d4afe8bd621a8628aa05db40 (diff) |
regulator: tps62361x: support for output discharge
Supporting the discharge of output capacitor via a typ.
300Ohm path.
bug 871944
Reviewed-on: http://git-master/r/65107
(cherry picked from commit a969b5c5e024c1ef6e29ef9d3603dd6bbe292567)
Change-Id: I1a8b605f486ab5978feb3a711c9c4e57ea737278
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/65804
Rebase-Id: R7d45dc727b03fa8b55470cc5507052eedecc8f76
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/tps6236x-regulator.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/regulator/tps6236x-regulator.c b/drivers/regulator/tps6236x-regulator.c index 86013ca04aa8..0d2d48f1e916 100644 --- a/drivers/regulator/tps6236x-regulator.c +++ b/drivers/regulator/tps6236x-regulator.c @@ -306,12 +306,30 @@ static int tps6236x_init_dcdc(struct i2c_client *client, else data &= ~(1 << 7); st = tps6236x_reg_write(tps, REG_VSET0 + tps->vsel_id, data); - if (data < 0) { + if (st < 0) { dev_err(tps->dev, "%s() fails in writing reg %d\n", __func__, REG_VSET0 + tps->vsel_id); return st; } + /* Configure the output discharge path */ + data = tps6236x_reg_read(tps, REG_RAMPCTRL); + if (data < 0) { + dev_err(tps->dev, "%s() fails in reading reg %d\n", + __func__, REG_RAMPCTRL); + return data; + } + if (pdata->enable_discharge) + data |= (1 << 2); + else + data &= ~(1 << 2); + st = tps6236x_write(tps, REG_RAMPCTRL, data); + if (st < 0) { + dev_err(tps->dev, "%s() fails in writing reg %d\n", + __func__, REG_RAMPCTRL); + return st; + } + if (!pdata->init_apply) return 0; |