Thread (22 messages) 22 messages, 5 authors, 2021-03-05

Re: [PATCH v2 2/7] ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg

From: Shengjiu Wang <shengjiu.wang@gmail.com>
Date: 2021-02-09 09:22:09
Also in: alsa-devel, linux-devicetree, lkml

On Mon, Feb 8, 2021 at 7:53 PM Mark Brown [off-list ref] wrote:
On Sun, Feb 07, 2021 at 06:23:50PM +0800, Shengjiu Wang wrote:
quoted
+static int fsl_rpmsg_hw_params(struct snd_pcm_substream *substream,
+                            struct snd_pcm_hw_params *params,
+                            struct snd_soc_dai *dai)
+{
...
quoted
+     ret = clk_prepare_enable(rpmsg->mclk);
+     if (ret)
+             dev_err(dai->dev, "failed to enable mclk: %d\n", ret);
+
+     return ret;
+}
+
+static int fsl_rpmsg_hw_free(struct snd_pcm_substream *substream,
+                          struct snd_soc_dai *dai)
+{
+     struct fsl_rpmsg *rpmsg = snd_soc_dai_get_drvdata(dai);
+
+     clk_disable_unprepare(rpmsg->mclk);
hw_params() can be called multiple times and there's no need for it to
be balanced with hw_free(), I'd move this to a different callback (DAPM
should work well).
Which callback should I use? Is there an example?

best regards
wang shengjiu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help