From: Oder Chiou <oder_chiou@realtek.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: Oder Chiou <oder_chiou@realtek.com>,
jack.yu@realtek.com, alsa-devel@alsa-project.org,
shumingf@realtek.com, bardliao@realtek.com, flove@realtek.com,
cychiang@chromium.org
Subject: [PATCH 2/2] ASoC: rt5514-spi: check irq status to schedule data copy in resume function
Date: Wed, 8 Nov 2017 15:04:22 +0800 [thread overview]
Message-ID: <1510124662-5065-2-git-send-email-oder_chiou@realtek.com> (raw)
In-Reply-To: <1510124662-5065-1-git-send-email-oder_chiou@realtek.com>
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>
---
sound/soc/codecs/rt5514-spi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 0c0e209..c722f33 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -465,11 +465,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;
}
--
2.7.4
next prev parent reply other threads:[~2017-11-08 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 7:04 [PATCH 1/2] ASoC: rt5514: Voice wakeup support Oder Chiou
2017-11-08 7:04 ` Oder Chiou [this message]
2017-11-08 21:30 ` Applied "ASoC: rt5514-spi: check irq status to schedule data copy in resume function" to the asoc tree Mark Brown
2017-11-08 21:30 ` Applied "ASoC: rt5514: Voice wakeup support." " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1510124662-5065-2-git-send-email-oder_chiou@realtek.com \
--to=oder_chiou@realtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=bardliao@realtek.com \
--cc=broonie@kernel.org \
--cc=cychiang@chromium.org \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lgirdwood@gmail.com \
--cc=shumingf@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).