Skip to content

Commit

Permalink
ASoC: rt5514-spi: check irq status to schedule data copy in resume fu…
Browse files Browse the repository at this point in the history
…nction

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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
oder-chiou authored and broonie committed Nov 8, 2017
1 parent 58f1c07 commit e9c50aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/codecs/rt5514-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e9c50aa

Please sign in to comment.