Commit 9642c81c authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915: split g4x_digital_port_connected to g4x and vlv variants

Choose the right function at the intel_digital_port_connected level.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarDurgadoss R <durgadoss.r@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 0df53b77
...@@ -4533,38 +4533,44 @@ static bool cpt_digital_port_connected(struct drm_i915_private *dev_priv, ...@@ -4533,38 +4533,44 @@ static bool cpt_digital_port_connected(struct drm_i915_private *dev_priv,
static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv, static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
struct intel_digital_port *port) struct intel_digital_port *port)
{ {
uint32_t bit; u32 bit;
if (IS_VALLEYVIEW(dev_priv)) { switch (port->port) {
switch (port->port) { case PORT_B:
case PORT_B: bit = PORTB_HOTPLUG_LIVE_STATUS_G4X;
bit = PORTB_HOTPLUG_LIVE_STATUS_VLV; break;
break; case PORT_C:
case PORT_C: bit = PORTC_HOTPLUG_LIVE_STATUS_G4X;
bit = PORTC_HOTPLUG_LIVE_STATUS_VLV; break;
break; case PORT_D:
case PORT_D: bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
bit = PORTD_HOTPLUG_LIVE_STATUS_VLV; break;
break; default:
default: MISSING_CASE(port->port);
MISSING_CASE(port->port); return false;
return false; }
}
} else { return I915_READ(PORT_HOTPLUG_STAT) & bit;
switch (port->port) { }
case PORT_B:
bit = PORTB_HOTPLUG_LIVE_STATUS_G4X; static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv,
break; struct intel_digital_port *port)
case PORT_C: {
bit = PORTC_HOTPLUG_LIVE_STATUS_G4X; u32 bit;
break;
case PORT_D: switch (port->port) {
bit = PORTD_HOTPLUG_LIVE_STATUS_G4X; case PORT_B:
break; bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
default: break;
MISSING_CASE(port->port); case PORT_C:
return false; bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
} break;
case PORT_D:
bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
break;
default:
MISSING_CASE(port->port);
return false;
} }
return I915_READ(PORT_HOTPLUG_STAT) & bit; return I915_READ(PORT_HOTPLUG_STAT) & bit;
...@@ -4584,6 +4590,8 @@ static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, ...@@ -4584,6 +4590,8 @@ static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
return ibx_digital_port_connected(dev_priv, port); return ibx_digital_port_connected(dev_priv, port);
if (HAS_PCH_SPLIT(dev_priv)) if (HAS_PCH_SPLIT(dev_priv))
return cpt_digital_port_connected(dev_priv, port); return cpt_digital_port_connected(dev_priv, port);
else if (IS_VALLEYVIEW(dev_priv))
return vlv_digital_port_connected(dev_priv, port);
else else
return g4x_digital_port_connected(dev_priv, port); return g4x_digital_port_connected(dev_priv, port);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment