diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-09 00:40:13 +0200 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-12-06 09:54:10 +0100 |
commit | bc94658fe9c361303245cff7f9798e9453b3baf0 (patch) | |
tree | 15a16d99c9d678a46fda9d6de04f8b406d815a5d /arch | |
parent | c920589f55e7a322278e0529ce07231a10eaaaea (diff) |
gta02: request usb pullup pin before using it.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2442/mach-gta02.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c index 3b99459f4fe..b20a912b991 100644 --- a/arch/arm/mach-s3c2442/mach-gta02.c +++ b/arch/arm/mach-s3c2442/mach-gta02.c @@ -465,11 +465,11 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd) switch (cmd) { case S3C2410_UDC_P_ENABLE: pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__); - gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1); + gpio_set_value(GTA02_GPIO_USB_PULLUP, 1); break; case S3C2410_UDC_P_DISABLE: pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__); - gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0); + gpio_set_value(GTA02_GPIO_USB_PULLUP, 0); break; case S3C2410_UDC_P_RESET: pr_debug("%s S3C2410_UDC_P_RESET\n", __func__); @@ -756,6 +756,19 @@ static void gta02_hijack_gpb(void) s3c24xx_gpios[1].chip.get = gta02_gpb_get; } +static void gta02_request_gpios(void) +{ + int ret; + ret = gpio_request(GTA02_GPIO_USB_PULLUP, "USB pullup"); + if (ret) { + printk(KERN_ERR "Failed to request USB pullup gpio pin: %d\n", ret); + } else { + ret = gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0); + if (ret) + printk(KERN_ERR "Failed to set USB pullup gpio direction: %d\n", ret); + } +} + static void __init gta02_machine_init(void) { /* Set the panic callback to make AUX LED blink at ~5Hz. */ @@ -763,6 +776,8 @@ static void __init gta02_machine_init(void) gta02_hijack_gpb(); + gta02_request_gpios(); + s3c_pm_init(); #ifdef CONFIG_CHARGER_PCF50633 |