From ba5d9986a256cee0d3061f21ac428e29b3251c20 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Tue, 3 Jan 2012 14:30:31 +0530 Subject: 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 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44142 Reviewed-by: QATOOLS Reviewed-by: Vijaya Kumar K-1 Reviewed-by: QABUILD --- drivers/regulator/ab5500.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'drivers/regulator') 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, -- cgit v1.2.3