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

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

Merge "usb: host: Fix passing of xhci-imod-value property to xhci-plat"

parents acf79ec0 e27420f4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1171,6 +1171,10 @@ static int dwc3_probe(struct platform_device *pdev)
				"snps,is-utmi-l1-suspend");
	device_property_read_u8(dev, "snps,hird-threshold",
				&hird_threshold);

	device_property_read_u32(dev, "snps,xhci-imod-value",
			&dwc->xhci_imod_value);

	dwc->usb3_lpm_capable = device_property_read_bool(dev,
				"snps,usb3_lpm_capable");

+2 −0
Original line number Diff line number Diff line
@@ -952,6 +952,7 @@ struct dwc3_scratchpad_array {
 * @imod_interval: set the interrupt moderation interval in 250ns
 *			increments or 0 to disable.
 * @create_reg_debugfs: create debugfs entry to allow dwc3 register dump
 * @xhci_imod_value: imod value to use with xhci
 */
struct dwc3 {
	struct usb_ctrlrequest	*ctrl_req;
@@ -1147,6 +1148,7 @@ struct dwc3 {
	int			last_fifo_depth;
	struct dwc3_gadget_events	dbg_gadget_events;
	bool			create_reg_debugfs;
	u32			xhci_imod_value;
};

/* -------------------------------------------------------------------------- */
+12 −1
Original line number Diff line number Diff line
@@ -52,14 +52,16 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
	return irq;
}

#define NUMBER_OF_PROPS	4
int dwc3_host_init(struct dwc3 *dwc)
{
	struct property_entry	props[3];
	struct property_entry	props[NUMBER_OF_PROPS];
	struct platform_device	*xhci;
	int			ret, irq;
	struct resource		*res;
	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
	int			prop_idx = 0;
	struct property_entry	imod_prop;

	irq = dwc3_host_get_irq(dwc);
	if (irq < 0)
@@ -101,6 +103,15 @@ int dwc3_host_init(struct dwc3 *dwc)
	if (dwc->usb3_lpm_capable)
		props[prop_idx++].name = "usb3-lpm-capable";

	if (dwc->xhci_imod_value) {
		imod_prop.name  = "xhci-imod-value";
		imod_prop.length  = sizeof(u32);
		imod_prop.is_string = false;
		imod_prop.is_array = false;
		imod_prop.value.u32_data = dwc->xhci_imod_value;
		props[prop_idx++] = imod_prop;
	}

	/**
	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
	 * where Port Disable command doesn't work.
+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
		xhci->quirks |= XHCI_BROKEN_PORT_PED;

	if (device_property_read_u32(sysdev, "snps,xhci-imod-value", &imod))
	if (device_property_read_u32(&pdev->dev, "xhci-imod-value", &imod))
		imod = 0;

	if (device_property_read_u32(sysdev, "usb-core-id", &xhci->core_id))