Commit da3f23fde9d7b4a7e0ca9a9a096cec3104df1b82

Authored by Jerome Brunet
Committed by Mark Brown
1 parent 4f8721542f

ASoC: meson: cards: deal dpcm flag change

Commit b73287f0b074 ("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: b73287f0b074 ("ASoC: soc-pcm: dpcm: fix playback/capture checks")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200731120603.2243261-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Showing 3 changed files with 19 additions and 21 deletions Side-by-side Diff

sound/soc/meson/axg-card.c
... ... @@ -327,20 +327,22 @@
327 327 return ret;
328 328  
329 329 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);
331 331 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);
335 333  
  334 +
  335 + ret = meson_card_set_be_link(card, dai_link, np);
336 336 if (ret)
337 337 return ret;
338 338  
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)) {
342 340 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);
344 346 }
345 347  
346 348 return ret;
sound/soc/meson/gx-card.c
... ... @@ -96,21 +96,21 @@
96 96 return ret;
97 97  
98 98 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);
102 100  
  101 + ret = meson_card_set_be_link(card, dai_link, np);
103 102 if (ret)
104 103 return ret;
105 104  
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   -
110 105 /* 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")) {
112 107 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);
114 114 }
115 115  
116 116 return ret;
sound/soc/meson/meson-card-utils.c
... ... @@ -147,10 +147,6 @@
147 147 struct device_node *np;
148 148 int ret, num_codecs;
149 149  
150   - link->no_pcm = 1;
151   - link->dpcm_playback = 1;
152   - link->dpcm_capture = 1;
153   -
154 150 num_codecs = of_get_child_count(node);
155 151 if (!num_codecs) {
156 152 dev_err(card->dev, "be link %s has no codec\n",