Rafał Miłecki | a2bec07 | 2014-03-21 10:08:08 +0100 | [diff] [blame] | 1 | #include "bcm47xx_private.h" |
| 2 | |
| 3 | #include <linux/gpio.h> |
| 4 | #include <bcm47xx_board.h> |
| 5 | #include <bcm47xx.h> |
| 6 | |
Tuomas Tynkkynen | ba2c41f | 2018-08-19 22:20:23 +0300 | [diff] [blame^] | 7 | static void __init bcm47xx_workarounds_enable_usb_power(int usb_power) |
Rafał Miłecki | a2bec07 | 2014-03-21 10:08:08 +0100 | [diff] [blame] | 8 | { |
Rafał Miłecki | a2bec07 | 2014-03-21 10:08:08 +0100 | [diff] [blame] | 9 | int err; |
| 10 | |
| 11 | err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power"); |
| 12 | if (err) |
| 13 | pr_err("Failed to request USB power gpio: %d\n", err); |
| 14 | else |
| 15 | gpio_free(usb_power); |
| 16 | } |
| 17 | |
| 18 | void __init bcm47xx_workarounds(void) |
| 19 | { |
| 20 | enum bcm47xx_board board = bcm47xx_board_get(); |
| 21 | |
| 22 | switch (board) { |
| 23 | case BCM47XX_BOARD_NETGEAR_WNR3500L: |
Tuomas Tynkkynen | ba2c41f | 2018-08-19 22:20:23 +0300 | [diff] [blame^] | 24 | bcm47xx_workarounds_enable_usb_power(12); |
| 25 | break; |
| 26 | case BCM47XX_BOARD_NETGEAR_WNDR3400_V3: |
| 27 | bcm47xx_workarounds_enable_usb_power(21); |
Rafał Miłecki | a2bec07 | 2014-03-21 10:08:08 +0100 | [diff] [blame] | 28 | break; |
| 29 | default: |
| 30 | /* No workaround(s) needed */ |
| 31 | break; |
| 32 | } |
| 33 | } |