[PATCH v2 2/3] arm64: dts: rockchip: disable unused i2s0 on rk3399-firefly

Yaozhong Li yaozhonguwl at gmail.com
Sun Sep 20 23:34:29 PDT 2026


The board file enables i2s0, but no sound card references it: the
on-board RT5640 is wired to i2s1 and the S/PDIF transmitter has its own
controller. Keeping it enabled starves the other controllers.

The pl330 instance that serves the audio block has six channels:

  dma-pl330 ff6d0000.dma-controller: DBUFF-32x8bytes Num_Chans-6 \
    Num_Peri-12 Num_Events-12

snd_dmaengine_pcm_register() requests the channels named in "dmas" when
the controller probes and holds them until it goes away, so this is
decided per controller and not per card. The demand is i2s0 2 + i2s1 2
+ i2s2 2 + spdif 1 = 7, one controller always loses, and which one
depends on probe order:

  rockchip-spdif ff870000.spdif: Missing dma channel for stream: 0

i2s0 cannot simply be dropped, though. Its pin groups also list
GPIO4_A0, which carries SCLK_I2S_8CH_OUT, the MCLK the codec runs on,
rather than an i2s0 data, bit clock or frame clock signal:

  i2s0-8ch-bus           ... <4 RK_PA0 1 &pcfg_pull_none>
  i2s0-8ch-bus-bclk-off  ... <4 RK_PA0 1 &pcfg_pull_none>
  i2s1-2ch-bus           ... GPIO4_A3..A7 only

  rt5640: rt5640 at 1c {
          clocks = <&cru SCLK_I2S_8CH_OUT>;
          clock-names = "mclk";
  };

Removing the &i2s0 override on its own would therefore leave that pin
unmuxed and analog audio dead. Both changes are required in one step:
disabling i2s0 without splitting out the MCLK pin leaves GPIO4_A0
unmuxed, while giving the new group to i2s1 without disabling i2s0
makes the two controllers contend for the same pin.

rk3399-roc-pc-plus.dts already carries the same i2s_8ch_mclk_pin split.

Measured on a Firefly-RK3399. The pin moves to the controller that
actually drives the codec:

  pin 128 (gpio4-0): ff890000.i2s function i2s1 group i2s-8ch-mclk-pin

The RT5640 and S/PDIF cards then register with no DMA errors, and a
1 kHz tone measured through the codec's internal HPOL/HPOR loopback is
unchanged (L 2135 -> 2138, R 2202 -> 2203), confirming that MCLK still
reaches the codec.

Fixes: 171582e00db1 ("arm64: dts: rockchip: add support for firefly-rk3399 board")
Assisted-by: LLM
Signed-off-by: Yaozhong Li <yaozhonguwl at gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 2fdfdd3..dbc38dd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -628,13 +628,9 @@ accelerometer at 68 {
 	};
 };
 
-&i2s0 {
-	rockchip,playback-channels = <8>;
-	rockchip,capture-channels = <8>;
-	status = "okay";
-};
-
 &i2s1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
 	rockchip,playback-channels = <2>;
 	rockchip,capture-channels = <2>;
 	status = "okay";
@@ -689,6 +685,12 @@ ir_int: ir-int {
 		};
 	};
 
+	i2s1 {
+		i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
+			rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
+		};
+	};
+
 	lcd-panel {
 		lcd_panel_reset: lcd-panel-reset {
 			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
-- 
2.55.0.windows.3




More information about the linux-arm-kernel mailing list