From 3f12b1eac33deed4e814411f786e6a7dfdb13220 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 22 Aug 2011 15:43:55 +0200 Subject: [PATCH] --- yaml --- r: 273375 b: refs/heads/master c: 881de67046f424fc3a6e05b1c681c12afd94e802 h: refs/heads/master i: 273373: c9bb6ef46c3ded6fdd5ec2f062ea36e5d696c474 273371: 7d5ac68136d7032f9bb4535832eca0c43b15f4f6 273367: 61afb577b049c0038d8d9acb2d2d14a38f867f64 273359: cfad3d1bba09d0555daf7433db342f0e2ff05bdb 273343: 8d6e397ce2079d21cd9694f70405940f1586d87b v: v3 --- [refs] | 2 +- trunk/drivers/mfd/wm8994-core.c | 19 +++++++++++++++++++ trunk/include/linux/mfd/wm8994/core.h | 2 ++ trunk/include/linux/mfd/wm8994/pdata.h | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e202e5e64b5b..d4fcf23c6f63 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 862de70c12bb6227943e155251c75e7fa4558068 +refs/heads/master: 881de67046f424fc3a6e05b1c681c12afd94e802 diff --git a/trunk/drivers/mfd/wm8994-core.c b/trunk/drivers/mfd/wm8994-core.c index 96479c9b1728..1f15743460a0 100644 --- a/trunk/drivers/mfd/wm8994-core.c +++ b/trunk/drivers/mfd/wm8994-core.c @@ -281,6 +281,13 @@ static int wm8994_suspend(struct device *dev) return 0; } + /* Disable LDO pulldowns while the device is suspended if we + * don't know that something will be driving them. */ + if (!wm8994->ldo_ena_always_driven) + wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2, + WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD, + WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD); + /* GPIO configuration state is saved here since we may be configuring * the GPIO alternate functions even if we're not using the gpiolib * driver for them. @@ -350,6 +357,11 @@ static int wm8994_resume(struct device *dev) if (ret < 0) dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); + /* Disable LDO pulldowns while the device is active */ + wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2, + WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD, + 0); + wm8994->suspended = false; return 0; @@ -513,8 +525,15 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) pdata->gpio_defaults[i]); } } + + wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven; } + /* Disable LDO pulldowns while the device is active */ + wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2, + WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD, + 0); + /* In some system designs where the regulators are not in use, * we can achieve a small reduction in leakage currents by * floating LDO outputs. This bit makes no difference if the diff --git a/trunk/include/linux/mfd/wm8994/core.h b/trunk/include/linux/mfd/wm8994/core.h index f0b69cdae41c..5ab71bd76f9c 100644 --- a/trunk/include/linux/mfd/wm8994/core.h +++ b/trunk/include/linux/mfd/wm8994/core.h @@ -63,6 +63,8 @@ struct wm8994 { void *control_data; + bool ldo_ena_always_driven; + int gpio_base; int irq_base; diff --git a/trunk/include/linux/mfd/wm8994/pdata.h b/trunk/include/linux/mfd/wm8994/pdata.h index 97cf4f27d647..ea32f306dca6 100644 --- a/trunk/include/linux/mfd/wm8994/pdata.h +++ b/trunk/include/linux/mfd/wm8994/pdata.h @@ -167,6 +167,13 @@ struct wm8994_pdata { /* WM8958 microphone bias configuration */ int micbias[2]; + + /* Disable the internal pull downs on the LDOs if they are + * always driven (eg, connected to an always on supply or + * GPIO that always drives an output. If they float power + * consumption will rise. + */ + bool ldo_ena_always_driven; }; #endif