Skip to content

Commit da3f23f

Browse files
jbrun3tbroonie
authored andcommitted
ASoC: meson: cards: deal dpcm flag change
Commit b73287f ("ASoC: soc-pcm: dpcm: fix playback/capture checks") changed the meaning of dpcm_playback/dpcm_capture and now requires the CPU DAI BE to aligned with those flags. This broke all Amlogic cards with uni-directional backends (All gx and most axg cards). While I'm still confused as to how this change is an improvement, those cards can't remain broken forever. Hopefully, next time an API change is done like that, all the users will be updated as part of the change, and not left to fend for themselves. Fixes: b73287f ("ASoC: soc-pcm: dpcm: fix playback/capture checks") Signed-off-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4f87215 commit da3f23f

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

sound/soc/meson/axg-card.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,20 +327,22 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
327327
return ret;
328328

329329
if (axg_card_cpu_is_playback_fe(dai_link->cpus->of_node))
330-
ret = meson_card_set_fe_link(card, dai_link, np, true);
330+
return meson_card_set_fe_link(card, dai_link, np, true);
331331
else if (axg_card_cpu_is_capture_fe(dai_link->cpus->of_node))
332-
ret = meson_card_set_fe_link(card, dai_link, np, false);
333-
else
334-
ret = meson_card_set_be_link(card, dai_link, np);
332+
return meson_card_set_fe_link(card, dai_link, np, false);
335333

334+
335+
ret = meson_card_set_be_link(card, dai_link, np);
336336
if (ret)
337337
return ret;
338338

339-
if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node))
340-
ret = axg_card_parse_tdm(card, np, index);
341-
else if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) {
339+
if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) {
342340
dai_link->params = &codec_params;
343-
dai_link->no_pcm = 0; /* link is not a DPCM BE */
341+
} else {
342+
dai_link->no_pcm = 1;
343+
snd_soc_dai_link_set_capabilities(dai_link);
344+
if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node))
345+
ret = axg_card_parse_tdm(card, np, index);
344346
}
345347

346348
return ret;

sound/soc/meson/gx-card.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,21 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
9696
return ret;
9797

9898
if (gx_card_cpu_identify(dai_link->cpus, "FIFO"))
99-
ret = meson_card_set_fe_link(card, dai_link, np, true);
100-
else
101-
ret = meson_card_set_be_link(card, dai_link, np);
99+
return meson_card_set_fe_link(card, dai_link, np, true);
102100

101+
ret = meson_card_set_be_link(card, dai_link, np);
103102
if (ret)
104103
return ret;
105104

106-
/* Check if the cpu is the i2s encoder and parse i2s data */
107-
if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder"))
108-
ret = gx_card_parse_i2s(card, np, index);
109-
110105
/* Or apply codec to codec params if necessary */
111-
else if (gx_card_cpu_identify(dai_link->cpus, "CODEC CTRL")) {
106+
if (gx_card_cpu_identify(dai_link->cpus, "CODEC CTRL")) {
112107
dai_link->params = &codec_params;
113-
dai_link->no_pcm = 0; /* link is not a DPCM BE */
108+
} else {
109+
dai_link->no_pcm = 1;
110+
snd_soc_dai_link_set_capabilities(dai_link);
111+
/* Check if the cpu is the i2s encoder and parse i2s data */
112+
if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder"))
113+
ret = gx_card_parse_i2s(card, np, index);
114114
}
115115

116116
return ret;

sound/soc/meson/meson-card-utils.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ int meson_card_set_be_link(struct snd_soc_card *card,
147147
struct device_node *np;
148148
int ret, num_codecs;
149149

150-
link->no_pcm = 1;
151-
link->dpcm_playback = 1;
152-
link->dpcm_capture = 1;
153-
154150
num_codecs = of_get_child_count(node);
155151
if (!num_codecs) {
156152
dev_err(card->dev, "be link %s has no codec\n",

0 commit comments

Comments
 (0)