summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStefano Radaelli <stefano.r@variscite.com>2026-02-13 16:03:55 +0100
committerMark Brown <broonie@kernel.org>2026-02-22 23:52:23 +0000
commitd075cef4af6327a5de4bee7bf77591e3201e54f4 (patch)
tree381f3ece16c882813853de2151a5c68d68ac6ff5 /include
parent5879521cb558871472b97c4744dbe634a4286f0e (diff)
downloadlinux-d075cef4af6327a5de4bee7bf77591e3201e54f4.tar.gz
linux-d075cef4af6327a5de4bee7bf77591e3201e54f4.zip
ASoC: simple-card-utils: add sysclk ordering support
When simple-audio-card programs sysclk for CPU and codec DAIs during hw_params, the ordering of these calls may matter on some platforms. Some CPU DAIs finalize or adjust the MCLK rate as part of their set_sysclk() callback (for example by calling clk_set_rate()). If the codec sysclk is configured before the CPU DAI applies the final MCLK rate, the codec may configure its internal clocking based on a non-final MCLK value. Such situations can arise depending on the clock provider/consumer relationship between the CPU DAI and the codec. Introduce an explicit sysclk ordering enum in simple-card-utils and use it to control the order of snd_soc_dai_set_sysclk() calls in the mclk-fs handling path. The default behaviour remains unchanged (codec-first) to avoid regressions. Signed-off-by: Stefano Radaelli <stefano.r@variscite.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20260213150355.442609-1-stefano.r@variscite.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/simple_card_utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 69a9c9c4d0e9..915e6ae5f68d 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -54,6 +54,11 @@ struct prop_nums {
int platforms;
};
+enum simple_util_sysclk_order {
+ SIMPLE_SYSCLK_ORDER_CODEC_FIRST = 0,
+ SIMPLE_SYSCLK_ORDER_CPU_FIRST,
+};
+
struct simple_util_priv {
struct snd_soc_card snd_card;
struct simple_dai_props {
@@ -63,6 +68,7 @@ struct simple_util_priv {
struct snd_soc_codec_conf *codec_conf;
struct prop_nums num;
unsigned int mclk_fs;
+ enum simple_util_sysclk_order sysclk_order;
} *dai_props;
struct simple_util_jack hp_jack;
struct simple_util_jack mic_jack;