devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property
@ 2023-06-14 11:15 Xu Yang
  2023-06-14 11:15 ` [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line Xu Yang
  2023-06-14 17:18 ` [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Xu Yang @ 2023-06-14 11:15 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, gregkh, shawnguo, s.hauer,
	jun.li
  Cc: Frank.Li, kernel, festevam, linux-imx, linux-phy, devicetree,
	linux-arm-kernel, linux-usb, xu.yang_2

The data line can be kept or disconnected when vbus is not present. This
will add a flag "fsl,hold-line-without-vbus" to describe this behavior.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
index f4b1ca2fb562..c5f9d8a8298e 100644
--- a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
+++ b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
@@ -87,6 +87,13 @@ properties:
     maximum: 119
     default: 100
 
+  fsl,hold-line-without-vbus:
+    description:
+      Normaly, the data line should be disconnected if vbus is not
+      present. This flag is used to hold data line even though vbus
+      is not present.
+    type: boolean
+
 required:
   - compatible
   - reg
-- 
2.34.1


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

* [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line
  2023-06-14 11:15 [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Xu Yang
@ 2023-06-14 11:15 ` Xu Yang
  2023-06-14 17:18   ` Krzysztof Kozlowski
  2023-06-14 17:18 ` [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Krzysztof Kozlowski
  1 sibling, 1 reply; 4+ messages in thread
From: Xu Yang @ 2023-06-14 11:15 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, gregkh, shawnguo, s.hauer,
	jun.li
  Cc: Frank.Li, kernel, festevam, linux-imx, linux-phy, devicetree,
	linux-arm-kernel, linux-usb, xu.yang_2

Whether the data line is disconnected when vbus is not present is related
to whether the platform data set MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS
flag. This will provide a override from dts node if the user want to hold
the data line when vbus is not present.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 drivers/usb/phy/phy-mxs-usb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index e1a2b2ea098b..036bb58a3a71 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -199,7 +199,7 @@ MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
 struct mxs_phy {
 	struct usb_phy phy;
 	struct clk *clk;
-	const struct mxs_phy_data *data;
+	struct mxs_phy_data *data;
 	struct regmap *regmap_anatop;
 	int port_id;
 	u32 tx_reg_set;
@@ -774,6 +774,11 @@ static int mxs_phy_probe(struct platform_device *pdev)
 		mxs_phy->tx_reg_set  |= GM_USBPHY_TX_D_CAL(val);
 	}
 
+	mxs_phy->data = (struct mxs_phy_data *)of_device_get_match_data(&pdev->dev);
+
+	if (of_property_present(np, "fsl,hold-line-without-vbus"))
+		mxs_phy->data->flags &= ~MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS;
+
 	ret = of_alias_get_id(np, "usbphy");
 	if (ret < 0)
 		dev_dbg(&pdev->dev, "failed to get alias id, errno %d\n", ret);
@@ -792,7 +797,6 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	mxs_phy->phy.charger_detect	= mxs_phy_charger_detect;
 
 	mxs_phy->clk = clk;
-	mxs_phy->data = of_device_get_match_data(&pdev->dev);
 
 	platform_set_drvdata(pdev, mxs_phy);
 
-- 
2.34.1


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

* Re: [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line
  2023-06-14 11:15 ` [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line Xu Yang
@ 2023-06-14 17:18   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-14 17:18 UTC (permalink / raw)
  To: Xu Yang, robh+dt, krzysztof.kozlowski+dt, gregkh, shawnguo,
	s.hauer, jun.li
  Cc: Frank.Li, kernel, festevam, linux-imx, linux-phy, devicetree,
	linux-arm-kernel, linux-usb

On 14/06/2023 13:15, Xu Yang wrote:
> Whether the data line is disconnected when vbus is not present is related
> to whether the platform data set MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS
> flag. This will provide a override from dts node if the user want to hold
> the data line when vbus is not present.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
>  drivers/usb/phy/phy-mxs-usb.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
> index e1a2b2ea098b..036bb58a3a71 100644
> --- a/drivers/usb/phy/phy-mxs-usb.c
> +++ b/drivers/usb/phy/phy-mxs-usb.c
> @@ -199,7 +199,7 @@ MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
>  struct mxs_phy {
>  	struct usb_phy phy;
>  	struct clk *clk;
> -	const struct mxs_phy_data *data;
> +	struct mxs_phy_data *data;
>  	struct regmap *regmap_anatop;
>  	int port_id;
>  	u32 tx_reg_set;
> @@ -774,6 +774,11 @@ static int mxs_phy_probe(struct platform_device *pdev)
>  		mxs_phy->tx_reg_set  |= GM_USBPHY_TX_D_CAL(val);
>  	}
>  
> +	mxs_phy->data = (struct mxs_phy_data *)of_device_get_match_data(&pdev->dev);
> +
> +	if (of_property_present(np, "fsl,hold-line-without-vbus"))
> +		mxs_phy->data->flags &= ~MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS;

How did you test it? What type of memory are you modifying?

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property
  2023-06-14 11:15 [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Xu Yang
  2023-06-14 11:15 ` [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line Xu Yang
@ 2023-06-14 17:18 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-14 17:18 UTC (permalink / raw)
  To: Xu Yang, robh+dt, krzysztof.kozlowski+dt, gregkh, shawnguo,
	s.hauer, jun.li
  Cc: Frank.Li, kernel, festevam, linux-imx, linux-phy, devicetree,
	linux-arm-kernel, linux-usb

On 14/06/2023 13:15, Xu Yang wrote:
> The data line can be kept or disconnected when vbus is not present. This
> will add a flag "fsl,hold-line-without-vbus" to describe this behavior.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
>  Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
> index f4b1ca2fb562..c5f9d8a8298e 100644
> --- a/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml
> @@ -87,6 +87,13 @@ properties:
>      maximum: 119
>      default: 100
>  
> +  fsl,hold-line-without-vbus:
> +    description:
> +      Normaly, the data line should be disconnected if vbus is not
> +      present. This flag is used to hold data line even though vbus
> +      is not present.

Why is this a property of a board? Why some boards need it? Neither
commit msg nor property explain why do you need it.

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-06-14 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 11:15 [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Xu Yang
2023-06-14 11:15 ` [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line Xu Yang
2023-06-14 17:18   ` Krzysztof Kozlowski
2023-06-14 17:18 ` [PATCH 1/2] dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).