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

Xu Yang xu.yang_2 at nxp.com
Wed Jun 14 04:15:48 PDT 2023


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




More information about the linux-arm-kernel mailing list