Commit 58074b08 authored by Stephen Boyd's avatar Stephen Boyd Committed by Sam Ravnborg

drm/bridge: ti-sn65dsi86: Read EDID blob over DDC

Use the DDC connection to read the EDID from the eDP panel instead of
relying on the panel to tell us the modes.
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarLaurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Sean Paul <seanpaul@chromium.org>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102181144.3469197-4-swboyd@chromium.org
parent b38558e3
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
* @debugfs: Used for managing our debugfs. * @debugfs: Used for managing our debugfs.
* @host_node: Remote DSI node. * @host_node: Remote DSI node.
* @dsi: Our MIPI DSI source. * @dsi: Our MIPI DSI source.
* @edid: Detected EDID of eDP panel.
* @refclk: Our reference clock. * @refclk: Our reference clock.
* @panel: Our panel. * @panel: Our panel.
* @enable_gpio: The GPIO we toggle to enable the bridge. * @enable_gpio: The GPIO we toggle to enable the bridge.
...@@ -146,6 +147,7 @@ struct ti_sn_bridge { ...@@ -146,6 +147,7 @@ struct ti_sn_bridge {
struct drm_bridge bridge; struct drm_bridge bridge;
struct drm_connector connector; struct drm_connector connector;
struct dentry *debugfs; struct dentry *debugfs;
struct edid *edid;
struct device_node *host_node; struct device_node *host_node;
struct mipi_dsi_device *dsi; struct mipi_dsi_device *dsi;
struct clk *refclk; struct clk *refclk;
...@@ -267,6 +269,23 @@ connector_to_ti_sn_bridge(struct drm_connector *connector) ...@@ -267,6 +269,23 @@ connector_to_ti_sn_bridge(struct drm_connector *connector)
static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector)
{ {
struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector);
struct edid *edid = pdata->edid;
int num, ret;
if (!edid) {
pm_runtime_get_sync(pdata->dev);
edid = pdata->edid = drm_get_edid(connector, &pdata->aux.ddc);
pm_runtime_put(pdata->dev);
}
if (edid && drm_edid_is_valid(edid)) {
ret = drm_connector_update_edid_property(connector, edid);
if (!ret) {
num = drm_add_edid_modes(connector, edid);
if (num)
return num;
}
}
return drm_panel_get_modes(pdata->panel, connector); return drm_panel_get_modes(pdata->panel, connector);
} }
...@@ -1262,6 +1281,7 @@ static int ti_sn_bridge_remove(struct i2c_client *client) ...@@ -1262,6 +1281,7 @@ static int ti_sn_bridge_remove(struct i2c_client *client)
if (!pdata) if (!pdata)
return -EINVAL; return -EINVAL;
kfree(pdata->edid);
ti_sn_debugfs_remove(pdata); ti_sn_debugfs_remove(pdata);
of_node_put(pdata->host_node); of_node_put(pdata->host_node);
......
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