Skip to content

Commit 3e4a818

Browse files
alcharkmmind
authored andcommitted
arm64: dts: rockchip: Configure MCLK for analog sound on NanoPi M5
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: 96cbdfd ("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>
1 parent 5ab3dd9 commit 3e4a818

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
pinctrl-names = "default";
202202
pinctrl-0 = <&hp_det_l>;
203203

204+
simple-audio-card,bitclock-master = <&masterdai>;
204205
simple-audio-card,format = "i2s";
205206
simple-audio-card,hp-det-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_LOW>;
206207
simple-audio-card,mclk-fs = <256>;
@@ -218,8 +219,9 @@
218219
sound-dai = <&rt5616>;
219220
};
220221

221-
simple-audio-card,cpu {
222+
masterdai: simple-audio-card,cpu {
222223
sound-dai = <&sai2>;
224+
system-clock-frequency = <12288000>;
223225
};
224226
};
225227
};
@@ -727,10 +729,12 @@
727729
rt5616: audio-codec@1b {
728730
compatible = "realtek,rt5616";
729731
reg = <0x1b>;
730-
assigned-clocks = <&cru CLK_SAI2_MCLKOUT>;
732+
assigned-clocks = <&cru CLK_SAI2_MCLKOUT_TO_IO>;
731733
assigned-clock-rates = <12288000>;
732-
clocks = <&cru CLK_SAI2_MCLKOUT>;
734+
clocks = <&cru CLK_SAI2_MCLKOUT_TO_IO>;
733735
clock-names = "mclk";
736+
pinctrl-0 = <&sai2m0_mclk>;
737+
pinctrl-names = "default";
734738
#sound-dai-cells = <0>;
735739
};
736740
};

0 commit comments

Comments
 (0)