Thread (1 message) 1 message, 1 author, 2017-10-05

[PATCHv3 2/2] phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800

From: s.nawrocki@samsung.com (Sylwester Nawrocki)
Date: 2017-10-05 12:28:24
Also in: linux-devicetree, linux-samsung-soc

On 10/05/2017 02:11 PM, Andrzej Pietrasiewicz wrote:
+static int crport_handshake(struct exynos5_usbdrd_phy *phy_drd,
+						u32 val, u32 cmd)
+{
+	u32 usec = 100;
+	unsigned int result;
+
+	writel(val | cmd, phy_drd->reg_phy + EXYNOS5_DRD_PHYREG0);
+
+	do {
+		result = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1);
+		if (result & PHYREG1_CR_ACK)
+			break;
+
+		udelay(1);
+	} while (usec-- > 0);
It looks like you could use readl_poll_timeout_atomic() macro 
instead of these polling loops.

-- 
Regards,
Sylwester
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help