From: Shengjiu Wang <shengjiu.wang@nxp.com>
To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, chancel.liu@nxp.com
Subject: [PATCH 1/2] ASoC: imx-card: Set mclk for codec
Date: Wed, 9 Oct 2024 15:46:43 +0800 [thread overview]
Message-ID: <1728460004-364-2-git-send-email-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <1728460004-364-1-git-send-email-shengjiu.wang@nxp.com>
From: Chancel Liu <chancel.liu@nxp.com>
In some cases, ASoC machine driver may modify the mclk frequency
according to sample rate but the value in codec is still initial
frequency which should be replaced. For example, we should update
mclk before setup for cs42xx8 mclk relating registers.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/imx-card.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index a7215bad6484..2f3dbbd15791 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -370,6 +370,11 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream,
dev_err(dev, "failed to set cpui dai mclk1 rate (%lu): %d\n", mclk_freq, ret);
return ret;
}
+ ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk_freq, SND_SOC_CLOCK_IN);
+ if (ret && ret != -ENOTSUPP) {
+ dev_err(dev, "failed to set codec dai mclk rate (%lu): %d\n", mclk_freq, ret);
+ return ret;
+ }
return 0;
}
--
2.34.1
next prev parent reply other threads:[~2024-10-09 8:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 7:46 [PATCH 0/2] ASoC: imx-card: add cs42888 codec support Shengjiu Wang
2024-10-09 7:46 ` Shengjiu Wang [this message]
2024-10-09 7:46 ` [PATCH 2/2] ASoC: imx-card: Add CS42888 support Shengjiu Wang
2024-10-10 8:11 ` [PATCH 0/2] ASoC: imx-card: add cs42888 codec support Iuliana Prodan
2024-10-12 12:50 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1728460004-364-2-git-send-email-shengjiu.wang@nxp.com \
--to=shengjiu.wang@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=chancel.liu@nxp.com \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).