Devicetree
 help / color / mirror / Atom feed
From: Xu Yang <xu.yang_2@nxp.com>
To: Frank Li <Frank.li@nxp.com>
Cc: krzk@kernel.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	imx@lists.linux.dev, jun.li@nxp.com
Subject: Re: [PATCH 3/3] extcon: ptn5150: Try to get usb role switch from connector fwnode
Date: Thu, 17 Apr 2025 10:24:36 +0800	[thread overview]
Message-ID: <20250417022436.xxv66vo5vfrbgqdn@hippo> (raw)
In-Reply-To: <Z//AtayeLP6zRGBT@lizhi-Precision-Tower-5810>

On Wed, Apr 16, 2025 at 10:37:41AM -0400, Frank Li wrote:
> On Wed, Apr 16, 2025 at 06:59:40PM +0800, Xu Yang wrote:
> > Since PTN5150 is a Type-C chip, we normally need to describe some
> > properties under connector node. Due to this, the port node will
> > locate at connector node in the future. To support it, we need to
> > get usb role switch via connector fwnode. For compatibility, this
> > will not remove usb_role_switch_get() function.
> 
> Your patch 2 already return error if there not connector, which already
> broken compatibility.
> 
> You should handle compatibility in patch 2 or before patch 2.

Since connector is not a required node, so patch2 doesn't return error if
connector node doesn't exist. It only handle orientation switch thing. This
will not break compatibility of usb role switch (eg: port node is outside of
connector node).

Thanks,
Xu Yang

> 
> Frank
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> > ---
> >  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 b7e05d921c79..160998e163f0 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
> >

  reply	other threads:[~2025-04-17  2:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 10:59 [PATCH 1/3] dt-bindings: extcon: ptn5150: Allow "connector" node to present Xu Yang
2025-04-16 10:59 ` [PATCH 2/3] extcon: ptn5150: Add Type-C orientation switch support Xu Yang
2025-04-16 14:33   ` Frank Li
2025-04-17  2:16     ` Xu Yang
2025-04-17 12:38   ` kernel test robot
2025-04-17 13:20   ` kernel test robot
2025-04-16 10:59 ` [PATCH 3/3] extcon: ptn5150: Try to get usb role switch from connector fwnode Xu Yang
2025-04-16 14:37   ` Frank Li
2025-04-17  2:24     ` Xu Yang [this message]
2025-04-17 14:34       ` Frank Li
2025-04-16 14:23 ` [PATCH 1/3] dt-bindings: extcon: ptn5150: Allow "connector" node to present Frank Li
2025-04-17  1:53   ` Xu Yang
2025-04-22 12:19 ` Rob Herring (Arm)

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=20250417022436.xxv66vo5vfrbgqdn@hippo \
    --to=xu.yang_2@nxp.com \
    --cc=Frank.li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=jun.li@nxp.com \
    --cc=krzk@kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=robh@kernel.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