[PATCH v5 2/5] drm/dp: Add drm_dp_dpcd_read_link_status() (original) (raw)
Thierry Reding thierry.reding at gmail.com
Thu Feb 20 07:55:31 PST 2014
- Previous message: [PATCH v5 1/5] drm/dp: Add AUX channel infrastructure
- Next message: [PATCH v5 3/5] drm/dp: Add DisplayPort link helpers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Thierry Reding <treding at nvidia.com>
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 at amd.com> Reviewed-by: Jani Nikula <jani.nikula at intel.com> Signed-off-by: Thierry Reding <treding at nvidia.com>
drivers/gpu/drm/drm_dp_helper.c | 16 ++++++++++++++++ include/drm/drm_dp_helper.h | 3 +++ 2 files changed, 19 insertions(+)
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, 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); diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 0eb29f089e61..8759ce6ce97f 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -487,4 +487,7 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, return drm_dp_dpcd_write(aux, offset, &value, 1); } +int drm_dp_dpcd_read_link_status(struct drm_dp_aux aux, + u8 status[DP_LINK_STATUS_SIZE]); + #endif / DRM_DP_HELPER_H */
1.8.4.2
- Previous message: [PATCH v5 1/5] drm/dp: Add AUX channel infrastructure
- Next message: [PATCH v5 3/5] drm/dp: Add DisplayPort link helpers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]