]> git.hungrycats.org Git - linux/commitdiff
[ARM PATCH] 1713/1: pxa2xx_udc (4/5) mach-pxa/lubbock.c updates
authorDavid Brownell <david-b@net.rmk.(none)>
Tue, 20 Jan 2004 16:46:33 +0000 (16:46 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 20 Jan 2004 16:46:33 +0000 (16:46 +0000)
Patch from David Brownell

This adds basic lubbock-specific customization for the UDC driver,
and makes it use INIT_MACHINE.

Depends on the INIT_MACHINE patch and the UDC platform_data patches
(#1, #3 in this series).

Be careful of patch conflicts applying to other kernels, mostly due
to different platform devices being listed.

arch/arm/mach-pxa/lubbock.c

index b61d88f5eaa514ed79b24c2f03b8eac1ea647c91..7983baf11eab38ccaf8aa09e25cdd07e521dc068 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/irq.h>
+#include <asm/arch/udc.h>
 #include <asm/hardware/sa1111.h>
 
 #include "generic.h"
@@ -88,6 +89,16 @@ static void __init lubbock_init_irq(void)
        set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
 }
 
+static int lubbock_udc_is_connected(void)
+{
+       return (LUB_MISC_RD & (1 << 9)) == 0;
+}
+
+static struct pxa2xx_udc_mach_info udc_info __initdata = {
+       .udc_is_connected       = lubbock_udc_is_connected,
+       // no D+ pullup; lubbock can't connect/disconnect in software
+};
+
 static struct resource sa1111_resources[] = {
        [0] = {
                .start  = 0x10000000,
@@ -112,13 +123,12 @@ static struct platform_device *devices[] __initdata = {
        &sa1111_device,
 };
 
-static int __init lubbock_init(void)
+static void __init lubbock_init(void)
 {
-       return platform_add_devices(devices, ARRAY_SIZE(devices));
+       pxa_set_udc_info(&udc_info);
+       (void) platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
-subsys_initcall(lubbock_init);
-
 static struct map_desc lubbock_io_desc[] __initdata = {
  /* virtual     physical    length      type */
   { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE }, /* CPLD */
@@ -157,4 +167,5 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform")
        BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
        MAPIO(lubbock_map_io)
        INITIRQ(lubbock_init_irq)
+       INIT_MACHINE(lubbock_init)
 MACHINE_END