Skip to content

Commit

Permalink
drm/bridge: adv7511: make it honour next bridge in DT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dmitry Baryshkov authored and Neil Armstrong committed Apr 24, 2024
1 parent 251e3c1 commit 14b3cdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/bridge/adv7511/adv7511.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ struct adv7511 {
enum drm_connector_status status;
bool powered;

struct drm_bridge *next_bridge;
struct drm_display_mode curr_mode;

unsigned int f_tmds;
Expand Down
12 changes: 12 additions & 0 deletions drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_of.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>

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

if (adv->next_bridge) {
ret = drm_bridge_attach(bridge->encoder, adv->next_bridge, bridge, flags);
if (ret)
return ret;
}

if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
ret = adv7511_connector_init(adv);
if (ret < 0)
Expand Down Expand Up @@ -1221,6 +1228,11 @@ static int adv7511_probe(struct i2c_client *i2c)

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

ret = drm_of_find_panel_or_bridge(dev->of_node, 1, -1, NULL,
&adv7511->next_bridge);
if (ret && ret != -ENODEV)
return ret;

if (adv7511->info->link_config)
ret = adv7511_parse_dt(dev->of_node, &link_config);
else
Expand Down

0 comments on commit 14b3cdb

Please sign in to comment.