diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2012-01-03 14:30:31 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 10:59:26 +0200 |
commit | ba5d9986a256cee0d3061f21ac428e29b3251c20 (patch) | |
tree | 743ea2855b5c7fbf6ab468676dd8b8005d0a01c9 /drivers/regulator | |
parent | a5bcb75c00cdb6a7cd8dcf1b74e1a2bea46f479d (diff) |
u5500: keep LDO_H always on
The software specification says: "The sub camera is put in
standby by setting GPIO_002 (CAM_SUB_PWDN) high and leaving
the power supplies on, shutting only one power supply off
will result in a leakage current of 1.1mA, Leaving both
supplies on results in a leakage current of 15uA".
Both supplies here are LDO_H and VIO, and since VIO is always
on, keep LDO_H always on too, setting it to low power mode
instead of disabling it.
ST-Ericsson ID: 407971
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I7ce2c30b761e04a26270718e2c92f4a609a07995
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44142
Reviewed-by: QATOOLS
Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@stericsson.com>
Reviewed-by: QABUILD
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/ab5500.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/regulator/ab5500.c b/drivers/regulator/ab5500.c index 375c676454d..a3de7701923 100644 --- a/drivers/regulator/ab5500.c +++ b/drivers/regulator/ab5500.c @@ -57,7 +57,7 @@ struct ab5500_regulator { struct regulator_desc desc; const int *voltages; int num_holes; - bool pwrctrl; + bool off_is_lowpower; bool enabled; int enable_time; int load_lp_uA; @@ -104,9 +104,14 @@ static int ab5500_regulator_disable(struct regulator_dev *rdev) { struct ab5500_regulators *ab5500 = rdev_get_drvdata(rdev); struct ab5500_regulator *r = ab5500->regulator[rdev_get_id(rdev)]; - u8 regval = r->pwrctrl ? AB5500_LDO_MODE_PWRCTRL : AB5500_LDO_MODE_OFF; + u8 regval; int ret; + if (r->off_is_lowpower) + regval = AB5500_LDO_MODE_LOWPOWER; + else + regval = AB5500_LDO_MODE_OFF; + ret = abx500_mask_and_set(ab5500->dev, r->bank, r->reg, r->update_mask, regval); if (ret < 0) @@ -187,6 +192,12 @@ static int ab5500_regulator_is_enabled(struct regulator_dev *rdev) case AB5500_LDO_MODE_OFF: r->enabled = false; break; + case AB5500_LDO_MODE_LOWPOWER: + if (r->off_is_lowpower) { + r->enabled = false; + break; + } + /* fall through */ default: r->enabled = true; break; @@ -522,6 +533,7 @@ static int __devinit ab5500_regulator_probe(struct platform_device *pdev) { struct ab5500_platform_data *ppdata = pdev->dev.parent->platform_data; struct ab5500_regulator_platform_data *pdata = ppdata->regulator; + struct ab5500_regulator_data *regdata; struct ab5500_regulators *ab5500; int err = 0; int i; @@ -534,6 +546,7 @@ static int __devinit ab5500_regulator_probe(struct platform_device *pdev) return -ENOMEM; ab5500->dev = &pdev->dev; + regdata = pdata->data; platform_set_drvdata(pdev, ab5500); @@ -541,6 +554,9 @@ static int __devinit ab5500_regulator_probe(struct platform_device *pdev) struct ab5500_regulator *regulator = &ab5500_regulators[i]; struct regulator_dev *rdev; + if (regdata) + regulator->off_is_lowpower = regdata[i].off_is_lowpower; + ab5500->regulator[i] = regulator; rdev = regulator_register(®ulator->desc, &pdev->dev, |