aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-11-12 09:22:11 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:48:28 -0500
commit81f280e22f14d6d976620acaa1b346a90f4e1adc (patch)
tree298db1ef614489451fecdd35439c630c8086a368 /arch/arm
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
[PATCH] USB: pxa27x OHCI - Separate platform code from main driver
To allow multiple platforms to use the PXA27x OHCI driver, the platform code needs to be moved into the board specific files in arch/arm/mach-pxa. This patch does this for mainstone and adds preliminary hooks to allow other boards to use the driver. This has been compile tested for mainstone and successfully run on Spitz (Sharp Zaurus SL-C3000) with the addition of an appropriate board support file. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Nicolas Pitre <nico@cam.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/mainstone.c21
-rw-r--r--arch/arm/mach-pxa/pxa27x.c6
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 07892f4012d8..277498ae5b6c 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -43,6 +43,7 @@
43#include <asm/arch/pxafb.h> 43#include <asm/arch/pxafb.h>
44#include <asm/arch/mmc.h> 44#include <asm/arch/mmc.h>
45#include <asm/arch/irda.h> 45#include <asm/arch/irda.h>
46#include <asm/arch/ohci.h>
46 47
47#include "generic.h" 48#include "generic.h"
48 49
@@ -393,6 +394,25 @@ static struct platform_device *platform_devices[] __initdata = {
393 &mst_flash_device[1], 394 &mst_flash_device[1],
394}; 395};
395 396
397static int mainstone_ohci_init(struct device *dev)
398{
399 /* setup Port1 GPIO pin. */
400 pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
401 pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
402
403 /* Set the Power Control Polarity Low and Power Sense
404 Polarity Low to active low. */
405 UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
406 ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE);
407
408 return 0;
409}
410
411static struct pxaohci_platform_data mainstone_ohci_platform_data = {
412 .port_mode = PMM_PERPORT_MODE,
413 .init = mainstone_ohci_init,
414};
415
396static void __init mainstone_init(void) 416static void __init mainstone_init(void)
397{ 417{
398 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */ 418 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
@@ -424,6 +444,7 @@ static void __init mainstone_init(void)
424 444
425 pxa_set_mci_info(&mainstone_mci_platform_data); 445 pxa_set_mci_info(&mainstone_mci_platform_data);
426 pxa_set_ficp_info(&mainstone_ficp_platform_data); 446 pxa_set_ficp_info(&mainstone_ficp_platform_data);
447 pxa_set_ohci_info(&mainstone_ohci_platform_data);
427} 448}
428 449
429 450
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index c722a9a91fcc..b41b1efaa2cf 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -21,6 +21,7 @@
21#include <asm/hardware.h> 21#include <asm/hardware.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
24#include <asm/arch/ohci.h>
24 25
25#include "generic.h" 26#include "generic.h"
26 27
@@ -194,6 +195,11 @@ static struct platform_device ohci_device = {
194 .resource = pxa27x_ohci_resources, 195 .resource = pxa27x_ohci_resources,
195}; 196};
196 197
198void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
199{
200 ohci_device.dev.platform_data = info;
201}
202
197static struct platform_device *devices[] __initdata = { 203static struct platform_device *devices[] __initdata = {
198 &ohci_device, 204 &ohci_device,
199}; 205};