mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 22:57:21 -04:00
ASoC: wm8960: Read initial MCLK rate from clock API
When we have a MCLK provided by the clock API read the rate at startup and store it so that there's something set before the machine driver has done clocking configuration (eg, if it only configures clocking based on sample rate). Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230731-asoc-wm8960-clk-v1-1-69f9ffa2b10a@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user