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

Commit 7722937f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: Give unique name to gsi endpoints"

parents 89a92d8b ee9b63c1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -779,6 +779,11 @@ static void dwc3_debugfs_create_endpoint_dir(struct dwc3_ep *dep,
	struct dentry		*dir;

	dir = debugfs_create_dir(dep->name, parent);
	if (!dir) {
		pr_err("%s: failed to create dir %s\n", __func__, dep->name);
		return;
	}

	dwc3_debugfs_create_endpoint_files(dep, dir);
}

@@ -984,6 +989,12 @@ void dwc3_debugfs_init(struct dwc3 *dwc)
	dwc->regset->base = dwc->regs - DWC3_GLOBALS_REGS_START;

	root = debugfs_create_dir(dev_name(dwc->dev), NULL);
	if (!root) {
		pr_err("%s: failed to create dir %s\n", __func__,
				dev_name(dwc->dev));
		return;
	}

	dwc->root = root;

	debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset);
+7 −2
Original line number Diff line number Diff line
@@ -2697,6 +2697,7 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)
	u8				epnum;
	u8				out_count;
	u8				in_count;
	u8				idx;
	struct dwc3_ep			*dep;

	in_count = out_count = total / 2;
@@ -2716,11 +2717,15 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)
		/* Reserve EPs at the end for GSI */
		if (!dep->direction && num >
				out_count - NUM_GSI_OUT_EPS - 1) {
			snprintf(dep->name, sizeof(dep->name), "gsi-epout");
			idx = num - (out_count - NUM_GSI_OUT_EPS - 1);
			snprintf(dep->name, sizeof(dep->name), "gsi-epout%d",
					idx);
			dep->endpoint.ep_type = EP_TYPE_GSI;
		} else if (dep->direction && num >
				in_count - NUM_GSI_IN_EPS - 1) {
			snprintf(dep->name, sizeof(dep->name), "gsi-epin");
			idx = num - (in_count - NUM_GSI_IN_EPS - 1);
			snprintf(dep->name, sizeof(dep->name), "gsi-epin%d",
					idx);
			dep->endpoint.ep_type = EP_TYPE_GSI;
		}
	}
+7 −2
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
EXPORT_SYMBOL_GPL(usb_ep_autoconfig_reset);

/**
 * usb_ep_autoconfig_by_name - Used to pick the endpoint by name. eg ep1in-gsi
 * usb_ep_autoconfig_by_name - Used to pick the endpoint by name. eg gsi-epin1
 * @gadget: The device to which the endpoint must belong.
 * @desc: Endpoint descriptor, with endpoint direction and transfer mode
 *	initialized.
@@ -223,8 +223,12 @@ struct usb_ep *usb_ep_autoconfig_by_name(
	struct usb_ep	*ep;
	bool ep_found = false;

	if (!ep_name || !strlen(ep_name))
		goto err;

	list_for_each_entry(ep, &gadget->ep_list, ep_list)
		if (strcmp(ep->name, ep_name) == 0 && !ep->driver_data) {
		if (strncmp(ep->name, ep_name, strlen(ep_name)) == 0 &&
				!ep->driver_data) {
			ep_found = true;
			break;
		}
@@ -239,6 +243,7 @@ struct usb_ep *usb_ep_autoconfig_by_name(
		return ep;
	}

err:
	pr_err("%s:error finding ep %s\n", __func__, ep_name);
	return NULL;
}