mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
usb: chipidea: add USB PHY event
Add USB PHY event for below situation: - usb role changed - vbus connect - vbus disconnect - gadget driver is enumerated USB PHY driver can get the last event after above situation occurs and deal with different situations. Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Acked-by: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/20230627110353.1879477-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7713aaf464
commit
b7a62611fa
@@ -281,8 +281,19 @@ static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role)
|
||||
return -ENXIO;
|
||||
|
||||
ret = ci->roles[role]->start(ci);
|
||||
if (!ret)
|
||||
ci->role = role;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ci->role = role;
|
||||
|
||||
if (ci->usb_phy) {
|
||||
if (role == CI_ROLE_HOST)
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_ID);
|
||||
else
|
||||
/* in device mode but vbus is invalid*/
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -296,6 +307,9 @@ static inline void ci_role_stop(struct ci_hdrc *ci)
|
||||
ci->role = CI_ROLE_END;
|
||||
|
||||
ci->roles[role]->stop(ci);
|
||||
|
||||
if (ci->usb_phy)
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
|
||||
}
|
||||
|
||||
static inline enum usb_role ci_role_to_usb_role(struct ci_hdrc *ci)
|
||||
|
||||
Reference in New Issue
Block a user