Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d471d559 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: audio-graph-card: use asoc_simple_card_clk_xxx()



Current simple-card-utils sets asoc_simple_dai::clk via
asoc_simple_card_parse_clk().
Current simple card drivers are using it directly for
clk_enable/disable.
Encapsulation is one of simple card util's purpose.
Let's use asoc_simple_card_clk_enable/disable.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6654fc77
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -44,13 +44,13 @@ static int asoc_graph_card_startup(struct snd_pcm_substream *substream)
	struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);
	struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);
	int ret;
	int ret;


	ret = clk_prepare_enable(dai_props->cpu_dai.clk);
	ret = asoc_simple_card_clk_enable(&dai_props->cpu_dai);
	if (ret)
	if (ret)
		return ret;
		return ret;


	ret = clk_prepare_enable(dai_props->codec_dai.clk);
	ret = asoc_simple_card_clk_enable(&dai_props->codec_dai);
	if (ret)
	if (ret)
		clk_disable_unprepare(dai_props->cpu_dai.clk);
		asoc_simple_card_clk_disable(&dai_props->cpu_dai);


	return ret;
	return ret;
}
}
@@ -61,9 +61,9 @@ static void asoc_graph_card_shutdown(struct snd_pcm_substream *substream)
	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 graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);
	struct graph_dai_props *dai_props = graph_priv_to_props(priv, rtd->num);


	clk_disable_unprepare(dai_props->cpu_dai.clk);
	asoc_simple_card_clk_disable(&dai_props->cpu_dai);


	clk_disable_unprepare(dai_props->codec_dai.clk);
	asoc_simple_card_clk_disable(&dai_props->codec_dai);
}
}


static struct snd_soc_ops asoc_graph_card_ops = {
static struct snd_soc_ops asoc_graph_card_ops = {