build/patch/kernel/archive/sunxi-6.4/patches.megous/phy-phy-rockchip-inno-usb2-Decrease-delay-between-port-init-and.patch

41 lines
1.5 KiB
Diff
Raw Normal View History

From b1395f14646097b4c99c91d25e25d5065985a386 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: [PATCH 356/469] 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 a0bc10aa7961..490cce6e1d40 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -443,7 +443,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);
--
2.34.1