summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_dp_helper.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2013-11-22 16:37:57 +0100
committerThierry Reding <treding@nvidia.com>2014-02-26 17:21:33 +0100
commit8d4adc6a5807ca51999421b4d6d4f193c95775ba (patch)
treeca44fc42336d1a5d786f89fada9f9a9cb6d25a2e /drivers/gpu/drm/drm_dp_helper.c
parentc197db75ff5c1d4f015c7668a3715e230a5d7e27 (diff)
downloadop-kernel-dev-8d4adc6a5807ca51999421b4d6d4f193c95775ba.zip
op-kernel-dev-8d4adc6a5807ca51999421b4d6d4f193c95775ba.tar.gz
drm/dp: Add drm_dp_dpcd_read_link_status()
The function reads the link status (6 bytes starting at offset 0x202) from the DPCD so that it can be conveniently passed to other DPCD helpers. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/drm_dp_helper.c')
-rw-r--r--drivers/gpu/drm/drm_dp_helper.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index da6bcfe..84262ed 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -456,3 +456,19 @@ ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset,
size);
}
EXPORT_SYMBOL(drm_dp_dpcd_write);
+
+/**
+ * drm_dp_dpcd_read_link_status() - read DPCD link status (bytes 0x202-0x207)
+ * @aux: DisplayPort AUX channel
+ * @status: buffer to store the link status in (must be at least 6 bytes)
+ *
+ * Returns the number of bytes transferred on success or a negative error
+ * code on failure.
+ */
+int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
+ u8 status[DP_LINK_STATUS_SIZE])
+{
+ return drm_dp_dpcd_read(aux, DP_LANE0_1_STATUS, status,
+ DP_LINK_STATUS_SIZE);
+}
+EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
OpenPOWER on IntegriCloud