Files
build/patch/kernel/archive/rockchip64-6.16/rk3399-usbc-phy-phy-rockchip-inno-usb2-Decrease-delay-between-po.patch
hyx0329 6e39531b62 rockchip64-6.16: Partial fix of DP alt mode on some rk3399 boards
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.
2025-07-02 12:12:05 +02:00

41 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 30 Jan 2022 23:44:42 +0100
Subject: phy: phy-rockchip-inno-usb2: Decrease delay between port init and
charger detection
When used on systems with TCPM, the charger detection via USB2.0 PHY
will take too much time during boot, so the fusb302 driver will not
be able to get the result, and will set incorrect current_max on
its power supply device.
This will lead to failure to charge when the device is powered up
while connected to non-PD charger.
Decreasing delay of otg_sm_work from 6s to 500ms ensures that
port type detection via the PHY will finish well in time for
TCPM to be able to use its result when Rp=default is detected
via CC pins.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 111111111111..222222222222 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -536,7 +536,7 @@ static int rockchip_usb2phy_init(struct phy *phy)
goto out;
schedule_delayed_work(&rport->otg_sm_work,
- OTG_SCHEDULE_DELAY * 3);
+ msecs_to_jiffies(500));
} else {
/* If OTG works in host only mode, do nothing. */
dev_dbg(&rport->phy->dev, "mode %d\n", rport->mode);
--
Armbian