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

Commit 627ada2e authored by Aniket Randive's avatar Aniket Randive
Browse files

usb: dwc3: Add support for assignment of GSI EP interrupt number



Add support for the dynamic assignment of gsi endpoint interrupt
number, according to number of gsi hardware endpoints
supported by the hardware. The assignment of EP interrupt
number is removed from f_gsi.c file.

Change-Id: Idd7729e22c76c05cc826bb1d3fce2e4ce253307c
Signed-off-by: default avatarAniket Randive <arandive@codeaurora.org>
parent 961306d1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2660,6 +2660,7 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)
	u8				epnum;
	u8				out_count;
	u8				in_count;
	u8				ep_interrupt_num = 1;

	INIT_LIST_HEAD(&dwc->gadget.ep_list);

@@ -2685,11 +2686,13 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)
			snprintf(dep->name, sizeof(dep->name), "gsi-epout%d",
					num);
			dep->endpoint.ep_type = EP_TYPE_GSI;
			dep->endpoint.ep_intr_num = ep_interrupt_num++;
		} else if (direction &&
				num > in_count - NUM_GSI_IN_EPS(dwc) - 1) {
			snprintf(dep->name, sizeof(dep->name), "gsi-epin%d",
					num);
			dep->endpoint.ep_type = EP_TYPE_GSI;
			dep->endpoint.ep_intr_num = ep_interrupt_num++;
		} else {
			snprintf(dep->name, sizeof(dep->name), "ep%u%s", num,
					direction ? "in" : "out");
+12 −17
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2398,24 +2398,19 @@ static int gsi_set_alt(struct usb_function *f, unsigned int intf,
			}

			/* Configure EPs for GSI */
			if (gsi->d_port.in_ep &&
				gsi->prot_id <= USB_PROT_DIAG_IPA) {
				if (gsi->prot_id == USB_PROT_DIAG_IPA)
					gsi->d_port.in_ep->ep_intr_num = 3;
				else
					gsi->d_port.in_ep->ep_intr_num = 2;
			if (gsi->prot_id <= USB_PROT_DIAG_IPA) {
				if (gsi->d_port.in_ep) {
					usb_gsi_ep_op(gsi->d_port.in_ep,
						&gsi->d_port.in_request,
							GSI_EP_OP_CONFIG);
				}

			if (gsi->d_port.out_ep &&
				gsi->prot_id <= USB_PROT_DIAG_IPA) {
				gsi->d_port.out_ep->ep_intr_num = 1;
				if (gsi->d_port.out_ep) {
					usb_gsi_ep_op(gsi->d_port.out_ep,
						&gsi->d_port.out_request,
							GSI_EP_OP_CONFIG);
				}
			}

			gsi->d_port.gadget = cdev->gadget;