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

Commit 98c9ff05 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: phy: qusb: Add tune2 module param to override TUNE2 value



QUSB PHY needs fine tuning of TUNE2 value. Hence add tune2 module
param to override default TUNE value when it is needed.

Change-Id: If986cae7d7812a87869fcb2b631fd37f7bbfb126
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 630fdcc6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -93,6 +93,10 @@

#define HS_PHY_CTRL_REG			0x10

unsigned int tune2;
module_param(tune2, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(tune2, "QUSB PHY TUNE2");

struct qusb_phy {
	struct usb_phy		phy;
	void __iomem		*base;
@@ -573,6 +577,15 @@ static int qusb_phy_init(struct usb_phy *phy)
			writel_relaxed(qphy->tune2_val,
					qphy->base + QUSB2PHY_PORT_TUNE2);
		}

		/* If tune2 modparam set, override tune2 value */
		if (tune2) {
			pr_debug("%s(): (modparam) TUNE2 val:0x%02x\n",
							__func__, tune2);
			writel_relaxed(tune2,
					qphy->base + QUSB2PHY_PORT_TUNE2);
		}

		/* ensure above writes are completed before re-enabling PHY */
		wmb();