#include <linux/pm.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <sound/core.h>
case SND_SOC_BIAS_STANDBY:
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
+ pm_runtime_get_sync(codec->dev);
+
/* Tweak DC servo and DSP configuration for
* improved performance. */
if (control->type == WM8994 && wm8994->revision < 4) {
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA |
WM8994_VMID_RAMP_MASK, 0);
+
+ pm_runtime_put(codec->dev);
}
break;
}
wm8994->pdata = dev_get_platdata(codec->dev->parent);
wm8994->codec = codec;
+ pm_runtime_enable(codec->dev);
+ pm_runtime_resume(codec->dev);
+
/* Read our current status back from the chip - we don't want to
* reset as this may interfere with the GPIO or LDO operation. */
for (i = 0; i < WM8994_CACHE_SIZE; i++) {
wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF);
+ pm_runtime_disable(codec->dev);
+
switch (control->type) {
case WM8994:
wm8994_free_irq(codec->control_data, WM8994_IRQ_MIC2_SHRT,