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

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

Merge "usb: xhci-plat: Add DT parameter to program xhci imod_interval" into msm-4.9

parents 5335d1d8 87283454
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ Optional properties:
	fladj_30mhz_sdbnd signal is invalid or incorrect.
 - snps,disable-clk-gating: If present, disable controller's internal clock
	gating. Default it is enabled.
 - snps,xhci-imod-value: Interrupt moderation interval for host mode
	(in increments of 250nsec).

This is usually a subnode to DWC3 glue to which it is connected.

@@ -65,4 +67,5 @@ dwc3@4a030000 {
	interrupts = <0 92 4>
	usb-phy = <&usb2_phy>, <&usb3,phy>;
	tx-fifo-resize;
	snps,xhci-imod-value = <4000>;
};
+17 −0
Original line number Diff line number Diff line
@@ -200,6 +200,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
	struct clk              *clk;
	int			ret;
	int			irq;
	u32			temp, imod;
	unsigned long		flags;

	if (usb_disabled())
		return -ENODEV;
@@ -308,6 +310,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
	if (device_property_read_bool(sysdev, "usb3-lpm-capable"))
		xhci->quirks |= XHCI_LPM_SUPPORT;

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

	hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
	if (IS_ERR(hcd->usb_phy)) {
		ret = PTR_ERR(hcd->usb_phy);
@@ -331,6 +336,18 @@ static int xhci_plat_probe(struct platform_device *pdev)
	if (ret)
		goto dealloc_usb2_hcd;

	/* override imod interval if specified */
	if (imod) {
		imod &= ER_IRQ_INTERVAL_MASK;
		spin_lock_irqsave(&xhci->lock, flags);
		temp = readl_relaxed(&xhci->ir_set->irq_control);
		temp &= ~ER_IRQ_INTERVAL_MASK;
		temp |= imod;
		writel_relaxed(temp, &xhci->ir_set->irq_control);
		spin_unlock_irqrestore(&xhci->lock, flags);
		dev_dbg(&pdev->dev, "%s: imod set to %u\n", __func__, imod);
	}

	ret = device_create_file(&pdev->dev, &dev_attr_config_imod);
	if (ret)
		dev_err(&pdev->dev, "%s: unable to create imod sysfs entry\n",