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

Commit 74c32cc6 authored by Felipe Balbi's avatar Felipe Balbi Committed by Hemant Kumar
Browse files

usb: dwc3: gadget: cache frame number in struct dwc3_ep



This is in preparation to simplifying prototype of
__dwc3_gadget_kick_transfer().

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 502a37b98a7bd45a198139e52671833469720c38
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
Change-Id: Ibdde571a0975fb18759269e7fa9ffa509d3f1874
parent cbf2565c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -593,6 +593,7 @@ struct dwc3_ep_events {
 * @number: endpoint number (1 - 15)
 * @type: set to bmAttributes & USB_ENDPOINT_XFERTYPE_MASK
 * @resource_index: Resource transfer index
 * @frame_number: set to the frame number we want this transfer to start (ISOC)
 * @interval: the interval on which the ISOC transfer is started
 * @allocated_requests: number of requests allocated
 * @queued_requests: number of requests queued for transfer
@@ -651,6 +652,7 @@ struct dwc3_ep {
	u8			resource_index;
	u32			allocated_requests;
	u32			queued_requests;
	u32			frame_number;
	u32			interval;

	char			name[20];
+2 −5
Original line number Diff line number Diff line
@@ -1419,8 +1419,6 @@ static int __dwc3_gadget_get_frame(struct dwc3 *dwc)
static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
		struct dwc3_ep *dep, u32 cur_uf)
{
	u32 uf;

	if (list_empty(&dep->pending_list)) {
		dev_info(dwc->dev, "%s: ran out of requests\n",
				dep->name);
@@ -1432,9 +1430,8 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
	 * Schedule the first trb for one interval in the future or at
	 * least 4 microframes.
	 */
	uf = cur_uf + max_t(u32, 4, dep->interval);

	__dwc3_gadget_kick_transfer(dep, uf);
	dep->frame_number = cur_uf + max_t(u32, 4, dep->interval);
	__dwc3_gadget_kick_transfer(dep, dep->frame_number);
}

static void dwc3_gadget_start_isoc(struct dwc3 *dwc,