mirror of
https://github.com/armbian/build.git
synced 2025-08-15 15:46:58 +02:00
The old method carried along with board-pbp-add-dp-alt-mode.patch only makes typec work in one(normal) orientation. This patch introduces a proper extcon driver and makes the workaround cleaner, so orientation switch is working. Improvements: - type-c DP on rk3399 works with both orientations - type-c USB 3.0 on rk3399 works with both orientations, with minor issues, see below Caveats: - Powered USB-C hubs may be not recognized, and can be worked around by loading a gadget driver, or manually toggling the mode once for each connection. - Some dual-role devices(phone, tablet) may be not recognized. Affected boards: - TinkerBoard 2/2S - Pinebook Pro - NanoPC T4 - Orange Pi 4 - Orange Pi 4 LTS Tested on tinkerboard 2s. This patch contains other minor fixes for tinker2's device tree, including adding a missing fan node, adding color labels to leds. The 2 patches adding dp support for nanopc t4 and pinebook pro are also updated accordingly. The device trees of Orange Pi 4 / 4 LTS are also updated to match the new implementation.
105 lines
2.5 KiB
Diff
105 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: hyx0329 <hyx0329@outlook.com>
|
|
Date: Mon, 2 Jun 2025 07:33:51 +0000
|
|
Subject: Add dp alt mode to pinebook pro
|
|
|
|
Signed-off-by: hyx0329 <hyx0329@outlook.com>
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 36 +++++++++-
|
|
1 file changed, 33 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
|
|
index 111111111111..222222222222 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
|
|
@@ -373,6 +373,14 @@ mains_charger: dc-charger {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&dc_det_pin>;
|
|
};
|
|
+
|
|
+ typec_extcon_bridge: typec-extcon {
|
|
+ compatible = "linux,typec-extcon-bridge";
|
|
+ usb-role-switch;
|
|
+ orientation-switch;
|
|
+ mode-switch;
|
|
+ svid = /bits/ 16 <0xff01>;
|
|
+ };
|
|
};
|
|
|
|
&cpu_b0 {
|
|
@@ -399,6 +407,12 @@ &cpu_l3 {
|
|
cpu-supply = <&vdd_cpu_l>;
|
|
};
|
|
|
|
+&cdn_dp {
|
|
+ status = "okay";
|
|
+ extcon = <&typec_extcon_bridge>;
|
|
+ phys = <&tcphy0_dp>;
|
|
+};
|
|
+
|
|
&edp {
|
|
force-hpd;
|
|
pinctrl-names = "default";
|
|
@@ -692,6 +706,8 @@ fusb0: fusb30x@22 {
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&fusb0_int_pin>;
|
|
vbus-supply = <&vbus_typec>;
|
|
+ usb-role-switch = <&typec_extcon_bridge>;
|
|
+ extcon = <&typec_extcon_bridge>;
|
|
|
|
connector {
|
|
compatible = "usb-c-connector";
|
|
@@ -700,10 +716,19 @@ connector {
|
|
op-sink-microwatt = <1000000>;
|
|
power-role = "dual";
|
|
sink-pdos =
|
|
- <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
|
|
+ <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
|
|
source-pdos =
|
|
- <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
|
|
+ <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
|
|
try-power-role = "sink";
|
|
+ mode-switch = <&typec_extcon_bridge>;
|
|
+ orientation-switch = <&typec_extcon_bridge>;
|
|
+
|
|
+ altmodes {
|
|
+ dp {
|
|
+ svid = /bits/ 16 <0xff01>;
|
|
+ vdo = <0x1c46>;
|
|
+ };
|
|
+ };
|
|
|
|
ports {
|
|
#address-cells = <1>;
|
|
@@ -970,6 +995,7 @@ spiflash: flash@0 {
|
|
};
|
|
|
|
&tcphy0 {
|
|
+ extcon = <&typec_extcon_bridge>;
|
|
status = "okay";
|
|
};
|
|
|
|
@@ -1003,6 +1029,8 @@ &tsadc {
|
|
|
|
&u2phy0 {
|
|
status = "okay";
|
|
+ extcon = <&typec_extcon_bridge>;
|
|
+ extcon,ignore-usb;
|
|
|
|
u2phy0_otg: otg-port {
|
|
status = "okay";
|
|
@@ -1079,7 +1107,9 @@ &usbdrd3_0 {
|
|
};
|
|
|
|
&usbdrd_dwc3_0 {
|
|
- dr_mode = "host";
|
|
+ dr_mode = "otg";
|
|
+ extcon = <&typec_extcon_bridge>;
|
|
+ snps,usb3-phy-reset-quirk;
|
|
status = "okay";
|
|
};
|
|
|
|
--
|
|
Armbian
|
|
|