On Sun, 19 Sep 2010 14:52:07 +0800, Zhenyu Wang <zhenyuw@xxxxxxxxxxxxxxx> wrote: > This will turn on DP audio output by checking monitor's audio > capability. > > Tested-by: Wu Fengguang <fengguang.wu@xxxxxxxxx> > Signed-off-by: Zhenyu Wang <zhenyuw@xxxxxxxxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_dp.c | 61 +++++++++++++++++++++++---------------- > 1 files changed, 36 insertions(+), 25 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index 208a4ec..81fca1e 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -1444,39 +1444,50 @@ intel_dp_detect(struct drm_connector *connector) > struct drm_i915_private *dev_priv = dev->dev_private; > uint32_t temp, bit; > enum drm_connector_status status; > + struct edid *edid = NULL; > > intel_dp->has_audio = false; > > - if (HAS_PCH_SPLIT(dev)) > - return ironlake_dp_detect(connector); > + if (HAS_PCH_SPLIT(dev)) { > + status = ironlake_dp_detect(connector); > + } else { > + switch (intel_dp->output_reg) { > + case DP_B: > + bit = DPB_HOTPLUG_INT_STATUS; > + break; > + case DP_C: > + bit = DPC_HOTPLUG_INT_STATUS; > + break; > + case DP_D: > + bit = DPD_HOTPLUG_INT_STATUS; > + break; > + default: > + return connector_status_unknown; > + } Move the switch and register check into a separate function, so the main detect body becomes: if (HAS_PCH_SPLIT(dev)) status = ironlake_dp_detect(connector); else status = g4x_dp_detect(connector); if (status != connector_status_connected) return status; -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel