workarounds.c 628 B

12345678910111213141516171819202122232425262728293031
  1. #include "bcm47xx_private.h"
  2. #include <linux/gpio.h>
  3. #include <bcm47xx_board.h>
  4. #include <bcm47xx.h>
  5. static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
  6. {
  7. const int usb_power = 12;
  8. int err;
  9. err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
  10. if (err)
  11. pr_err("Failed to request USB power gpio: %d\n", err);
  12. else
  13. gpio_free(usb_power);
  14. }
  15. void __init bcm47xx_workarounds(void)
  16. {
  17. enum bcm47xx_board board = bcm47xx_board_get();
  18. switch (board) {
  19. case BCM47XX_BOARD_NETGEAR_WNR3500L:
  20. bcm47xx_workarounds_netgear_wnr3500l();
  21. break;
  22. default:
  23. /* No workaround(s) needed */
  24. break;
  25. }
  26. }