mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
usb: gadget: f_cdev: Call function wakeup if func_wakeup_pending is set
Perform function wakeup from cser_resume if func_wakup_pending flag is true. Set it again if the func_wakeup returns -EAGAIN. Change-Id: If056327126e932911e3d832421b6171a50757e55 Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
This commit is contained in:
parent
5caba72586
commit
d44f01f447
1 changed files with 9 additions and 3 deletions
|
|
@ -566,8 +566,13 @@ static void usb_cser_resume(struct usb_function *f)
|
|||
* In that case resume is done by Function Resume request (write).
|
||||
*/
|
||||
if ((cdev->gadget->speed >= USB_SPEED_SUPER) &&
|
||||
port->func_is_suspended)
|
||||
port->func_is_suspended) {
|
||||
if (port->func_wakeup_pending) {
|
||||
ret = usb_func_wakeup(f);
|
||||
port->func_wakeup_pending = (ret == -EAGAIN) ? true : false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("%s\n", __func__);
|
||||
port->is_suspended = false;
|
||||
|
|
@ -1462,9 +1467,10 @@ ssize_t f_cdev_write(struct file *file,
|
|||
spin_unlock_irqrestore(&port->port_lock, flags);
|
||||
|
||||
if (gadget->speed >= USB_SPEED_SUPER
|
||||
&& port->func_is_suspended)
|
||||
&& port->func_is_suspended) {
|
||||
ret = usb_func_wakeup(func);
|
||||
else
|
||||
port->func_wakeup_pending = (ret == -EAGAIN) ? true : false;
|
||||
} else
|
||||
ret = usb_gadget_wakeup(gadget);
|
||||
|
||||
if (ret < 0 && ret != -EACCES && ret != -EAGAIN) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue