[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <54C7C653.6080904@samsung.com>
Date: Tue, 27 Jan 2015 18:09:39 +0100
From: Sylwester Nawrocki <s.nawrocki@...sung.com>
To: Inha Song <ideal.song@...sung.com>
Cc: alsa-devel@...a-project.org, robh+dt@...nel.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
linux@....linux.org.uk, kgene@...nel.org, sbkim73@...sung.com,
lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz,
tiwai@...e.de, grant.likely@...aro.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org
Subject: Re: [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for
Trats2
On 23/01/15 06:03, Inha Song wrote:
> +static int trats2_aif1_startup(struct snd_pcm_substream *substream)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> + int ret;
> +
> + ret = clk_prepare_enable(priv->clk_mclk);
> + if (ret) {
> + dev_err(rtd->card->dev, "Failed to enable mclk: %d\n", ret);
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +
> + clk_disable_unprepare(priv->clk_mclk);
> +}
> +
> +static const struct snd_soc_ops trats2_aif1_ops = {
> + .startup = trats2_aif1_startup,
> + .shutdown = trats2_aif1_shutdown,
> + .hw_params = trats2_aif1_hw_params,
> +};
> +static int trats2_audio_probe(struct platform_device *pdev)
> +{
> + priv->clk_mclk = of_clk_get_by_name(codec_node, "MCLK1");
> + if (IS_ERR(priv->clk_mclk)) {
> + dev_err(&pdev->dev, "Failed to get mclk clock\n");
> + of_node_put(codec_node);
> + return PTR_ERR(priv->clk_mclk);
> + }
Wouldn't it also work if we added clock handling into the wm8994 codec
driver instead? Not sure if it is correct to retrieve the codec's clock
in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
should be added to the sound DT node and handled only by the machine
driver, together with the other (MCLK2) clock?
> + of_node_put(codec_node);
--
Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists