aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2013-12-09 05:47:55 -0500
committerThierry Reding <treding@nvidia.com>2014-02-26 11:21:34 -0500
commit516c0f7c0a608833cc01d3f5b2a357ee806b78a1 (patch)
tree2ba87f3b5c08202f106c753cf138b2eba991a126 /include
parent8d4adc6a5807ca51999421b4d6d4f193c95775ba (diff)
drm/dp: Add DisplayPort link helpers
Add a helper to probe a DP link (read out the supported DPCD revision, maximum rate, link count and capabilities) as well as power up the DP link and configure it accordingly. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Thierry Reding <treding@nvidia.com> --- Changes in v5: - export helpers Changes in v4: - fix a couple of typos in comments as pointed out by Alex Deucher Changes in v3: - split into drm_dp_link_power_up() and drm_dp_link_configure() - do not change sink state for DPCD versions earlier than 1.1 - sleep for 1-2 ms after setting local sink to D0 state - read and write consecutive registers where possible - read DPCD revision when link is probed - remove duplicate kerneldoc
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_dp_helper.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index a78711feb0d1..28ab6f4e3b09 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -291,6 +291,7 @@
291#define DP_SET_POWER 0x600 291#define DP_SET_POWER 0x600
292# define DP_SET_POWER_D0 0x1 292# define DP_SET_POWER_D0 0x1
293# define DP_SET_POWER_D3 0x2 293# define DP_SET_POWER_D3 0x2
294# define DP_SET_POWER_MASK 0x3
294 295
295#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */ 296#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */
296# define DP_PSR_LINK_CRC_ERROR (1 << 0) 297# define DP_PSR_LINK_CRC_ERROR (1 << 0)
@@ -480,4 +481,20 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux,
480int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, 481int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
481 u8 status[DP_LINK_STATUS_SIZE]); 482 u8 status[DP_LINK_STATUS_SIZE]);
482 483
484/*
485 * DisplayPort link
486 */
487#define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0)
488
489struct drm_dp_link {
490 unsigned char revision;
491 unsigned int rate;
492 unsigned int num_lanes;
493 unsigned long capabilities;
494};
495
496int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
497int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
498int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
499
483#endif /* _DRM_DP_HELPER_H_ */ 500#endif /* _DRM_DP_HELPER_H_ */