Merge series "ASoC: meson: axg: fix TDM channel order sync" from Jerome Brunet <jbrunet@baylibre.com>:
On the Amlogic AXG series, the TODDR FIFO may get out of sync with the TDM decoder if the decoder is started before the FIFO. The channel appears shifted in memory in an unpredictable way. To fix this, the trick is to start the FIFO before the TDM decoder. This way the FIFO is already waiting when the 1st channel is produced and it is correctly placed in memory. Jerome Brunet (2): ASoC: meson: axg-card: make links nonatomic ASoC: meson: axg-tdm-interface: manage formatters in trigger sound/soc/meson/axg-card.c | 1 + sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) -- 2.33.0
This commit is contained in:
Коммит
866d744434
|
@ -320,6 +320,7 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
|
|||
|
||||
dai_link->cpus = cpu;
|
||||
dai_link->num_cpus = 1;
|
||||
dai_link->nonatomic = true;
|
||||
|
||||
ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
|
||||
&dai_link->cpus->dai_name);
|
||||
|
|
|
@ -351,13 +351,29 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream,
|
||||
static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream,
|
||||
int cmd,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream);
|
||||
struct axg_tdm_stream *ts =
|
||||
snd_soc_dai_get_dma_data(dai, substream);
|
||||
|
||||
/* Force all attached formatters to update */
|
||||
return axg_tdm_stream_reset(ts);
|
||||
switch (cmd) {
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
axg_tdm_stream_start(ts);
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
axg_tdm_stream_stop(ts);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai)
|
||||
|
@ -397,8 +413,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = {
|
|||
.set_fmt = axg_tdm_iface_set_fmt,
|
||||
.startup = axg_tdm_iface_startup,
|
||||
.hw_params = axg_tdm_iface_hw_params,
|
||||
.prepare = axg_tdm_iface_prepare,
|
||||
.hw_free = axg_tdm_iface_hw_free,
|
||||
.trigger = axg_tdm_iface_trigger,
|
||||
};
|
||||
|
||||
/* TDM Backend DAIs */
|
||||
|
|
Загрузка…
Ссылка в новой задаче