diff mbox

[v3,10/12] drm/i915: Read DP branch device HW revision

Message ID 1464000657-16867-11-git-send-email-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kahola, Mika May 23, 2016, 10:50 a.m. UTC
HW revision is mandatory field for DisplayPort branch
devices. This is defined in DPCD register field 0x509.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++++
 include/drm/drm_dp_helper.h     | 2 ++
 2 files changed, 7 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2b768da..12ab26b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3463,6 +3463,11 @@  intel_dp_probe_oui(struct intel_dp *intel_dp)
 		if (drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_ID, intel_dp->bd.id,
 				     sizeof(intel_dp->bd.id)) == sizeof(intel_dp->bd.id))
 			DRM_DEBUG_KMS("Device ID: %s\n", intel_dp->bd.id);
+
+		if (drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &intel_dp->bd.hw_rev,
+				     sizeof(intel_dp->bd.hw_rev)) == sizeof(intel_dp->bd.hw_rev))
+			DRM_DEBUG_KMS("HW revision: %.2d.%.2d\n",
+				      intel_dp->bd.hw_rev & 0xf, (intel_dp->bd.hw_rev>>4) & 0xf);
 	}
 }
 
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index f1fc4e2..d0965ca 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -458,6 +458,7 @@ 
 #define DP_SINK_OUI			    0x400
 #define DP_BRANCH_OUI			    0x500
 #define DP_BRANCH_ID                        0x503
+#define DP_BRANCH_HW_REV                    0x509
 
 #define DP_SET_POWER                        0x600
 # define DP_SET_POWER_D0                    0x1
@@ -871,6 +872,7 @@  struct drm_dp_bd {
 	int type;
 	bool hpd;
 	uint8_t id[6];
+	uint8_t hw_rev;
 	union {
 		struct drm_dp_vga vga;
 		struct drm_dp_dvi dvi;