[PATCH] drm: bridge: anx7625: correctly detect if PD can be disabled

Dmitry Baryshkov posted 1 patch 1 month, 2 weeks ago
drivers/gpu/drm/bridge/analogix/anx7625.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
[PATCH] drm: bridge: anx7625: correctly detect if PD can be disabled
Posted by Dmitry Baryshkov 1 month, 2 weeks ago
During initial checks the ANX7625 bridge can be powered on before
setting up the Type-C port. At this point, when
anx7625_ocm_loading_check() checks if it can disable PD or not, it will
notice that typec_port is not set and disable PD, breaking orientation
and HPD handling. Unify the check between anx7625_ocm_loading_check()
anx7625_i2c_probe() and anx7625_typec_register() and check for the
presence of the "connector" node.

Fixes: 8ad0f7d2e6fd ("drm: bridge: anx7625: implement message sending")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index c43519097a45..1157a58cf1b1 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1363,6 +1363,18 @@ static void anx7625_configure_hpd(struct anx7625_data *ctx)
 	anx7625_hpd_timer_config(ctx);
 }
 
+static bool anx7625_need_pd(struct anx7625_data *ctx)
+{
+	struct fwnode_handle *fwnode;
+
+	fwnode = device_get_named_child_node(ctx->dev, "connector");
+	if (!fwnode)
+		return false;
+
+	fwnode_handle_put(fwnode);
+	return true;
+}
+
 static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
 {
 	int ret;
@@ -1378,7 +1390,7 @@ static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
 	if ((ret & FLASH_LOAD_STA_CHK) != FLASH_LOAD_STA_CHK)
 		return -ENODEV;
 
-	if (!ctx->typec_port)
+	if (!anx7625_need_pd(ctx))
 		anx7625_disable_pd_protocol(ctx);
 	anx7625_configure_hpd(ctx);
 
@@ -2924,12 +2936,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
 	}
 
 	if (!platform->pdata.low_power_mode) {
-		struct fwnode_handle *fwnode;
-
-		fwnode = device_get_named_child_node(dev, "connector");
-		if (fwnode)
-			fwnode_handle_put(fwnode);
-		else
+		if (!anx7625_need_pd(platform))
 			anx7625_disable_pd_protocol(platform);
 
 		anx7625_configure_hpd(platform);

---
base-commit: 400a84e1f7a3681ef24d58d49b5d07e81c14f4e9
change-id: 20260211-anx7625-fix-pd-792609132331

Best regards,
-- 
With best wishes
Dmitry
Re: [PATCH] drm: bridge: anx7625: correctly detect if PD can be disabled
Posted by Dmitry Baryshkov 3 weeks, 1 day ago
On Wed, 11 Feb 2026 11:17:27 +0200, Dmitry Baryshkov wrote:
> During initial checks the ANX7625 bridge can be powered on before
> setting up the Type-C port. At this point, when
> anx7625_ocm_loading_check() checks if it can disable PD or not, it will
> notice that typec_port is not set and disable PD, breaking orientation
> and HPD handling. Unify the check between anx7625_ocm_loading_check()
> anx7625_i2c_probe() and anx7625_typec_register() and check for the
> presence of the "connector" node.
> 
> [...]

Applied to drm-misc-next, thanks!

[1/1] drm: bridge: anx7625: correctly detect if PD can be disabled
      commit: 91d045058c68ab0ae133cd0bd8ed25a32c3dee97

Best regards,
-- 
With best wishes
Dmitry
Re: [PATCH] drm: bridge: anx7625: correctly detect if PD can be disabled
Posted by Neil Armstrong 3 weeks, 6 days ago
On 2/11/26 10:17, Dmitry Baryshkov wrote:
> During initial checks the ANX7625 bridge can be powered on before
> setting up the Type-C port. At this point, when
> anx7625_ocm_loading_check() checks if it can disable PD or not, it will
> notice that typec_port is not set and disable PD, breaking orientation
> and HPD handling. Unify the check between anx7625_ocm_loading_check()
> anx7625_i2c_probe() and anx7625_typec_register() and check for the
> presence of the "connector" node.
> 
> Fixes: 8ad0f7d2e6fd ("drm: bridge: anx7625: implement message sending")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/bridge/analogix/anx7625.c | 21 ++++++++++++++-------
>   1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index c43519097a45..1157a58cf1b1 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1363,6 +1363,18 @@ static void anx7625_configure_hpd(struct anx7625_data *ctx)
>   	anx7625_hpd_timer_config(ctx);
>   }
>   
> +static bool anx7625_need_pd(struct anx7625_data *ctx)
> +{
> +	struct fwnode_handle *fwnode;
> +
> +	fwnode = device_get_named_child_node(ctx->dev, "connector");
> +	if (!fwnode)
> +		return false;
> +
> +	fwnode_handle_put(fwnode);
> +	return true;
> +}
> +
>   static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
>   {
>   	int ret;
> @@ -1378,7 +1390,7 @@ static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
>   	if ((ret & FLASH_LOAD_STA_CHK) != FLASH_LOAD_STA_CHK)
>   		return -ENODEV;
>   
> -	if (!ctx->typec_port)
> +	if (!anx7625_need_pd(ctx))
>   		anx7625_disable_pd_protocol(ctx);
>   	anx7625_configure_hpd(ctx);
>   
> @@ -2924,12 +2936,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
>   	}
>   
>   	if (!platform->pdata.low_power_mode) {
> -		struct fwnode_handle *fwnode;
> -
> -		fwnode = device_get_named_child_node(dev, "connector");
> -		if (fwnode)
> -			fwnode_handle_put(fwnode);
> -		else
> +		if (!anx7625_need_pd(platform))
>   			anx7625_disable_pd_protocol(platform);
>   
>   		anx7625_configure_hpd(platform);
> 
> ---
> base-commit: 400a84e1f7a3681ef24d58d49b5d07e81c14f4e9
> change-id: 20260211-anx7625-fix-pd-792609132331
> 
> Best regards,

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil
Re: [PATCH] drm: bridge: anx7625: correctly detect if PD can be disabled
Posted by Loic Poulain 1 month, 2 weeks ago
On Wed, Feb 11, 2026 at 10:17 AM Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> wrote:
>
> During initial checks the ANX7625 bridge can be powered on before
> setting up the Type-C port. At this point, when
> anx7625_ocm_loading_check() checks if it can disable PD or not, it will
> notice that typec_port is not set and disable PD, breaking orientation
> and HPD handling. Unify the check between anx7625_ocm_loading_check()
> anx7625_i2c_probe() and anx7625_typec_register() and check for the
> presence of the "connector" node.
>
> Fixes: 8ad0f7d2e6fd ("drm: bridge: anx7625: implement message sending")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Tested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>

> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index c43519097a45..1157a58cf1b1 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1363,6 +1363,18 @@ static void anx7625_configure_hpd(struct anx7625_data *ctx)
>         anx7625_hpd_timer_config(ctx);
>  }
>
> +static bool anx7625_need_pd(struct anx7625_data *ctx)
> +{
> +       struct fwnode_handle *fwnode;
> +
> +       fwnode = device_get_named_child_node(ctx->dev, "connector");
> +       if (!fwnode)
> +               return false;
> +
> +       fwnode_handle_put(fwnode);
> +       return true;
> +}
> +
>  static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
>  {
>         int ret;
> @@ -1378,7 +1390,7 @@ static int anx7625_ocm_loading_check(struct anx7625_data *ctx)
>         if ((ret & FLASH_LOAD_STA_CHK) != FLASH_LOAD_STA_CHK)
>                 return -ENODEV;
>
> -       if (!ctx->typec_port)
> +       if (!anx7625_need_pd(ctx))
>                 anx7625_disable_pd_protocol(ctx);
>         anx7625_configure_hpd(ctx);
>
> @@ -2924,12 +2936,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
>         }
>
>         if (!platform->pdata.low_power_mode) {
> -               struct fwnode_handle *fwnode;
> -
> -               fwnode = device_get_named_child_node(dev, "connector");
> -               if (fwnode)
> -                       fwnode_handle_put(fwnode);
> -               else
> +               if (!anx7625_need_pd(platform))
>                         anx7625_disable_pd_protocol(platform);
>
>                 anx7625_configure_hpd(platform);
>
> ---
> base-commit: 400a84e1f7a3681ef24d58d49b5d07e81c14f4e9
> change-id: 20260211-anx7625-fix-pd-792609132331
>
> Best regards,
> --
> With best wishes
> Dmitry
>
>