mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Because USB OTG id irq is disabled during system suspend and enabled after resume, so the usb2 phy doesn't notice any id status change upon resume. It may cause two issues: 1. Plug in OTG cable and USB device when system enter suspend, it will fail to detect the OTG cable and USB device after resume. 2. Plug out OTG cable and USB device when system enter suspend, and then connect USB to PC or USB charger after resume, it will fail to detect USB charge type. This patch restores the OTG id status before enter suspend, and check the id status upon resume, and set the extcon state and vbus if id status has changed. Change-Id: Iaca14841cc287e7d82e1cffd64ff18bba86d3ba4 Signed-off-by: William Wu <william.wu@rock-chips.com>