Commit 1340739d authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: audio-graph-scu-card: use simple_dai_props

audi-graph-card and audio-graph-scu-card are very similar driver,
but using different feature. Thus we are keeping synchronization
on these 2 drivers style, because it is easy to confirm / check.

Current big difference between these 2 drivers are "dai_props" on
graph_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature
on audio-graph-scu-card. Thus, this patch synchronize it.

[audio-graph]
struct graph_card_data {
	...
	struct graph_dai_props {
		...
	} *dai_props;
	...
};

[audio-graph-scu]
struct graph_card_data {
	...
	struct asoc_simple_dai *dai_props;
	...
};
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8e6746db
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
struct graph_card_data { struct graph_card_data {
struct snd_soc_card snd_card; struct snd_soc_card snd_card;
struct snd_soc_codec_conf codec_conf; struct snd_soc_codec_conf codec_conf;
struct asoc_simple_dai *dai_props; struct graph_dai_props {
struct asoc_simple_dai dai;
} *dai_props;
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
struct asoc_simple_card_data adata; struct asoc_simple_card_data adata;
}; };
...@@ -39,18 +41,18 @@ static int asoc_graph_card_startup(struct snd_pcm_substream *substream) ...@@ -39,18 +41,18 @@ static int asoc_graph_card_startup(struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card); struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
struct asoc_simple_dai *dai_props = graph_priv_to_props(priv, rtd->num); struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);
return asoc_simple_card_clk_enable(dai_props); return asoc_simple_card_clk_enable(&dai_props->dai);
} }
static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream) static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card); struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
struct asoc_simple_dai *dai_props = graph_priv_to_props(priv, rtd->num); struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);
asoc_simple_card_clk_disable(dai_props); asoc_simple_card_clk_disable(&dai_props->dai);
} }
static const struct snd_soc_ops asoc_graph_card_ops = { static const struct snd_soc_ops asoc_graph_card_ops = {
...@@ -63,7 +65,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd) ...@@ -63,7 +65,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd)
struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card); struct graph_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
struct asoc_simple_dai *dai_props; struct graph_dai_props *dai_props;
int num = rtd->num; int num = rtd->num;
dai_link = graph_priv_to_link(priv, num); dai_link = graph_priv_to_link(priv, num);
...@@ -72,7 +74,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd) ...@@ -72,7 +74,7 @@ static int asoc_graph_card_dai_init(struct snd_soc_pcm_runtime *rtd)
rtd->cpu_dai : rtd->cpu_dai :
rtd->codec_dai; rtd->codec_dai;
return asoc_simple_card_init_dai(dai, dai_props); return asoc_simple_card_init_dai(dai, &dai_props->dai);
} }
static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
...@@ -92,7 +94,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ...@@ -92,7 +94,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
{ {
struct device *dev = graph_priv_to_dev(priv); struct device *dev = graph_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, idx); struct snd_soc_dai_link *dai_link = graph_priv_to_link(priv, idx);
struct asoc_simple_dai *dai_props = graph_priv_to_props(priv, idx); struct graph_dai_props *dai_props = graph_priv_to_props(priv, idx);
struct snd_soc_card *card = graph_priv_to_card(priv); struct snd_soc_card *card = graph_priv_to_card(priv);
int ret; int ret;
...@@ -110,7 +112,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ...@@ -110,7 +112,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
if (ret) if (ret)
return ret; return ret;
ret = asoc_simple_card_parse_clk_cpu(dev, ep, dai_link, dai_props); ret = asoc_simple_card_parse_clk_cpu(dev, ep, dai_link, &dai_props->dai);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -137,7 +139,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ...@@ -137,7 +139,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = asoc_simple_card_parse_clk_codec(dev, ep, dai_link, dai_props); ret = asoc_simple_card_parse_clk_codec(dev, ep, dai_link, &dai_props->dai);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -153,7 +155,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep, ...@@ -153,7 +155,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
"prefix"); "prefix");
} }
ret = asoc_simple_card_of_parse_tdm(ep, dai_props); ret = asoc_simple_card_of_parse_tdm(ep, &dai_props->dai);
if (ret) if (ret)
return ret; return ret;
...@@ -331,7 +333,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev) ...@@ -331,7 +333,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)
{ {
struct graph_card_data *priv; struct graph_card_data *priv;
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
struct asoc_simple_dai *dai_props; struct graph_dai_props *dai_props;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct snd_soc_card *card; struct snd_soc_card *card;
int num, ret; int num, ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment