Re: [PATCH 11/11] drm/bridge: tc358768: Add DRM_BRIDGE_ATTACH_NO_CONNECTOR support

From: Tomi Valkeinen
Date: Fri Aug 11 2023 - 12:58:27 EST


On 11/08/2023 19:44, Péter Ujfalusi wrote:


On 04/08/2023 13:44, Tomi Valkeinen wrote:

I would rather have a commit message than a blank one.

Oops...

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/bridge/tc358768.c | 64 +++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c
index ea19de5509ed..a567f136ddc7 100644
--- a/drivers/gpu/drm/bridge/tc358768.c
+++ b/drivers/gpu/drm/bridge/tc358768.c
@@ -131,8 +131,17 @@ static const char * const tc358768_supplies[] = {
struct tc358768_dsi_output {
struct mipi_dsi_device *dev;
+
+ /* Legacy field if DRM_BRIDGE_ATTACH_NO_CONNECTOR is not used */
struct drm_panel *panel;
- struct drm_bridge *bridge;
+
+ /*
+ * If DRM_BRIDGE_ATTACH_NO_CONNECTOR is not used and a panel is attached
+ * to tc358768, 'next_bridge' contains the bridge the driver created
+ * with drm_panel_bridge_add_typed(). Otherwise 'next_bridge' contains
+ * the next bridge the driver found.
+ */
+ struct drm_bridge *next_bridge;

why it is better to call it next_bridge than just bridge? Is there a
prev_bridge also?

There is, prev bridge would be the bridge behind tc358768 in the chain. Bridge is tc358768. Next bridge is the following one.

Here, it's in the tc358768_dsi_output struct, so bridge is perhaps ok. I just wanted to be extra clear here, as I think it's often called next_bridge in other drivers.

Tomi