All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Eddie Hung <eddie.hung@mediatek.com>,
	"Nicolas Boichat" <drinkcat@chromium.org>
Subject: [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm
Date: Tue, 23 Mar 2021 15:02:47 +0800	[thread overview]
Message-ID: <1616482975-17841-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com>

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>
---
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


WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	 <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Eddie Hung <eddie.hung@mediatek.com>,
	"Nicolas Boichat" <drinkcat@chromium.org>
Subject: [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm
Date: Tue, 23 Mar 2021 15:02:47 +0800	[thread overview]
Message-ID: <1616482975-17841-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com>

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>
---
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
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	 <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Eddie Hung <eddie.hung@mediatek.com>,
	"Nicolas Boichat" <drinkcat@chromium.org>
Subject: [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm
Date: Tue, 23 Mar 2021 15:02:47 +0800	[thread overview]
Message-ID: <1616482975-17841-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1616482975-17841-1-git-send-email-chunfeng.yun@mediatek.com>

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>
---
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-03-23  7:04 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  7:02 [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable Chunfeng Yun
2021-03-23  7:02 ` Chunfeng Yun
2021-03-23  7:02 ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 02/13] dt-bindings: usb: mtk-xhci: add support wakeup for mt8183 and mt8192 Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-27 17:26   ` Rob Herring
2021-03-27 17:26     ` Rob Herring
2021-03-27 17:26     ` Rob Herring
2021-03-23  7:02 ` [PATCH v2 03/13] dt-bindings: usb: mtu3: " Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-27 17:28   ` Rob Herring
2021-03-27 17:28     ` Rob Herring
2021-03-27 17:28     ` Rob Herring
2021-03-23  7:02 ` [PATCH v2 04/13] usb: xhci-mtk: fix broken streams issue on 0.96 xHCI Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` Chunfeng Yun [this message]
2021-03-23  7:02   ` [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 06/13] usb: xhci-mtk: support ip-sleep wakeup for MT8183 Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 07/13] usb: xhci-mtk: add support ip-sleep wakeup for mT8192 Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 08/13] usb: xhci-mtk: drop CONFIG_OF Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 09/13] usb: xhci-mtk: remove MODULE_ALIAS Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 10/13] usb: mtu3: support ip-sleep wakeup for MT8183 Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 11/13] usb: mtu3: add support ip-sleep wakeup for MT8192 Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 12/13] usb: mtu3: drop CONFIG_OF Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02 ` [PATCH v2 13/13] arm64: dts: mt8183: update wakeup register offset Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-23  7:02   ` Chunfeng Yun
2021-03-29 11:24   ` Matthias Brugger
2021-03-29 11:24     ` Matthias Brugger
2021-03-29 11:24     ` Matthias Brugger
2021-03-23  9:07 ` [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable Sergei Shtylyov
2021-03-23  9:07   ` Sergei Shtylyov
2021-03-23  9:07   ` Sergei Shtylyov
2021-03-27 17:24 ` Rob Herring
2021-03-27 17:24   ` Rob Herring
2021-03-27 17:24   ` Rob Herring
2021-03-29  3:10   ` Chunfeng Yun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1616482975-17841-5-git-send-email-chunfeng.yun@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=drinkcat@chromium.org \
    --cc=eddie.hung@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.