diff options
| author | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
| commit | 1ac731c529cd4d6adbce134754b51ff7d822b145 (patch) | |
| tree | 143ab3f35ca5f3b69f583c84e6964b17139c2ec1 /drivers/usb/dwc3/ep0.c | |
| parent | 07b4c950f27bef0362dc6ad7ee713aab61d58149 (diff) | |
| parent | 54116d442e001e1b6bd482122043b1870998a1f3 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.6 merge window.
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
| -rw-r--r-- | drivers/usb/dwc3/ep0.c | 19 | 
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 61de693461da..953b752a5052 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -30,6 +30,8 @@  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) @@ -356,6 +358,9 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,  				usb_status |= 1 << USB_DEV_STAT_U1_ENABLED;  			if (reg & DWC3_DCTL_INITU2ENA)  				usb_status |= 1 << USB_DEV_STAT_U2_ENABLED; +		} else { +			usb_status |= dwc->gadget->wakeup_armed << +					USB_DEVICE_REMOTE_WAKEUP;  		}  		break; @@ -365,7 +370,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,  		 * Function Remote Wake Capable	D0  		 * Function Remote Wakeup	D1  		 */ -		break; +		return dwc3_ep0_delegate_req(dwc, ctrl);  	case USB_RECIP_ENDPOINT:  		dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex); @@ -476,6 +481,10 @@ static int dwc3_ep0_handle_device(struct dwc3 *dwc,  	switch (wValue) {  	case USB_DEVICE_REMOTE_WAKEUP: +		if (dwc->wakeup_configured) +			dwc->gadget->wakeup_armed = set; +		else +			ret = -EINVAL;  		break;  	/*  	 * 9.4.1 says only for SS, in AddressState only for @@ -510,13 +519,7 @@ static int dwc3_ep0_handle_intf(struct dwc3 *dwc,  	switch (wValue) {  	case USB_INTRF_FUNC_SUSPEND: -		/* -		 * REVISIT: Ideally we would enable some low power mode here, -		 * however it's unclear what we should be doing here. -		 * -		 * 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);  		break;  	default:  		ret = -EINVAL;  |