From: Jani Nikula Date: Thu, 20 Aug 2015 07:47:41 +0000 (+0300) Subject: drm/i915: split g4x_digital_port_connected to g4x and vlv variants X-Git-Tag: MMI-PSA29.97-13-9~7427^2~45^2~1593 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9642c81c225a43982536fcb7a3fa212dcfaa67ea;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Jani Nikula Reviewed-by: Durgadoss R Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 689dfe65d27b..e7ebacd51432 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -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, struct intel_digital_port *port) { - uint32_t bit; + u32 bit; - if (IS_VALLEYVIEW(dev_priv)) { - switch (port->port) { - case PORT_B: - bit = PORTB_HOTPLUG_LIVE_STATUS_VLV; - break; - case PORT_C: - bit = PORTC_HOTPLUG_LIVE_STATUS_VLV; - break; - case PORT_D: - bit = PORTD_HOTPLUG_LIVE_STATUS_VLV; - break; - default: - MISSING_CASE(port->port); - return false; - } - } else { - switch (port->port) { - case PORT_B: - bit = PORTB_HOTPLUG_LIVE_STATUS_G4X; - break; - case PORT_C: - bit = PORTC_HOTPLUG_LIVE_STATUS_G4X; - break; - case PORT_D: - bit = PORTD_HOTPLUG_LIVE_STATUS_G4X; - break; - default: - MISSING_CASE(port->port); - return false; - } + switch (port->port) { + case PORT_B: + bit = PORTB_HOTPLUG_LIVE_STATUS_G4X; + break; + case PORT_C: + bit = PORTC_HOTPLUG_LIVE_STATUS_G4X; + break; + case PORT_D: + bit = PORTD_HOTPLUG_LIVE_STATUS_G4X; + break; + default: + MISSING_CASE(port->port); + return false; + } + + return I915_READ(PORT_HOTPLUG_STAT) & bit; +} + +static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv, + struct intel_digital_port *port) +{ + u32 bit; + + switch (port->port) { + case PORT_B: + bit = PORTB_HOTPLUG_LIVE_STATUS_VLV; + break; + case PORT_C: + 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; @@ -4584,6 +4590,8 @@ static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, return ibx_digital_port_connected(dev_priv, port); if (HAS_PCH_SPLIT(dev_priv)) return cpt_digital_port_connected(dev_priv, port); + else if (IS_VALLEYVIEW(dev_priv)) + return vlv_digital_port_connected(dev_priv, port); else return g4x_digital_port_connected(dev_priv, port); }