diff options
Diffstat (limited to 'recipes/linux/linux/acern30/n30-usbstart.patch')
-rw-r--r-- | recipes/linux/linux/acern30/n30-usbstart.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes/linux/linux/acern30/n30-usbstart.patch b/recipes/linux/linux/acern30/n30-usbstart.patch new file mode 100644 index 0000000000..b7479b50e4 --- /dev/null +++ b/recipes/linux/linux/acern30/n30-usbstart.patch @@ -0,0 +1,59 @@ +This patch tries to start the USB gadget in a nice way by +disconnecting and then reconnecting the pull up. + +I ought to use the same callback and configuration as RTP does in +mach-h1940. + +Index: linux-2.6.14/arch/arm/mach-s3c2410/mach-n30.c +=================================================================== +--- linux-2.6.14.orig/arch/arm/mach-s3c2410/mach-n30.c ++++ linux-2.6.14/arch/arm/mach-s3c2410/mach-n30.c +@@ -356,7 +356,33 @@ static void __init n30_init_irq(void) + s3c24xx_init_irq(); + } + +-/* GPB3 is the line that controls the pull-up for the USB D+ line */ ++static int n30_usbstart_thread(void *unused) ++{ ++ /* Disable both USB ports */ ++ s3c2410_modify_misccr(S3C2410_MISCCR_USBSUSPND0 | ++ S3C2410_MISCCR_USBSUSPND1, ++ S3C2410_MISCCR_USBSUSPND0 | ++ S3C2410_MISCCR_USBSUSPND1); ++ ++ /* Turn off the D+ pull up for a few second so that the USB ++ * host at the other end will do a rescan of the USB bus. */ ++ s3c2410_gpio_setpin(S3C2410_GPB3, 0); ++ ++ msleep_interruptible(1 * 1000); ++ ++ /* Enable the USB host port if this is a n30 */ ++ if (machine_is_n30()) ++ s3c2410_modify_misccr(S3C2410_MISCCR_USBSUSPND0, 0); ++ ++ /* Turn off suspend on USB device port and switch it to device ++ * mode. */ ++ s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | ++ S3C2410_MISCCR_USBSUSPND1, 0x0); ++ ++ s3c2410_gpio_setpin(S3C2410_GPB3, 1); ++ ++ return 0; ++} + + static void __init n30_init(void) + { +@@ -380,12 +406,7 @@ static void __init n30_init(void) + msleep(1); + s3c2410_gpio_setpin(S3C2410_GPC5, 1); + +- /* Turn off suspend on both USB ports, and switch the +- * selectable USB port to USB device mode. */ +- +- s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | +- S3C2410_MISCCR_USBSUSPND0 | +- S3C2410_MISCCR_USBSUSPND1, 0x0); ++ kthread_run(n30_usbstart_thread, NULL, "n30_usbstart"); + } + + MACHINE_START(N30, "Acer-N30") |