Skip to content

Commit c26830b

Browse files
superna9999broonie
authored andcommitted
ASoC: meson: axg-tdm-interface: Fix formatters in trigger"
This reverts commit bf5e488 because the following and required commit e138233 causes the following system crash when using audio: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282 Fixes: bf5e488 ("ASoC: meson: axg-tdm-interface: manage formatters in trigger") Reported-by: Dmitry Shmidt <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Acked-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent eb57732 commit c26830b

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

sound/soc/meson/axg-tdm-interface.c

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream,
351351
return 0;
352352
}
353353

354-
static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream,
355-
int cmd,
354+
static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream,
356355
struct snd_soc_dai *dai)
357356
{
358-
struct axg_tdm_stream *ts =
359-
snd_soc_dai_get_dma_data(dai, substream);
360-
361-
switch (cmd) {
362-
case SNDRV_PCM_TRIGGER_START:
363-
case SNDRV_PCM_TRIGGER_RESUME:
364-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
365-
axg_tdm_stream_start(ts);
366-
break;
367-
case SNDRV_PCM_TRIGGER_SUSPEND:
368-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
369-
case SNDRV_PCM_TRIGGER_STOP:
370-
axg_tdm_stream_stop(ts);
371-
break;
372-
default:
373-
return -EINVAL;
374-
}
357+
struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream);
375358

376-
return 0;
359+
/* Force all attached formatters to update */
360+
return axg_tdm_stream_reset(ts);
377361
}
378362

379363
static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai)
@@ -413,8 +397,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = {
413397
.set_fmt = axg_tdm_iface_set_fmt,
414398
.startup = axg_tdm_iface_startup,
415399
.hw_params = axg_tdm_iface_hw_params,
400+
.prepare = axg_tdm_iface_prepare,
416401
.hw_free = axg_tdm_iface_hw_free,
417-
.trigger = axg_tdm_iface_trigger,
418402
};
419403

420404
/* TDM Backend DAIs */

0 commit comments

Comments
 (0)