aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-22 09:43:55 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 08:09:10 -0400
commit881de67046f424fc3a6e05b1c681c12afd94e802 (patch)
tree3f83b7d051532c785a598d442daa64267c2be210
parent862de70c12bb6227943e155251c75e7fa4558068 (diff)
mfd: Allow WM8994 LDO enable pulls to be disabled
In systems where the LDO enables are always driven (for example, being connected to an always on supply rail or a GPIO which is driven by the CPU even in suspend) then we can disable the pull downs on the LDO for a small power savings. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/wm8994-core.c19
-rw-r--r--include/linux/mfd/wm8994/core.h2
-rw-r--r--include/linux/mfd/wm8994/pdata.h7
3 files changed, 28 insertions, 0 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index 96479c9b1728..1f15743460a0 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -281,6 +281,13 @@ static int wm8994_suspend(struct device *dev)
281 return 0; 281 return 0;
282 } 282 }
283 283
284 /* Disable LDO pulldowns while the device is suspended if we
285 * don't know that something will be driving them. */
286 if (!wm8994->ldo_ena_always_driven)
287 wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
288 WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
289 WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD);
290
284 /* GPIO configuration state is saved here since we may be configuring 291 /* GPIO configuration state is saved here since we may be configuring
285 * the GPIO alternate functions even if we're not using the gpiolib 292 * the GPIO alternate functions even if we're not using the gpiolib
286 * driver for them. 293 * driver for them.
@@ -350,6 +357,11 @@ static int wm8994_resume(struct device *dev)
350 if (ret < 0) 357 if (ret < 0)
351 dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); 358 dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);
352 359
360 /* Disable LDO pulldowns while the device is active */
361 wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
362 WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
363 0);
364
353 wm8994->suspended = false; 365 wm8994->suspended = false;
354 366
355 return 0; 367 return 0;
@@ -513,8 +525,15 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
513 pdata->gpio_defaults[i]); 525 pdata->gpio_defaults[i]);
514 } 526 }
515 } 527 }
528
529 wm8994->ldo_ena_always_driven = pdata->ldo_ena_always_driven;
516 } 530 }
517 531
532 /* Disable LDO pulldowns while the device is active */
533 wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
534 WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
535 0);
536
518 /* In some system designs where the regulators are not in use, 537 /* In some system designs where the regulators are not in use,
519 * we can achieve a small reduction in leakage currents by 538 * we can achieve a small reduction in leakage currents by
520 * floating LDO outputs. This bit makes no difference if the 539 * floating LDO outputs. This bit makes no difference if the
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index f0b69cdae41c..5ab71bd76f9c 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -63,6 +63,8 @@ struct wm8994 {
63 63
64 void *control_data; 64 void *control_data;
65 65
66 bool ldo_ena_always_driven;
67
66 int gpio_base; 68 int gpio_base;
67 int irq_base; 69 int irq_base;
68 70
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 97cf4f27d647..ea32f306dca6 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -167,6 +167,13 @@ struct wm8994_pdata {
167 167
168 /* WM8958 microphone bias configuration */ 168 /* WM8958 microphone bias configuration */
169 int micbias[2]; 169 int micbias[2];
170
171 /* Disable the internal pull downs on the LDOs if they are
172 * always driven (eg, connected to an always on supply or
173 * GPIO that always drives an output. If they float power
174 * consumption will rise.
175 */
176 bool ldo_ena_always_driven;
170}; 177};
171 178
172#endif 179#endif