summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-11-19 23:28:15 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-11-28 22:58:36 +0100
commit5f629ad7e5f9b99c6d025bf199d402734bd72d0f (patch)
tree099257b25ef362f133f52739a9d3afc33793e6cd /drivers/usb
parentUSB: s3c2410 gadget: allow sharing of vbus irq (diff)
downloadlinux-5f629ad7e5f9b99c6d025bf199d402734bd72d0f.tar.xz
linux-5f629ad7e5f9b99c6d025bf199d402734bd72d0f.zip
USB: s3c2410 gadget: ensure vbus pin in input mode during read
Some CPUs in the S3C24XX series do not support readback of the value of a pin when the pin has been configured to an IRQ. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 5acaddabbe8f..4ce050c3d13f 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1511,7 +1511,11 @@ static irqreturn_t s3c2410_udc_vbus_irq(int irq, void *_dev)
unsigned int value;
dprintk(DEBUG_NORMAL, "%s()\n", __func__);
+
+ /* some cpus cannot read from an line configured to IRQ! */
+ s3c2410_gpio_cfgpin(udc_info->vbus_pin, S3C2410_GPIO_INPUT);
value = s3c2410_gpio_getpin(udc_info->vbus_pin);
+ s3c2410_gpio_cfgpin(udc_info->vbus_pin, S3C2410_GPIO_SFN2);
if (udc_info->vbus_pin_inverted)
value = !value;