* [PATCH 2/2] phy: mediatek: xsphy: add support to set disconnect threshold
2024-11-26 2:58 [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold Chunfeng Yun
@ 2024-11-26 2:58 ` Chunfeng Yun
2024-11-26 7:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property " Krzysztof Kozlowski
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Chunfeng Yun @ 2024-11-26 2:58 UTC (permalink / raw)
To: Vinod Koul, Rob Herring
Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
linux-phy, devicetree, linux-kernel
Add a property to tune usb2 phy's disconnect threshold.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/phy/mediatek/phy-mtk-xsphy.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c
index 7c248f5cfca5..718ed8f17c2d 100644
--- a/drivers/phy/mediatek/phy-mtk-xsphy.c
+++ b/drivers/phy/mediatek/phy-mtk-xsphy.c
@@ -59,6 +59,7 @@
#define XSP_USBPHYACR6 ((SSUSB_SIFSLV_U2PHY_COM) + 0x018)
#define P2A6_RG_BC11_SW_EN BIT(23)
#define P2A6_RG_OTG_VBUSCMP_EN BIT(20)
+#define PA6_RG_U2_DISCTH GENMASK(7, 4)
#define XSP_U2PHYDTM1 ((SSUSB_SIFSLV_U2PHY_COM) + 0x06C)
#define P2D_FORCE_IDDIG BIT(9)
@@ -95,6 +96,7 @@ struct xsphy_instance {
int eye_src;
int eye_vrt;
int eye_term;
+ int discth;
};
struct mtk_xsphy {
@@ -244,9 +246,12 @@ static void phy_parse_property(struct mtk_xsphy *xsphy,
&inst->eye_vrt);
device_property_read_u32(dev, "mediatek,eye-term",
&inst->eye_term);
- dev_dbg(dev, "intr:%d, src:%d, vrt:%d, term:%d\n",
+ device_property_read_u32(dev, "mediatek,discth",
+ &inst->discth);
+ dev_dbg(dev, "intr:%d, src:%d, vrt:%d, term:%d, discth:%d\n",
inst->efuse_intr, inst->eye_src,
- inst->eye_vrt, inst->eye_term);
+ inst->eye_vrt, inst->eye_term,
+ inst->discth);
break;
case PHY_TYPE_USB3:
device_property_read_u32(dev, "mediatek,efuse-intr",
@@ -285,6 +290,9 @@ static void u2_phy_props_set(struct mtk_xsphy *xsphy,
if (inst->eye_term)
mtk_phy_update_field(pbase + XSP_USBPHYACR1, P2A1_RG_TERM_SEL,
inst->eye_term);
+ if (inst->discth)
+ mtk_phy_update_field(pbase + XSP_USBPHYACR6, PA6_RG_U2_DISCTH,
+ inst->discth);
}
static void u3_phy_props_set(struct mtk_xsphy *xsphy,
--
2.46.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-26 2:58 [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold Chunfeng Yun
2024-11-26 2:58 ` [PATCH 2/2] phy: mediatek: xsphy: add support " Chunfeng Yun
@ 2024-11-26 7:38 ` Krzysztof Kozlowski
2025-01-06 14:37 ` Chunfeng Yun (云春峰)
2024-11-26 8:51 ` AngeloGioacchino Del Regno
2024-11-27 14:26 ` Rob Herring
3 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 7:38 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Vinod Koul, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Matthias Brugger, AngeloGioacchino Del Regno, linux-arm-kernel,
linux-mediatek, linux-phy, devicetree, linux-kernel
On Tue, Nov 26, 2024 at 10:58:58AM +0800, Chunfeng Yun wrote:
> Add a property to tune usb2 phy's disconnect threshold.
> And add a compatible for mt8196.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> index a9e3139fd421..2e012d5e1da1 100644
> --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> @@ -49,6 +49,7 @@ properties:
> - enum:
> - mediatek,mt3611-xsphy
> - mediatek,mt3612-xsphy
> + - mediatek,mt8196-xsphy
Keep order.
> - const: mediatek,xsphy
>
> reg:
> @@ -129,6 +130,13 @@ patternProperties:
> minimum: 1
> maximum: 7
>
> + mediatek,discth:
> + description:
> + The selection of disconnect threshold (U2 phy)
Threshold in what units?
Best regards,
Krzysztof
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-26 7:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property " Krzysztof Kozlowski
@ 2025-01-06 14:37 ` Chunfeng Yun (云春峰)
0 siblings, 0 replies; 8+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-01-06 14:37 UTC (permalink / raw)
To: krzk@kernel.org
Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org,
linux-arm-kernel@lists.infradead.org, vkoul@kernel.org,
matthias.bgg@gmail.com, krzk+dt@kernel.org,
linux-phy@lists.infradead.org, AngeloGioacchino Del Regno
On Tue, 2024-11-26 at 08:38 +0100, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On Tue, Nov 26, 2024 at 10:58:58AM +0800, Chunfeng Yun wrote:
> > Add a property to tune usb2 phy's disconnect threshold.
> > And add a compatible for mt8196.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8
> > ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > index a9e3139fd421..2e012d5e1da1 100644
> > --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > @@ -49,6 +49,7 @@ properties:
> > - enum:
> > - mediatek,mt3611-xsphy
> > - mediatek,mt3612-xsphy
> > + - mediatek,mt8196-xsphy
>
> Keep order.
Yes, it's already ordered.
>
> > - const: mediatek,xsphy
> >
> > reg:
> > @@ -129,6 +130,13 @@ patternProperties:
> > minimum: 1
> > maximum: 7
> >
> > + mediatek,discth:
> > + description:
> > + The selection of disconnect threshold (U2 phy)
>
> Threshold in what units?
It's a threshold level, can be treat it as an index.
Thanks
>
> Best regards,
> Krzysztof
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-26 2:58 [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold Chunfeng Yun
2024-11-26 2:58 ` [PATCH 2/2] phy: mediatek: xsphy: add support " Chunfeng Yun
2024-11-26 7:38 ` [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property " Krzysztof Kozlowski
@ 2024-11-26 8:51 ` AngeloGioacchino Del Regno
2025-01-06 14:34 ` Chunfeng Yun (云春峰)
2024-11-27 14:26 ` Rob Herring
3 siblings, 1 reply; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-11-26 8:51 UTC (permalink / raw)
To: Chunfeng Yun, Vinod Koul, Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
linux-arm-kernel, linux-mediatek, linux-phy, devicetree,
linux-kernel
Il 26/11/24 03:58, Chunfeng Yun ha scritto:
> Add a property to tune usb2 phy's disconnect threshold.
> And add a compatible for mt8196.
>
Is this a board-specific property? If so, can you please describe the reason?
Thanks,
Angelo
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> index a9e3139fd421..2e012d5e1da1 100644
> --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> @@ -49,6 +49,7 @@ properties:
> - enum:
> - mediatek,mt3611-xsphy
> - mediatek,mt3612-xsphy
> + - mediatek,mt8196-xsphy
> - const: mediatek,xsphy
>
> reg:
> @@ -129,6 +130,13 @@ patternProperties:
> minimum: 1
> maximum: 7
>
> + mediatek,discth:
> + description:
> + The selection of disconnect threshold (U2 phy)
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 1
> + maximum: 15
> +
> mediatek,efuse-intr:
> description:
> The selection of Internal Resistor (U2/U3 phy)
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-26 8:51 ` AngeloGioacchino Del Regno
@ 2025-01-06 14:34 ` Chunfeng Yun (云春峰)
0 siblings, 0 replies; 8+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-01-06 14:34 UTC (permalink / raw)
To: robh@kernel.org, vkoul@kernel.org, AngeloGioacchino Del Regno
Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org,
linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
krzk+dt@kernel.org, linux-phy@lists.infradead.org
On Tue, 2024-11-26 at 09:51 +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:58, Chunfeng Yun ha scritto:
> > Add a property to tune usb2 phy's disconnect threshold.
> > And add a compatible for mt8196.
> >
>
> Is this a board-specific property? If so, can you please describe the
> reason?
No, it's a common property, all SoC with xsphy controller can use it.
Thanks
>
> Thanks,
> Angelo
>
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8
> > ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > index a9e3139fd421..2e012d5e1da1 100644
> > --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > @@ -49,6 +49,7 @@ properties:
> > - enum:
> > - mediatek,mt3611-xsphy
> > - mediatek,mt3612-xsphy
> > + - mediatek,mt8196-xsphy
> > - const: mediatek,xsphy
> >
> > reg:
> > @@ -129,6 +130,13 @@ patternProperties:
> > minimum: 1
> > maximum: 7
> >
> > + mediatek,discth:
> > + description:
> > + The selection of disconnect threshold (U2 phy)
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + minimum: 1
> > + maximum: 15
> > +
> > mediatek,efuse-intr:
> > description:
> > The selection of Internal Resistor (U2/U3 phy)
>
>
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-26 2:58 [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold Chunfeng Yun
` (2 preceding siblings ...)
2024-11-26 8:51 ` AngeloGioacchino Del Regno
@ 2024-11-27 14:26 ` Rob Herring
2025-01-06 14:32 ` Chunfeng Yun (云春峰)
3 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2024-11-27 14:26 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Vinod Koul, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
linux-phy, devicetree, linux-kernel
On Tue, Nov 26, 2024 at 10:58:58AM +0800, Chunfeng Yun wrote:
> Add a property to tune usb2 phy's disconnect threshold.
> And add a compatible for mt8196.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> index a9e3139fd421..2e012d5e1da1 100644
> --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> @@ -49,6 +49,7 @@ properties:
> - enum:
> - mediatek,mt3611-xsphy
> - mediatek,mt3612-xsphy
> + - mediatek,mt8196-xsphy
> - const: mediatek,xsphy
>
> reg:
> @@ -129,6 +130,13 @@ patternProperties:
> minimum: 1
> maximum: 7
>
> + mediatek,discth:
That's not understandable. Spell it out: mediatek,disconnect-thres
> + description:
> + The selection of disconnect threshold (U2 phy)
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 1
> + maximum: 15
> +
> mediatek,efuse-intr:
> description:
> The selection of Internal Resistor (U2/U3 phy)
> --
> 2.46.0
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 1/2] dt-bindings: phy: mediatek,xsphy: add property to set disconnect threshold
2024-11-27 14:26 ` Rob Herring
@ 2025-01-06 14:32 ` Chunfeng Yun (云春峰)
0 siblings, 0 replies; 8+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-01-06 14:32 UTC (permalink / raw)
To: robh@kernel.org
Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org,
linux-arm-kernel@lists.infradead.org, vkoul@kernel.org,
matthias.bgg@gmail.com, krzk+dt@kernel.org,
linux-phy@lists.infradead.org, AngeloGioacchino Del Regno
hi,
On Wed, 2024-11-27 at 08:26 -0600, Rob Herring wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On Tue, Nov 26, 2024 at 10:58:58AM +0800, Chunfeng Yun wrote:
> > Add a property to tune usb2 phy's disconnect threshold.
> > And add a compatible for mt8196.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 8
> > ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > index a9e3139fd421..2e012d5e1da1 100644
> > --- a/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > +++ b/Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml
> > @@ -49,6 +49,7 @@ properties:
> > - enum:
> > - mediatek,mt3611-xsphy
> > - mediatek,mt3612-xsphy
> > + - mediatek,mt8196-xsphy
> > - const: mediatek,xsphy
> >
> > reg:
> > @@ -129,6 +130,13 @@ patternProperties:
> > minimum: 1
> > maximum: 7
> >
> > + mediatek,discth:
>
> That's not understandable. Spell it out: mediatek,disconnect-thres
It comes from xsphy register map document, due to xsphy is similar with
t-phy, I port it from t-phy, and use the same property.
https://elixir.bootlin.com/linux/v6.13-rc3/source/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml#L226
Thanks.
>
> > + description:
> > + The selection of disconnect threshold (U2 phy)
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + minimum: 1
> > + maximum: 15
> > +
> > mediatek,efuse-intr:
> > description:
> > The selection of Internal Resistor (U2/U3 phy)
> > --
> > 2.46.0
> >
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 8+ messages in thread