drm/i915/dp: move dp aux ch register init to aux init
authorJani Nikula <jani.nikula@intel.com>
Fri, 14 Mar 2014 14:51:16 +0000 (16:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 18 Mar 2014 14:05:47 +0000 (15:05 +0100)
Do a slight rearrangement of the switch to prep for follow-up.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dp.c

index b31f6db..623b50c 100644 (file)
@@ -643,6 +643,28 @@ static void
 intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector *connector)
 {
        struct drm_device *dev = intel_dp_to_dev(intel_dp);
+       struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+       enum port port = intel_dig_port->port;
+
+       switch (port) {
+       case PORT_A:
+               intel_dp->aux_ch_ctl_reg = DPA_AUX_CH_CTL;
+               break;
+       case PORT_B:
+               intel_dp->aux_ch_ctl_reg = PCH_DPB_AUX_CH_CTL;
+               break;
+       case PORT_C:
+               intel_dp->aux_ch_ctl_reg = PCH_DPC_AUX_CH_CTL;
+               break;
+       case PORT_D:
+               intel_dp->aux_ch_ctl_reg = PCH_DPD_AUX_CH_CTL;
+               break;
+       default:
+               BUG();
+       }
+
+       if (!HAS_DDI(dev))
+               intel_dp->aux_ch_ctl_reg = intel_dp->output_reg + 0x10;
 
        intel_dp->aux.dev = dev->dev;
        intel_dp->aux.transfer = intel_dp_aux_transfer;
@@ -3849,26 +3871,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
                intel_connector->get_hw_state = intel_connector_get_hw_state;
        intel_connector->unregister = intel_dp_connector_unregister;
 
-       intel_dp->aux_ch_ctl_reg = intel_dp->output_reg + 0x10;
-       if (HAS_DDI(dev)) {
-               switch (intel_dig_port->port) {
-               case PORT_A:
-                       intel_dp->aux_ch_ctl_reg = DPA_AUX_CH_CTL;
-                       break;
-               case PORT_B:
-                       intel_dp->aux_ch_ctl_reg = PCH_DPB_AUX_CH_CTL;
-                       break;
-               case PORT_C:
-                       intel_dp->aux_ch_ctl_reg = PCH_DPC_AUX_CH_CTL;
-                       break;
-               case PORT_D:
-                       intel_dp->aux_ch_ctl_reg = PCH_DPD_AUX_CH_CTL;
-                       break;
-               default:
-                       BUG();
-               }
-       }
-
        /* Set up the DDC bus. */
        switch (port) {
        case PORT_A: