1
0
Fork 0

MLK-13308-1 usb: chipidea: udc: add USB PHY event

Add USB PHY event for below situation:
- vbus connect
- vbus disconnect
- gadget driver is enumerated

USB PHY driver can get the last event after above situation
occurs.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2016-10-18 16:32:04 +08:00 committed by Dong Aisheng
parent 14bc08c6ab
commit ae54db9905
1 changed files with 10 additions and 0 deletions

View File

@ -1543,6 +1543,13 @@ static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
/* Charger Detection */
ci_usb_charger_connect(ci, is_active);
if (ci->usb_phy) {
if (is_active)
usb_phy_set_event(ci->usb_phy, USB_EVENT_VBUS);
else
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
}
if (gadget_ready)
ci_hdrc_gadget_connect(_gadget, is_active);
@ -1857,6 +1864,9 @@ static irqreturn_t udc_irq(struct ci_hdrc *ci)
if (USBi_PCI & intr) {
ci->gadget.speed = hw_port_is_high_speed(ci) ?
USB_SPEED_HIGH : USB_SPEED_FULL;
if (ci->usb_phy)
usb_phy_set_event(ci->usb_phy,
USB_EVENT_ENUMERATED);
if (ci->suspended) {
if (ci->driver->resume) {
spin_unlock(&ci->lock);