[patch 3/3] s3c2410 gadget: ensure vbus pin in input mode during read
Ben Dooks <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
simtec/simtec-drivers-udc-s3c24xx-vbusfix.patch
(text/plain, 1.3 KB)
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 <[email protected]> Index: linux-2.6.22-simtec19/drivers/usb/gadget/s3c2410_udc.c =================================================================== --- linux-2.6.22-simtec19.orig/drivers/usb/gadget/s3c2410_udc.c +++ linux-2.6.22-simtec19/drivers/usb/gadget/s3c2410_udc.c @@ -1511,7 +1511,11 @@ static irqreturn_t s3c2410_udc_vbus_irq( 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; -- Ben ([email protected], http://www.fluff.org/) 'a smiley only costs 4 bytes' ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel