summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2016-02-12 07:46:08 +0530
committerMark Brown <broonie@kernel.org>2016-02-15 20:21:11 +0000
commit1aa8ec255370d3e6f60dfa4a8cdd5e1357b1ab78 (patch)
treed4f12af887a345b6a749643416f976b8710f3820 /include/drm
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
downloadop-kernel-dev-1aa8ec255370d3e6f60dfa4a8cdd5e1357b1ab78.zip
op-kernel-dev-1aa8ec255370d3e6f60dfa4a8cdd5e1357b1ab78.tar.gz
drm/edid: Add API to help find connection type
To fill the audio infoframe it is required to identify the connection type as DP or HDMI. This patch adds an API which parses ELD and returns the display type connected. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_edid.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 2af9769..dec6221 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -403,6 +403,18 @@ static inline int drm_eld_size(const uint8_t *eld)
return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4;
}
+/**
+ * drm_eld_get_conn_type - Get device type hdmi/dp connected
+ * @eld: pointer to an ELD memory structure
+ *
+ * The caller need to use %DRM_ELD_CONN_TYPE_HDMI or %DRM_ELD_CONN_TYPE_DP to
+ * identify the display type connected.
+ */
+static inline u8 drm_eld_get_conn_type(const uint8_t *eld)
+{
+ return eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_CONN_TYPE_MASK;
+}
+
struct edid *drm_do_get_edid(struct drm_connector *connector,
int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
size_t len),
OpenPOWER on IntegriCloud