Skip to content

Commit 86377bf

Browse files
noglitchgregkh
authored andcommitted
usb: gadget: udc: atmel: set vbus irqflags explicitly
commit 6baeda120d90aa637b08f7604de104ab00ce9126 upstream. The driver triggers actions on both edges of the vbus signal. The former PIO controller was triggering IRQs on both falling and rising edges by default. Newer PIO controller don't, so it's better to set it explicitly to IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING. Without this patch we may trigger the connection with host but only on some bouncing signal conditions and thus lose connecting events. Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f72264e commit 86377bf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/usb/gadget/udc/atmel_usba_udc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <asm/gpio.h>
2929

3030
#include "atmel_usba_udc.h"
31+
#define USBA_VBUS_IRQFLAGS (IRQF_ONESHOT \
32+
| IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING)
3133

3234
#ifdef CONFIG_USB_GADGET_DEBUG_FS
3335
#include <linux/debugfs.h>
@@ -2185,7 +2187,7 @@ static int usba_udc_probe(struct platform_device *pdev)
21852187
IRQ_NOAUTOEN);
21862188
ret = devm_request_threaded_irq(&pdev->dev,
21872189
gpio_to_irq(udc->vbus_pin), NULL,
2188-
usba_vbus_irq_thread, IRQF_ONESHOT,
2190+
usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
21892191
"atmel_usba_udc", udc);
21902192
if (ret) {
21912193
udc->vbus_pin = -ENODEV;

0 commit comments

Comments
 (0)