Skip to content

Commit

Permalink
[ARM] 2876/1: N30 - remove task to toggle USB D+ line
Browse files Browse the repository at this point in the history
Patch from Ben Dooks

The n30 machine file is using a kernel thread to change the
state of the USB D+ pull-up resistor, which is not the proper
way to do this. Once the usb-gadget support for the 24xx is
merge, the proper access method will be added.
This patch also removes the problem of using HZ for the
msleep calls, from Nishanth Aravamudan.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Ben Dooks authored and Russell King committed Sep 5, 2005
1 parent 9d88347 commit 027da01
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions arch/arm/mach-s3c2410/mach-n30.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,24 @@ void __init n30_init_irq(void)
s3c24xx_init_irq();
}


static int n30_usbstart_thread(void *unused)
{
/* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */
writel(readl(S3C2410_MISCCR) & ~0x00003008, S3C2410_MISCCR);

/* Turn off the D+ pull up for 3 seconds 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(3*HZ);

s3c2410_gpio_setpin(S3C2410_GPB3, 1);

return 0;
}

/* GPB3 is the line that controls the pull-up for the USB D+ line */

void __init n30_init(void)
{
s3c_device_i2c.dev.platform_data = &n30_i2ccfg;

kthread_run(n30_usbstart_thread, NULL, "n30_usbstart");
/* 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);
}

MACHINE_START(N30, "Acer-N30")
/* Maintainer: Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org> */
/* Maintainer: Christer Weinigel <christer@weinigel.se>,
Ben Dooks <ben-linux@fluff.org>
*/
.phys_ram = S3C2410_SDRAM_PA,
.phys_io = S3C2410_PA_UART,
.io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
Expand Down

0 comments on commit 027da01

Please sign in to comment.