Loading drivers/usb/dwc3/ep0.c +9 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ MODULE_PARM_DESC(enable_dwc3_u1u2, "Enable support for U1U2 low power modes"); static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep); static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, struct dwc3_ep *dep, struct dwc3_request *req); static int dwc3_ep0_delegate_req(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl); static void dwc3_ep0_prepare_one_trb(struct dwc3_ep *dep, dma_addr_t buf_dma, u32 len, u32 type, bool chain) Loading Loading @@ -332,12 +334,14 @@ static struct dwc3_ep *dwc3_wIndex_to_dep(struct dwc3 *dwc, __le16 wIndex_le) static void dwc3_ep0_status_cmpl(struct usb_ep *ep, struct usb_request *req) { } /* * ch 9.4.5 */ static int dwc3_ep0_handle_status(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) { int ret; struct dwc3_ep *dep; u32 recip; u32 value; Loading Loading @@ -377,7 +381,8 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, * Function Remote Wake Capable D0 * Function Remote Wakeup D1 */ break; ret = dwc3_ep0_delegate_req(dwc, ctrl); return ret; case USB_RECIP_ENDPOINT: dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex); Loading Loading @@ -538,6 +543,9 @@ static int dwc3_ep0_handle_intf(struct dwc3 *dwc, * For now, we're not doing anything, just making sure we return * 0 so USB Command Verifier tests pass without any errors. */ ret = dwc3_ep0_delegate_req(dwc, ctrl); if (ret) return ret; break; default: ret = -EINVAL; Loading drivers/usb/gadget/function/f_gsi.c +9 −0 Original line number Diff line number Diff line Loading @@ -2342,6 +2342,14 @@ static void gsi_resume(struct usb_function *f) log_event_dbg("%s: completed", __func__); } static int gsi_get_status(struct usb_function *f) { unsigned int remote_wakeup_en_status = f->func_wakeup_allowed ? 1 : 0; return (remote_wakeup_en_status << FUNC_WAKEUP_ENABLE_SHIFT) | (1 << FUNC_WAKEUP_CAPABLE_SHIFT); } static int gsi_func_suspend(struct usb_function *f, u8 options) { bool func_wakeup_allowed; Loading Loading @@ -3002,6 +3010,7 @@ static int gsi_bind_config(struct f_gsi *gsi) gsi->function.disable = gsi_disable; gsi->function.free_func = gsi_free_func; gsi->function.suspend = gsi_suspend; gsi->function.get_status = gsi_get_status; gsi->function.func_suspend = gsi_func_suspend; gsi->function.resume = gsi_resume; Loading include/linux/usb/composite.h +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ #define FUNC_SUSPEND_OPT_SUSP_MASK BIT(0) #define FUNC_SUSPEND_OPT_RW_EN_MASK BIT(1) #define FUNC_WAKEUP_CAPABLE_SHIFT 0 #define FUNC_WAKEUP_ENABLE_SHIFT 1 /* * USB function drivers should return USB_GADGET_DELAYED_STATUS if they * wish to delay the data/status stages of the control transfer till they Loading Loading
drivers/usb/dwc3/ep0.c +9 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ MODULE_PARM_DESC(enable_dwc3_u1u2, "Enable support for U1U2 low power modes"); static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep); static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, struct dwc3_ep *dep, struct dwc3_request *req); static int dwc3_ep0_delegate_req(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl); static void dwc3_ep0_prepare_one_trb(struct dwc3_ep *dep, dma_addr_t buf_dma, u32 len, u32 type, bool chain) Loading Loading @@ -332,12 +334,14 @@ static struct dwc3_ep *dwc3_wIndex_to_dep(struct dwc3 *dwc, __le16 wIndex_le) static void dwc3_ep0_status_cmpl(struct usb_ep *ep, struct usb_request *req) { } /* * ch 9.4.5 */ static int dwc3_ep0_handle_status(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) { int ret; struct dwc3_ep *dep; u32 recip; u32 value; Loading Loading @@ -377,7 +381,8 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, * Function Remote Wake Capable D0 * Function Remote Wakeup D1 */ break; ret = dwc3_ep0_delegate_req(dwc, ctrl); return ret; case USB_RECIP_ENDPOINT: dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex); Loading Loading @@ -538,6 +543,9 @@ static int dwc3_ep0_handle_intf(struct dwc3 *dwc, * For now, we're not doing anything, just making sure we return * 0 so USB Command Verifier tests pass without any errors. */ ret = dwc3_ep0_delegate_req(dwc, ctrl); if (ret) return ret; break; default: ret = -EINVAL; Loading
drivers/usb/gadget/function/f_gsi.c +9 −0 Original line number Diff line number Diff line Loading @@ -2342,6 +2342,14 @@ static void gsi_resume(struct usb_function *f) log_event_dbg("%s: completed", __func__); } static int gsi_get_status(struct usb_function *f) { unsigned int remote_wakeup_en_status = f->func_wakeup_allowed ? 1 : 0; return (remote_wakeup_en_status << FUNC_WAKEUP_ENABLE_SHIFT) | (1 << FUNC_WAKEUP_CAPABLE_SHIFT); } static int gsi_func_suspend(struct usb_function *f, u8 options) { bool func_wakeup_allowed; Loading Loading @@ -3002,6 +3010,7 @@ static int gsi_bind_config(struct f_gsi *gsi) gsi->function.disable = gsi_disable; gsi->function.free_func = gsi_free_func; gsi->function.suspend = gsi_suspend; gsi->function.get_status = gsi_get_status; gsi->function.func_suspend = gsi_func_suspend; gsi->function.resume = gsi_resume; Loading
include/linux/usb/composite.h +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ #define FUNC_SUSPEND_OPT_SUSP_MASK BIT(0) #define FUNC_SUSPEND_OPT_RW_EN_MASK BIT(1) #define FUNC_WAKEUP_CAPABLE_SHIFT 0 #define FUNC_WAKEUP_ENABLE_SHIFT 1 /* * USB function drivers should return USB_GADGET_DELAYED_STATUS if they * wish to delay the data/status stages of the control transfer till they Loading