[PATCH] USB: rcar-phy: fixup implicit declaration of function 'iowrite32'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Current rcar-phy driver used iowerite32/ioread32,
but it cause compile error on some architectures.
This patch used writel/readl and HAS_IOMEM to solve this issue.

drivers/usb/phy/rcar-phy.c: In function 'rcar_usb_phy_init':
drivers/usb/phy/rcar-phy.c:75:3: error: implicit declaration of function\
	'iowrite32' [-Werror=implicit-function-declaration]
drivers/usb/phy/rcar-phy.c:83:4: error: implicit declaration of function\
	'ioread32' [-Werror=implicit-function-declaration]

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
>> Felipe

Sorry for late response.
Does this patch solve the issue ?

 drivers/usb/phy/Kconfig    |    1 +
 drivers/usb/phy/rcar-phy.c |   26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 7eb73c5..39f920b 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -36,6 +36,7 @@ config MV_U3D_PHY
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB phy support"
 	depends on USB || USB_GADGET
+	depends on HAS_IOMEM
 	select USB_OTG_UTILS
 	help
 	  Say Y here to add support for the Renesas R-Car USB phy driver.
diff --git a/drivers/usb/phy/rcar-phy.c b/drivers/usb/phy/rcar-phy.c
index 792f505..0096660c 100644
--- a/drivers/usb/phy/rcar-phy.c
+++ b/drivers/usb/phy/rcar-phy.c
@@ -72,15 +72,15 @@ static int rcar_usb_phy_init(struct usb_phy *phy)
 		 */
 
 		/* (1) USB-PHY standby release */
-		iowrite32(PHY_ENB, (reg0 + USBPCTRL1));
+		writel(PHY_ENB, (reg0 + USBPCTRL1));
 
 		/* (2) start USB-PHY internal PLL */
-		iowrite32(PHY_ENB | PLL_ENB, (reg0 + USBPCTRL1));
+		writel(PHY_ENB | PLL_ENB, (reg0 + USBPCTRL1));
 
 		/* (3) USB module status check */
 		for (i = 0; i < 1024; i++) {
 			udelay(10);
-			val = ioread32(reg0 + USBST);
+			val = readl(reg0 + USBST);
 			if (val == (ST_ACT | ST_PLL))
 				break;
 		}
@@ -91,10 +91,10 @@ static int rcar_usb_phy_init(struct usb_phy *phy)
 		}
 
 		/* (4) USB-PHY reset clear */
-		iowrite32(PHY_ENB | PLL_ENB | PHY_RST, (reg0 + USBPCTRL1));
+		writel(PHY_ENB | PLL_ENB | PHY_RST, (reg0 + USBPCTRL1));
 
 		/* set platform specific port settings */
-		iowrite32(0x00000000, (reg0 + USBPCTRL0));
+		writel(0x00000000, (reg0 + USBPCTRL0));
 
 		/*
 		 * EHCI IP internal buffer setting
@@ -103,21 +103,21 @@ static int rcar_usb_phy_init(struct usb_phy *phy)
 		 * These are recommended value of a datasheet
 		 * see [USB :: EHCI internal buffer setting]
 		 */
-		iowrite32(0x00ff0040, (reg0 + EIIBC1));
-		iowrite32(0x00ff0040, (reg1 + EIIBC1));
+		writel(0x00ff0040, (reg0 + EIIBC1));
+		writel(0x00ff0040, (reg1 + EIIBC1));
 
-		iowrite32(0x00000001, (reg0 + EIIBC2));
-		iowrite32(0x00000001, (reg1 + EIIBC2));
+		writel(0x00000001, (reg0 + EIIBC2));
+		writel(0x00000001, (reg1 + EIIBC2));
 
 		/*
 		 * Bus alignment settings
 		 */
 
 		/* (1) EHCI bus alignment (little endian) */
-		iowrite32(0x00000000, (reg0 + USBEH0));
+		writel(0x00000000, (reg0 + USBEH0));
 
 		/* (1) OHCI bus alignment (little endian) */
-		iowrite32(0x00000000, (reg0 + USBOH0));
+		writel(0x00000000, (reg0 + USBOH0));
 	}
 
 phy_init_end:
@@ -135,8 +135,8 @@ static void rcar_usb_phy_shutdown(struct usb_phy *phy)
 	spin_lock_irqsave(&priv->lock, flags);
 
 	if (priv->counter-- == 1) { /* last user */
-		iowrite32(0x00000000, (reg0 + USBPCTRL0));
-		iowrite32(0x00000000, (reg0 + USBPCTRL1));
+		writel(0x00000000, (reg0 + USBPCTRL0));
+		writel(0x00000000, (reg0 + USBPCTRL1));
 	}
 
 	spin_unlock_irqrestore(&priv->lock, flags);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux