summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-12-13 21:35:20 -0500
committerMark Brown <broonie@kernel.org>2018-12-14 06:48:42 -0500
commitdd82410f7e939f00591c415d62915a89ac2fb8f0 (patch)
tree068fb116c1ddb6d5f7fb83cf0c116cd87af43991 /sound
parent79e834914d1fa2d078c586094ad347cc05aa428c (diff)
ASoC: simple-card: tidyup convert_rate/channel method
Current simple-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { simple-audio-card,convert_channels = <xxx>; // initial simple-audio-card,dai-link { convert_channels = <xxx>; // overwrite cpu { convert_channels = <xxx>; // overwrite }; codec { convert_channels = <xxx>; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/generic/simple-card.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 8593d51e0c6c..fb18e5148aad 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -30,7 +30,6 @@ struct simple_card_data {
30 struct asoc_simple_jack mic_jack; 30 struct asoc_simple_jack mic_jack;
31 struct snd_soc_dai_link *dai_link; 31 struct snd_soc_dai_link *dai_link;
32 struct asoc_simple_dai *dais; 32 struct asoc_simple_dai *dais;
33 struct asoc_simple_card_data adata;
34 struct snd_soc_codec_conf *codec_conf; 33 struct snd_soc_codec_conf *codec_conf;
35}; 34};
36 35
@@ -163,9 +162,6 @@ static int asoc_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
163 162
164 asoc_simple_card_convert_fixup(&dai_props->adata, params); 163 asoc_simple_card_convert_fixup(&dai_props->adata, params);
165 164
166 /* overwrite by top level adata if exist */
167 asoc_simple_card_convert_fixup(&priv->adata, params);
168
169 return 0; 165 return 0;
170} 166}
171 167
@@ -267,7 +263,9 @@ static int asoc_simple_card_dai_link_of_dpcm(struct device_node *top,
267 "prefix"); 263 "prefix");
268 } 264 }
269 265
266 asoc_simple_card_parse_convert(dev, top, PREFIX, &dai_props->adata);
270 asoc_simple_card_parse_convert(dev, node, prefix, &dai_props->adata); 267 asoc_simple_card_parse_convert(dev, node, prefix, &dai_props->adata);
268 asoc_simple_card_parse_convert(dev, np, NULL, &dai_props->adata);
271 269
272 ret = asoc_simple_card_of_parse_tdm(np, dai); 270 ret = asoc_simple_card_of_parse_tdm(np, dai);
273 if (ret) 271 if (ret)
@@ -460,8 +458,6 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
460 if (ret < 0) 458 if (ret < 0)
461 return ret; 459 return ret;
462 460
463 asoc_simple_card_parse_convert(dev, top, PREFIX, &priv->adata);
464
465 /* Single/Muti DAI link(s) & New style of DT node */ 461 /* Single/Muti DAI link(s) & New style of DT node */
466 loop = 1; 462 loop = 1;
467 link_idx = 0; 463 link_idx = 0;