linux-mips
[Top] [All Lists]

[PATCH 16/32 v3] MIPS: PNX8550: use OHCI platform driver

To: stern@rowland.harvard.edu
Subject: [PATCH 16/32 v3] MIPS: PNX8550: use OHCI platform driver
From: Florian Fainelli <florian@openwrt.org>
Date: Fri, 5 Oct 2012 18:20:48 +0200
Cc: linux-usb@vger.kernel.org, Florian Fainelli <florian@openwrt.org>, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
In-reply-to: <1349454064-11606-1-git-send-email-florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1349454064-11606-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
Change the PNX8550 platform code to register an ohci-platform driver instead
of ohci-pnx8550 since the ohci-platform is suitable for use.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
No changes in v2 and v3

 arch/mips/pnx8550/common/platform.c |   31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/arch/mips/pnx8550/common/platform.c 
b/arch/mips/pnx8550/common/platform.c
index 5264cc0..0a8faea 100644
--- a/arch/mips/pnx8550/common/platform.c
+++ b/arch/mips/pnx8550/common/platform.c
@@ -20,6 +20,7 @@
 #include <linux/serial.h>
 #include <linux/serial_pnx8xxx.h>
 #include <linux/platform_device.h>
+#include <linux/usb/ohci_pdriver.h>
 
 #include <int.h>
 #include <usb.h>
@@ -96,12 +97,40 @@ static u64 ohci_dmamask = DMA_BIT_MASK(32);
 
 static u64 uart_dmamask = DMA_BIT_MASK(32);
 
+static int pnx8550_usb_ohci_power_on(struct platform_device *pdev)
+{
+       /*
+        * Set register CLK48CTL to enable and 48MHz
+        */
+       outl(0x00000003, PCI_BASE | 0x0004770c);
+
+       /*
+        * Set register CLK12CTL to enable and 48MHz
+        */
+       outl(0x00000003, PCI_BASE | 0x00047710);
+
+       udelay(100);
+
+       return 0;
+}
+
+static void pnx8550_usb_ohci_power_off(struct platform_device *pdev)
+{
+       udelay(10);
+}
+
+static struct usb_ohci_pdata pnx8550_usb_ohci_pdata = {
+       .power_on       = pnx8550_usb_ohci_power_on,
+       .power_off      = pnx8550_usb_ohci_power_off,
+};
+
 static struct platform_device pnx8550_usb_ohci_device = {
-       .name           = "pnx8550-ohci",
+       .name           = "ohci-platform",
        .id             = -1,
        .dev = {
                .dma_mask               = &ohci_dmamask,
                .coherent_dma_mask      = DMA_BIT_MASK(32),
+               .platform_data          = &pnx8550_usb_ohci_pdata,
        },
        .num_resources  = ARRAY_SIZE(pnx8550_usb_ohci_resources),
        .resource       = pnx8550_usb_ohci_resources,
-- 
1.7.9.5


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 16/32 v3] MIPS: PNX8550: use OHCI platform driver, Florian Fainelli <=