Skip to content

Commit 14b3cdb

Browse files
lumagsuperna9999
authored andcommitted
drm/bridge: adv7511: make it honour next bridge in DT
DT bindings for adv7511 and adv7533 bridges specify HDMI output to be present at the port@1. This allows board DT to add e.g. HDMI connector nodes or any other next chained bridge. Make adv7511 driver discover that bridge and attach it to the chain. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20240331-adv7511-next-bridge-v2-1-7356d61dc7b2@linaro.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240331-adv7511-next-bridge-v2-1-7356d61dc7b2@linaro.org
1 parent 251e3c1 commit 14b3cdb

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/gpu/drm/bridge/adv7511/adv7511.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ struct adv7511 {
356356
enum drm_connector_status status;
357357
bool powered;
358358

359+
struct drm_bridge *next_bridge;
359360
struct drm_display_mode curr_mode;
360361

361362
unsigned int f_tmds;

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <drm/drm_atomic.h>
1818
#include <drm/drm_atomic_helper.h>
1919
#include <drm/drm_edid.h>
20+
#include <drm/drm_of.h>
2021
#include <drm/drm_print.h>
2122
#include <drm/drm_probe_helper.h>
2223

@@ -951,6 +952,12 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge,
951952
struct adv7511 *adv = bridge_to_adv7511(bridge);
952953
int ret = 0;
953954

955+
if (adv->next_bridge) {
956+
ret = drm_bridge_attach(bridge->encoder, adv->next_bridge, bridge, flags);
957+
if (ret)
958+
return ret;
959+
}
960+
954961
if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
955962
ret = adv7511_connector_init(adv);
956963
if (ret < 0)
@@ -1221,6 +1228,11 @@ static int adv7511_probe(struct i2c_client *i2c)
12211228

12221229
memset(&link_config, 0, sizeof(link_config));
12231230

1231+
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, -1, NULL,
1232+
&adv7511->next_bridge);
1233+
if (ret && ret != -ENODEV)
1234+
return ret;
1235+
12241236
if (adv7511->info->link_config)
12251237
ret = adv7511_parse_dt(dev->of_node, &link_config);
12261238
else

0 commit comments

Comments
 (0)