kernel: update 4.4 kernel to 4.4.42
[openwrt/staging/dedeckeh.git] / target / linux / bcm53xx / patches-4.4 / 180-usb-xhci-add-support-for-performing-fake-doorbell.patch
index 0e8a65a182f348b8d828f260e3ce09f024268cd6..f5a7f37a498926a6da8de8d6c8272c3fe9394b9f 100644 (file)
@@ -1,40 +1,22 @@
-From 37df205cdb69d17d5e815385fc1af3c97d1fe20b Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
 Date: Sat, 1 Oct 2016 22:54:48 +0200
 Subject: [PATCH] usb: xhci: add support for performing fake doorbell
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
 
 Broadcom's Northstar XHCI controllers seem to need a special start
-procedure to work correctly. There isn't any official documentation on
+procedure to work correctly. There isn't any official documentation of
 this, the problem is that controller doesn't detect any connected
 devices with default setup. Moreover connecting USB device to controller
 that doesn't run properly can cause SoC's watchdog issues.
 
 A workaround that was successfully tested on multiple devices is to
-perform a fake doorbell. This patch adds code for doing that and a DT
-binding enabling it.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+perform a fake doorbell. This patch adds code for doing this and enables
+it on BCM4708 family.
 ---
- Documentation/devicetree/bindings/usb/usb-xhci.txt |  2 +
- drivers/usb/host/xhci-plat.c                       |  6 +++
- drivers/usb/host/xhci.c                            | 63 ++++++++++++++++++++--
- drivers/usb/host/xhci.h                            |  1 +
- 4 files changed, 69 insertions(+), 3 deletions(-)
+ drivers/usb/host/xhci-plat.c |  6 +++++
+ drivers/usb/host/xhci.c      | 63 +++++++++++++++++++++++++++++++++++++++++---
+ drivers/usb/host/xhci.h      |  1 +
+ 3 files changed, 67 insertions(+), 3 deletions(-)
 
---- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
-+++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
-@@ -12,6 +12,8 @@ Required properties:
- Optional properties:
-   - clocks: reference to a clock
-   - usb3-lpm-capable: determines if platform is USB3 LPM capable
-+  - usb3-fake-doorbell: determines if controller requires a fake doorbell when
-+                      starting it
- Example:
-       usb@f0931000 {
 --- a/drivers/usb/host/xhci-plat.c
 +++ b/drivers/usb/host/xhci-plat.c
 @@ -38,12 +38,18 @@ static const struct xhci_driver_override
@@ -51,7 +33,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
         */
        xhci->quirks |= XHCI_PLAT;
 +
-+      if (node && of_property_read_bool(node, "usb3-fake-doorbell"))
++      if (node && of_machine_is_compatible("brcm,bcm4708"))
 +              xhci->quirks |= XHCI_FAKE_DOORBELL;
  }
  
@@ -145,11 +127,11 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  /*
 --- a/drivers/usb/host/xhci.h
 +++ b/drivers/usb/host/xhci.h
-@@ -1631,6 +1631,7 @@ struct xhci_hcd {
- /* For controllers with a broken beyond repair streams implementation */
+@@ -1635,6 +1635,7 @@ struct xhci_hcd {
  #define XHCI_BROKEN_STREAMS   (1 << 19)
  #define XHCI_PME_STUCK_QUIRK  (1 << 20)
-+#define XHCI_FAKE_DOORBELL    (1 << 24)
+ #define XHCI_MISSING_CAS      (1 << 24)
++#define XHCI_FAKE_DOORBELL    (1 << 25)
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
        /* There are two roothubs to keep track of bus suspend info for */