From: Yaozhong Li <yaozhonguwl@gmail.com>
To: heiko@sntech.de
Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] arm64: dts: rockchip: fix analog headphone output on rk3399-firefly
Date: Mon, 21 Sep 2026 14:34:28 +0800 [thread overview]
Message-ID: <20260921063431.103-2-yaozhonguwl@gmail.com> (raw)
In-Reply-To: <20260921063431.103-1-yaozhonguwl@gmail.com>
The analog headphone jack on this board has never produced any sound
with a mainline kernel.
GPIO4_C5 has to be high for audio to reach the jack. The board file
muxes the pin to GPIO through the rt5640_hpcon pinctrl group and
references that group from the codec node, but nothing ever requests or
drives the line:
pin 149 (gpio4-21): 1-001c (GPIO UNCLAIMED) function rt5640 \
group rt5640-hpcon
It therefore stays an input and reads low. The vendor tree drives it
from a hp-con-gpio property that was dropped during review of the
original board submission because it is not part of the RT5640 binding,
but the pinmux half was kept, leaving the description incomplete.
Describe it the way rk3399-roc-pc-plus.dts already describes the
equivalent signal, as a simple-audio-amplifier auxiliary component, so
that DAPM asserts the GPIO while the headphone path is active. That
board's DTS carries the same caveat in a comment: the binding is used
because it expresses a DAPM-controlled output enable, not because the
hardware is necessarily an amplifier.
Measured on a Firefly-RK3399 by toggling only this line while a 1 kHz
tone kept playing, with the playback PCM in state: RUNNING throughout:
high -> audible, low -> silent, high -> audible
With this change the line is claimed and follows the audio path:
pin 149 (gpio4-21): headphones-amp gpio4:149
idle: gpio-21 (|enable) out lo
playing: gpio-21 (|enable) out hi
Fixes: 171582e00db1 ("arm64: dts: rockchip: add support for firefly-rk3399 board")
Assisted-by: LLM
Signed-off-by: Yaozhong Li <yaozhonguwl@gmail.com>
---
.../arm64/boot/dts/rockchip/rk3399-firefly.dts | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 0568dfa..2fdfdd3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -96,6 +96,15 @@ key-power {
};
};
+ /* GPIO that enables the headphone output path */
+ headphones_amp: headphones-amp {
+ compatible = "simple-audio-amplifier";
+ pinctrl-names = "default";
+ pinctrl-0 = <&rt5640_hpcon>;
+ enable-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
+ sound-name-prefix = "Headphone Amp";
+ };
+
ir-receiver {
compatible = "gpio-ir-receiver";
gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
@@ -132,8 +141,11 @@ rt5640-sound {
simple-audio-card,routing =
"Mic Jack", "MICBIAS1",
"IN1P", "Mic Jack",
- "Headphone Jack", "HPOL",
- "Headphone Jack", "HPOR";
+ "Headphone Amp INL", "HPOL",
+ "Headphone Amp INR", "HPOR",
+ "Headphone Jack", "Headphone Amp OUTL",
+ "Headphone Jack", "Headphone Amp OUTR";
+ simple-audio-card,aux-devs = <&headphones_amp>;
simple-audio-card,cpu {
sound-dai = <&i2s1>;
@@ -547,8 +559,6 @@ rt5640: rt5640@1c {
clock-names = "mclk";
realtek,in1-differential;
#sound-dai-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&rt5640_hpcon>;
};
};
--
2.55.0.windows.3
next prev parent reply other threads:[~2026-09-21 6:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 6:34 [PATCH v2 0/3] arm64: dts: rockchip: fix audio on Firefly-RK3399 Yaozhong Li
2026-09-21 6:34 ` Yaozhong Li [this message]
2026-09-21 6:34 ` [PATCH v2 2/3] arm64: dts: rockchip: disable unused i2s0 on rk3399-firefly Yaozhong Li
2026-09-21 6:34 ` [PATCH v2 3/3] arm64: dts: rockchip: enable HDMI audio " Yaozhong Li
2026-10-04 21:17 ` [PATCH v2 0/3] arm64: dts: rockchip: fix audio on Firefly-RK3399 Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921063431.103-2-yaozhonguwl@gmail.com \
--to=yaozhonguwl@gmail.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox