[PATCH 2/7] arm64: dts: rockchip: Configure MCLK for analog sound on NanoPi M5
Alexey Charkov
alchark at gmail.com
Mon Dec 29 02:11:59 PST 2025
NanoPi M5 derives its analog sound signal from SAI2 in M0 pin mode, so the
MCLK pin should be configured accordingly for the sound codec to get its
I2S signal from the SoC. Request the required pin config.
The clock itself should also be CLK_SAI2_MCLKOUT_TO_IO for the sound to
work (otherwise there is only silence out of the audio out jack).
Fixes: 96cbdfdd3ac2 ("arm64: dts: rockchip: Add FriendlyElec NanoPi M5 support")
Cc: <stable at vger.kernel.org>
Signed-off-by: Alexey Charkov <alchark at gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
index 37184913f918..bb2cc2814b83 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
@@ -201,6 +201,7 @@ sound {
pinctrl-names = "default";
pinctrl-0 = <&hp_det_l>;
+ simple-audio-card,bitclock-master = <&masterdai>;
simple-audio-card,format = "i2s";
simple-audio-card,hp-det-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_LOW>;
simple-audio-card,mclk-fs = <256>;
@@ -218,8 +219,9 @@ simple-audio-card,codec {
sound-dai = <&rt5616>;
};
- simple-audio-card,cpu {
+ masterdai: simple-audio-card,cpu {
sound-dai = <&sai2>;
+ system-clock-frequency = <12288000>;
};
};
};
@@ -727,10 +729,12 @@ &i2c5 {
rt5616: audio-codec at 1b {
compatible = "realtek,rt5616";
reg = <0x1b>;
- assigned-clocks = <&cru CLK_SAI2_MCLKOUT>;
+ assigned-clocks = <&cru CLK_SAI2_MCLKOUT_TO_IO>;
assigned-clock-rates = <12288000>;
- clocks = <&cru CLK_SAI2_MCLKOUT>;
+ clocks = <&cru CLK_SAI2_MCLKOUT_TO_IO>;
clock-names = "mclk";
+ pinctrl-0 = <&sai2m0_mclk>;
+ pinctrl-names = "default";
#sound-dai-cells = <0>;
};
};
--
2.51.2
More information about the linux-arm-kernel
mailing list