082-0001-USB-bcma-initialize-Northstar-USB-3.0-controller.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 3cc7e7b7872ebd0f200b5450f5471bc3700de141 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
  3. Date: Fri, 8 Jul 2016 14:02:50 +0200
  4. Subject: [PATCH] USB: bcma: initialize Northstar USB 3.0 controller
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. It's a rather simple controller, we just need to make sure USB is
  9. powered (using GPIO pin) and reset bus core. Once this is done it's
  10. safe to register XHCI controller and let it init PHY and do its magic.
  11. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  12. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  13. ---
  14. drivers/usb/host/bcma-hcd.c | 19 +++++++++++++++++++
  15. 1 file changed, 19 insertions(+)
  16. --- a/drivers/usb/host/bcma-hcd.c
  17. +++ b/drivers/usb/host/bcma-hcd.c
  18. @@ -27,6 +27,7 @@
  19. #include <linux/slab.h>
  20. #include <linux/of.h>
  21. #include <linux/of_gpio.h>
  22. +#include <linux/of_platform.h>
  23. #include <linux/usb/ehci_pdriver.h>
  24. #include <linux/usb/ohci_pdriver.h>
  25. @@ -338,6 +339,18 @@ err_unregister_ohci_dev:
  26. return err;
  27. }
  28. +static int bcma_hcd_usb30_init(struct bcma_hcd_device *bcma_hcd)
  29. +{
  30. + struct bcma_device *core = bcma_hcd->core;
  31. + struct device *dev = &core->dev;
  32. +
  33. + bcma_core_enable(core, 0);
  34. +
  35. + of_platform_default_populate(dev->of_node, NULL, dev);
  36. +
  37. + return 0;
  38. +}
  39. +
  40. static int bcma_hcd_probe(struct bcma_device *core)
  41. {
  42. int err;
  43. @@ -362,6 +375,11 @@ static int bcma_hcd_probe(struct bcma_de
  44. if (err)
  45. return err;
  46. break;
  47. + case BCMA_CORE_NS_USB30:
  48. + err = bcma_hcd_usb30_init(usb_dev);
  49. + if (err)
  50. + return err;
  51. + break;
  52. default:
  53. return -ENODEV;
  54. }
  55. @@ -416,6 +434,7 @@ static int bcma_hcd_resume(struct bcma_d
  56. static const struct bcma_device_id bcma_hcd_table[] = {
  57. BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_USB20_HOST, BCMA_ANY_REV, BCMA_ANY_CLASS),
  58. BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_USB20, BCMA_ANY_REV, BCMA_ANY_CLASS),
  59. + BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_USB30, BCMA_ANY_REV, BCMA_ANY_CLASS),
  60. {},
  61. };
  62. MODULE_DEVICE_TABLE(bcma, bcma_hcd_table);