c824e28317366342368c84b8b74f7f7fe67fac76
[openwrt/staging/blocktrron.git] /
1 From feef7918667b84f9d5653c501542dd8d84ae32af Mon Sep 17 00:00:00 2001
2 From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
3 Date: Sun, 19 Aug 2018 22:20:23 +0300
4 Subject: [PATCH] MIPS: BCM47XX: Enable USB power on Netgear WNDR3400v3
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Setting GPIO 21 high seems to be required to enable power to USB ports
10 on the WNDR3400v3. As there is already similar code for WNR3500L,
11 make the existing USB power GPIO code generic and use that.
12
13 Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
14 Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
15 Signed-off-by: Paul Burton <paul.burton@mips.com>
16 Patchwork: https://patchwork.linux-mips.org/patch/20259/
17 Cc: Rafał Miłecki <zajec5@gmail.com>
18 Cc: linux-mips@linux-mips.org
19 Cc: linux-kernel@vger.kernel.org
20 ---
21 arch/mips/bcm47xx/workarounds.c | 8 +++++---
22 1 file changed, 5 insertions(+), 3 deletions(-)
23
24 --- a/arch/mips/bcm47xx/workarounds.c
25 +++ b/arch/mips/bcm47xx/workarounds.c
26 @@ -5,9 +5,8 @@
27 #include <bcm47xx_board.h>
28 #include <bcm47xx.h>
29
30 -static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
31 +static void __init bcm47xx_workarounds_enable_usb_power(int usb_power)
32 {
33 - const int usb_power = 12;
34 int err;
35
36 err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
37 @@ -23,7 +22,10 @@ void __init bcm47xx_workarounds(void)
38
39 switch (board) {
40 case BCM47XX_BOARD_NETGEAR_WNR3500L:
41 - bcm47xx_workarounds_netgear_wnr3500l();
42 + bcm47xx_workarounds_enable_usb_power(12);
43 + break;
44 + case BCM47XX_BOARD_NETGEAR_WNDR3400_V3:
45 + bcm47xx_workarounds_enable_usb_power(21);
46 break;
47 default:
48 /* No workaround(s) needed */