From 9f424182f4d7f6bab60d91944666ffdeb8d60d17 Mon Sep 17 00:00:00 2001 From: William Wu Date: Mon, 22 May 2023 16:05:13 +0800 Subject: [PATCH] phy: rockchip: inno-usb2: power on phy if linestate is SE1 Some special devices connected to host port, the linestate maybe SE1 (DP/DM both in High level). The below devices are the known special devices Wireless HID: VID = 0xa604, PID = 0x0715 RK3308BS ADB: VID = 0x2207, PID = 0x0006 In order to support these special devices, this patch handle the linestate SE1 as device connected state, and power on the phy if it has already suspended. Change-Id: I55fe83150c18d6c2629fbc857790ef04cdb68da5 Signed-off-by: William Wu --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index f0bf68b32ed2..9d6dbbf4e08c 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -59,6 +59,7 @@ enum rockchip_usb2phy_host_state { PHY_STATE_DISCONNECT = 1, PHY_STATE_CONNECT = 2, PHY_STATE_FS_LS_ONLINE = 4, + PHY_STATE_SE1 = 6, }; /** @@ -1484,6 +1485,15 @@ static void rockchip_usb2phy_sm_work(struct work_struct *work) dev_dbg(&rport->phy->dev, "FS/LS online\n"); } break; + case PHY_STATE_SE1: + if (rport->suspended) { + dev_dbg(&rport->phy->dev, "linestate is SE1, power on phy\n"); + mutex_unlock(&rport->mutex); + rockchip_usb2phy_power_on(rport->phy); + mutex_lock(&rport->mutex); + rport->suspended = false; + } + break; case PHY_STATE_DISCONNECT: if (!rport->suspended) { dev_dbg(&rport->phy->dev, "Disconnected\n");