enum hpd_pin {
HPD_NONE = 0,
- HPD_PORT_A = HPD_NONE, /* PORT_A is internal */
HPD_TV = HPD_NONE, /* TV is known to be unreliable */
HPD_CRT,
HPD_SDVO_B,
HPD_SDVO_C,
+ HPD_PORT_A,
HPD_PORT_B,
HPD_PORT_C,
HPD_PORT_D,
void intel_hpd_init(struct drm_i915_private *dev_priv);
void intel_hpd_init_work(struct drm_i915_private *dev_priv);
void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
-enum port intel_hpd_pin_to_port(enum hpd_pin pin);
+bool intel_hpd_pin_to_port(enum hpd_pin pin, enum port *port);
/* i915_irq.c */
void i915_queue_hangcheck(struct drm_device *dev);
*pin_mask |= BIT(i);
- port = intel_hpd_pin_to_port(i);
+ if (!intel_hpd_pin_to_port(i, &port))
+ continue;
+
if (long_pulse_detect(port, dig_hotplug_reg))
*long_mask |= BIT(i);
}
* it will use i915_hotplug_work_func where this logic is handled.
*/
-enum port intel_hpd_pin_to_port(enum hpd_pin pin)
+bool intel_hpd_pin_to_port(enum hpd_pin pin, enum port *port)
{
switch (pin) {
+ case HPD_PORT_A:
+ *port = PORT_A;
+ return true;
case HPD_PORT_B:
- return PORT_B;
+ *port = PORT_B;
+ return true;
case HPD_PORT_C:
- return PORT_C;
+ *port = PORT_C;
+ return true;
case HPD_PORT_D:
- return PORT_D;
+ *port = PORT_D;
+ return true;
default:
- return PORT_A; /* no hpd */
+ return false; /* no hpd */
}
}
if (!(BIT(i) & pin_mask))
continue;
- port = intel_hpd_pin_to_port(i);
- is_dig_port = port && dev_priv->hotplug.irq_port[port];
+ is_dig_port = intel_hpd_pin_to_port(i, &port) &&
+ dev_priv->hotplug.irq_port[port];
if (is_dig_port) {
bool long_hpd = long_mask & BIT(i);