summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci.h
diff options
context:
space:
mode:
authorBecky Bruce <beckyb@kernel.crashing.org>2010-06-30 13:05:44 -0500
committerRemy Bohmer <linux@bohmer.net>2010-06-30 21:38:10 +0200
commita5496a180b3b6fd9feac6dc51822167892879470 (patch)
tree36b526967641fd6036b2a307ef915c2ac5bd9bcc /drivers/usb/host/ohci.h
parent944a4894c047f9fc17d21f1e4ca92d5909b8405b (diff)
downloadu-boot-imx-a5496a180b3b6fd9feac6dc51822167892879470.zip
u-boot-imx-a5496a180b3b6fd9feac6dc51822167892879470.tar.gz
u-boot-imx-a5496a180b3b6fd9feac6dc51822167892879470.tar.bz2
drivers/usb/host/ohci-hcd: rename readl/writel to ohci_readl/ohci_writel
This avoids a build warning that you see if anyone in the header chain has included io.h (which is coming shortly). The previous code redefined readl/writel; this patch renames it to be specific to ohci. The defines are also moved from ohci-hcd.c to ohci.h. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Diffstat (limited to 'drivers/usb/host/ohci.h')
-rw-r--r--drivers/usb/host/ohci.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 79aa79d..d977e8f 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -7,6 +7,17 @@
* usb-ohci.h
*/
+/*
+ * e.g. PCI controllers need this
+ */
+#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
+# define ohci_readl(a) __swap_32(*((volatile u32 *)(a)))
+# define ohci_writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a))
+#else
+# define ohci_readl(a) (*((volatile u32 *)(a)))
+# define ohci_writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
+#endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */
+
/* functions for doing board or CPU specific setup/cleanup */
extern int usb_board_init(void);
extern int usb_board_stop(void);
@@ -196,8 +207,8 @@ struct ohci_hcca {
/*
* This is the structure of the OHCI controller's memory mapped I/O
- * region. This is Memory Mapped I/O. You must use the readl() and
- * writel() macros defined in asm/io.h to access these!!
+ * region. This is Memory Mapped I/O. You must use the ohci_readl() and
+ * ohci_writel() macros defined in this file to access these!!
*/
struct ohci_regs {
/* control and status registers */