Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4025457pxf; Tue, 23 Mar 2021 00:05:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxinG0OHiqlfbAhoXSNSVemb5RVsuT0Jk/mKl5MIH3rVxCLdRqkJLzC6J9mz0KKflv7RQM X-Received: by 2002:a17:906:a049:: with SMTP id bg9mr3519743ejb.186.1616483149362; Tue, 23 Mar 2021 00:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616483149; cv=none; d=google.com; s=arc-20160816; b=UHfjtN33I1GgoU2j+eZ1vu3iNniKZlRNg3YA+2NdXvDrwaSs+m/7vw5+TVvkA+JGhJ QgqJcT7zTvORLB3Ue+chB+wriSPDY9H+U8eqI/dR7Pye9jlh1d2fd/C8N2ok18V55bYV ZaIswYjM/Hp9/aQIm77O4jdPihyz5Vq/ILHRwaKgTVPVzq3ZpvazdBTYtdAPY64kZ0YZ rAfzppCmBTEh/qBn5opv98FoLG4BodX1n6Kya1xx5RoVLKnqgSW14Iy6qwvZ6mJ3sOBt m736LskbGIW7SXBw0k9B4wUvaBz9+tDWlJuEsMv07ZTXsFIZw2NMJT/51P63Yq2ZfcP6 R3Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=nibj2td0N2H5cdnHy4k+HEXAFLpoqzotXFdYCb+L700=; b=tLfH/xav/Du8Ja29BWDIHvKCX/VOV7Fs+4fArn0redtTjM6H+EvvKRErgcr+JSM76n WfG/095Nqmyel7V/5FgUn0DUoUVnXuVLKQpVwJ2KQ3aeUXsij6vbcqColwKyTTNN7iuB X/4krtjBlkStT70XTq+n6pfhNVQYY7fFRlb3fB0AUr5H8Hcd9zHqG5zAkgesocxrPmJw +vKctWvWNXJj8PDeExP8g8v3/LqI0WFA752Qgf2Wtgl9c/QEGyfh4ajOiLfkh7Fz+gXu /Yyh70rOVz+dnAXDl6EGGCytkpT7WWV/XR508aRNEAx1MhJ3i9xgLJVMlX0l8ZG1nDA5 nN9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si12932249eds.18.2021.03.23.00.05.27; Tue, 23 Mar 2021 00:05:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230205AbhCWHDy (ORCPT + 99 others); Tue, 23 Mar 2021 03:03:54 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:52761 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229464AbhCWHDh (ORCPT ); Tue, 23 Mar 2021 03:03:37 -0400 X-UUID: 188d5105d8ea482ab2f18aa0ecdb5ec3-20210323 X-UUID: 188d5105d8ea482ab2f18aa0ecdb5ec3-20210323 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1216543948; Tue, 23 Mar 2021 15:03:35 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Mar 2021 15:03:13 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 23 Mar 2021 15:03:12 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring , Mathias Nyman CC: Chunfeng Yun , Matthias Brugger , , , , , , Sergei Shtylyov , Eddie Hung , "Nicolas Boichat" Subject: [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm Date: Tue, 23 Mar 2021 15:02:47 +0800 Message-ID: <1616482975-17841-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com> References: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: DD9F8651991F2219FCB74CE67B4205BC3BD452D60A0A435A8210568683BACF6F2000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v2: no changes --- drivers/usb/host/xhci-mtk.c | 3 +++ drivers/usb/host/xhci-mtk.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 1b9f10048fe0..09f2ddbfe8b9 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -388,6 +388,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, @@ -470,6 +472,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); diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h index 621ec1a85009..4ccd08e20a15 100644 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h @@ -149,6 +149,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; -- 2.18.0