[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250908053335.36685-4-xu.yang_2@nxp.com>
Date: Mon, 8 Sep 2025 13:33:35 +0800
From: Xu Yang <xu.yang_2@....com>
To: krzk@...nel.org,
myungjoo.ham@...sung.com,
cw00.choi@...sung.com,
robh@...nel.org,
conor+dt@...nel.org,
gregkh@...uxfoundation.org
Cc: swboyd@...omium.org,
heikki.krogerus@...ux.intel.com,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
imx@...ts.linux.dev,
jun.li@....com
Subject: [RESEND v4 4/4] extcon: ptn5150: Support USB role switch via connector fwnode
Since the PTN5150 is a Type-C chip, it's common to describe related
properties under the connector node. To align with this, the port
node will be located under the connector node in the future.
To support this layout, retrieve the USB role switch using the
connector's fwnode. For compatibility with existing device trees,
keep the usb_role_switch_get() function.
Reviewed-by: Frank Li <Frank.Li@....com>
Signed-off-by: Xu Yang <xu.yang_2@....com>
---
Changes in v4:
- add Rb tag
Changes in v3:
- no changes
Changes in v2:
- improve commit message
---
drivers/extcon/extcon-ptn5150.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c
index 768428d306ce..f33f80e103c2 100644
--- a/drivers/extcon/extcon-ptn5150.c
+++ b/drivers/extcon/extcon-ptn5150.c
@@ -352,6 +352,8 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c)
}
info->role_sw = usb_role_switch_get(info->dev);
+ if (!info->role_sw && connector)
+ info->role_sw = fwnode_usb_role_switch_get(connector);
if (IS_ERR(info->role_sw))
return dev_err_probe(info->dev, PTR_ERR(info->role_sw),
"failed to get role switch\n");
--
2.34.1
Powered by blists - more mailing lists