Skip to contentSkip to conversation

dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property

PATCH In review Xu Yang 2 participants 4 messages Jun 14, 2023

Subsystems (4)
lore
Share & tools
lore

Xu Yang

author
#0 lore raw

PATCH 1/2 dt-bindings: phy: fsl,mxs-usbphy: add fsl,hold-line-without-vbus property

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.

---
 Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml +7 -0
index f4b1ca2fb562..c5f9d8a8298e 100644
@@ -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
Signature · 7 lines
2.34.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
author
#1 lore raw

PATCH 2/2 usb: phy: mxs: add DT bindings to hold data line

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.

---
 drivers/usb/phy/phy-mxs-usb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/usb/phy/phy-mxs-usb.c +6 -2
index e1a2b2ea098b..036bb58a3a71 100644
@@ -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);
 
Signature · 7 lines
2.34.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#2 lore raw

Re: [PATCH 2/2] usb: phy: mxs: add DT bindings to hold data line

Quoted 24 lines · Xu Yang

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.

---
 drivers/usb/phy/phy-mxs-usb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/usb/phy/phy-mxs-usb.c +1 -1
index e1a2b2ea098b..036bb58a3a71 100644
@@ -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;

drivers/usb/phy/phy-mxs-usb.c static int mxs_phy_probe(struct platform_device *pdev) · line 780

Quoted 7 lines
drivers/usb/phy/phy-mxs-usb.c +4 -0
@@ -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

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#3 lore raw
In reply to Xu Yang
Quoted 13 lines · Xu Yang

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.

---
 Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml +0 -0
index f4b1ca2fb562..c5f9d8a8298e 100644

Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml properties: · line 94

Quoted 8 lines
Documentation/devicetree/bindings/phy/fsl,mxs-usbphy.yaml +5 -0
@@ -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

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy