Re: [RESEND v4 4/4] extcon: ptn5150: Support USB role switch via connector fwnode
From: Chanwoo Choi
Date: Tue Sep 09 2025 - 11:38:27 EST
Hi,
Applied it. Thanks.
On Mon, Sep 8, 2025 at 2:34 PM Xu Yang <xu.yang_2@xxxxxxx> wrote:
>
> 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@xxxxxxx>
> Signed-off-by: Xu Yang <xu.yang_2@xxxxxxx>
>
> ---
> 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
>
>
--
Best Regards,
Chanwoo Choi
Samsung Electronics