* [PATCH 0/3] Minor bug fixes for some older Wolfson devices
@ 2025-08-21 8:23 Charles Keepax
2025-08-21 8:23 ` [PATCH 1/3] ASoC: wm8940: Correct PLL rate rounding Charles Keepax
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Charles Keepax @ 2025-08-21 8:23 UTC (permalink / raw)
To: broonie; +Cc: lgirdwood, lukma, mans, linux-sound, patches
Minor bug fixes for a couple of older devices reported by some users.
Mostly this centers around the automatic PLL configuration getting the
wrong values due to rounding.
Thanks,
Charles
Charles Keepax (3):
ASoC: wm8940: Correct PLL rate rounding
ASoC: wm8940: Correct typo in control name
ASoC: wm8974: Correct PLL rate rounding
sound/soc/codecs/wm8940.c | 9 +++++++--
sound/soc/codecs/wm8974.c | 8 ++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
--
2.47.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] ASoC: wm8940: Correct PLL rate rounding
2025-08-21 8:23 [PATCH 0/3] Minor bug fixes for some older Wolfson devices Charles Keepax
@ 2025-08-21 8:23 ` Charles Keepax
2025-08-21 8:23 ` [PATCH 2/3] ASoC: wm8940: Correct typo in control name Charles Keepax
2025-08-21 8:23 ` [PATCH 3/3] ASoC: wm8974: Correct PLL rate rounding Charles Keepax
2 siblings, 0 replies; 4+ messages in thread
From: Charles Keepax @ 2025-08-21 8:23 UTC (permalink / raw)
To: broonie; +Cc: lgirdwood, lukma, mans, linux-sound, patches
Using a single value of 22500000 for both 48000Hz and 44100Hz audio
will sometimes result in returning wrong dividers due to rounding.
Update the code to use the actual value for both.
Fixes: 294833fc9eb4 ("ASoC: wm8940: Rewrite code to set proper clocks")
Reported-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/codecs/wm8940.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index 401ee20897b1b..46c16c9bc17a8 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -693,7 +693,12 @@ static int wm8940_update_clocks(struct snd_soc_dai *dai)
f = wm8940_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
if (f != priv->mclk) {
/* The PLL performs best around 90MHz */
- fpll = wm8940_get_mclkdiv(22500000, fs256, &mclkdiv);
+ if (fs256 % 8000)
+ f = 22579200;
+ else
+ f = 24576000;
+
+ fpll = wm8940_get_mclkdiv(f, fs256, &mclkdiv);
}
wm8940_set_dai_pll(dai, 0, 0, priv->mclk, fpll);
--
2.47.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] ASoC: wm8940: Correct typo in control name
2025-08-21 8:23 [PATCH 0/3] Minor bug fixes for some older Wolfson devices Charles Keepax
2025-08-21 8:23 ` [PATCH 1/3] ASoC: wm8940: Correct PLL rate rounding Charles Keepax
@ 2025-08-21 8:23 ` Charles Keepax
2025-08-21 8:23 ` [PATCH 3/3] ASoC: wm8974: Correct PLL rate rounding Charles Keepax
2 siblings, 0 replies; 4+ messages in thread
From: Charles Keepax @ 2025-08-21 8:23 UTC (permalink / raw)
To: broonie; +Cc: lgirdwood, lukma, mans, linux-sound, patches
Fixes: 0b5e92c5e020 ("ASoC WM8940 Driver")
Reported-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/codecs/wm8940.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index 46c16c9bc17a8..94873ea630146 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -220,7 +220,7 @@ static const struct snd_kcontrol_new wm8940_snd_controls[] = {
SOC_SINGLE_TLV("Digital Capture Volume", WM8940_ADCVOL,
0, 255, 0, wm8940_adc_tlv),
SOC_ENUM("Mic Bias Level", wm8940_mic_bias_level_enum),
- SOC_SINGLE_TLV("Capture Boost Volue", WM8940_ADCBOOST,
+ SOC_SINGLE_TLV("Capture Boost Volume", WM8940_ADCBOOST,
8, 1, 0, wm8940_capture_boost_vol_tlv),
SOC_SINGLE_TLV("Speaker Playback Volume", WM8940_SPKVOL,
0, 63, 0, wm8940_spk_vol_tlv),
--
2.47.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] ASoC: wm8974: Correct PLL rate rounding
2025-08-21 8:23 [PATCH 0/3] Minor bug fixes for some older Wolfson devices Charles Keepax
2025-08-21 8:23 ` [PATCH 1/3] ASoC: wm8940: Correct PLL rate rounding Charles Keepax
2025-08-21 8:23 ` [PATCH 2/3] ASoC: wm8940: Correct typo in control name Charles Keepax
@ 2025-08-21 8:23 ` Charles Keepax
2 siblings, 0 replies; 4+ messages in thread
From: Charles Keepax @ 2025-08-21 8:23 UTC (permalink / raw)
To: broonie; +Cc: lgirdwood, lukma, mans, linux-sound, patches
Using a single value of 22500000 for both 48000Hz and 44100Hz audio
will sometimes result in returning wrong dividers due to rounding.
Update the code to use the actual value for both.
Fixes: 51b2bb3f2568 ("ASoC: wm8974: configure pll and mclk divider automatically")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/codecs/wm8974.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c
index bdf437a5403fe..db16d893a2351 100644
--- a/sound/soc/codecs/wm8974.c
+++ b/sound/soc/codecs/wm8974.c
@@ -419,10 +419,14 @@ static int wm8974_update_clocks(struct snd_soc_dai *dai)
fs256 = 256 * priv->fs;
f = wm8974_get_mclkdiv(priv->mclk, fs256, &mclkdiv);
-
if (f != priv->mclk) {
/* The PLL performs best around 90MHz */
- fpll = wm8974_get_mclkdiv(22500000, fs256, &mclkdiv);
+ if (fs256 % 8000)
+ f = 22579200;
+ else
+ f = 24576000;
+
+ fpll = wm8974_get_mclkdiv(f, fs256, &mclkdiv);
}
wm8974_set_dai_pll(dai, 0, 0, priv->mclk, fpll);
--
2.47.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-21 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 8:23 [PATCH 0/3] Minor bug fixes for some older Wolfson devices Charles Keepax
2025-08-21 8:23 ` [PATCH 1/3] ASoC: wm8940: Correct PLL rate rounding Charles Keepax
2025-08-21 8:23 ` [PATCH 2/3] ASoC: wm8940: Correct typo in control name Charles Keepax
2025-08-21 8:23 ` [PATCH 3/3] ASoC: wm8974: Correct PLL rate rounding Charles Keepax
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).