Skip to content

Commit

Permalink
MIPS: PNX8550: use OHCI platform driver
Browse files Browse the repository at this point in the history
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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Florian Fainelli authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent cfa49b4 commit f2028bd
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion arch/mips/pnx8550/common/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f2028bd

Please sign in to comment.