bcm53xx: use upstream fix simplifying USB power GPIO usage
authorRafał Miłecki <zajec5@gmail.com>
Thu, 7 Jul 2016 13:06:34 +0000 (15:06 +0200)
committerRafał Miłecki <zajec5@gmail.com>
Thu, 7 Jul 2016 13:07:02 +0000 (15:07 +0200)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
target/linux/bcm53xx/patches-4.4/081-0003-USB-bcma-use-simpler-devm-helper-for-getting-vcc-GPI.patch [new file with mode: 0644]
target/linux/bcm53xx/patches-4.4/197-USB-bcma-add-USB-3.0-support.patch
target/linux/bcm53xx/patches-4.4/810-USB-bcma-use-simpler-devm_gpiod_get.patch [deleted file]

diff --git a/target/linux/bcm53xx/patches-4.4/081-0003-USB-bcma-use-simpler-devm-helper-for-getting-vcc-GPI.patch b/target/linux/bcm53xx/patches-4.4/081-0003-USB-bcma-use-simpler-devm-helper-for-getting-vcc-GPI.patch
new file mode 100644 (file)
index 0000000..840669c
--- /dev/null
@@ -0,0 +1,34 @@
+From 1507372b97a098fd51b92c4dbdbbcd65cba26939 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Wed, 23 Mar 2016 12:37:11 +0100
+Subject: [PATCH] USB: bcma: use simpler devm helper for getting vcc GPIO
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Thanks to switching to devm_gpiod_get:
+1) We don't have to pass fwnode pointer
+2) We can request initial GPIO value at getting call
+This was successfully tested on Netgear R6250 (BCM4708).
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/bcma-hcd.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/host/bcma-hcd.c
++++ b/drivers/usb/host/bcma-hcd.c
+@@ -352,10 +352,8 @@ static int bcma_hcd_probe(struct bcma_de
+       usb_dev->core = core;
+       if (core->dev.of_node)
+-              usb_dev->gpio_desc = devm_get_gpiod_from_child(&core->dev, "vcc",
+-                                                             &core->dev.of_node->fwnode);
+-      if (!IS_ERR_OR_NULL(usb_dev->gpio_desc))
+-              gpiod_direction_output(usb_dev->gpio_desc, 1);
++              usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
++                                                  GPIOD_OUT_HIGH);
+       switch (core->id.id) {
+       case BCMA_CORE_USB20_HOST:
index a906892a5c03468a0903f0b0b886f43af06b5c5f..946b8e5efc71e826daacdc3f8a874e31d89b87a8 100644 (file)
@@ -209,7 +209,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  static int bcma_hcd_probe(struct bcma_device *core)
  {
        int err;
-@@ -364,6 +531,11 @@ static int bcma_hcd_probe(struct bcma_de
+@@ -362,6 +529,11 @@ static int bcma_hcd_probe(struct bcma_de
                if (err)
                        return err;
                break;
@@ -221,7 +221,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
        default:
                return -ENODEV;
        }
-@@ -377,11 +549,14 @@ static void bcma_hcd_remove(struct bcma_
+@@ -375,11 +547,14 @@ static void bcma_hcd_remove(struct bcma_
        struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);
        struct platform_device *ohci_dev = usb_dev->ohci_dev;
        struct platform_device *ehci_dev = usb_dev->ehci_dev;
@@ -236,7 +236,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  
        bcma_core_disable(dev, 0);
  }
-@@ -418,6 +593,7 @@ static int bcma_hcd_resume(struct bcma_d
+@@ -416,6 +591,7 @@ static int bcma_hcd_resume(struct bcma_d
  static const struct bcma_device_id bcma_hcd_table[] = {
        BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_USB20_HOST, BCMA_ANY_REV, BCMA_ANY_CLASS),
        BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_USB20, BCMA_ANY_REV, BCMA_ANY_CLASS),
diff --git a/target/linux/bcm53xx/patches-4.4/810-USB-bcma-use-simpler-devm_gpiod_get.patch b/target/linux/bcm53xx/patches-4.4/810-USB-bcma-use-simpler-devm_gpiod_get.patch
deleted file mode 100644 (file)
index 3779fab..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
-Date: Sat, 2 Jan 2016 11:26:28 +0100
-Subject: [PATCH] USB: bcma: use simpler devm_gpiod_get
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
----
- drivers/usb/host/bcma-hcd.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
---- a/drivers/usb/host/bcma-hcd.c
-+++ b/drivers/usb/host/bcma-hcd.c
-@@ -519,8 +519,7 @@ static int bcma_hcd_probe(struct bcma_de
-       usb_dev->core = core;
-       if (core->dev.of_node)
--              usb_dev->gpio_desc = devm_get_gpiod_from_child(&core->dev, "vcc",
--                                                             &core->dev.of_node->fwnode);
-+              usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc", 0);
-       if (!IS_ERR_OR_NULL(usb_dev->gpio_desc))
-               gpiod_direction_output(usb_dev->gpio_desc, 1);