mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
ASoC: simple-audio-card: enable playback/capture_only property
Audio Graph Card2 is supporting playback/capture_only property, let's follow Simple Audio Card, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87wmnefrv4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a0174c8838
commit
42d37e8de8
@ -187,24 +187,39 @@ static int simple_parse_node(struct simple_util_priv *priv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int simple_link_init(struct simple_util_priv *priv,
|
static int simple_link_init(struct simple_util_priv *priv,
|
||||||
struct device_node *node,
|
struct device_node *cpu,
|
||||||
struct device_node *codec,
|
struct device_node *codec,
|
||||||
struct link_info *li,
|
struct link_info *li,
|
||||||
char *prefix, char *name)
|
char *prefix, char *name)
|
||||||
{
|
{
|
||||||
struct device *dev = simple_priv_to_dev(priv);
|
struct device *dev = simple_priv_to_dev(priv);
|
||||||
|
struct device_node *top = dev->of_node;
|
||||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||||
|
struct device_node *node = of_get_parent(cpu);
|
||||||
|
bool playback_only = 0, capture_only = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = simple_util_parse_daifmt(dev, node, codec,
|
ret = simple_util_parse_daifmt(dev, node, codec,
|
||||||
prefix, &dai_link->dai_fmt);
|
prefix, &dai_link->dai_fmt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return 0;
|
goto init_end;
|
||||||
|
|
||||||
|
graph_util_parse_link_direction(top, &playback_only, &capture_only);
|
||||||
|
graph_util_parse_link_direction(node, &playback_only, &capture_only);
|
||||||
|
graph_util_parse_link_direction(cpu, &playback_only, &capture_only);
|
||||||
|
graph_util_parse_link_direction(codec, &playback_only, &capture_only);
|
||||||
|
|
||||||
|
dai_link->playback_only = playback_only;
|
||||||
|
dai_link->capture_only = capture_only;
|
||||||
|
|
||||||
dai_link->init = simple_util_dai_init;
|
dai_link->init = simple_util_dai_init;
|
||||||
dai_link->ops = &simple_ops;
|
dai_link->ops = &simple_ops;
|
||||||
|
|
||||||
return simple_util_set_dailink_name(dev, dai_link, name);
|
ret = simple_util_set_dailink_name(dev, dai_link, name);
|
||||||
|
init_end:
|
||||||
|
of_node_put(node);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,
|
static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,
|
||||||
@ -278,7 +293,7 @@ static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,
|
|||||||
|
|
||||||
snd_soc_dai_link_set_capabilities(dai_link);
|
snd_soc_dai_link_set_capabilities(dai_link);
|
||||||
|
|
||||||
ret = simple_link_init(priv, node, codec, li, prefix, dai_name);
|
ret = simple_link_init(priv, np, codec, li, prefix, dai_name);
|
||||||
|
|
||||||
out_put_node:
|
out_put_node:
|
||||||
li->link++;
|
li->link++;
|
||||||
@ -336,7 +351,7 @@ static int simple_dai_link_of(struct simple_util_priv *priv,
|
|||||||
simple_util_canonicalize_cpu(cpus, single_cpu);
|
simple_util_canonicalize_cpu(cpus, single_cpu);
|
||||||
simple_util_canonicalize_platform(platforms, cpus);
|
simple_util_canonicalize_platform(platforms, cpus);
|
||||||
|
|
||||||
ret = simple_link_init(priv, node, codec, li, prefix, dai_name);
|
ret = simple_link_init(priv, cpu, codec, li, prefix, dai_name);
|
||||||
|
|
||||||
dai_link_of_err:
|
dai_link_of_err:
|
||||||
of_node_put(plat);
|
of_node_put(plat);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user