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

Commit b8974c4b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_gsi: Fix setting of ep_type for GSI endpoints"

parents 49ee402e 1ccf343c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1089,6 +1089,11 @@ static void gsi_free_trbs(struct usb_ep *ep)
		dep->trb_pool = NULL;
		dep->trb_pool_dma = 0;
		dep->trb_dma_pool = NULL;
		/*
		 * Reset the ep_type to NORMAL, for next compostion
		 * switch which may be non-gsi.
		 */
		dep->endpoint.ep_type = EP_TYPE_NORMAL;
	}
}
/*
@@ -1109,6 +1114,9 @@ static void gsi_configure_ep(struct usb_ep *ep, struct usb_gsi_request *request)

	memset(&params, 0x00, sizeof(params));

	/* Set the ep_type as GSI */
	dep->endpoint.ep_type = EP_TYPE_GSI;

	/* Configure GSI EP */
	params.param0 = DWC3_DEPCFG_EP_TYPE(usb_endpoint_type(desc))
		| DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc));
+7 −4
Original line number Diff line number Diff line
@@ -408,12 +408,15 @@ static void dwc3_free_trb_pool(struct dwc3_ep *dep)
	if (dep->endpoint.ep_type == EP_TYPE_GSI)
		return;

	dma_free_coherent(dwc->dev, sizeof(struct dwc3_trb) * DWC3_TRB_NUM,
			dep->trb_pool, dep->trb_pool_dma);
	if (dep->trb_pool && dep->trb_pool_dma) {
		dma_free_coherent(dwc->dev,
			sizeof(struct dwc3_trb) * DWC3_TRB_NUM, dep->trb_pool,
			dep->trb_pool_dma);

		dep->trb_pool = NULL;
		dep->trb_pool_dma = 0;
	}
}

static int dwc3_gadget_start_config(struct dwc3 *dwc, struct dwc3_ep *dep)
{
+0 −2
Original line number Diff line number Diff line
@@ -2266,7 +2266,6 @@ skip_string_id_alloc:
		ep = usb_ep_autoconfig(cdev->gadget, info->fs_in_desc);
		if (!ep)
			goto fail;
		ep->ep_type = EP_TYPE_GSI;
		gsi->d_port.in_ep = ep;
		ep->driver_data = cdev;	/* claim */
	}
@@ -2275,7 +2274,6 @@ skip_string_id_alloc:
		ep = usb_ep_autoconfig(cdev->gadget, info->fs_out_desc);
		if (!ep)
			goto fail;
		ep->ep_type = EP_TYPE_GSI;
		gsi->d_port.out_ep = ep;
		ep->driver_data = cdev;	/* claim */
	}