From 18df89fef2d5c7cfd15ab898b17a292d00222b0c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 27 Apr 2012 11:11:58 +0200 Subject: drm: Decouple EDID parsing from I2C adapter The drm_get_edid() function performs direct I2C accesses to read EDID blocks, assuming that the monitor DDC interface is directly connected to the I2C bus. It can't thus be used with HDMI encoders that control the DDC bus and expose EDID blocks through a different interface. Refactor drm_do_get_edid() to take a block read callback function instead of an I2C adapter, and export it for direct use by drivers. As in the general case the DDC bus is accessible by the kernel at the I2C level, drivers must make all reasonable efforts to expose it as an I2C adapter and use drm_get_edid() instead of abusing this function. Signed-off-by: Lars-Peter Clausen Signed-off-by: Laurent Pinchart Reviewed-by: Rob Clark Reviewed-by: Daniel Vetter --- include/drm/drm_edid.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/drm/drm_edid.h') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index c2f1bfa22010..d59240ffb1f7 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -381,4 +381,9 @@ static inline int drm_eld_size(const uint8_t *eld) return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4; } +struct edid *drm_do_get_edid(struct drm_connector *connector, + int (*get_edid_block)(void *data, u8 *buf, unsigned int block, + size_t len), + void *data); + #endif /* __DRM_EDID_H__ */ -- cgit v1.2.3