Skip to content

Commit

Permalink
USB: s3c2410 gadget: ensure vbus pin in input mode during read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and Greg Kroah-Hartman committed Nov 28, 2007
1 parent 8802bca commit 5f629ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/usb/gadget/s3c2410_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f629ad

Please sign in to comment.