aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-10-25 16:43:14 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2015-10-25 16:43:14 +0000
commitfa4395db04e20e5e50b63cdec8b876e22d7e118f (patch)
treebc28783c76a6d20dba287f02a119dd4af04abe8a /target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch
parent6bc864016313e486d8d451a7d1421f11d48cf6a6 (diff)
downloadupstream-fa4395db04e20e5e50b63cdec8b876e22d7e118f.tar.gz
upstream-fa4395db04e20e5e50b63cdec8b876e22d7e118f.tar.bz2
upstream-fa4395db04e20e5e50b63cdec8b876e22d7e118f.zip
bcm53xx: add support basic for kernel 4.3
The files directory is now split up into the files which are needed for every kernel version and the files only needed by kernel 4.1. The files in files-4.1 are already merged into mainline kernel 4.3. This patch only removed patches which were merged into mainline kernel 4.3. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 47251
Diffstat (limited to 'target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch')
-rw-r--r--target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch b/target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch
new file mode 100644
index 0000000000..75932937c0
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.3/198-USB-bcma-fix-setting-VCC-GPIO-value.patch
@@ -0,0 +1,54 @@
+From 7572673e06393b117f87b20b82be0518634d7042 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Sun, 21 Jun 2015 12:09:57 +0200
+Subject: [PATCH v3 6/6] usb: bcma: fix setting VCC GPIO value
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It wasn't working (on most of devices?) without setting GPIO direction
+and wasn't respecting ACTIVE_LOW flag.
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ drivers/usb/host/bcma-hcd.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/host/bcma-hcd.c
++++ b/drivers/usb/host/bcma-hcd.c
+@@ -26,6 +26,7 @@
+ #include <linux/slab.h>
+ #include <linux/of.h>
+ #include <linux/of_gpio.h>
++#include <linux/gpio/consumer.h>
+ #include <linux/usb/ehci_pdriver.h>
+ #include <linux/usb/ohci_pdriver.h>
+ #include <linux/usb/xhci_pdriver.h>
+@@ -231,17 +232,22 @@ static void bcma_hcd_init_chip_arm(struc
+
+ static void bcma_hci_platform_power_gpio(struct bcma_device *dev, bool val)
+ {
++ enum of_gpio_flags of_flags;
+ int gpio;
+
+- gpio = of_get_named_gpio(dev->dev.of_node, "vcc-gpio", 0);
++ gpio = of_get_named_gpio_flags(dev->dev.of_node, "vcc-gpio", 0, &of_flags);
+ if (!gpio_is_valid(gpio))
+ return;
+
+ if (val) {
+- gpio_request(gpio, "bcma-hcd-gpio");
+- gpio_set_value(gpio, 1);
++ unsigned long flags = 0;
++ bool active_low = !!(of_flags & OF_GPIO_ACTIVE_LOW);
++
++ flags |= active_low ? GPIOF_ACTIVE_LOW : 0;
++ flags |= active_low ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH;
++ gpio_request_one(gpio, flags, "bcma-hcd-gpio");
+ } else {
+- gpio_set_value(gpio, 0);
++ gpiod_set_value(gpio_to_desc(gpio), 0);
+ gpio_free(gpio);
+ }
+ }