aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroder_chiou@realtek.com <oder_chiou@realtek.com>2017-11-08 02:04:22 -0500
committerMark Brown <broonie@kernel.org>2017-11-08 16:29:09 -0500
commite9c50aa6bd3996924b5fd87ab59289888cd5704a (patch)
tree70894fa7a397a4174b7ea6b363d16cb5efc7af49
parent58f1c07d23cddbc4c8aa99a214934eb7d33e8523 (diff)
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>
-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)
473 473
474static int rt5514_resume(struct device *dev) 474static int rt5514_resume(struct device *dev)
475{ 475{
476 struct snd_soc_platform *platform = snd_soc_lookup_platform(dev);
477 struct rt5514_dsp *rt5514_dsp =
478 snd_soc_platform_get_drvdata(platform);
476 int irq = to_spi_device(dev)->irq; 479 int irq = to_spi_device(dev)->irq;
480 u8 buf[8];
477 481
478 if (device_may_wakeup(dev)) 482 if (device_may_wakeup(dev))
479 disable_irq_wake(irq); 483 disable_irq_wake(irq);
480 484
485 if (rt5514_dsp->substream) {
486 rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
487 if (buf[0] & RT5514_IRQ_STATUS_BIT)
488 rt5514_schedule_copy(rt5514_dsp);
489 }
490
481 return 0; 491 return 0;
482} 492}
483 493