Commit 2be68b59 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/bridge: panel: Implement bridge connector operations

Implement the newly added bridge connector operations, allowing the
usage of drm_bridge_panel with drm_bridge_connector.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-18-laurent.pinchart@ideasonboard.com
parent cff5e6f7
...@@ -60,10 +60,8 @@ static int panel_bridge_attach(struct drm_bridge *bridge, ...@@ -60,10 +60,8 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
struct drm_connector *connector = &panel_bridge->connector; struct drm_connector *connector = &panel_bridge->connector;
int ret; int ret;
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
DRM_ERROR("Fix bridge driver to make connector optional!"); return 0;
return -EINVAL;
}
if (!bridge->encoder) { if (!bridge->encoder) {
DRM_ERROR("Missing encoder\n"); DRM_ERROR("Missing encoder\n");
...@@ -126,6 +124,14 @@ static void panel_bridge_post_disable(struct drm_bridge *bridge) ...@@ -126,6 +124,14 @@ static void panel_bridge_post_disable(struct drm_bridge *bridge)
drm_panel_unprepare(panel_bridge->panel); drm_panel_unprepare(panel_bridge->panel);
} }
static int panel_bridge_get_modes(struct drm_bridge *bridge,
struct drm_connector *connector)
{
struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
return drm_panel_get_modes(panel_bridge->panel, connector);
}
static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
.attach = panel_bridge_attach, .attach = panel_bridge_attach,
.detach = panel_bridge_detach, .detach = panel_bridge_detach,
...@@ -133,6 +139,7 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = { ...@@ -133,6 +139,7 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
.enable = panel_bridge_enable, .enable = panel_bridge_enable,
.disable = panel_bridge_disable, .disable = panel_bridge_disable,
.post_disable = panel_bridge_post_disable, .post_disable = panel_bridge_post_disable,
.get_modes = panel_bridge_get_modes,
.atomic_reset = drm_atomic_helper_bridge_reset, .atomic_reset = drm_atomic_helper_bridge_reset,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
...@@ -206,6 +213,8 @@ struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel, ...@@ -206,6 +213,8 @@ struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel,
#ifdef CONFIG_OF #ifdef CONFIG_OF
panel_bridge->bridge.of_node = panel->dev->of_node; panel_bridge->bridge.of_node = panel->dev->of_node;
#endif #endif
panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES;
panel_bridge->bridge.type = connector_type;
drm_bridge_add(&panel_bridge->bridge); drm_bridge_add(&panel_bridge->bridge);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment