mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	 Mathias Nyman <mathias.nyman@intel.com>
Cc: kernel@collabora.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,
	 Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>,
	 Mingjin Ge <mingjin.ge@mediatek.com>
Subject: [PATCH 3/3] usb: xhci-mtk: add MT8189 remote wakeup support
Date: Wed, 02 Dec 2026 13:55:08 +0100	[thread overview]
Message-ID: <20261202-mt8189-add-usb-support-v1-3-5749ab20ec84@collabora.com> (raw)
In-Reply-To: <20261202-mt8189-add-usb-support-v1-0-5749ab20ec84@collabora.com>

From: Mingjin Ge <mingjin.ge@mediatek.com>

Add specific register definitions and handling to support
remote wakeup for the MT8189 SoC.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Mingjin Ge <mingjin.ge@mediatek.com>
[Louis-Alexis Eyraud: reworded title and description, modified
SSUSB_UWK_V1_10 value to match MT8189 mediatek,syscon-wakeup
parameter value from bindings]
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
 drivers/usb/host/xhci-mtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 122104eea048..45ec1e98c287 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -96,6 +96,10 @@
 #define WC0_IS_P	BIT(12)	/* polarity */
 #define WC0_IS_EN	BIT(6)
 
+/* mt8189*/
+#define PERI_WK_CTRL0_8189	0x0
+#define WC0_IS_EN_P_89		BIT(18)
+
 /* mt8192 */
 #define WC0_SSUSB0_CDEN		BIT(6)
 #define WC0_IS_SPM_EN		BIT(1)
@@ -129,6 +133,7 @@ enum ssusb_uwk_vers {
 	SSUSB_UWK_V1_4,		/* mt8195 IP1 */
 	SSUSB_UWK_V1_5,		/* mt8195 IP2 */
 	SSUSB_UWK_V1_6,		/* mt8195 IP3 */
+	SSUSB_UWK_V1_10 = 110,	/* mt8189 IP all */
 };
 
 /*
@@ -381,6 +386,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable)
 		msk = WC0_IS_EN_P3_95 | WC0_IS_C_95(0x7) | WC0_IS_P_95;
 		val = enable ? (WC0_IS_EN_P3_95 | WC0_IS_C_95(0x1)) : 0;
 		break;
+	case SSUSB_UWK_V1_10:
+		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8189;
+		msk = WC0_IS_EN_P_89;
+		val = enable ? msk : 0;
+		break;
 	case SSUSB_UWK_V2:
 		reg = mtk->uwk_reg_base + PERI_SSUSB_SPM_CTRL;
 		msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN;

-- 
2.56.1


      parent reply	other threads:[~2026-12-02 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
2026-12-02 12:55 ` [PATCH 2/3] usb: mtu3: add MT8189 remote wakeup support Louis-Alexis Eyraud
2026-12-02 12:55 ` Louis-Alexis Eyraud [this message]

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=20261202-mt8189-add-usb-support-v1-3-5749ab20ec84@collabora.com \
    --to=louisalexis.eyraud@collabora.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.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=mingjin.ge@mediatek.com \
    --cc=robh@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®