Commit 55913110 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Allow i915 binding later in codec driver

Due to the recent change, HDA controller driver for Intel PCH tries to
bind i915 audio component always at the probe time no matter whether
HDMI/DP codec is found.  This is, however, superflulous for old
chipsets (e.g. on IVB) where they don't have always the HDMI/DP codecs
but  often have only a discrete GPU instead.

For the newer chipsets, we need already the i915 binding from the
beginning due to power well control.  Meanwhile, for older chipsets
where we don't need power well, we don't need the i915 binding at the
controller level.

This patch removes again the i915 binding in the HDA controller driver
for old Intel PCHs, but adds the binding in HDMI/DP codec driver
instead.  This allows still the use of the direct notification from
the graphics driver while we can avoid the unnecessary load of i915
driver for machines only with another GPU.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f4e3040b
......@@ -288,11 +288,11 @@ enum {
(AZX_DCAPS_NO_ALIGN_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY |\
AZX_DCAPS_REVERSE_ASSIGN | AZX_DCAPS_SNOOP_TYPE(SCH))
/* PCH up to IVB; bound with i915 audio component for HDMI, no runtime PM */
/* PCH up to IVB; no runtime PM */
#define AZX_DCAPS_INTEL_PCH_NOPM \
(AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_I915_POWERWELL)
(AZX_DCAPS_INTEL_PCH_BASE)
/* PCH for HSW/BDW; with runtime PM, but no i915 binding */
/* PCH for HSW/BDW; with runtime PM */
#define AZX_DCAPS_INTEL_PCH \
(AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME)
......
......@@ -150,6 +150,7 @@ struct hdmi_spec {
/* i915/powerwell (Haswell+/Valleyview+) specific */
struct i915_audio_component_audio_ops i915_audio_ops;
bool i915_bound; /* was i915 bound in this driver? */
};
#ifdef CONFIG_SND_HDA_I915
......@@ -2234,6 +2235,8 @@ static void generic_hdmi_free(struct hda_codec *codec)
eld_proc_free(per_pin);
}
if (spec->i915_bound)
snd_hdac_i915_exit(&codec->bus->core);
hdmi_array_free(spec);
kfree(spec);
}
......@@ -2381,6 +2384,12 @@ static int patch_generic_hdmi(struct hda_codec *codec)
codec->spec = spec;
hdmi_array_init(spec, 4);
/* Try to bind with i915 for any Intel codecs (if not done yet) */
if (!codec_has_acomp(codec) &&
(codec->core.vendor_id >> 16) == 0x8086)
if (!snd_hdac_i915_init(&codec->bus->core))
spec->i915_bound = true;
if (is_haswell_plus(codec)) {
intel_haswell_enable_all_pins(codec, true);
intel_haswell_fixup_enable_dp12(codec);
......@@ -2404,6 +2413,8 @@ static int patch_generic_hdmi(struct hda_codec *codec)
}
if (hdmi_parse_codec(codec) < 0) {
if (spec->i915_bound)
snd_hdac_i915_exit(&codec->bus->core);
codec->spec = NULL;
kfree(spec);
return -EINVAL;
......
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