mac80211: brcmfmac: backport fixes from the 5.0-rc1
[openwrt/staging/jogo.git] / target / linux / brcm47xx / patches-4.19 / 161-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch
1 From 17cb62255ef8f6b6ac270024204a8fa65537b333 Mon Sep 17 00:00:00 2001
2 From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
3 Date: Sun, 19 Aug 2018 21:23:14 +0300
4 Subject: [PATCH] MIPS: BCM47XX: Enable USB power on Netgear WNDR3400v3
5
6 Setting GPIO 21 high seems to be required to enable power to USB ports
7 on the WNDR3400v3. As there is already similar code for WNR3500L,
8 make the existing USB power GPIO code generic and use that.
9
10 Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
11 ---
12 arch/mips/bcm47xx/workarounds.c | 8 +++++---
13 1 file changed, 5 insertions(+), 3 deletions(-)
14
15 --- a/arch/mips/bcm47xx/workarounds.c
16 +++ b/arch/mips/bcm47xx/workarounds.c
17 @@ -5,9 +5,8 @@
18 #include <bcm47xx_board.h>
19 #include <bcm47xx.h>
20
21 -static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
22 +static void __init bcm47xx_workarounds_enable_usb_power(int usb_power)
23 {
24 - const int usb_power = 12;
25 int err;
26
27 err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
28 @@ -23,7 +22,10 @@ void __init bcm47xx_workarounds(void)
29
30 switch (board) {
31 case BCM47XX_BOARD_NETGEAR_WNR3500L:
32 - bcm47xx_workarounds_netgear_wnr3500l();
33 + bcm47xx_workarounds_enable_usb_power(12);
34 + break;
35 + case BCM47XX_BOARD_NETGEAR_WNDR3400_V3:
36 + bcm47xx_workarounds_enable_usb_power(21);
37 break;
38 default:
39 /* No workaround(s) needed */