[PATCH 2/4] USB: UHCI: Add support for big endian mmio

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

 



This patch adds support for big endian mmio to the UHCI HCD. Big endian
mmio is supported by adding big endian versions of the uhci_* register
access functions.

Signed-off-by: Jan Andersson <jan@xxxxxxxxxxx>
---
 drivers/usb/host/Kconfig    |    4 ++++
 drivers/usb/host/uhci-hcd.h |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 8898505..ce9e22b 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -416,6 +416,10 @@ config USB_UHCI_SUPPORT_NON_PCI_HC
 	depends on USB_UHCI_HCD
 	default y if SPARC_LEON
 
+config USB_UHCI_BIG_ENDIAN_MMIO
+	bool
+	depends on USB_UHCI_SUPPORT_NON_PCI_HC
+
 config USB_FHCI_HCD
 	tristate "Freescale QE USB Host Controller support"
 	depends on USB && OF_GPIO && QE_GPIO && QUICC_ENGINE
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index c73edd6..04e241f 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -593,4 +593,37 @@ static void uhci_mmio_writeb(const struct uhci_hcd *uhci, u8 val, int reg)
 }
 #endif /* !defined(CONFIG_USB_UHCI_SUPPORT_NON_PCI_HC) */
 
+#if defined(CONFIG_USB_UHCI_BIG_ENDIAN_MMIO)
+/* Functions for big endian memory mapped I/O */
+static u32 uhci_mmio_readl_be(const struct uhci_hcd *uhci, int reg)
+{
+	return readl_be(uhci->regs + reg);
+}
+
+static void uhci_mmio_writel_be(const struct uhci_hcd *uhci, u32 val, int reg)
+{
+	writel_be(val, uhci->regs + reg);
+}
+
+static u16 uhci_mmio_readw_be(const struct uhci_hcd *uhci, int reg)
+{
+	return readw_be(uhci->regs + reg);
+}
+
+static void uhci_mmio_writew_be(const struct uhci_hcd *uhci, u16 val, int reg)
+{
+	writew_be(val, uhci->regs + reg);
+}
+
+static u8 uhci_mmio_readb_be(const struct uhci_hcd *uhci, int reg)
+{
+	return readb_be(uhci->regs + reg);
+}
+
+static void uhci_mmio_writeb_be(const struct uhci_hcd *uhci, u8 val, int reg)
+{
+	writeb_be(val, uhci->regs + reg);
+}
+#endif /* defined(CONFIG_USB_UHCI_BIG_ENDIAN_MMIO) */
+
 #endif
-- 
1.7.0.4

--
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