Skip to content

Commit 9f7041b

Browse files
Ravulapati Vishnu vardhan raobroonie
authored andcommitted
ASoC: amd: closing specific instance.
The steps to reproduce: Record from the internal mic : (arecord -D hw:1,2 -f dat /dev/null -V stereos) Record from the headphone mic: (arecord -D hw:1,0 -f dat /dev/null -V stereos) Kill the recording from internal mic. We can see the recording from the headphone mic is broken. This patch rectifies the issue reported. Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent dcb231e commit 9f7041b

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

sound/soc/amd/raven/acp3x-pcm-dma.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,25 +342,41 @@ static int acp3x_dma_close(struct snd_soc_component *component,
342342
{
343343
struct snd_soc_pcm_runtime *prtd;
344344
struct i2s_dev_data *adata;
345+
struct i2s_stream_instance *ins;
345346

346347
prtd = substream->private_data;
347348
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
348349
adata = dev_get_drvdata(component->dev);
350+
ins = substream->runtime->private_data;
351+
if (!ins)
352+
return -EINVAL;
349353

354+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
355+
switch (ins->i2s_instance) {
356+
case I2S_BT_INSTANCE:
357+
adata->play_stream = NULL;
358+
break;
359+
case I2S_SP_INSTANCE:
360+
default:
361+
adata->i2ssp_play_stream = NULL;
362+
}
363+
} else {
364+
switch (ins->i2s_instance) {
365+
case I2S_BT_INSTANCE:
366+
adata->capture_stream = NULL;
367+
break;
368+
case I2S_SP_INSTANCE:
369+
default:
370+
adata->i2ssp_capture_stream = NULL;
371+
}
372+
}
350373

351374
/* Disable ACP irq, when the current stream is being closed and
352375
* another stream is also not active.
353376
*/
354377
if (!adata->play_stream && !adata->capture_stream &&
355378
!adata->i2ssp_play_stream && !adata->i2ssp_capture_stream)
356379
rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
357-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
358-
adata->play_stream = NULL;
359-
adata->i2ssp_play_stream = NULL;
360-
} else {
361-
adata->capture_stream = NULL;
362-
adata->i2ssp_capture_stream = NULL;
363-
}
364380
return 0;
365381
}
366382

0 commit comments

Comments
 (0)