Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include "bcm47xx_private.h"
0003 
0004 #include <linux/gpio.h>
0005 #include <bcm47xx_board.h>
0006 #include <bcm47xx.h>
0007 
0008 static void __init bcm47xx_workarounds_enable_usb_power(int usb_power)
0009 {
0010     int err;
0011 
0012     err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
0013     if (err)
0014         pr_err("Failed to request USB power gpio: %d\n", err);
0015     else
0016         gpio_free(usb_power);
0017 }
0018 
0019 void __init bcm47xx_workarounds(void)
0020 {
0021     enum bcm47xx_board board = bcm47xx_board_get();
0022 
0023     switch (board) {
0024     case BCM47XX_BOARD_NETGEAR_WNR3500L:
0025     case BCM47XX_BOARD_NETGEAR_WNR3500L_V2:
0026         bcm47xx_workarounds_enable_usb_power(12);
0027         break;
0028     case BCM47XX_BOARD_NETGEAR_WNDR3400V2:
0029     case BCM47XX_BOARD_NETGEAR_WNDR3400_V3:
0030         bcm47xx_workarounds_enable_usb_power(21);
0031         break;
0032     default:
0033         /* No workaround(s) needed */
0034         break;
0035     }
0036 }