[PATCH 0/2] ASoC: rt5631: Support an MCLK clock from the SoC

From: Romain TISSERAND

Date: Sun Oct 25 2026 - 10:54:08 EST


The RT5631 driver doesn't take a master clock, so when MCLK comes from a
SoC clock output, that clock is turned off at boot as unused. This
series adds an optional "mclk" clock to the binding and enables it in
the driver while the codec is active, as rt5616 does.

The board that needs it is the GPD XD (RK3288), whose device tree is not
upstream yet. Its MCLK is i2s0_clkout: handed to simple-audio-card, the
mux picked the 12 MHz oscillator for 12.288 MHz (wrong pitch); held by
the codec, it follows the I2S clock, as on the RK3288 boards with ES8388
and MAX98090 codecs.

Testing: dt_binding_check for realtek,rt5631.yaml; W=1 builds for arm
(multi_v7) and arm64 (defconfig) with SND_SOC_RT5631=y and =m, no
warnings. Tested live on the GPD XD (RT5631 on simple-audio-card, mclk-fs
256) on 6.18.54 with this change backported (the bias level read uses
snd_soc_component_get_bias_level() there): i2s0_clkout stays on the I2S
clock at 11.2896 MHz for 44.1 kHz and 12.288 MHz for 48 kHz, and both
play at the right pitch. Boards without an "mclk" clock are not affected
(clk_prepare_enable() on a NULL clock does nothing); not tested on other
boards.

Tool disclosure: this series was prepared with Claude Opus 5.5
(Anthropic) as a coding assistant, in an interactive session where I
asked it to fix the pitch problem without the RK3288 clock change that
was refused in 2014. It traced the clock ordering in simple-audio-card,
proposed taking the clock in the codec driver following rt5616, and
drafted the patches and the messages. I reviewed and understand them,
and tested them on the GPD XD as described above.


Romain TISSERAND (2):
ASoC: dt-bindings: realtek,rt5631: Add the optional MCLK
ASoC: codecs: rt5631: Enable the optional MCLK

.../bindings/sound/realtek,rt5631.yaml | 8 ++++++++
sound/soc/codecs/rt5631.c | 17 ++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)


base-commit: cc3fc99f1bce93c3ae3771ef98cb91a566da857e
--
2.43.0