The xHCI driver support usb2 HW LPM by default, here add support XHCI_HW_LPM_DISABLE quirk, then we can disable usb2 lpm when need it.
Unified · Split
| @@ -411,6 +411,8 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci) · 410 unmodified lines | ||
| 411 | 411 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; |
| 412 | 412 | if (mtk->lpm_support) |
| 413 | 413 | xhci->quirks |= XHCI_LPM_SUPPORT; |
| 414 | + if (mtk->u2_lpm_disable) | |
| 415 | + xhci->quirks |= XHCI_HW_LPM_DISABLE; | |
| 414 | 416 | |
| 415 | 417 | /* |
| 416 | 418 | * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream, |
| @@ -493,6 +495,7 @@ static int xhci_mtk_probe(struct platform_device *pdev) · 76 unmodified lines | ||
| 493 | 495 | return ret; |
| 494 | 496 | |
| 495 | 497 | mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable"); |
| 498 | + mtk->u2_lpm_disable = of_property_read_bool(node, "usb2-lpm-disable"); | |
| 496 | 499 | /* optional property, ignore the error if it does not exist */ |
| 497 | 500 | of_property_read_u32(node, "mediatek,u3p-dis-msk", |
| 498 | 501 | &mtk->u3p_dis_msk); |
| @@ -149,6 +149,7 @@ struct xhci_hcd_mtk { · 148 unmodified lines | ||
| 149 | 149 | struct phy **phys; |
| 150 | 150 | int num_phys; |
| 151 | 151 | bool lpm_support; |
| 152 | + bool u2_lpm_disable; | |
| 152 | 153 | /* usb remote wakeup */ |
| 153 | 154 | bool uwk_en; |
| 154 | 155 | struct regmap *uwk; |