balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline/armbian/0000-0063-phy-sun4i-usb-Add-DT-property-to-force-ID-VBUS-polli.patch
Vicentiu Galanopulo 7d5f1dbda1 recipes-kernel/linux: Remove unused patches and householding
Some patches were part of other linux-mainline
kernel versions but are not anymore part of the
current 4.19.76.

Move 0001-Enable-uart3-for-NanoPi-Neo-Air-used-by-BT.patch
in linux-mainline_4.19.76.bbappend to avoid error
patching file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
Hunk #2 FAILED at 162.
1 out of 2 hunks FAILED -- rejects in file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts

Place all patches from Armbian in a separate directory and do all the Balena specific
operations in linux-mainline_%.bbappend only.

Changelog-entry: Remove unused patches and cleanup
Signed-off-by: Vicentiu Galanopulo <vicentiu@balena.io>
2019-10-14 09:43:01 +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