ASoC: grace time for DPCM cleanup
Subsystems (9)
Kuninori Morimoto
maintainerv2 cover ASoC: grace time for DPCM cleanup
Hi Mark, Pierre-Louis, Jerome
Cc each ASoC driver maintainer
As we discussed in [1], we don't need to use dpcm_playback/capture flag, so we remove it. But we have been using it for 10 years, some driver might get damage. The most likely case is that the device/driver can use both playback/capture, but have only one flag, and not using xxx_only flag. [1/3] patch indicates warning in such case.
And because of its history, DPCM has been checking CPU side only. But it should check Codec side too same as non-DPCM. Some device/driver has been bypassed this check. It should be error. [2/3] patch indicates warning in such case.
Because dpcm_xxx flag is no longer used by [1/3] patch, snd_soc_dai_link_set_capabilities() is no longer needed. [3/3] patch remove it.
These adds grace time for DPCM cleanup.
I'm not sure when dpcm_xxx will be removed, and Codec check bypass will be error, but maybe v6.11 or v6.12 ?
Please check each driver by that time.
[1] https://lore.kernel.org/r/[email protected]
v1 -> v2
- tidyup Codec check warning output condition
Kuninori Morimoto (3):
ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition
ASoC: soc-pcm: Indicate warning if CPU / Codec availability mismatch
ASoC: remove snd_soc_dai_link_set_capabilities()
include/sound/soc-dai.h | 1 - include/sound/soc.h | 1 + sound/soc/fsl/imx-card.c | 3 - sound/soc/generic/audio-graph-card.c | 2 - sound/soc/generic/audio-graph-card2.c | 2 - sound/soc/generic/simple-card.c | 2 - sound/soc/meson/axg-card.c | 1 - sound/soc/meson/gx-card.c | 1 - sound/soc/qcom/common.c | 1 - sound/soc/soc-dai.c | 38 --------- sound/soc/soc-pcm.c | 110 +++++++++++++++++++------- 11 files changed, 81 insertions(+), 81 deletions(-)
Signature · 1 line
2.25.1
Kuninori Morimoto
maintainerPATCH v2 1/3 ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition
I have been wondering why DPCM needs special flag (= dpcm_playback/capture) to use it. Below is the history why it was added to ASoC.
(A) In beginning, there was no dpcm_xxx flag on ASoC.
It checks channels_min for DPCM, same as current non-DPCM.
Let's name it as "validation check" here.
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
if (cpu_dai->driver->playback.channels_min)
playback = 1;
if (cpu_dai->driver->capture.channels_min)
capture = 1;(B) commit 1e9de42f4324 ("ASoC: dpcm: Explicitly set BE DAI link supported stream directions") force to use dpcm_xxx flag on DPCM. According to this commit log, this is because "Some BE dummy DAI doesn't set channels_min for playback/capture". But we don't know which DAI is it, and not know why it can't/don't have channels_min. Let's name it as "no_chan_DAI" here. According to the code and git-log, it is used as DCPM-BE and is CPU DAI. I think the correct solution was set channels_min on "no_chan_DAI" side, not update ASoC framework side. But everything is under smoke today.
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
playback = rtd->dai_link->dpcm_playback; capture = rtd->dai_link->dpcm_capture;
(C) commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") checks channels_min (= validation check) again. Because DPCM availability was handled by dpcm_xxx flag at that time, but some Sound Card set it even though it wasn't available. Clearly there's a contradiction here. I think correct solution was update Sound Card side instead of ASoC framework. Sound Card side will be updated to handle this issue later (commit 25612477d20b ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper"))
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
...
playback = rtd->dai_link->dpcm_playback &&
snd_soc_dai_stream_valid(cpu_dai, ...);
capture = rtd->dai_link->dpcm_capture &&
snd_soc_dai_stream_valid(cpu_dai, ...);
This (C) patch should have broken "no_chan_DAI" which doesn't have channels_min, but there was no such report during this 4 years. Possibilities case are as follows
- No one is using "no_chan_DAI"
- "no_chan_DAI" is no longer exist : was removed ?
- "no_chan_DAI" is no longer exist : has channels_min ?
Because of these history, this dpcm_xxx is unneeded flag today. But because we have been used it for 10 years since (B), it may have been used differently. For example some DAI available both playback/capture, but it set dpcm_playback flag only, in this case dpcm_xxx flag is used as availability limitation. We can use playback_only flag instead in this case, but it is very difficult to find such DAI today.
Let's add grace time to remove dpcm_playback/capture flag.
This patch don't use dpcm_xxx flag anymore, and indicates warning to use xxx_only flag if both playback/capture were available but using only one of dpcm_xxx flag, and not using xxx_only flag.
--- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 28 deletions(-)
include/sound/soc.h +1 -0
@@ -815,6 +815,7 @@ struct snd_soc_dai_link {/* This DAI link can route to other DAI links at runtime (Frontend)*/ unsigned int dynamic:1; +/* REMOVE ME */ /* DPCM capture and Playback support */ unsigned int dpcm_capture:1; unsigned int dpcm_playback:1;
sound/soc/soc-pcm.c +37 -28
86 lines not on this page · raw message
Signature · 1 line
2.25.1
Kuninori Morimoto
maintainerPATCH v2 2/3 ASoC: soc-pcm: Indicate warning if CPU / Codec availability mismatch
In reply to Kuninori MorimotoCurrent DCPM is checking CPU side availability only, but it should also check Codec availability. But because of long DPCM operation history, it is possible that the some Codec driver check have been bypassed.
It should be error, but let's add grace time to update driver.
This patch indicates warning in above case. Each applicable driver need to update during this grace time.
--- sound/soc/soc-pcm.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-)
sound/soc/soc-pcm.c +43 -2
@@ -2795,6 +2795,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, {struct snd_soc_dai_link *dai_link = rtd->dai_link;struct snd_soc_dai *cpu_dai; +struct snd_soc_dai *codec_dai;struct snd_soc_dai_link_ch_map *ch_maps;int has_playback =0 ;int has_capture =0 ;
@@ -2806,15 +2807,25 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, }if (dai_link->dynamic || dai_link->no_pcm) { +int has_playback_both =0 ; +int has_capture_both =0 ;for_each_rtd_ch_maps (rtd, i, ch_maps) { cpu_dai =snd_soc_rtd_to_cpu (rtd, ch_maps->cpu); + codec_dai =snd_soc_rtd_to_codec (rtd, ch_maps->codec);if (snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_PLAYBACK )) has_playback =1 ;if (snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_CAPTURE )) has_capture =1 ; + +if (snd_soc_dai_stream_valid (codec_dai,SNDRV_PCM_STREAM_PLAYBACK ) && +snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_PLAYBACK )) + has_playback_both =1 ; +if (snd_soc_dai_stream_valid (codec_dai,SNDRV_PCM_STREAM_CAPTURE ) && +snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_CAPTURE )) + has_capture_both =1 ; }/*
@@ -2850,9 +2861,39 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, has_playback =0 ; } } - }else { -struct snd_soc_dai *codec_dai; +/* +* REMOVE ME +* +* Current DPCM is checking CPU side only, but both CPU and Codec should be +* checked. Indicate warning if there was CPU / Codec mismatch. +* To keep compatibility, warning only for now. +*/ +if ((dai_link->dpcm_playback || dai_link->playback_only) && + !has_playback_both) +dev_warn (rtd->card->dev, +"System reuqsts playback, but not available (%s)." +" Please update Codec driver\n" , + dai_link->stream_name); +if ((dai_link->dpcm_capture || dai_link->capture_only) && + !has_capture_both) +dev_warn (rtd->card->dev, +"System reuqsts capture, but not available (%s)." +" Please update Codec driver\n" , + dai_link->stream_name); + +/* +* REMOVE ME +* +* In case of there was no dpcm_xxx flag, and CPU / Codec mismatch, +* follow new style +*/ +if (!dai_link->dpcm_playback && has_playback) + has_playback = has_playback_both; +if (!dai_link->dpcm_capture && has_capture) + has_capture = has_capture_both; + + }else {/* Adapt stream for codec2codec links */ int cpu_capture =snd_soc_get_stream_cpu (dai_link,SNDRV_PCM_STREAM_CAPTURE );int cpu_playback =snd_soc_get_stream_cpu (dai_link,SNDRV_PCM_STREAM_PLAYBACK );
Signature · 1 line
2.25.1
Re: [PATCH v2 2/3] ASoC: soc-pcm: Indicate warning if CPU / Codec availability mismatch
Quoted 60 lines · Kuninori Morimoto
Current DCPM is checking CPU side availability only, but it should also check Codec availability. But because of long DPCM operation history, it is possible that the some Codec driver check have been bypassed.
It should be error, but let's add grace time to update driver.
This patch indicates warning in above case. Each applicable driver need to update during this grace time.
Signed-off-by Kuninori Morimoto <[email protected]>--- sound/soc/soc-pcm.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-)sound/soc/soc-pcm.c +12
-2@@ -2795,6 +2795,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, {struct snd_soc_dai_link *dai_link = rtd->dai_link;struct snd_soc_dai *cpu_dai; +struct snd_soc_dai *codec_dai;struct snd_soc_dai_link_ch_map *ch_maps;int has_playback =0 ;int has_capture =0 ;@@ -2806,15 +2807,25 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, }if (dai_link->dynamic || dai_link->no_pcm) { +int has_playback_both =0 ; +int has_capture_both =0 ;for_each_rtd_ch_maps (rtd, i, ch_maps) { cpu_dai =snd_soc_rtd_to_cpu (rtd, ch_maps->cpu); + codec_dai =snd_soc_rtd_to_codec (rtd, ch_maps->codec);if (snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_PLAYBACK )) has_playback =1 ;if (snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_CAPTURE )) has_capture =1 ; + +if (snd_soc_dai_stream_valid (codec_dai,SNDRV_PCM_STREAM_PLAYBACK ) && +snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_PLAYBACK )) + has_playback_both =1 ; +if (snd_soc_dai_stream_valid (codec_dai,SNDRV_PCM_STREAM_CAPTURE ) && +snd_soc_dai_stream_valid (cpu_dai,SNDRV_PCM_STREAM_CAPTURE )) + has_capture_both =1 ; }/* @@ -2850,9 +2861,39 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, has_playback =0 ; } } - }else { -struct snd_soc_dai *codec_dai; +/*
sound/soc/soc-pcm.c static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, · line 2875
Quoted 10 lines
sound/soc/soc-pcm.c +10
-0+* REMOVE ME +* +* Current DPCM is checking CPU side only, but both CPU and Codec should be +* checked. Indicate warning if there was CPU / Codec mismatch. +* To keep compatibility, warning only for now. +*/ +if ((dai_link->dpcm_playback || dai_link->playback_only) && + !has_playback_both) +dev_warn (rtd->card->dev, + "System reuqsts playback, but not available (%s)."
Typo: reuqsts -> requests
sound/soc/soc-pcm.c static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, · line 2881
Quoted 6 lines
sound/soc/soc-pcm.c +6
-0+" Please update Codec driver\n" , + dai_link->stream_name); +if ((dai_link->dpcm_capture || dai_link->capture_only) && + !has_capture_both) +dev_warn (rtd->card->dev, + "System reuqsts capture, but not available (%s)."
Same here.
Quoted 18 lines
sound/soc/soc-pcm.c +15
-0+" Please update Codec driver\n" , + dai_link->stream_name); + +/* +* REMOVE ME +* +* In case of there was no dpcm_xxx flag, and CPU / Codec mismatch, +* follow new style +*/ +if (!dai_link->dpcm_playback && has_playback) + has_playback = has_playback_both; +if (!dai_link->dpcm_capture && has_capture) + has_capture = has_capture_both; + + }else {/* Adapt stream for codec2codec links */ int cpu_capture =snd_soc_get_stream_cpu (dai_link,SNDRV_PCM_STREAM_CAPTURE );int cpu_playback =snd_soc_get_stream_cpu (dai_link,SNDRV_PCM_STREAM_PLAYBACK );
Kuninori Morimoto
maintainerRe: [PATCH v2 2/3] ASoC: soc-pcm: Indicate warning if CPU / Codec availability mismatch
Hi Amadeusz
Quoted 7 lines
sound/soc/soc-pcm.c static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, · line 2875
Quoted 4 lines
sound/soc/soc-pcm.c +4
-0+if ((dai_link->dpcm_playback || dai_link->playback_only) && + !has_playback_both) +dev_warn (rtd->card->dev, + "System reuqsts playback, but not available (%s)."Typo: reuqsts -> requests
Quoted 8 lines
sound/soc/soc-pcm.c static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, · line 2881
Quoted 6 lines
sound/soc/soc-pcm.c +6
-0+" Please update Codec driver\n" , + dai_link->stream_name); +if ((dai_link->dpcm_capture || dai_link->capture_only) && + !has_capture_both) +dev_warn (rtd->card->dev, + "System reuqsts capture, but not available (%s)."Same here.
Grr, thank you pointing it.
Will fix in v3.
Thank you for your help !!
Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto
Kuninori Morimoto
maintainerPATCH v2 3/3 ASoC: remove snd_soc_dai_link_set_capabilities()
In reply to Kuninori Morimotodpcm_xxx flags are no longer needed.
We need to use xxx_only flags instead if needed, but snd_soc_dai_link_set_capabilities() user adds dpcm_xxx if playback/catpure were available. Thus converting dpcm_xxx to xxx_only is not needed. Just remove it.
--- include/sound/soc-dai.h | 1 - sound/soc/fsl/imx-card.c | 3 --- sound/soc/generic/audio-graph-card.c | 2 -- sound/soc/generic/audio-graph-card2.c | 2 -- sound/soc/generic/simple-card.c | 2 -- sound/soc/meson/axg-card.c | 1 - sound/soc/meson/gx-card.c | 1 - sound/soc/qcom/common.c | 1 - sound/soc/soc-dai.c | 38 --------------------------- 9 files changed, 51 deletions(-)
include/sound/soc-dai.h +0 -1
@@ -219,7 +219,6 @@ void snd_soc_dai_resume(struct snd_soc_dai *dai);int snd_soc_dai_compress_new (struct snd_soc_dai *dai,struct snd_soc_pcm_runtime *rtd,int num);bool snd_soc_dai_stream_valid (struct snd_soc_dai *dai,int stream); -void snd_soc_dai_link_set_capabilities (struct snd_soc_dai_link *dai_link);void snd_soc_dai_action (struct snd_soc_dai *dai,int stream,int action); static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,
sound/soc/fsl/imx-card.c +0 -3
@@ -650,9 +650,6 @@ static int imx_card_parse_of(struct imx_card_data *data) link->ops = &imx_aif_ops; } -if (link->no_pcm || link->dynamic) -snd_soc_dai_link_set_capabilities (link); -/* Get dai fmt */ ret =simple_util_parse_daifmt (dev, np, codec,NULL , &link->dai_fmt);
sound/soc/generic/audio-graph-card.c +0 -2
@@ -246,8 +246,6 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv,graph_parse_convert (dev, ep, &dai_props->adata); -snd_soc_dai_link_set_capabilities (dai_link); - ret =graph_link_init (priv, cpu_ep, codec_ep, li, dai_name); li->link++;
sound/soc/generic/audio-graph-card2.c +0 -2
@@ -925,8 +925,6 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv,graph_parse_convert (ep, dai_props);/* at node of <dpcm> */ graph_parse_convert (rep, dai_props);/* at node of <CPU/Codec> */ -snd_soc_dai_link_set_capabilities (dai_link); -graph_link_init (priv, rport, li, is_cpu); err:of_node_put (ep);
sound/soc/generic/simple-card.c +0 -2
@@ -276,8 +276,6 @@ static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,simple_parse_convert (dev, np, &dai_props->adata); -snd_soc_dai_link_set_capabilities (dai_link); - ret =simple_link_init (priv, node, codec, li, prefix, dai_name); out_put_node:
sound/soc/meson/axg-card.c +0 -1
@@ -339,7 +339,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->num_c2c_params =1 ; }else { dai_link->no_pcm =1 ; -snd_soc_dai_link_set_capabilities (dai_link);if (axg_card_cpu_is_tdm_iface (dai_link->cpus->of_node)) ret =axg_card_parse_tdm (card, np, index); }
sound/soc/meson/gx-card.c +0 -1
@@ -107,7 +107,6 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->num_c2c_params =1 ; }else { dai_link->no_pcm =1 ; -snd_soc_dai_link_set_capabilities (dai_link);/* Check if the cpu is the i2s encoder and parse i2s data */ if (gx_card_cpu_identify (dai_link->cpus,"I2S Encoder" )) ret =gx_card_parse_i2s (card, np, index);
sound/soc/qcom/common.c +0 -1
@@ -145,7 +145,6 @@ int qcom_snd_parse_of(struct snd_soc_card *card)if (platform || !codec) {/* DPCM */ -snd_soc_dai_link_set_capabilities (link); link->ignore_suspend =1 ; link->nonatomic =1 ; }
sound/soc/soc-dai.c +0 -38
@@ -479,44 +479,6 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)return stream->channels_min; } -/* -* snd_soc_dai_link_set_capabilities() - set dai_link properties based on its DAIs -*/ -void snd_soc_dai_link_set_capabilities (struct snd_soc_dai_link *dai_link) -{ -bool supported[SNDRV_PCM_STREAM_LAST +1 ]; -int direction; - -for_each_pcm_streams (direction) { -struct snd_soc_dai_link_component *cpu; -struct snd_soc_dai_link_component *codec; -struct snd_soc_dai *dai; -bool supported_cpu = false; -bool supported_codec = false; -int i; - -for_each_link_cpus (dai_link, i, cpu) { - dai =snd_soc_find_dai_with_mutex (cpu); -if (dai &&snd_soc_dai_stream_valid (dai, direction)) { - supported_cpu = true; -break ; - } - } -for_each_link_codecs (dai_link, i, codec) { - dai =snd_soc_find_dai_with_mutex (codec); -if (dai &&snd_soc_dai_stream_valid (dai, direction)) { - supported_codec = true; -break ; - } - } - supported[direction] = supported_cpu && supported_codec; - } - - dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK ]; - dai_link->dpcm_capture = supported[SNDRV_PCM_STREAM_CAPTURE ]; -} -EXPORT_SYMBOL_GPL (snd_soc_dai_link_set_capabilities); -void snd_soc_dai_action (struct snd_soc_dai *dai,int stream,int action) {
Signature · 1 line
2.25.1
Jerome Brunet
maintainerRFC PATCH 1/1 ASoC: amlogic: do not use dpcm_playback/capture flags
In reply to Kuninori Morimotodpcm_playback/capture flags are being deprecated in ASoC. Use playback/capture_only flags instead
---
Following Kuninori's series, dpcm_playback/capture will be ignored. However, properly disabling stream direction is important for Amlogic audio drivers.
I'm not too sure how this should be applied to avoid breaking bisect, before or after Kuninori's series. Maybe it should be merged into it ?
Any suggestion Kuninori ?
sound/soc/meson/axg-card.c | 10 +++++----- sound/soc/meson/meson-card-utils.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/meson/axg-card.c +5 -5
@@ -132,7 +132,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card, lb->stream_name = lb->name; lb->cpus->of_node = pad->cpus->of_node; lb->cpus->dai_name ="TDM Loopback" ; - lb->dpcm_capture =1 ; + lb->capture_only =1 ; lb->no_pcm =1 ; lb->ops = &axg_card_tdm_be_ops; lb->init = axg_card_tdm_dai_lb_init;
@@ -176,7 +176,7 @@ static int axg_card_parse_cpu_tdm_slots(struct snd_soc_card *card,/* Disable playback is the interface has no tx slots */ if (!tx) - link->dpcm_playback =0 ; + link->capture_only =1 ;for (i =0 , rx =0 ; i <AXG_TDM_NUM_LANES ; i++) {snprintf (propname,32 ,"dai-tdm-slot-rx-mask-%d" , i);
@@ -186,9 +186,9 @@ static int axg_card_parse_cpu_tdm_slots(struct snd_soc_card *card,/* Disable capture is the interface has no rx slots */ if (!rx) - link->dpcm_capture =0 ; + link->playback_only =1 ; -/* ... but the interface should at least have one of them */ +/* ... but the interface should at least have one direction */ if (!tx && !rx) {dev_err (card->dev,"tdm link has no cpu slots\n" );return -EINVAL ;
@@ -275,7 +275,7 @@ static int axg_card_parse_tdm(struct snd_soc_card *card,return ret;/* Add loopback if the pad dai has playback */ -if (link->dpcm_playback) { +if (!link->capture_only) { ret =axg_card_add_tdm_loopback (card, index);if (ret)return ret;
sound/soc/meson/meson-card-utils.c +2 -2
@@ -186,9 +186,9 @@ int meson_card_set_fe_link(struct snd_soc_card *card, link->dpcm_merged_rate =1 ;if (is_playback) - link->dpcm_playback =1 ; + link->playback_only =1 ;else - link->dpcm_capture =1 ; + link->capture_only =1 ;return meson_card_set_link_name (card, link, node,"fe" ); }
Signature · 1 line
2.43.0
Mark Brown
maintainerRe: [PATCH RFC] ASoC: amlogic: do not use dpcm_playback/capture flags
Quoted 5 lines · Jerome Brunet
dpcm_playback/capture flags are being deprecated in ASoC. Use playback/capture_only flags instead
Suggested-by Kuninori Morimoto <[email protected]>Signed-off-by Jerome Brunet <[email protected]>
Quoted 8 lines
---
Following Kuninori's series, dpcm_playback/capture will be ignored. However, properly disabling stream direction is important for Amlogic audio drivers.
I'm not too sure how this should be applied to avoid breaking bisect, before or after Kuninori's series. Maybe it should be merged into it ?
Probably better to integrate it I think?
Kuninori Morimoto
maintainerRe: [PATCH RFC] ASoC: amlogic: do not use dpcm_playback/capture flags
Hi
Quoted 7 lines
Quoted 7 lines
dpcm_playback/capture flags are being deprecated in ASoC. Use playback/capture_only flags instead
Suggested-by Kuninori Morimoto <[email protected]>Signed-off-by Jerome Brunet <[email protected]>---
Quoted 8 lines
Quoted 6 lines
Following Kuninori's series, dpcm_playback/capture will be ignored. However, properly disabling stream direction is important for Amlogic audio drivers.
I'm not too sure how this should be applied to avoid breaking bisect, before or after Kuninori's series. Maybe it should be merged into it ?
Probably better to integrate it I think?
ASoC needs dpcm_xxx flag *before* my patch.
Your patch is replacing it to xxx_only flag, so it should be applied *after* my patch. So integrate/merge is good idea, I think.
Thank you for your help !!
Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto
Jerome Brunet
maintainerRe: [PATCH RFC] ASoC: amlogic: do not use dpcm_playback/capture flags
Quoted 13 lines · Kuninori Morimoto
Hi
Quoted 11 lines
Quoted 11 lines
dpcm_playback/capture flags are being deprecated in ASoC. Use playback/capture_only flags instead
Suggested-by Kuninori Morimoto <[email protected]>Signed-off-by Jerome Brunet <[email protected]>---
Following Kuninori's series, dpcm_playback/capture will be ignored. However, properly disabling stream direction is important for Amlogic audio drivers.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
I'm not too sure how this should be applied to avoid breaking bisect, before or after Kuninori's series. Maybe it should be merged into it ?
Probably better to integrate it I think?
ASoC needs
dpcm_xxxflag *before* my patch.
Your patch is replacing it toxxx_onlyflag, so it should be applied *after* my patch. So integrate/merge is good idea, I think.
Ok. Then I guess it is up to you and Mark.
Please let me know if you need me for anything.
Cheers
Quoted 7 lines
Thank you for your help !!
Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto
Signature · 1 line
Jerome
Quoted 26 lines · Kuninori Morimoto
Hi Mark, Pierre-Louis, Jerome
Cc each ASoC driver maintainerAs we discussed in [1], we don't need to use dpcm_playback/capture flag, so we remove it. But we have been using it for 10 years, some driver might get damage. The most likely case is that the device/driver can use both playback/capture, but have only one flag, and not using
xxx_onlyflag. [1/3] patch indicates warning in such case.And because of its history, DPCM has been checking CPU side only. But it should check Codec side too same as non-DPCM. Some device/driver has been bypassed this check. It should be error. [2/3] patch indicates warning in such case.
Because
dpcm_xxxflag is no longer used by [1/3] patch,snd_soc_dai_link_set_capabilities()is no longer needed. [3/3] patch remove it.These adds grace time for DPCM cleanup.
I'm not sure whendpcm_xxxwill be removed, and Codec check bypass will be error, but maybe v6.11 or v6.12 ?
Please check each driver by that time.
Quoted 7 lines
v1 -> v2
- tidyup Codec check warning output conditionKuninori Morimoto (3):
ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition
ASoC: soc-pcm: Indicate warning if CPU / Codec availability mismatch
ASoC: removesnd_soc_dai_link_set_capabilities()
For Amlogic, with the change sent as RFC on this series.
Quoted 13 lines
include/sound/soc-dai.h | 1 - include/sound/soc.h | 1 + sound/soc/fsl/imx-card.c | 3 - sound/soc/generic/audio-graph-card.c | 2 - sound/soc/generic/audio-graph-card2.c | 2 - sound/soc/generic/simple-card.c | 2 - sound/soc/meson/axg-card.c | 1 - sound/soc/meson/gx-card.c | 1 - sound/soc/qcom/common.c | 1 - sound/soc/soc-dai.c | 38 --------- sound/soc/soc-pcm.c | 110 +++++++++++++++++++------- 11 files changed, 81 insertions(+), 81 deletions(-)
Signature · 1 line
Jerome