Commit fed9d35d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Sam Ravnborg

drm: bridge: adv7511: Split EDID read to a separate function

To prepare for the implementation of the DRM bridge connector
operations, move EDID read out of adv7511_get_modes() to a separate
function.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-2-laurent.pinchart+renesas@ideasonboard.com
parent c9bb9d66
...@@ -589,11 +589,10 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, ...@@ -589,11 +589,10 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
* ADV75xx helpers * ADV75xx helpers
*/ */
static int adv7511_get_modes(struct adv7511 *adv7511, static struct edid *adv7511_get_edid(struct adv7511 *adv7511,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct edid *edid; struct edid *edid;
unsigned int count;
/* Reading the EDID only works if the device is powered */ /* Reading the EDID only works if the device is powered */
if (!adv7511->powered) { if (!adv7511->powered) {
...@@ -612,15 +611,25 @@ static int adv7511_get_modes(struct adv7511 *adv7511, ...@@ -612,15 +611,25 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
if (!adv7511->powered) if (!adv7511->powered)
__adv7511_power_off(adv7511); __adv7511_power_off(adv7511);
drm_connector_update_edid_property(connector, edid);
count = drm_add_edid_modes(connector, edid);
adv7511_set_config_csc(adv7511, connector, adv7511->rgb, adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
drm_detect_hdmi_monitor(edid)); drm_detect_hdmi_monitor(edid));
cec_s_phys_addr_from_edid(adv7511->cec_adap, edid); cec_s_phys_addr_from_edid(adv7511->cec_adap, edid);
return edid;
}
static int adv7511_get_modes(struct adv7511 *adv7511,
struct drm_connector *connector)
{
struct edid *edid;
unsigned int count;
edid = adv7511_get_edid(adv7511, connector);
drm_connector_update_edid_property(connector, edid);
count = drm_add_edid_modes(connector, edid);
kfree(edid); kfree(edid);
return count; return count;
......
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