diff options
author | Takashi Iwai <tiwai@suse.de> | 2022-12-22 11:11:48 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2022-12-22 11:11:48 +0300 |
commit | 2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b (patch) | |
tree | f711bc9cab45f4963e4883ef15ff4c54a6cbc12e /sound/soc/generic | |
parent | b47068b4aa53a57552398e3f60d0ed1918700c2b (diff) | |
parent | ee0b089d660021792e4ab4dda191b097ce1e964f (diff) | |
download | linux-2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b.tar.xz |
Merge branch 'for-next' into for-linus
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card.c | 4 | ||||
-rw-r--r-- | sound/soc/generic/audio-graph-card2-custom-sample.dtsi | 10 | ||||
-rw-r--r-- | sound/soc/generic/audio-graph-card2.c | 6 | ||||
-rw-r--r-- | sound/soc/generic/simple-card-utils.c | 35 |
4 files changed, 26 insertions, 29 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index fe7cf972d44c..5daa824a4ffc 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -485,8 +485,10 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv, of_node_put(codec_ep); of_node_put(codec_port); - if (ret < 0) + if (ret < 0) { + of_node_put(cpu_ep); return ret; + } codec_port_old = codec_port; } diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi index fe547c18771f..994db61a26b3 100644 --- a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi +++ b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi @@ -49,10 +49,13 @@ * +-+ +-+ * * [DPCM] + * + * CPU3/CPU4 are converting rate to 44100 + * * FE BE * **** * cpu3 <-@--* *--@-> codec3 - * cpu4 <-@--* * + * cpu4 <-@--* * (44.1kHz) * **** * * [DPCM-Multi] @@ -286,7 +289,10 @@ port@2 { codec2_ep: endpoint { remote-endpoint = <&mcodec2_ep>; }; }; /* [DPCM]::BE */ - port@3 { codec3_ep: endpoint { remote-endpoint = <&be00_ep>; }; }; + port@3 { + convert-rate = <44100>; + codec3_ep: endpoint { remote-endpoint = <&be00_ep>; }; + }; /* [DPCM-Multi]::BE */ port@4 { codec4_ep: endpoint { remote-endpoint = <&mbe1_ep>; }; }; diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 8ac6df645ee6..06609a526b78 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -849,7 +849,8 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv, goto err; } - graph_parse_convert(rep, dai_props); + 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); @@ -1271,9 +1272,6 @@ err: if (ret < 0) dev_err_probe(dev, ret, "parse error\n"); - if (ret == 0) - dev_warn(dev, "Audio Graph Card2 is still under Experimental stage\n"); - return ret; } EXPORT_SYMBOL_GPL(audio_graph2_parse_of); diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index be69bbc47f81..e35becce9635 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -41,27 +41,6 @@ static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data, } } -void asoc_simple_convert_fixup(struct asoc_simple_data *data, - struct snd_pcm_hw_params *params) -{ - struct snd_interval *rate = hw_param_interval(params, - SNDRV_PCM_HW_PARAM_RATE); - struct snd_interval *channels = hw_param_interval(params, - SNDRV_PCM_HW_PARAM_CHANNELS); - - if (data->convert_rate) - rate->min = - rate->max = data->convert_rate; - - if (data->convert_channels) - channels->min = - channels->max = data->convert_channels; - - if (data->convert_sample_format) - asoc_simple_fixup_sample_fmt(data, params); -} -EXPORT_SYMBOL_GPL(asoc_simple_convert_fixup); - void asoc_simple_parse_convert(struct device_node *np, char *prefix, struct asoc_simple_data *data) @@ -522,8 +501,20 @@ int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, { struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); + struct asoc_simple_data *data = &dai_props->adata; + struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); + struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + + if (data->convert_rate) + rate->min = + rate->max = data->convert_rate; - asoc_simple_convert_fixup(&dai_props->adata, params); + if (data->convert_channels) + channels->min = + channels->max = data->convert_channels; + + if (data->convert_sample_format) + asoc_simple_fixup_sample_fmt(data, params); return 0; } |