From: "Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>
To: "robh@kernel.org" <robh@kernel.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"mathias.nyman@intel.com" <mathias.nyman@intel.com>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>
Subject: Re: [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
Date: Mon, 6 Jan 2025 14:47:28 +0000 [thread overview]
Message-ID: <0820cf224ae9022fc34fb31d97d4c6f8f6e2eec1.camel@mediatek.com> (raw)
In-Reply-To: <207f9e96-3165-440d-8576-545bf2bc9dee@collabora.com>
On Tue, 2024-11-26 at 09:50 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> Il 26/11/24 03:55, Chunfeng Yun ha scritto:
> > There are 2 USB controllers on mt8196, each controller's wakeup
> > control is
> > different, add some specific versions for them.
> >
>
> Is there any MTU3 controller in MT8196, like all other MediaTek SoCs?
Yes.
>
> If so, then please just add the wakeup control to the MTU3 driver,
> otherwise
> we are going to duplicate this for yet another SoC, like we've done
> for MT8192,
> MT8195, MT8188 and MT8186 already...
Even I add it in MTU3 driver, I still need add it in xhci-mtk driver,
some projects only use host mode;
I can also add it in MTU3 driver and send out new patches.
But it's not a good idea to duplicate it into MTU3 driver directly for
some SoC which has limitation on dual-role switch when using upstream
driver.
Thanks
>
> Cheers,
> Angelo
>
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
> > mtk.c
> > index 3252e3d2d79c..31223912b0b4 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -113,6 +113,12 @@
> > #define WC1_IS_P_95 BIT(12)
> > #define WC1_IS_EN_P0_95 BIT(6)
> >
> > +/* mt8196 */
> > +#define PERI_WK_CTRL0_8196 0x08
> > +#define UWK_V1_7_CTRL2_MASK 0x5
> > +
> > +#define WCP1_IS_EN BIT(7) /* port1 en bit */
> > +
> > /* mt2712 etc */
> > #define PERI_SSUSB_SPM_CTRL 0x0
> > #define SSC_IP_SLEEP_EN BIT(4)
> > @@ -129,6 +135,8 @@ 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_7, /* mt8196 IP0 */
> > + SSUSB_UWK_V1_8, /* mt8196 IP1 */
> > };
> >
> > /*
> > @@ -381,6 +389,16 @@ 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_7:
> > + reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > + msk = UWK_V1_7_CTRL2_MASK;
> > + val = enable ? msk : 0;
> > + break;
> > + case SSUSB_UWK_V1_8:
> > + reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > + msk = WCP1_IS_EN;
> > + 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;
>
>
>
next prev parent reply other threads:[~2025-01-06 14:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 2:55 [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
2024-11-26 2:55 ` [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
2024-11-26 8:50 ` AngeloGioacchino Del Regno
2025-01-06 14:47 ` Chunfeng Yun (云春峰) [this message]
2025-01-07 5:07 ` Chen-Yu Tsai
2025-01-07 11:46 ` AngeloGioacchino Del Regno
2024-11-26 7:37 ` [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196 Krzysztof Kozlowski
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=0820cf224ae9022fc34fb31d97d4c6f8f6e2eec1.camel@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--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=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®