diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-07-17 16:53:45 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-25 12:23:48 -0400 |
commit | ab9d7c302af858e1bc8f613c3a6f1eea3c4c0364 (patch) | |
tree | df67556c2ba40c048fcf564afeb8357f4ca2cd27 /drivers/gpu/drm/i915/intel_dp.c | |
parent | 47ea7542a1ac33ba9f15608d2fca00abcc1c11e5 (diff) |
drm/i915: add port field to struct intel_dp and use it
This will be needed for Haswell, but already has its uses here.
This patch started as a small patch written patch by Shobhit Kumar,
but it has changed so much that none of its original lines remain.
Credits-to: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 61400c1fef0f..ad90a499dab7 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -2426,7 +2426,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect | |||
2426 | } | 2426 | } |
2427 | 2427 | ||
2428 | void | 2428 | void |
2429 | intel_dp_init(struct drm_device *dev, int output_reg) | 2429 | intel_dp_init(struct drm_device *dev, int output_reg, enum port port) |
2430 | { | 2430 | { |
2431 | struct drm_i915_private *dev_priv = dev->dev_private; | 2431 | struct drm_i915_private *dev_priv = dev->dev_private; |
2432 | struct drm_connector *connector; | 2432 | struct drm_connector *connector; |
@@ -2441,6 +2441,7 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2441 | return; | 2441 | return; |
2442 | 2442 | ||
2443 | intel_dp->output_reg = output_reg; | 2443 | intel_dp->output_reg = output_reg; |
2444 | intel_dp->port = port; | ||
2444 | intel_dp->dpms_mode = -1; | 2445 | intel_dp->dpms_mode = -1; |
2445 | 2446 | ||
2446 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 2447 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
@@ -2486,28 +2487,25 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2486 | drm_sysfs_connector_add(connector); | 2487 | drm_sysfs_connector_add(connector); |
2487 | 2488 | ||
2488 | /* Set up the DDC bus. */ | 2489 | /* Set up the DDC bus. */ |
2489 | switch (output_reg) { | 2490 | switch (port) { |
2490 | case DP_A: | 2491 | case PORT_A: |
2491 | name = "DPDDC-A"; | 2492 | name = "DPDDC-A"; |
2492 | break; | 2493 | break; |
2493 | case DP_B: | 2494 | case PORT_B: |
2494 | case PCH_DP_B: | 2495 | dev_priv->hotplug_supported_mask |= DPB_HOTPLUG_INT_STATUS; |
2495 | dev_priv->hotplug_supported_mask |= | 2496 | name = "DPDDC-B"; |
2496 | DPB_HOTPLUG_INT_STATUS; | 2497 | break; |
2497 | name = "DPDDC-B"; | 2498 | case PORT_C: |
2498 | break; | 2499 | dev_priv->hotplug_supported_mask |= DPC_HOTPLUG_INT_STATUS; |
2499 | case DP_C: | 2500 | name = "DPDDC-C"; |
2500 | case PCH_DP_C: | 2501 | break; |
2501 | dev_priv->hotplug_supported_mask |= | 2502 | case PORT_D: |
2502 | DPC_HOTPLUG_INT_STATUS; | 2503 | dev_priv->hotplug_supported_mask |= DPD_HOTPLUG_INT_STATUS; |
2503 | name = "DPDDC-C"; | 2504 | name = "DPDDC-D"; |
2504 | break; | 2505 | break; |
2505 | case DP_D: | 2506 | default: |
2506 | case PCH_DP_D: | 2507 | WARN(1, "Invalid port %c\n", port_name(port)); |
2507 | dev_priv->hotplug_supported_mask |= | 2508 | break; |
2508 | DPD_HOTPLUG_INT_STATUS; | ||
2509 | name = "DPDDC-D"; | ||
2510 | break; | ||
2511 | } | 2509 | } |
2512 | 2510 | ||
2513 | intel_dp_i2c_init(intel_dp, intel_connector, name); | 2511 | intel_dp_i2c_init(intel_dp, intel_connector, name); |