From 16e46e0fc12e140dfb0ff82999df168d5e5b2c54 Mon Sep 17 00:00:00 2001 From: Jianing Ren Date: Thu, 28 Nov 2019 09:26:38 +0800 Subject: [PATCH] phy: phy-rockchip-inno-usb2: add EXTCON_USB_HOST working as peripheral We previously registered two extcon notifier in dwc3/dwc3_rockchip.c in kernel-4.4, EXTCON_USB and EXTCON_USB_HOST respectively, so we only need to send EXTCON_USB notifications when acting as a peripheral. In the new kernel 4.19 code, only EXTCON_USB_HOST is registered in dwc3/drd.c. In order to be notified to dwc3 controller as a peripheral, we need to send a EXTCON_USB_HOST notification at the same time. Change-Id: I7507b90c94d35877ce704222a49e8e673a49a162 Signed-off-by: Jianing Ren --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 485bf726dd65..704b881936f5 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1121,11 +1121,12 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work) if (rphy->edev_self && (extcon_get_state(rphy->edev, EXTCON_USB) != - rport->perip_connected)) + rport->perip_connected)) { extcon_set_state_sync(rphy->edev, EXTCON_USB, rport->perip_connected); - + extcon_sync(rphy->edev, EXTCON_USB_HOST); + } if (sch_work) schedule_delayed_work(&rport->otg_sm_work, delay);