summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3/mtu3_gadget_ep0.c
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2022-07-08 10:19:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-08 15:53:30 +0300
commit1742b765982cd6d9d5e76ba040598981d53e0a0f (patch)
tree01f45c6e9e0e6a5bc4d445425811d2644e09c65b /drivers/usb/mtu3/mtu3_gadget_ep0.c
parent683ff6e485f1d16fe3ad4f5fbd04af11ce917caf (diff)
downloadlinux-1742b765982cd6d9d5e76ba040598981d53e0a0f.tar.xz
usb: mtu3: support function remote wakeup
Add function wake notification to support function remote wakeup, currently assume the composite device only enable function wake for the first interface. Forward request to function driver when the recipient is an interface, including: GetStatus() request to the first interface in a function returns the information about 'function remote wakeup' and 'function remote wakeup capalbe'; SetFeature request of FUNCTION_SUSPEND to an interface recipient, the controller driver saves the suspend option; Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/20220708071903.25752-5-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3/mtu3_gadget_ep0.c')
-rw-r--r--drivers/usb/mtu3/mtu3_gadget_ep0.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/mtu3/mtu3_gadget_ep0.c b/drivers/usb/mtu3/mtu3_gadget_ep0.c
index 7e7013508af6..e4fd1bb14a55 100644
--- a/drivers/usb/mtu3/mtu3_gadget_ep0.c
+++ b/drivers/usb/mtu3/mtu3_gadget_ep0.c
@@ -226,6 +226,8 @@ ep0_get_status(struct mtu3 *mtu, const struct usb_ctrlrequest *setup)
break;
case USB_RECIP_INTERFACE:
+ /* status of function remote wakeup, forward request */
+ handled = 0;
break;
case USB_RECIP_ENDPOINT:
epnum = (u8) le16_to_cpu(setup->wIndex);
@@ -397,10 +399,8 @@ static int ep0_handle_feature(struct mtu3 *mtu,
/* superspeed only */
if (value == USB_INTRF_FUNC_SUSPEND &&
mtu->g.speed >= USB_SPEED_SUPER) {
- /*
- * forward the request because function drivers
- * should handle it
- */
+ /* forward the request for function suspend */
+ mtu->may_wakeup = !!(index & USB_INTRF_FUNC_SUSPEND_RW);
handled = 0;
}
break;