Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-20 12:08:06 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-20 12:08:20 +0100
commitd8e381103e036c4a809fc99ff3d15b26e90142a0 (patch)
treeb8bd193bdd363fc29453b1bfdc68d17912a883d5
parentc17aa547fa1625cf952f55b51be23d46c264cd2c (diff)
phy: allwinner: sun4i-usb: poll vbus changes on A23/A33 when
driving VBUS (bsc#1051510).
-rw-r--r--patches.drivers/phy-allwinner-sun4i-usb-poll-vbus-changes-on-A23-A33.patch74
-rw-r--r--series.conf1
2 files changed, 75 insertions, 0 deletions
diff --git a/patches.drivers/phy-allwinner-sun4i-usb-poll-vbus-changes-on-A23-A33.patch b/patches.drivers/phy-allwinner-sun4i-usb-poll-vbus-changes-on-A23-A33.patch
new file mode 100644
index 0000000000..9f778f09d9
--- /dev/null
+++ b/patches.drivers/phy-allwinner-sun4i-usb-poll-vbus-changes-on-A23-A33.patch
@@ -0,0 +1,74 @@
+From d7119224bfe6e8efbf821a52db7da9530d790f07 Mon Sep 17 00:00:00 2001
+From: Chen-Yu Tsai <wens@csie.org>
+Date: Fri, 19 Jan 2018 17:25:41 +0800
+Subject: [PATCH] phy: allwinner: sun4i-usb: poll vbus changes on A23/A33 when driving VBUS
+Git-commit: d7119224bfe6e8efbf821a52db7da9530d790f07
+Patch-mainline: v4.17-rc1
+References: bsc#1051510
+
+The AXP223 PMIC, like the AXP221, does not generate VBUS change
+interrupts when N_VBUSEN is used to drive VBUS for the OTG port
+on the board.
+
+This was not noticed until recently, as most A23/A33 boards use
+a GPIO pin that does not support interrupts for OTG ID detection.
+This forces the driver to use polling. However the A33-OlinuXino
+uses a pin that does support interrupts, so the driver uses them.
+However the VBUS interrupt never fires, and the driver never gets
+to update the VBUS status. This results in musb timing out waiting
+for VBUS to rise.
+
+This was worked around for the AXP221 by resorting to polling
+changes in commit 91d96f06a760 ("phy-sun4i-usb: Add workaround for
+missing Vbus det interrupts on A31"). This patch adds the A23 and
+A33 to the list of SoCs that need the workaround.
+
+Fixes: fc1f45ed3043 ("phy-sun4i-usb: Add support for the usb-phys on the sun8i-a33 SoC")
+Fixes: 123dfdbcfaf5 ("phy-sun4i-usb: Add support for the usb-phys on the sun8i-a23 SoC")
+Cc: <stable@vger.kernel.org> # 4.3.x: 68dbc2ce77bb phy-sun4i-usb: Use of_match_node to get model specific config data
+Cc: <stable@vger.kernel.org> # 4.3.x: 5cf700ac9d50 phy: phy-sun4i-usb: Fix optional gpios failing probe
+Cc: <stable@vger.kernel.org> # 4.3.x: 04e59a0211ff phy-sun4i-usb: Fix irq free conditions to match request conditions
+Cc: <stable@vger.kernel.org> # 4.3.x: 91d96f06a760 phy-sun4i-usb: Add workaround for missing Vbus det interrupts on A31
+Cc: <stable@vger.kernel.org> # 4.3.x
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/phy/allwinner/phy-sun4i-usb.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
+index bee798892b21..d4dcd39b8d76 100644
+--- a/drivers/phy/allwinner/phy-sun4i-usb.c
++++ b/drivers/phy/allwinner/phy-sun4i-usb.c
+@@ -411,11 +411,13 @@ static bool sun4i_usb_phy0_poll(struct sun4i_usb_phy_data *data)
+ return true;
+
+ /*
+- * The A31 companion pmic (axp221) does not generate vbus change
+- * interrupts when the board is driving vbus, so we must poll
++ * The A31/A23/A33 companion pmics (AXP221/AXP223) do not
++ * generate vbus change interrupts when the board is driving
++ * vbus using the N_VBUSEN pin on the pmic, so we must poll
+ * when using the pmic for vbus-det _and_ we're driving vbus.
+ */
+- if (data->cfg->type == sun6i_a31_phy &&
++ if ((data->cfg->type == sun6i_a31_phy ||
++ data->cfg->type == sun8i_a33_phy) &&
+ data->vbus_power_supply && data->phys[0].regulator_on)
+ return true;
+
+@@ -886,7 +888,7 @@ static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = {
+
+ static const struct sun4i_usb_phy_cfg sun8i_a23_cfg = {
+ .num_phys = 2,
+- .type = sun4i_a10_phy,
++ .type = sun6i_a31_phy,
+ .disc_thresh = 3,
+ .phyctl_offset = REG_PHYCTL_A10,
+ .dedicated_clocks = true,
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index cf26e1148f..2045b5449f 100644
--- a/series.conf
+++ b/series.conf
@@ -14840,6 +14840,7 @@
patches.fixes/0001-xhci-zero-usb-device-slot_id-member-when-disabling-a.patch
patches.drivers/phy-qcom-qmp-Fix-phy-pipe-clock-gating.patch
patches.drivers/phy-rockchip-emmc-retry-calpad-busy-trimming.patch
+ patches.drivers/phy-allwinner-sun4i-usb-poll-vbus-changes-on-A23-A33.patch
patches.drivers/USB-serial-ftdi_sio-add-RT-Systems-VX-8-cable.patch
patches.drivers/USB-serial-cp210x-add-ELDAT-Easywave-RX09-id.patch
patches.drivers/USB-serial-ftdi_sio-add-support-for-Harman-FirmwareH.patch