From 37fb5ab8934413d1428fddc32ae460c6a70c16e5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 25 Jun 2015 21:33:53 +0000 Subject: bcm53xx: add support for kernel 4.1 This only removes the patches already applied upstream and makes the rest apply cleanly. Signed-off-by: Hauke Mehrtens SVN-Revision: 46128 --- .../813-USB-bcma-fix-setting-VCC-GPIO-value.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 target/linux/bcm53xx/patches-4.1/813-USB-bcma-fix-setting-VCC-GPIO-value.patch (limited to 'target/linux/bcm53xx/patches-4.1/813-USB-bcma-fix-setting-VCC-GPIO-value.patch') diff --git a/target/linux/bcm53xx/patches-4.1/813-USB-bcma-fix-setting-VCC-GPIO-value.patch b/target/linux/bcm53xx/patches-4.1/813-USB-bcma-fix-setting-VCC-GPIO-value.patch new file mode 100644 index 0000000000..9ba3bdeece --- /dev/null +++ b/target/linux/bcm53xx/patches-4.1/813-USB-bcma-fix-setting-VCC-GPIO-value.patch @@ -0,0 +1,45 @@ +From bdc3b01d94b22f8b5f9621a1c37336e78f4f1bce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 21 Jun 2015 12:09:57 +0200 +Subject: [PATCH] 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 +--- + drivers/usb/host/bcma-hcd.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/usb/host/bcma-hcd.c ++++ b/drivers/usb/host/bcma-hcd.c +@@ -230,17 +230,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); + } + } -- cgit v1.2.3