summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps6591x-regulator.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-07-25 18:08:15 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:54 -0800
commit27cd56c718b642dee30d064bdd4263c2b55bf5cc (patch)
tree31a228f77575bdc6b7471ad1908da0e7b78611b0 /drivers/regulator/tps6591x-regulator.c
parent4ed9769c0c832afa7292ef0c92d46f797a595dad (diff)
regulator: tps6591x: Clear external control setting in shutdown
Clearing the external control configuartion in shutdown on the regulator. bug 839572 Original-Change-Id: I2362c6decb7209aa5f5667de48315ef0bc8926a2 Reviewed-on: http://git-master/r/43048 Tested-by: Vivek Kumar <vivekk@nvidia.com> Reviewed-by: Kaushik Sen <ksen@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: R4aa455b1b3fd6007875f94ab31c61315fd61633b
Diffstat (limited to 'drivers/regulator/tps6591x-regulator.c')
-rw-r--r--drivers/regulator/tps6591x-regulator.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/regulator/tps6591x-regulator.c b/drivers/regulator/tps6591x-regulator.c
index 2fff27aa8a33..8758211dadb6 100644
--- a/drivers/regulator/tps6591x-regulator.c
+++ b/drivers/regulator/tps6591x-regulator.c
@@ -86,6 +86,7 @@ struct tps6591x_regulator {
int *voltages;
int delay; /* delay in us for regulator to stabilize */
+ enum tps6591x_ext_control ectrl;
};
static inline struct device *to_tps6591x_dev(struct regulator_dev *rdev)
@@ -731,6 +732,7 @@ static int __devinit tps6591x_regulator_probe(struct platform_device *pdev)
return -EINVAL;
}
tps_pdata = pdev->dev.platform_data;
+ ri->ectrl = tps_pdata->ectrl;
err = tps6591x_regulator_preinit(pdev->dev.parent, ri, tps_pdata);
if (err)
@@ -757,6 +759,21 @@ static int __devexit tps6591x_regulator_remove(struct platform_device *pdev)
return 0;
}
+static void tps6591x_regulator_shutdown(struct platform_device *pdev)
+{
+ struct regulator_dev *rdev = platform_get_drvdata(pdev);
+ struct tps6591x_regulator *ri = rdev_get_drvdata(rdev);
+ struct device *parent = to_tps6591x_dev(rdev);
+ int ret;
+
+ if (ri->ectrl == EXT_CTRL_EN1) {
+ ret = tps6591x_clr_bits(parent, ri->en1_reg.addr,
+ (1 << ri->en1_reg.shift_bits));
+ if (ret < 0)
+ dev_err(&pdev->dev, "Error in clearing external control\n");
+ }
+}
+
static struct platform_driver tps6591x_regulator_driver = {
.driver = {
.name = "tps6591x-regulator",
@@ -764,6 +781,7 @@ static struct platform_driver tps6591x_regulator_driver = {
},
.probe = tps6591x_regulator_probe,
.remove = __devexit_p(tps6591x_regulator_remove),
+ .shutdown = tps6591x_regulator_shutdown,
};
static int __init tps6591x_regulator_init(void)