0044-ar71xx-Send-power-to-USB-port-on-WNR2200.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 29 May 2016 11:37:08 +0200
  3. Subject: ar71xx: Send power to USB port on WNR2200
  4. This patch fixes ticket #15267 by enabling power on the
  5. WNR2200's USB port. At present, the USB port on the WNR2200
  6. is non-functional due to it not receiving power.
  7. This patch defines an additional GPIO pin, but none of the
  8. current GPIO definitions have been modified.
  9. Signed-off-by: Riley Baird <BM-2cVqnDuYbAU5do2DfJTrN7ZbAJ246S4XiX@bitmessage.ch>
  10. Backport of r47236
  11. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c
  12. index 0087cac..5d23f21 100644
  13. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c
  14. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c
  15. @@ -36,7 +36,7 @@
  16. #define WNR2200_GPIO_LED_LAN4_GREEN 16
  17. #define WNR2200_GPIO_LED_PWR_AMBER 21
  18. #define WNR2200_GPIO_LED_PWR_GREEN 22
  19. -
  20. +#define WNR2200_GPIO_USB_5V 4
  21. #define WNR2200_GPIO_USB_POWER 24
  22. #define WNR2200_KEYS_POLL_INTERVAL 20 /* msecs */
  23. @@ -128,9 +128,9 @@ static void __init wnr2200_setup(void)
  24. wnr2200_leds_gpio);
  25. /* enable power for the USB port */
  26. - gpio_request_one(WNR2200_GPIO_USB_POWER,
  27. - GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
  28. - "USB power");
  29. + ap9x_pci_setup_wmac_gpio(0,
  30. + BIT(WNR2200_GPIO_USB_5V),
  31. + BIT(WNR2200_GPIO_USB_5V));
  32. ath79_register_usb();
  33. }