Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c7c30af authored by QCTECMDR Service's avatar QCTECMDR Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_cdev: Add remote wakeup capability from notify_serial_state"

parents cc7ab6ff 8837f666
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -732,13 +732,26 @@ static int usb_cser_notify(struct f_cdev *port, u8 type, u16 value,
static int port_notify_serial_state(struct cserial *cser)
{
	struct f_cdev *port = cser_to_port(cser);
	int status;
	int status, ret;
	unsigned long flags;
	struct usb_composite_dev *cdev = port->port_usb.func.config->cdev;
	struct usb_function *func = &cser->func;
	struct usb_gadget *gadget;

	if (port->is_suspended) {
		gadget = cser->func.config->cdev->gadget;
		port->pending_state_notify = true;
		pr_debug("%s: port is suspended\n", __func__);
		if (usb_cser_get_remote_wakeup_capable(func, gadget)) {
			if (gadget->speed >= USB_SPEED_SUPER && port->func_is_suspended) {
				ret = usb_func_wakeup(func);
				port->func_wakeup_pending = (ret == -EAGAIN) ? true : false;
			} else {
				ret = usb_gadget_wakeup(gadget);
			}
		} else {
			pr_debug("%s remote-wakeup not capable\n", __func__);
		}
		return 0;
	}