drm/i915: split ibx_digital_port_connected to ibx and cpt variants

Choose the right function at the intel_digital_port_connected level.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Jani Nikula 2015-08-20 10:47:40 +03:00 committed by Daniel Vetter
parent 7e66bcf265
commit 0df53b7728
1 changed files with 43 additions and 35 deletions

View File

@ -4485,40 +4485,46 @@ static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
{ {
u32 bit; u32 bit;
if (HAS_PCH_IBX(dev_priv->dev)) { switch (port->port) {
switch (port->port) { case PORT_A:
case PORT_A: return true;
return true; case PORT_B:
case PORT_B: bit = SDE_PORTB_HOTPLUG;
bit = SDE_PORTB_HOTPLUG; break;
break; case PORT_C:
case PORT_C: bit = SDE_PORTC_HOTPLUG;
bit = SDE_PORTC_HOTPLUG; break;
break; case PORT_D:
case PORT_D: bit = SDE_PORTD_HOTPLUG;
bit = SDE_PORTD_HOTPLUG; break;
break; default:
default: MISSING_CASE(port->port);
MISSING_CASE(port->port); return false;
return false; }
}
} else { return I915_READ(SDEISR) & bit;
switch (port->port) { }
case PORT_A:
return true; static bool cpt_digital_port_connected(struct drm_i915_private *dev_priv,
case PORT_B: struct intel_digital_port *port)
bit = SDE_PORTB_HOTPLUG_CPT; {
break; u32 bit;
case PORT_C:
bit = SDE_PORTC_HOTPLUG_CPT; switch (port->port) {
break; case PORT_A:
case PORT_D: return true;
bit = SDE_PORTD_HOTPLUG_CPT; case PORT_B:
break; bit = SDE_PORTB_HOTPLUG_CPT;
default: break;
MISSING_CASE(port->port); case PORT_C:
return false; bit = SDE_PORTC_HOTPLUG_CPT;
} break;
case PORT_D:
bit = SDE_PORTD_HOTPLUG_CPT;
break;
default:
MISSING_CASE(port->port);
return false;
} }
return I915_READ(SDEISR) & bit; return I915_READ(SDEISR) & bit;
@ -4574,8 +4580,10 @@ static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
struct intel_digital_port *port) struct intel_digital_port *port)
{ {
if (HAS_PCH_SPLIT(dev_priv)) if (HAS_PCH_IBX(dev_priv))
return ibx_digital_port_connected(dev_priv, port); return ibx_digital_port_connected(dev_priv, port);
if (HAS_PCH_SPLIT(dev_priv))
return cpt_digital_port_connected(dev_priv, port);
else else
return g4x_digital_port_connected(dev_priv, port); return g4x_digital_port_connected(dev_priv, port);
} }