summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5514-spi.c
diff options
context:
space:
mode:
authoroder_chiou@realtek.com <oder_chiou@realtek.com>2017-11-08 08:04:22 +0100
committerMark Brown <broonie@kernel.org>2017-11-08 22:29:09 +0100
commite9c50aa6bd3996924b5fd87ab59289888cd5704a (patch)
tree70894fa7a397a4174b7ea6b363d16cb5efc7af49 /sound/soc/codecs/rt5514-spi.c
parentASoC: rt5514: Voice wakeup support. (diff)
downloadlinux-e9c50aa6bd3996924b5fd87ab59289888cd5704a.tar.xz
linux-e9c50aa6bd3996924b5fd87ab59289888cd5704a.zip
ASoC: rt5514-spi: check irq status to schedule data copy in resume function
For wake on voice use case, we need to copy data from DSP buffer to PCM stream when system wakes up by voice. However the edge triggered IRQ could be missed when system wakes up, in that case the irq function will not be called. If the substream was constructed beforce suspend, we will schedule data copy in resume function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5514-spi.c')
-rw-r--r--sound/soc/codecs/rt5514-spi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index d03756913dd9..36e0a58ffc87 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -473,11 +473,21 @@ static int rt5514_suspend(struct device *dev)
static int rt5514_resume(struct device *dev)
{
+ struct snd_soc_platform *platform = snd_soc_lookup_platform(dev);
+ struct rt5514_dsp *rt5514_dsp =
+ snd_soc_platform_get_drvdata(platform);
int irq = to_spi_device(dev)->irq;
+ u8 buf[8];
if (device_may_wakeup(dev))
disable_irq_wake(irq);
+ if (rt5514_dsp->substream) {
+ rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
+ if (buf[0] & RT5514_IRQ_STATUS_BIT)
+ rt5514_schedule_copy(rt5514_dsp);
+ }
+
return 0;
}