ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches
authorMatt Ranostay <matt@ranostay.consulting>
Tue, 31 Jan 2017 21:21:43 +0000 (13:21 -0800)
committerMark Brown <broonie@kernel.org>
Wed, 1 Feb 2017 17:19:53 +0000 (17:19 +0000)
commit9834ffd1ecc3a401d0ce64c2d4235a726da6d4f9
treeb9241a9299e5e8f4d26072d0eb72e540f895e272
parenta5de5b74a50113564a1e0850e2da96c37c35e55d
ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent glitches

We can get audio errors if hitting deeper idle states on omaps:

[alsa.c:230] error: Fatal problem with alsa output, error -5.
[audio.c:614] error: Error in writing audio (Input/output error?)!

This seems to happen with off mode idle enabled as power for the
whole SoC may get cut off between filling the McBSP fifo using DMA.
While active DMA blocks deeper idle states in hardware, McBSP
activity does not seem to do so.

Basing the QoS latency calculation on the FIFO size, threshold,
sample rate, and channels.

Based on the original patch by Tony Lindgren
Link: https://patchwork.kernel.org/patch/9305867/
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/omap/mcbsp.h
sound/soc/omap/omap-mcbsp.c