summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/acp-pcm-dma.c
diff options
context:
space:
mode:
authorAkshu Agrawal <akshu.agrawal@amd.com>2018-09-10 19:20:27 +0200
committerMark Brown <broonie@kernel.org>2018-09-10 19:46:09 +0200
commit8dcb0c90c691de5b79608d04ec7941ef9b3fee9c (patch)
tree542f75339e01b428d035a9a5e93870c9510e0c10 /sound/soc/amd/acp-pcm-dma.c
parentASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai (diff)
downloadlinux-8dcb0c90c691de5b79608d04ec7941ef9b3fee9c.tar.xz
linux-8dcb0c90c691de5b79608d04ec7941ef9b3fee9c.zip
ASoC: AMD: Fix simultaneous playback and capture on different channel
If capture and playback are started on different channel (I2S/BT) there is a possibilty that channel information passed from machine driver is overwritten before the configuration is done in dma driver. Example: 113.597588: cz_max_startup: ---playback sets BT channel 113.597694: cz_dmic1_startup: ---capture sets I2S channel 113.597979: acp_dma_hw_params: ---configures capture for I2S channel 113.598114: acp_dma_hw_params: ---configures playback for I2S channel This is fixed by having 2 separate instance for playback and capture. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp-pcm-dma.c')
-rw-r--r--sound/soc/amd/acp-pcm-dma.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index e359938e3d7e..8f3bc6e37f26 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -846,8 +846,12 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
if (pinfo) {
- rtd->i2s_instance = pinfo->i2s_instance;
- rtd->capture_channel = pinfo->capture_channel;
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ rtd->i2s_instance = pinfo->play_i2s_instance;
+ } else {
+ rtd->i2s_instance = pinfo->cap_i2s_instance;
+ rtd->capture_channel = pinfo->capture_channel;
+ }
}
if (adata->asic_type == CHIP_STONEY) {
val = acp_reg_read(adata->acp_mmio,