Skip to content

Commit 67e69e1

Browse files
Akshu Agrawalbroonie
authored andcommitted
ASoC: amd: Fix simultaneous playback and capture
Stopping of one stream is killing the other stream when they are running simultaneously. This is because, IER register is cleared which disables I2S and overrides any other block enables. Clearing IER register only when all streams on a channel are disabled, fixes the issue. Signed-off-by: Akshu Agrawal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 98ff5c2 commit 67e69e1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sound/soc/amd/raven/acp3x-i2s.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,30 +234,32 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
234234
switch (rtd->i2s_instance) {
235235
case I2S_BT_INSTANCE:
236236
reg_val = mmACP_BTTDM_ITER;
237-
ier_val = mmACP_BTTDM_IER;
238237
break;
239238
case I2S_SP_INSTANCE:
240239
default:
241240
reg_val = mmACP_I2STDM_ITER;
242-
ier_val = mmACP_I2STDM_IER;
243241
}
244242

245243
} else {
246244
switch (rtd->i2s_instance) {
247245
case I2S_BT_INSTANCE:
248246
reg_val = mmACP_BTTDM_IRER;
249-
ier_val = mmACP_BTTDM_IER;
250247
break;
251248
case I2S_SP_INSTANCE:
252249
default:
253250
reg_val = mmACP_I2STDM_IRER;
254-
ier_val = mmACP_I2STDM_IER;
255251
}
256252
}
257253
val = rv_readl(rtd->acp3x_base + reg_val);
258254
val = val & ~BIT(0);
259255
rv_writel(val, rtd->acp3x_base + reg_val);
260-
rv_writel(0, rtd->acp3x_base + ier_val);
256+
257+
if (!(rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER) & BIT(0)) &&
258+
!(rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER) & BIT(0)))
259+
rv_writel(0, rtd->acp3x_base + mmACP_BTTDM_IER);
260+
if (!(rv_readl(rtd->acp3x_base + mmACP_I2STDM_ITER) & BIT(0)) &&
261+
!(rv_readl(rtd->acp3x_base + mmACP_I2STDM_IRER) & BIT(0)))
262+
rv_writel(0, rtd->acp3x_base + mmACP_I2STDM_IER);
261263
ret = 0;
262264
break;
263265
default:

0 commit comments

Comments
 (0)