balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline-4.19/0000-0063-phy-sun4i-usb-Add-DT-property-to-force-ID-VBUS-polli.patch
Vicentiu Galanopulo 065936bc48 recipes-kernel/linux: Rename linux to linux-mainline
Since the Armbian sources refer to linux 4.19.76 as
being linux-mainline, all the patches from linux-4.19
were moved to linux-mainline_4.19 and the linux_4.19.76
recipes was named accordingly.

This patch makes 4.19.76 as default version for linux

Signed-off-by: Vicentiu Galanopulo <vicentiu@balena.io>
2019-10-10 11:50:45 +02:00

74 lines
2.5 KiB
Diff

From 9a7e926353d5aea2d78ce507ae5bb3537cbccbed Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Tue, 12 Dec 2017 14:04:19 +0100
Subject: [PATCH 63/82] phy: sun4i-usb: Add DT property to force ID/VBUS
polling
In some cases interrupts on GPIO don't fire for whatever reason.
Allow to force polling of ID/VBUS detection pins from DT.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/phy/allwinner/phy-sun4i-usb.c | 44 ++++++++++++++-------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 1f8809bab002..1cbb01c41d8d 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -816,29 +816,31 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
phy_set_drvdata(phy->phy, &data->phys[i]);
}
- data->id_det_irq = gpiod_to_irq(data->id_det_gpio);
- if (data->id_det_irq > 0) {
- ret = devm_request_irq(dev, data->id_det_irq,
- sun4i_usb_phy0_id_vbus_det_irq,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- "usb0-id-det", data);
- if (ret) {
- dev_err(dev, "Err requesting id-det-irq: %d\n", ret);
- return ret;
+ if (!of_find_property(np, "force-poll-vbus-id-det", NULL)) {
+ data->id_det_irq = gpiod_to_irq(data->id_det_gpio);
+ if (data->id_det_irq > 0) {
+ ret = devm_request_irq(dev, data->id_det_irq,
+ sun4i_usb_phy0_id_vbus_det_irq,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "usb0-id-det", data);
+ if (ret) {
+ dev_err(dev, "Err requesting id-det-irq: %d\n", ret);
+ return ret;
+ }
}
- }
- data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio);
- if (data->vbus_det_irq > 0) {
- ret = devm_request_irq(dev, data->vbus_det_irq,
- sun4i_usb_phy0_id_vbus_det_irq,
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- "usb0-vbus-det", data);
- if (ret) {
- dev_err(dev, "Err requesting vbus-det-irq: %d\n", ret);
- data->vbus_det_irq = -1;
- sun4i_usb_phy_remove(pdev); /* Stop detect work */
- return ret;
+ data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio);
+ if (data->vbus_det_irq > 0) {
+ ret = devm_request_irq(dev, data->vbus_det_irq,
+ sun4i_usb_phy0_id_vbus_det_irq,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "usb0-vbus-det", data);
+ if (ret) {
+ dev_err(dev, "Err requesting vbus-det-irq: %d\n", ret);
+ data->vbus_det_irq = -1;
+ sun4i_usb_phy_remove(pdev); /* Stop detect work */
+ return ret;
+ }
}
}
--
2.20.1