chromeos-dwc2-glue.patch 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. diff -rup linux-4.9.95-orig/arch/arm/boot/dts/rk3288.dtsi linux-4.9.95/arch/arm/boot/dts/rk3288.dtsi
  2. --- linux-4.9.95-orig/arch/arm/boot/dts/rk3288.dtsi 2018-04-20 09:21:08.000000000 +0300
  3. +++ linux-4.9.95/arch/arm/boot/dts/rk3288.dtsi 2018-04-21 17:56:26.360024274 +0300
  4. @@ -582,6 +582,9 @@
  5. dr_mode = "host";
  6. phys = <&usbphy2>;
  7. phy-names = "usb2-phy";
  8. + resets = <&cru SRST_USBHOST1_PHY>;
  9. + reset-names = "phy-full-reset";
  10. + snps,need-phy-full-reset-on-wake;
  11. status = "disabled";
  12. };
  13. diff -rup linux-4.9.95-orig/arch/arm/boot/dts/rk3288-veyron.dtsi linux-4.9.95/arch/arm/boot/dts/rk3288-veyron.dtsi
  14. --- linux-4.9.95-orig/arch/arm/boot/dts/rk3288-veyron.dtsi 2018-04-20 09:21:08.000000000 +0300
  15. +++ linux-4.9.95/arch/arm/boot/dts/rk3288-veyron.dtsi 2018-04-21 17:47:25.796011427 +0300
  16. @@ -429,6 +429,7 @@
  17. &usb_host1 {
  18. status = "okay";
  19. + snps,need-phy-for-wake;
  20. };
  21. &usb_otg {
  22. @@ -437,6 +438,7 @@
  23. assigned-clocks = <&cru SCLK_USBPHY480M_SRC>;
  24. assigned-clock-parents = <&usbphy0>;
  25. dr_mode = "host";
  26. + snps,need-phy-for-wake;
  27. };
  28. &vopb {
  29. diff -rup linux-4.9.95-orig/drivers/base/dd.c linux-4.9.95/drivers/base/dd.c
  30. --- linux-4.9.95-orig/drivers/base/dd.c 2018-04-20 09:21:08.000000000 +0300
  31. +++ linux-4.9.95/drivers/base/dd.c 2018-04-21 13:01:30.280037034 +0300
  32. @@ -523,6 +523,9 @@ int driver_probe_device(struct device_dr
  33. bool driver_allows_async_probing(struct device_driver *drv)
  34. {
  35. + if (drv->async_probe)
  36. + return true;
  37. +
  38. switch (drv->probe_type) {
  39. case PROBE_PREFER_ASYNCHRONOUS:
  40. return true;
  41. diff -rup linux-4.9.95-orig/drivers/usb/common/common.c linux-4.9.95/drivers/usb/common/common.c
  42. --- linux-4.9.95-orig/drivers/usb/common/common.c 2018-04-20 09:21:08.000000000 +0300
  43. +++ linux-4.9.95/drivers/usb/common/common.c 2018-04-21 13:36:51.184087441 +0300
  44. @@ -105,6 +105,30 @@ static const char *const usb_dr_modes[]
  45. [USB_DR_MODE_OTG] = "otg",
  46. };
  47. +/**
  48. + * of_usb_get_dr_mode - Get dual role mode for given device_node
  49. + * @np: Pointer to the given device_node
  50. + *
  51. + * The function gets phy interface string from property 'dr_mode',
  52. + * and returns the correspondig enum usb_dr_mode
  53. + */
  54. +enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
  55. +{
  56. + const char *dr_mode;
  57. + int err, i;
  58. +
  59. + err = of_property_read_string(np, "dr_mode", &dr_mode);
  60. + if (err < 0)
  61. + return USB_DR_MODE_UNKNOWN;
  62. +
  63. + for (i = 0; i < ARRAY_SIZE(usb_dr_modes); i++)
  64. + if (!strcmp(dr_mode, usb_dr_modes[i]))
  65. + return i;
  66. +
  67. + return USB_DR_MODE_UNKNOWN;
  68. +}
  69. +EXPORT_SYMBOL_GPL(of_usb_get_dr_mode);
  70. +
  71. static enum usb_dr_mode usb_get_dr_mode_from_string(const char *str)
  72. {
  73. int ret;
  74. diff -rup linux-4.9.95-orig/drivers/usb/core/hub.c linux-4.9.95/drivers/usb/core/hub.c
  75. --- linux-4.9.95-orig/drivers/usb/core/hub.c 2018-04-20 09:21:08.000000000 +0300
  76. +++ linux-4.9.95/drivers/usb/core/hub.c 2018-04-21 17:58:20.456026986 +0300
  77. @@ -3063,13 +3063,14 @@ static int usb_disable_remote_wakeup(str
  78. }
  79. /* Count of wakeup-enabled devices at or below udev */
  80. -static unsigned wakeup_enabled_descendants(struct usb_device *udev)
  81. +unsigned usb_wakeup_enabled_descendants(struct usb_device *udev)
  82. {
  83. struct usb_hub *hub = usb_hub_to_struct_hub(udev);
  84. return udev->do_remote_wakeup +
  85. (hub ? hub->wakeup_enabled_descendants : 0);
  86. }
  87. +EXPORT_SYMBOL_GPL(usb_wakeup_enabled_descendants);
  88. /*
  89. * usb_port_suspend - suspend a usb device's upstream port
  90. @@ -3178,7 +3179,7 @@ int usb_port_suspend(struct usb_device *
  91. * Therefore we will turn on the suspend feature if udev or any of its
  92. * descendants is enabled for remote wakeup.
  93. */
  94. - else if (PMSG_IS_AUTO(msg) || wakeup_enabled_descendants(udev) > 0)
  95. + else if (PMSG_IS_AUTO(msg) || usb_wakeup_enabled_descendants(udev) > 0)
  96. status = set_port_feature(hub->hdev, port1,
  97. USB_PORT_FEAT_SUSPEND);
  98. else {
  99. @@ -3581,7 +3582,7 @@ static int hub_suspend(struct usb_interf
  100. }
  101. if (udev)
  102. hub->wakeup_enabled_descendants +=
  103. - wakeup_enabled_descendants(udev);
  104. + usb_wakeup_enabled_descendants(udev);
  105. }
  106. if (hdev->do_remote_wakeup && hub->quirk_check_port_auto_suspend) {
  107. diff -rup linux-4.9.95-orig/include/linux/device.h linux-4.9.95/include/linux/device.h
  108. --- linux-4.9.95-orig/include/linux/device.h 2018-04-20 09:21:08.000000000 +0300
  109. +++ linux-4.9.95/include/linux/device.h 2018-04-21 13:06:59.172044851 +0300
  110. @@ -270,6 +270,7 @@ struct device_driver {
  111. bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
  112. enum probe_type probe_type;
  113. + bool async_probe;
  114. const struct of_device_id *of_match_table;
  115. const struct acpi_device_id *acpi_match_table;
  116. diff -rup linux-4.9.95-orig/include/linux/of.h linux-4.9.95/include/linux/of.h
  117. --- linux-4.9.95-orig/include/linux/of.h 2018-04-20 09:21:08.000000000 +0300
  118. +++ linux-4.9.95/include/linux/of.h 2018-04-21 18:03:18.492034069 +0300
  119. @@ -521,6 +521,8 @@ const char *of_prop_next_string(struct p
  120. bool of_console_check(struct device_node *dn, char *name, int index);
  121. +enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
  122. +
  123. #else /* CONFIG_OF */
  124. static inline void of_core_init(void)
  125. diff -rup linux-4.9.95-orig/include/linux/usb/hcd.h linux-4.9.95/include/linux/usb/hcd.h
  126. --- linux-4.9.95-orig/include/linux/usb/hcd.h 2018-04-20 09:21:08.000000000 +0300
  127. +++ linux-4.9.95/include/linux/usb/hcd.h 2018-04-21 18:02:33.620033003 +0300
  128. @@ -640,6 +640,7 @@ extern wait_queue_head_t usb_kill_urb_qu
  129. #define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
  130. #ifdef CONFIG_PM
  131. +extern unsigned usb_wakeup_enabled_descendants(struct usb_device *udev);
  132. extern void usb_root_hub_lost_power(struct usb_device *rhdev);
  133. extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
  134. extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);