From: Xu Yang <xu.yang_2@nxp.com>
To: krzk@kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com,
robh@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org
Cc: swboyd@chromium.org, heikki.krogerus@linux.intel.com,
devicetree@vger.kernel.org, imx@lists.linux.dev, jun.li@nxp.com
Subject: [PATCH v3 4/4] extcon: ptn5150: Support USB role switch via connector fwnode
Date: Fri, 9 May 2025 14:45:26 +0800 [thread overview]
Message-ID: <20250509064526.3767729-4-xu.yang_2@nxp.com> (raw)
In-Reply-To: <20250509064526.3767729-1-xu.yang_2@nxp.com>
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.
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
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
next prev parent reply other threads:[~2025-05-09 6:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 6:45 [PATCH v3 1/4] usb: typec: Stub out typec_switch APIs when CONFIG_TYPEC=n Xu Yang
2025-05-09 6:45 ` [PATCH v3 2/4] dt-bindings: extcon: ptn5150: Allow "connector" node to present Xu Yang
2025-05-09 6:45 ` [PATCH v3 3/4] extcon: ptn5150: Add Type-C orientation switch support Xu Yang
2025-05-19 20:14 ` Frank Li
2025-05-09 6:45 ` Xu Yang [this message]
2025-05-19 20:18 ` [PATCH v3 4/4] extcon: ptn5150: Support USB role switch via connector fwnode Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250509064526.3767729-4-xu.yang_2@nxp.com \
--to=xu.yang_2@nxp.com \
--cc=conor+dt@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=imx@lists.linux.dev \
--cc=jun.li@nxp.com \
--cc=krzk@kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=robh@kernel.org \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox