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

Commit 3388c2d1 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa Committed by Matt Wagantall
Browse files

USB: gadget: composite: Don't enable endpoints if already enabled



As part of USBCV complaince, host sends set interface request
after set configuration request. This will reenable the endpoints
which are already enabled. This could cause WARN_ON message by
DCD. Hence check whether config is active or not and allow to call
function driver's set_alt if alternate setting is non zero.

CRs-Fixed: 486281
Change-Id: Id90c50f364b446329a38cd3b7389e4d0638d9023
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
[jackp@codeaurora.org: squashed with 'USB: composite: Fix issue of
 get interface returning wrong altsetting']
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 970625c6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1690,6 +1690,15 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
			break;
		if (w_value && !f->set_alt)
			break;
		/*
		 * We put interfaces in default settings (alt 0)
		 * upon set config#1. Call set_alt for non-zero
		 * alternate setting.
		 */
		if (!w_value && cdev->config && !f->get_alt) {
			value = 0;
			break;
		}
		value = f->set_alt(f, w_index, w_value);
		if (value == USB_GADGET_DELAYED_STATUS) {
			DBG(cdev,