diff mbox series

drm/bridge: tc358767: Fix DP bridge mode detection from DT endpoints

Message ID 20220429204625.241591-1-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series drm/bridge: tc358767: Fix DP bridge mode detection from DT endpoints | expand

Commit Message

Marek Vasut April 29, 2022, 8:46 p.m. UTC
Per toshiba,tc358767.yaml DT binding document, port@2 the output (e)DP
port is optional. In case this port is not described in DT, the bridge
driver operates in DPI-to-DP mode. Make sure the driver treats this as
a valid mode of operation instead of reporting invalid mode.

Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 drivers/gpu/drm/bridge/tc358767.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Lucas Stach May 4, 2022, 2:45 p.m. UTC | #1
Am Freitag, dem 29.04.2022 um 22:46 +0200 schrieb Marek Vasut:
> Per toshiba,tc358767.yaml DT binding document, port@2 the output (e)DP
> port is optional. In case this port is not described in DT, the bridge
> driver operates in DPI-to-DP mode. Make sure the driver treats this as
> a valid mode of operation instead of reporting invalid mode.
> 
> Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT")
> Signed-off-by: Marek Vasut <marex@denx.de>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Maxime Ripard <maxime@cerno.tech>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  drivers/gpu/drm/bridge/tc358767.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 7dde71313b84..485717c8f0b4 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -1964,7 +1964,9 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
>  	struct of_endpoint endpoint;
>  	struct device_node *node = NULL;
>  	const u8 mode_dpi_to_edp = BIT(1) | BIT(2);
> +	const u8 mode_dpi_to_dp = BIT(1);
>  	const u8 mode_dsi_to_edp = BIT(0) | BIT(2);
> +	const u8 mode_dsi_to_dp = BIT(0);
>  	const u8 mode_dsi_to_dpi = BIT(0) | BIT(1);
>  	u8 mode = 0;
>  
> @@ -1990,11 +1992,11 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
>  		mode |= BIT(endpoint.port);
>  	}
>  
> -	if (mode == mode_dpi_to_edp)
> +	if (mode == mode_dpi_to_edp || mode == mode_dpi_to_dp)
>  		return tc_probe_edp_bridge_endpoint(tc);
>  	else if (mode == mode_dsi_to_dpi)
>  		return tc_probe_dpi_bridge_endpoint(tc);
> -	else if (mode == mode_dsi_to_edp)
> +	else if (mode == mode_dsi_to_edp || mode == mode_dsi_to_dp)
>  		dev_warn(dev, "The mode DSI-to-(e)DP is not supported!\n");
>  	else
>  		dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 7dde71313b84..485717c8f0b4 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1964,7 +1964,9 @@  static int tc_probe_bridge_endpoint(struct tc_data *tc)
 	struct of_endpoint endpoint;
 	struct device_node *node = NULL;
 	const u8 mode_dpi_to_edp = BIT(1) | BIT(2);
+	const u8 mode_dpi_to_dp = BIT(1);
 	const u8 mode_dsi_to_edp = BIT(0) | BIT(2);
+	const u8 mode_dsi_to_dp = BIT(0);
 	const u8 mode_dsi_to_dpi = BIT(0) | BIT(1);
 	u8 mode = 0;
 
@@ -1990,11 +1992,11 @@  static int tc_probe_bridge_endpoint(struct tc_data *tc)
 		mode |= BIT(endpoint.port);
 	}
 
-	if (mode == mode_dpi_to_edp)
+	if (mode == mode_dpi_to_edp || mode == mode_dpi_to_dp)
 		return tc_probe_edp_bridge_endpoint(tc);
 	else if (mode == mode_dsi_to_dpi)
 		return tc_probe_dpi_bridge_endpoint(tc);
-	else if (mode == mode_dsi_to_edp)
+	else if (mode == mode_dsi_to_edp || mode == mode_dsi_to_dp)
 		dev_warn(dev, "The mode DSI-to-(e)DP is not supported!\n");
 	else
 		dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode);