diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2014-07-24 19:55:37 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-28 07:35:01 +0200 |
commit | 92466472c2116b93ef5ed957a559fe84b9d88c80 (patch) | |
tree | f430714a3f80cf46579d3f92ee3951b8ca2d607b | |
parent | b8d2d4923f199d25d6465e3ef09a90ca420ca3f7 (diff) | |
download | barebox-92466472c2116b93ef5ed957a559fe84b9d88c80.tar.gz barebox-92466472c2116b93ef5ed957a559fe84b9d88c80.tar.xz |
usb: ehci: use linux-way ehci_readl and ehci_writel
Also drop nowhere defined CONFIG_EHCI_DESC_BIG_ENDIAN.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/usb/host/ehci.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 8cc477aa4f..d71d0565e8 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -18,6 +18,8 @@ #ifndef USB_EHCI_H #define USB_EHCI_H +#include <io.h> + #if !defined(CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 16 #endif @@ -68,14 +70,15 @@ struct ehci_hcor { #define USBMODE_CM_HC (3 << 0) /* host controller mode */ #define USBMODE_CM_IDLE (0 << 0) /* idle state */ -#if defined CONFIG_EHCI_DESC_BIG_ENDIAN -#define ehci_readl(x) (*((volatile u32 *)(x))) -#define ehci_writel(a, b) (*((volatile u32 *)(a)) = ((volatile u32)b)) -#else -#define ehci_readl(x) cpu_to_le32((*((volatile u32 *)(x)))) -#define ehci_writel(a, b) (*((volatile u32 *)(a)) = \ - cpu_to_le32(((volatile u32)b))) -#endif +static inline void ehci_writel(__u32 __iomem *regs, const unsigned int val) +{ + writel(val, regs); +} + +static inline unsigned int ehci_readl(__u32 __iomem *regs) +{ + return readl(regs); +} #if defined CONFIG_EHCI_MMIO_BIG_ENDIAN #define hc32_to_cpu(x) be32_to_cpu((x)) |