From 138d22226ed2b36a94d74873f8f1ac3193ee944f Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Sep 2020 20:22:17 +0100 Subject: [PATCH] temporary work-around for not being able to read sysclk from dts for ac10x The "sysclk = 24000000" value is supposed to come from the "clock-frequency" field of ac108_mclk / ac10x_mclk, but somehow it isn't on 5.4 (vs 4.19). This is a temporary work-around. For some strange unknown reasons, this affects only the square 4-mic device, but not the linear 4-mic nor the 6-mics device. The other two devices have two ac108's, and seem to work fine without it. In v4.19: seeed_voice_card_probe [snd_soc_seeed_voicecard] -> devm_snd_soc_register_card [snd_soc_core] -> snd_soc_register_card [snd_soc_core] -> seeed_voice_card_dai_init [snd_soc_seeed_voicecard] -> asoc_simple_card_init_dai [snd_soc_simple_card_utils] -> snd_soc_dai_set_sysclk [snd_soc_core] -> ac108_set_sysclk [snd_soc_ac108] In 5.4: seeed_voice_card_probe [snd_soc_seeed_voicecard] -> devm_snd_soc_register_card [snd_soc_core] -> snd_soc_register_card [snd_soc_core] -> snd_soc_instantiate_card [snd_soc_core] -> seeed_voice_card_dai_init [snd_soc_seeed_voicecard] -> asoc_simple_init_dai.part.0 [snd_soc_seeed_voicecard] -> snd_soc_dai_set_sysclk [snd_soc_core] -> ac108_set_sysclk [snd_soc_ac108] Which results in the "ac108_set_sysclk :24000000" kernel message. Note the extra snd_soc_instantiate_card(), and the copied/renamed asoc_simple_init_dai() - it became static and not-available to other drivers in v5.x. See https://github.com/respeaker/seeed-voicecard/issues/246 --- seeed-voicecard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seeed-voicecard.c b/seeed-voicecard.c index 1ed9a0e..aceb7b9 100644 --- a/seeed-voicecard.c +++ b/seeed-voicecard.c @@ -457,6 +457,8 @@ static int seeed_voice_card_dai_link_of(struct device_node *node, #else ret = asoc_simple_parse_clk_codec(dev, codec, dai_link, codec_dai); #endif + if (!strncmp(dai_link->codecs->dai_name, "ac10", 4)) + codec_dai->sysclk = 24000000; if (ret < 0) goto dai_link_of_err;