]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: rockchip: Configure MCLK for analog sound on NanoPi M5
authorAlexey Charkov <alchark@gmail.com>
Mon, 29 Dec 2025 10:11:59 +0000 (14:11 +0400)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 6 Jan 2026 18:36:52 +0000 (19:36 +0100)
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@vger.kernel.org
Signed-off-by: Alexey Charkov <alchark@gmail.com>
Link: https://patch.msgid.link/20251229-rk3576-sound-v1-2-2f59ef0d19b1@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts

index 37184913f91886f7f88f05a9a5dbcbb466a206f1..bb2cc2814b83f2e8ea804ceb51816e53a6f25d93 100644 (file)
                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>;
                        sound-dai = <&rt5616>;
                };
 
-               simple-audio-card,cpu {
+               masterdai: simple-audio-card,cpu {
                        sound-dai = <&sai2>;
+                       system-clock-frequency = <12288000>;
                };
        };
 };
        rt5616: audio-codec@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>;
        };
 };