aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <[email protected]>2023-07-31 22:27:26 +0100
committerMark Brown <[email protected]>2023-07-31 22:27:26 +0100
commit169e154b8f338e022f09536cfca7eb4f38aa80a4 (patch)
tree00813375c5281f41d519ad3c5dd6b40a97846b49
parent36eb986845a8ca87c1f7f91976fad53ee249ae8c (diff)
parent2bbc2df46e67be1a26b9c2b18a581b83e17ccb19 (diff)
ASoC: wm8960: Clocking tweaks
Merge series from Mark Brown <[email protected]>: A couple of minor clocking improvements that make the wm8960 driver work a bit better with generic cards.
-rw-r--r--sound/soc/codecs/wm8960.c8
-rw-r--r--sound/soc/codecs/wm8960.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index c2bd9ef41ebb..d4bc97088354 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -1429,6 +1429,14 @@ static int wm8960_i2c_probe(struct i2c_client *i2c)
if (IS_ERR(wm8960->mclk)) {
if (PTR_ERR(wm8960->mclk) == -EPROBE_DEFER)
return -EPROBE_DEFER;
+ } else {
+ ret = clk_get_rate(wm8960->mclk);
+ if (ret >= 0) {
+ wm8960->freq_in = ret;
+ } else {
+ dev_err(&i2c->dev, "Failed to read MCLK rate: %d\n",
+ ret);
+ }
}
wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap);
diff --git a/sound/soc/codecs/wm8960.h b/sound/soc/codecs/wm8960.h
index 63ba6c03c488..e8ff33b188e9 100644
--- a/sound/soc/codecs/wm8960.h
+++ b/sound/soc/codecs/wm8960.h
@@ -77,9 +77,9 @@
#define WM8960_SYSCLK_DIV_1 (0 << 1)
#define WM8960_SYSCLK_DIV_2 (2 << 1)
-#define WM8960_SYSCLK_MCLK (0 << 0)
+#define WM8960_SYSCLK_AUTO (0 << 0)
#define WM8960_SYSCLK_PLL (1 << 0)
-#define WM8960_SYSCLK_AUTO (2 << 0)
+#define WM8960_SYSCLK_MCLK (2 << 0)
#define WM8960_DAC_DIV_1 (0 << 3)
#define WM8960_DAC_DIV_1_5 (1 << 3)