Unverified Commit 5ece10ab authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: simple-scu-card: use simple_dai_props



simple-card and simple-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
simple_card_data (= priv).
It will be difficult to keep synchronize if we will add new feature
on simple-scu-card. Thus, this patch synchronize it.

[simple]
struct simple_card_data {
	...
	struct simple_dai_props {
		...
	} *dai_props;
	...
};

[simple scu]
struct simple_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 710af919
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -22,7 +22,9 @@
struct simple_card_data {
	struct snd_soc_card snd_card;
	struct snd_soc_codec_conf codec_conf;
	struct asoc_simple_dai *dai_props;
	struct simple_dai_props {
		struct asoc_simple_dai dai;
	} *dai_props;
	struct snd_soc_dai_link *dai_link;
	struct asoc_simple_card_data adata;
};
@@ -40,20 +42,20 @@ static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct simple_card_data *priv =	snd_soc_card_get_drvdata(rtd->card);
	struct asoc_simple_dai *dai_props =
	struct simple_dai_props *dai_props =
		simple_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_simple_card_shutdown(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct simple_card_data *priv =	snd_soc_card_get_drvdata(rtd->card);
	struct asoc_simple_dai *dai_props =
	struct simple_dai_props *dai_props =
		simple_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_simple_card_ops = {
@@ -66,7 +68,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
	struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
	struct snd_soc_dai *dai;
	struct snd_soc_dai_link *dai_link;
	struct asoc_simple_dai *dai_props;
	struct simple_dai_props *dai_props;
	int num = rtd->num;

	dai_link	= simple_priv_to_link(priv, num);
@@ -75,7 +77,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
				rtd->cpu_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_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
@@ -95,7 +97,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,
{
	struct device *dev = simple_priv_to_dev(priv);
	struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx);
	struct asoc_simple_dai *dai_props = simple_priv_to_props(priv, idx);
	struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx);
	struct snd_soc_card *card = simple_priv_to_card(priv);
	int ret;

@@ -116,7 +118,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,
		if (ret)
			return ret;

		ret = asoc_simple_card_parse_clk_cpu(dev, np, dai_link, dai_props);
		ret = asoc_simple_card_parse_clk_cpu(dev, np, dai_link, &dai_props->dai);
		if (ret < 0)
			return ret;

@@ -141,7 +143,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,
		if (ret < 0)
			return ret;

		ret = asoc_simple_card_parse_clk_codec(dev, np, dai_link, dai_props);
		ret = asoc_simple_card_parse_clk_codec(dev, np, dai_link, &dai_props->dai);
		if (ret < 0)
			return ret;

@@ -157,7 +159,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *np,
					      PREFIX "prefix");
	}

	ret = asoc_simple_card_of_parse_tdm(np, dai_props);
	ret = asoc_simple_card_of_parse_tdm(np, &dai_props->dai);
	if (ret)
		return ret;

@@ -230,7 +232,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
{
	struct simple_card_data *priv;
	struct snd_soc_dai_link *dai_link;
	struct asoc_simple_dai *dai_props;
	struct simple_dai_props *dai_props;
	struct snd_soc_card *card;
	struct device *dev = &pdev->dev;
	struct device_node *np = dev->of_node;