mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196
@ 2024-11-26  2:55 Chunfeng Yun
  2024-11-26  2:55 ` [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
  2024-11-26  7:37 ` [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196 Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Chunfeng Yun @ 2024-11-26  2:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley,
	Matthias Brugger, AngeloGioacchino Del Regno, Mathias Nyman,
	linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel

There are 2 USB controllers on mt8196, each controller's wakeup control is
different, add some specific versions for them, and add compatilbe for it.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index ef3143f4b794..03f7c226675e 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -36,6 +36,7 @@ properties:
           - mediatek,mt8188-xhci
           - mediatek,mt8192-xhci
           - mediatek,mt8195-xhci
+          - mediatek,mt8196-xhci
           - mediatek,mt8365-xhci
       - const: mediatek,mtk-xhci
 
@@ -164,7 +165,9 @@ properties:
             104 - used by mt8195, IP1, specific 1.04;
             105 - used by mt8195, IP2, specific 1.05;
             106 - used by mt8195, IP3, specific 1.06;
-          enum: [1, 2, 101, 102, 103, 104, 105, 106]
+            107 - used by mt8196, IP0, specific 1.07;
+            108 - used by mt8196, IP1, specific 1.08;
+          enum: [1, 2, 101, 102, 103, 104, 105, 106, 107, 108]
 
   mediatek,u3p-dis-msk:
     $ref: /schemas/types.yaml#/definitions/uint32
-- 
2.46.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
  2024-11-26  2:55 [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
@ 2024-11-26  2:55 ` Chunfeng Yun
  2024-11-26  8:50   ` AngeloGioacchino Del Regno
  2024-11-26  7:37 ` [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196 Krzysztof Kozlowski
  1 sibling, 1 reply; 7+ messages in thread
From: Chunfeng Yun @ 2024-11-26  2:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley,
	Matthias Brugger, AngeloGioacchino Del Regno, Mathias Nyman,
	linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel

There are 2 USB controllers on mt8196, each controller's wakeup control is
different, add some specific versions for them.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: usb: mtk-xhci: add support mt8196
  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  7:37 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26  7:37 UTC (permalink / raw)
  To: Chunfeng Yun
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

On Tue, Nov 26, 2024 at 10:55:06AM +0800, Chunfeng Yun wrote:
> There are 2 USB controllers on mt8196, each controller's wakeup control is
> different, add some specific versions for them, and add compatilbe for it.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
  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 (云春峰)
  0 siblings, 1 reply; 7+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-11-26  8:50 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring
  Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

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?

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

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;




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
  2024-11-26  8:50   ` AngeloGioacchino Del Regno
@ 2025-01-06 14:47     ` Chunfeng Yun (云春峰)
  2025-01-07  5:07       ` Chen-Yu Tsai
  0 siblings, 1 reply; 7+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-01-06 14:47 UTC (permalink / raw)
  To: robh, AngeloGioacchino Del Regno, gregkh
  Cc: linux-mediatek, linux-kernel, linux-usb, devicetree,
	mathias.nyman, conor+dt, linux-arm-kernel, matthias.bgg, krzk+dt

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-01-06 14:47     ` Chunfeng Yun (云春峰)
@ 2025-01-07  5:07       ` Chen-Yu Tsai
  2025-01-07 11:46         ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 7+ messages in thread
From: Chen-Yu Tsai @ 2025-01-07  5:07 UTC (permalink / raw)
  To: Chunfeng Yun (云春峰)
  Cc: robh, AngeloGioacchino Del Regno, gregkh, linux-mediatek,
	linux-kernel, linux-usb, devicetree, mathias.nyman, conor+dt,
	linux-arm-kernel, matthias.bgg, krzk+dt

On Mon, Jan 6, 2025 at 10:58 PM Chunfeng Yun (云春峰)
<Chunfeng.Yun@mediatek.com> wrote:
>
> 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.

I think the idea behind Angelo's point is that MTU3 should be used for
all projects, regardless whether they are host mode only or not.
The hardware is there. Don't hide it.

ChenYu

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-01-07  5:07       ` Chen-Yu Tsai
@ 2025-01-07 11:46         ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 7+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-01-07 11:46 UTC (permalink / raw)
  To: Chen-Yu Tsai, Chunfeng Yun (云春峰)
  Cc: robh, gregkh, linux-mediatek, linux-kernel, linux-usb,
	devicetree, mathias.nyman, conor+dt, linux-arm-kernel,
	matthias.bgg, krzk+dt

Il 07/01/25 06:07, Chen-Yu Tsai ha scritto:
> On Mon, Jan 6, 2025 at 10:58 PM Chunfeng Yun (云春峰)
> <Chunfeng.Yun@mediatek.com> wrote:
>>
>> 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.
> 
> I think the idea behind Angelo's point is that MTU3 should be used for
> all projects, regardless whether they are host mode only or not.
> The hardware is there. Don't hide it.
> 

Yes, I confirm that's exactly my point.

Thanks for clarifying, Chen-Yu.

Cheers!

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-07 11:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 (云春峰)
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

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®