Commit 232a6ee9 authored by Todd Previte's avatar Todd Previte Committed by Daniel Vetter

drm/i915: VLV2 - Fix hotplug detect bits

Add new definitions for hotplug live status bits for VLV2 since they're
in reverse order from the gen4x ones.

Changelog:
- Restored gen4 bit definitions
- Added new definitions for VLV2
- Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct
  bit defintions
- Replaced a lost trailing brace for the added switch()
Signed-off-by: default avatarTodd Previte <tprevite@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73951
[danvet: Switch to _VLV postfix instead of prefix and regroupg
comments again so that the g4x warning is right next to those defines.
Also add a _G4X suffix for those special ones. Also cc stable.]
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 43181011
...@@ -2122,9 +2122,13 @@ ...@@ -2122,9 +2122,13 @@
* Please check the detailed lore in the commit message for for experimental * Please check the detailed lore in the commit message for for experimental
* evidence. * evidence.
*/ */
#define PORTD_HOTPLUG_LIVE_STATUS (1 << 29) #define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 29)
#define PORTC_HOTPLUG_LIVE_STATUS (1 << 28) #define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28)
#define PORTB_HOTPLUG_LIVE_STATUS (1 << 27) #define PORTB_HOTPLUG_LIVE_STATUS_G4X (1 << 27)
/* VLV DP/HDMI bits again match Bspec */
#define PORTD_HOTPLUG_LIVE_STATUS_VLV (1 << 27)
#define PORTC_HOTPLUG_LIVE_STATUS_VLV (1 << 28)
#define PORTB_HOTPLUG_LIVE_STATUS_VLV (1 << 29)
#define PORTD_HOTPLUG_INT_STATUS (3 << 21) #define PORTD_HOTPLUG_INT_STATUS (3 << 21)
#define PORTC_HOTPLUG_INT_STATUS (3 << 19) #define PORTC_HOTPLUG_INT_STATUS (3 << 19)
#define PORTB_HOTPLUG_INT_STATUS (3 << 17) #define PORTB_HOTPLUG_INT_STATUS (3 << 17)
......
...@@ -3009,19 +3009,35 @@ g4x_dp_detect(struct intel_dp *intel_dp) ...@@ -3009,19 +3009,35 @@ g4x_dp_detect(struct intel_dp *intel_dp)
return status; return status;
} }
if (IS_VALLEYVIEW(dev)) {
switch (intel_dig_port->port) { switch (intel_dig_port->port) {
case PORT_B: case PORT_B:
bit = PORTB_HOTPLUG_LIVE_STATUS; bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
break; break;
case PORT_C: case PORT_C:
bit = PORTC_HOTPLUG_LIVE_STATUS; bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
break; break;
case PORT_D: case PORT_D:
bit = PORTD_HOTPLUG_LIVE_STATUS; bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
break; break;
default: default:
return connector_status_unknown; return connector_status_unknown;
} }
} else {
switch (intel_dig_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:
return connector_status_unknown;
}
}
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0) if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
return connector_status_disconnected; return connector_status_disconnected;
......
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