From 59256069acfb3bf0b75b66c22dea1e5b20ecde57 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Tue, 20 Jan 2004 16:46:33 +0000 Subject: [PATCH] [ARM PATCH] 1713/1: pxa2xx_udc (4/5) mach-pxa/lubbock.c updates 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 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index b61d88f5eaa51..7983baf11eab3 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -29,6 +29,7 @@ #include #include +#include #include #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 -- 2.53.0