Skip to content

Commit 78c7655

Browse files
Xu Yanggregkh
authored andcommitted
usb: chipidea: udc: add CI_HDRC_CONTROLLER_PULLUP_EVENT event
The device controller will send CI_HDRC_CONTROLLER_PULLUP_EVENT event when it's going to pullup or pulldown data line. Signed-off-by: Xu Yang <[email protected]> Acked-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent df9a825 commit 78c7655

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/usb/chipidea/udc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
19701970
hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
19711971
else
19721972
hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
1973+
1974+
if (ci->platdata->notify_event) {
1975+
_gadget->connected = is_on;
1976+
ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_PULLUP_EVENT);
1977+
}
19731978
pm_runtime_put_sync(ci->dev);
19741979

19751980
return 0;

include/linux/usb/chipidea.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct ci_hdrc_platform_data {
7272
#define CI_HDRC_IMX_HSIC_ACTIVE_EVENT 2
7373
#define CI_HDRC_IMX_HSIC_SUSPEND_EVENT 3
7474
#define CI_HDRC_CONTROLLER_VBUS_EVENT 4
75+
#define CI_HDRC_CONTROLLER_PULLUP_EVENT 5
7576
int (*notify_event) (struct ci_hdrc *ci, unsigned event);
7677
struct regulator *reg_vbus;
7778
struct usb_otg_caps ci_otg_caps;

0 commit comments

Comments
 (0)