From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>,
shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com,
lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH AUTOSEL 6.5 07/31] ASoC: fsl-asoc-card: use integer type for fll_id and pll_id
Date: Wed, 18 Oct 2023 10:11:24 -0400 [thread overview]
Message-ID: <20231018141151.1334501-7-sashal@kernel.org> (raw)
In-Reply-To: <20231018141151.1334501-1-sashal@kernel.org>
From: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Upstream commit 2b21207afd06714986a3d22442ed4860ba4f9ced ]
As the pll_id and pll_id can be zero (WM8960_SYSCLK_AUTO)
with the commit 2bbc2df46e67 ("ASoC: wm8960: Make automatic the
default clocking mode")
Then the machine driver will skip to call set_sysclk() and set_pll()
for codec, when the sysclk rate is different with what wm8960 read
at probe, the output sound frequency is wrong.
So change the fll_id and pll_id initial value, still keep machine
driver's behavior same as before.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1695202992-24864-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/fsl/fsl-asoc-card.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 76b5bfc288fde..bab7d34cf585b 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -52,8 +52,8 @@ struct codec_priv {
unsigned long mclk_freq;
unsigned long free_freq;
u32 mclk_id;
- u32 fll_id;
- u32 pll_id;
+ int fll_id;
+ int pll_id;
};
/**
@@ -206,7 +206,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
}
/* Specific configuration for PLL */
- if (codec_priv->pll_id && codec_priv->fll_id) {
+ if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {
if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)
pll_out = priv->sample_rate * 384;
else
@@ -248,7 +248,7 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
priv->streams &= ~BIT(substream->stream);
- if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) {
+ if (!priv->streams && codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {
/* Force freq to be free_freq to avoid error message in codec */
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
codec_priv->mclk_id,
@@ -621,6 +621,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
priv->card.dapm_routes = audio_map;
priv->card.num_dapm_routes = ARRAY_SIZE(audio_map);
priv->card.driver_name = DRIVER_NAME;
+
+ priv->codec_priv.fll_id = -1;
+ priv->codec_priv.pll_id = -1;
+
/* Diversify the card configurations */
if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {
codec_dai_name = "cs42888";
--
2.40.1
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
alsa-devel@alsa-project.org, Xiubo.Lee@gmail.com,
linuxppc-dev@lists.ozlabs.org,
Shengjiu Wang <shengjiu.wang@nxp.com>,
tiwai@suse.com, lgirdwood@gmail.com, perex@perex.cz,
Mark Brown <broonie@kernel.org>,
shengjiu.wang@gmail.com
Subject: [PATCH AUTOSEL 6.5 07/31] ASoC: fsl-asoc-card: use integer type for fll_id and pll_id
Date: Wed, 18 Oct 2023 10:11:24 -0400 [thread overview]
Message-ID: <20231018141151.1334501-7-sashal@kernel.org> (raw)
In-Reply-To: <20231018141151.1334501-1-sashal@kernel.org>
From: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Upstream commit 2b21207afd06714986a3d22442ed4860ba4f9ced ]
As the pll_id and pll_id can be zero (WM8960_SYSCLK_AUTO)
with the commit 2bbc2df46e67 ("ASoC: wm8960: Make automatic the
default clocking mode")
Then the machine driver will skip to call set_sysclk() and set_pll()
for codec, when the sysclk rate is different with what wm8960 read
at probe, the output sound frequency is wrong.
So change the fll_id and pll_id initial value, still keep machine
driver's behavior same as before.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1695202992-24864-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/fsl/fsl-asoc-card.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 76b5bfc288fde..bab7d34cf585b 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -52,8 +52,8 @@ struct codec_priv {
unsigned long mclk_freq;
unsigned long free_freq;
u32 mclk_id;
- u32 fll_id;
- u32 pll_id;
+ int fll_id;
+ int pll_id;
};
/**
@@ -206,7 +206,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
}
/* Specific configuration for PLL */
- if (codec_priv->pll_id && codec_priv->fll_id) {
+ if (codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {
if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)
pll_out = priv->sample_rate * 384;
else
@@ -248,7 +248,7 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
priv->streams &= ~BIT(substream->stream);
- if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) {
+ if (!priv->streams && codec_priv->pll_id >= 0 && codec_priv->fll_id >= 0) {
/* Force freq to be free_freq to avoid error message in codec */
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
codec_priv->mclk_id,
@@ -621,6 +621,10 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
priv->card.dapm_routes = audio_map;
priv->card.num_dapm_routes = ARRAY_SIZE(audio_map);
priv->card.driver_name = DRIVER_NAME;
+
+ priv->codec_priv.fll_id = -1;
+ priv->codec_priv.pll_id = -1;
+
/* Diversify the card configurations */
if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {
codec_dai_name = "cs42888";
--
2.40.1
next prev parent reply other threads:[~2023-10-18 14:14 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 14:11 [PATCH AUTOSEL 6.5 01/31] Input: xpad - add HyperX Clutch Gladiate Support Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 02/31] ASoC: Intel: soc-acpi: Add entry for sof_es8336 in MTL match table Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 03/31] ASoC: Intel: sof_sdw: add support for SKU 0B14 Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 04/31] ASoC: simple-card: fixup asoc_simple_probe() error handling Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 05/31] coresight: tmc-etr: Disable warnings for allocation failures Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 06/31] ACPI: EC: Add quirk for the HP Pavilion Gaming 15-dk1xxx Sasha Levin
2023-10-18 14:11 ` Sasha Levin [this message]
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 07/31] ASoC: fsl-asoc-card: use integer type for fll_id and pll_id Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 08/31] ASoC: core: Do not call link_exit() on uninitialized rtd objects Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 09/31] ASoC: tlv320adc3xxx: BUG: Correct micbias setting Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 10/31] Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 11/31] Input: goodix - ensure int GPIO is in input for gpio_count == 1 && gpio_int_idx == 0 case Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 12/31] workqueue: Fix UAF report by KASAN in pwq_release_workfn() Sasha Levin
2023-10-22 2:52 ` Z qiang
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 13/31] ALSA: usb-audio: Fix microphone sound on Opencomm2 Headset Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 14/31] net: sched: cls_u32: Fix allocation size in u32_init() Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 15/31] arm64: dts: imx93: add the Flex-CAN stop mode by GPR Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 16/31] can: flexcan: remove the auto stop mode for IMX93 Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 17/31] irqchip/gic-v3-its: Split allocation from initialisation of its_node Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 18/31] irqchip/gic-v3: Enable non-coherent redistributors/ITSes DT probing Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 19/31] irqchip/riscv-intc: Mark all INTC nodes as initialized Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 20/31] irqchip/stm32-exti: add missing DT IRQ flag translation Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 21/31] dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 22/31] ALSA: usb-audio: Fix microphone sound on Nexigo webcam Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 23/31] ACPI: resource: Add TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q to irq1_edge_low_force_override[] Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 24/31] ata: pata_parport: add custom version of wait_after_reset Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 25/31] ata: pata_parport: fit3: implement IDE command set registers Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 26/31] net: macsec: indicate next pn update when offloading Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 27/31] powerpc/85xx: Fix math emulation exception Sasha Levin
2023-10-18 14:11 ` Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 28/31] media: i2c: ov8858: Don't set fwnode in the driver Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 29/31] Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 30/31] Input: xpad - add PXN V900 support Sasha Levin
2023-10-18 14:11 ` [PATCH AUTOSEL 6.5 31/31] Input: powermate - fix use-after-free in powermate_config_complete Sasha Levin
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=20231018141151.1334501-7-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=stable@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.