summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hotplug.c
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2017-08-11 11:26:50 -0700
committerRodrigo Vivi <rodrigo.vivi@intel.com>2017-08-11 11:53:47 -0700
commitf761bef2f341015eb1ad8a8840187a989c4893f2 (patch)
treea7be0e62a4da5e1906e57dedba942c5af1d01a2d /drivers/gpu/drm/i915/intel_hotplug.c
parent256cfdde42c0f8f74d417875f71ea864e686917b (diff)
downloadlinux-stable-f761bef2f341015eb1ad8a8840187a989c4893f2.tar.gz
linux-stable-f761bef2f341015eb1ad8a8840187a989c4893f2.tar.bz2
linux-stable-f761bef2f341015eb1ad8a8840187a989c4893f2.zip
drm/i915: Introduce intel_hpd_pin function.
The idea is to have an unique place to decide the pin-port per platform. So let's create this function now without any functional change. Just adding together code from hdmi and dp together. v2: Add missing pin for port A. v3: Fix typo on subject. Avoid behaviour change so add WARN_ON and return if port A on HDMI. (by DK). Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170811182650.14327-2-rodrigo.vivi@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hotplug.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hotplug.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index d442d9f012d6..875d5d218d5c 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -101,6 +101,32 @@ enum port intel_hpd_pin_to_port(enum hpd_pin pin)
}
}
+/**
+ * intel_hpd_pin - return pin hard associated with certain port.
+ * @port: the hpd port to get associated pin
+ *
+ * Return pin that is associatade with @port and HDP_NONE if no pin is
+ * hard associated with that @port.
+ */
+enum hpd_pin intel_hpd_pin(enum port port)
+{
+ switch (port) {
+ case PORT_A:
+ return HPD_PORT_A;
+ case PORT_B:
+ return HPD_PORT_B;
+ case PORT_C:
+ return HPD_PORT_C;
+ case PORT_D:
+ return HPD_PORT_D;
+ case PORT_E:
+ return HPD_PORT_E;
+ default:
+ MISSING_CASE(port);
+ return HPD_NONE;
+ }
+}
+
#define HPD_STORM_DETECT_PERIOD 1000
#define HPD_STORM_REENABLE_DELAY (2 * 60 * 1000)