提交 6baeda12 编写于 作者: N Nicolas Ferre 提交者: Felipe Balbi

usb: gadget: udc: atmel: set vbus irqflags explicitly

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: NLudovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: NNicolas Ferre <nicolas.ferre@microchip.com>
Cc: stable <stable@vger.kernel.org> # v4.4+
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 addfc582
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include "atmel_usba_udc.h" #include "atmel_usba_udc.h"
#define USBA_VBUS_IRQFLAGS (IRQF_ONESHOT \
| IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING)
#ifdef CONFIG_USB_GADGET_DEBUG_FS #ifdef CONFIG_USB_GADGET_DEBUG_FS
#include <linux/debugfs.h> #include <linux/debugfs.h>
...@@ -2361,7 +2363,7 @@ static int usba_udc_probe(struct platform_device *pdev) ...@@ -2361,7 +2363,7 @@ static int usba_udc_probe(struct platform_device *pdev)
IRQ_NOAUTOEN); IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(&pdev->dev, ret = devm_request_threaded_irq(&pdev->dev,
gpio_to_irq(udc->vbus_pin), NULL, gpio_to_irq(udc->vbus_pin), NULL,
usba_vbus_irq_thread, IRQF_ONESHOT, usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS,
"atmel_usba_udc", udc); "atmel_usba_udc", udc);
if (ret) { if (ret) {
udc->vbus_pin = -ENODEV; udc->vbus_pin = -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册