aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-10-09 00:40:13 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-05-17 20:59:33 +0200
commit334b5b2914655ebc0fd4ad7949ce6f75221ec755 (patch)
treeb6b6b4ff353b52991b60513e3919a902e79ec4f9 /arch
parentb73c4d16edda334d62be79cf8894a8297ee6fbc7 (diff)
gta02: request usb pullup pin before using it.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 4e705d164c0..c73421cae02 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -463,11 +463,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__);
@@ -808,6 +808,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. */
@@ -815,6 +828,8 @@ static void __init gta02_machine_init(void)
gta02_hijack_gpb();
+ gta02_request_gpios();
+
s3c_pm_init();
#ifdef CONFIG_CHARGER_PCF50633