]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: xhci-mtk: support quirk to disable usb2 lpm
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 31 Mar 2021 09:05:53 +0000 (17:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:59:15 +0000 (10:59 +0200)
[ Upstream commit bee1f89aad2a51cd3339571bc8eadbb0dc88a683 ]

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.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1617181553-3503-4-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci-mtk.c
drivers/usb/host/xhci-mtk.h

index 09d5a789fcd5d754f1c3fbbb09c9b46dfd164a69..f4b2e766f195b981875105407464d4bd12abb6f8 100644 (file)
@@ -395,6 +395,8 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
        xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
        if (mtk->lpm_support)
                xhci->quirks |= XHCI_LPM_SUPPORT;
+       if (mtk->u2_lpm_disable)
+               xhci->quirks |= XHCI_HW_LPM_DISABLE;
 
        /*
         * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream,
@@ -467,6 +469,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
                return ret;
 
        mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
+       mtk->u2_lpm_disable = of_property_read_bool(node, "usb2-lpm-disable");
        /* optional property, ignore the error if it does not exist */
        of_property_read_u32(node, "mediatek,u3p-dis-msk",
                             &mtk->u3p_dis_msk);
index cc59d80b663b47513bca11a37c8c4a1c744c696f..1601ca9a388e881b4396ca68fb39e376dbc86339 100644 (file)
@@ -123,6 +123,7 @@ struct xhci_hcd_mtk {
        struct phy **phys;
        int num_phys;
        bool lpm_support;
+       bool u2_lpm_disable;
        /* usb remote wakeup */
        bool uwk_en;
        struct regmap *uwk;