mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
ASoC: remove snd_soc_dai_link_set_capabilities()
dpcm_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/capture were available. Thus converting dpcm_xxx to xxx_only is not needed. Just remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://patch.msgid.link/87r0aiaahh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fd69dfe678
commit
1280651048
@ -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(const 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,
|
||||
|
@ -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);
|
||||
|
@ -279,8 +279,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++;
|
||||
|
@ -966,8 +966,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, lnk, cpu_port, codec_port, li, is_cpu);
|
||||
err:
|
||||
of_node_put(ep);
|
||||
|
@ -291,8 +291,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, np, codec, li, prefix, dai_name);
|
||||
|
||||
out_put_node:
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -155,7 +155,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;
|
||||
}
|
||||
|
@ -479,44 +479,6 @@ bool snd_soc_dai_stream_valid(const 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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user