diff options
author | Thierry Reding <treding@nvidia.com> | 2013-11-22 10:37:57 -0500 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-02-26 11:21:33 -0500 |
commit | 8d4adc6a5807ca51999421b4d6d4f193c95775ba (patch) | |
tree | ca44fc42336d1a5d786f89fada9f9a9cb6d25a2e | |
parent | c197db75ff5c1d4f015c7668a3715e230a5d7e27 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/drm_dp_helper.c | 16 | ||||
-rw-r--r-- | include/drm/drm_dp_helper.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index da6bcfe178a6..84262ed64ce7 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, | |||
456 | size); | 456 | size); |
457 | } | 457 | } |
458 | EXPORT_SYMBOL(drm_dp_dpcd_write); | 458 | EXPORT_SYMBOL(drm_dp_dpcd_write); |
459 | |||
460 | /** | ||
461 | * drm_dp_dpcd_read_link_status() - read DPCD link status (bytes 0x202-0x207) | ||
462 | * @aux: DisplayPort AUX channel | ||
463 | * @status: buffer to store the link status in (must be at least 6 bytes) | ||
464 | * | ||
465 | * Returns the number of bytes transferred on success or a negative error | ||
466 | * code on failure. | ||
467 | */ | ||
468 | int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, | ||
469 | u8 status[DP_LINK_STATUS_SIZE]) | ||
470 | { | ||
471 | return drm_dp_dpcd_read(aux, DP_LANE0_1_STATUS, status, | ||
472 | DP_LINK_STATUS_SIZE); | ||
473 | } | ||
474 | EXPORT_SYMBOL(drm_dp_dpcd_read_link_status); | ||
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 70f18eb3ca1a..a78711feb0d1 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -477,4 +477,7 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, | |||
477 | return drm_dp_dpcd_write(aux, offset, &value, 1); | 477 | return drm_dp_dpcd_write(aux, offset, &value, 1); |
478 | } | 478 | } |
479 | 479 | ||
480 | int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, | ||
481 | u8 status[DP_LINK_STATUS_SIZE]); | ||
482 | |||
480 | #endif /* _DRM_DP_HELPER_H_ */ | 483 | #endif /* _DRM_DP_HELPER_H_ */ |