diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-03-04 11:12:24 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-04 11:12:26 +0100 |
commit | e0a92c17470775cd85bac52f5372ccc3dc58254a (patch) | |
tree | 9339da8754084bed50b941b018706b75482025cb /drivers/mfd/wm8994-core.c | |
parent | 544b4a1f309d18f40969dbab7e08bafd136b2f55 (diff) | |
parent | 0c3b9168017cbad2c4af3dd65ec93fe646eeaa62 (diff) | |
download | lwn-e0a92c17470775cd85bac52f5372ccc3dc58254a.tar.gz lwn-e0a92c17470775cd85bac52f5372ccc3dc58254a.zip |
Merge branch 'sched/urgent' into sched/core
Merge reason: Add fixes before applying dependent patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/mfd/wm8994-core.c')
-rw-r--r-- | drivers/mfd/wm8994-core.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 41233c7fa581..f4016a075fd6 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -246,6 +246,16 @@ static int wm8994_suspend(struct device *dev) struct wm8994 *wm8994 = dev_get_drvdata(dev); int ret; + /* Don't actually go through with the suspend if the CODEC is + * still active (eg, for audio passthrough from CP. */ + ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1); + if (ret < 0) { + dev_err(dev, "Failed to read power status: %d\n", ret); + } else if (ret & WM8994_VMID_SEL_MASK) { + dev_dbg(dev, "CODEC still active, ignoring suspend\n"); + return 0; + } + /* 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. @@ -261,6 +271,8 @@ static int wm8994_suspend(struct device *dev) if (ret < 0) dev_err(dev, "Failed to save LDO registers: %d\n", ret); + wm8994->suspended = true; + ret = regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies); if (ret != 0) { @@ -276,6 +288,10 @@ static int wm8994_resume(struct device *dev) struct wm8994 *wm8994 = dev_get_drvdata(dev); int ret; + /* We may have lied to the PM core about suspending */ + if (!wm8994->suspended) + return 0; + ret = regulator_bulk_enable(wm8994->num_supplies, wm8994->supplies); if (ret != 0) { @@ -298,6 +314,8 @@ static int wm8994_resume(struct device *dev) if (ret < 0) dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); + wm8994->suspended = false; + return 0; } #endif |