aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_hdmi.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 49ee4e55dd16..8cdb804aa9cf 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -152,6 +152,7 @@ struct hdmi_spec {
152 struct hda_pcm_stream pcm_playback; 152 struct hda_pcm_stream pcm_playback;
153 153
154 /* i915/powerwell (Haswell+/Valleyview+) specific */ 154 /* i915/powerwell (Haswell+/Valleyview+) specific */
155 bool use_acomp_notifier; /* use i915 eld_notify callback for hotplug */
155 struct i915_audio_component_audio_ops i915_audio_ops; 156 struct i915_audio_component_audio_ops i915_audio_ops;
156 bool i915_bound; /* was i915 bound in this driver? */ 157 bool i915_bound; /* was i915 bound in this driver? */
157 158
@@ -159,8 +160,11 @@ struct hdmi_spec {
159}; 160};
160 161
161#ifdef CONFIG_SND_HDA_I915 162#ifdef CONFIG_SND_HDA_I915
162#define codec_has_acomp(codec) \ 163static inline bool codec_has_acomp(struct hda_codec *codec)
163 ((codec)->bus->core.audio_component != NULL) 164{
165 struct hdmi_spec *spec = codec->spec;
166 return spec->use_acomp_notifier;
167}
164#else 168#else
165#define codec_has_acomp(codec) false 169#define codec_has_acomp(codec) false
166#endif 170#endif
@@ -2248,12 +2252,18 @@ static int patch_generic_hdmi(struct hda_codec *codec)
2248 codec->spec = spec; 2252 codec->spec = spec;
2249 hdmi_array_init(spec, 4); 2253 hdmi_array_init(spec, 4);
2250 2254
2255#ifdef CONFIG_SND_HDA_I915
2251 /* Try to bind with i915 for Intel HSW+ codecs (if not done yet) */ 2256 /* Try to bind with i915 for Intel HSW+ codecs (if not done yet) */
2252 if (!codec_has_acomp(codec) && 2257 if ((codec->core.vendor_id >> 16) == 0x8086 &&
2253 (codec->core.vendor_id >> 16) == 0x8086 && 2258 is_haswell_plus(codec)) {
2254 is_haswell_plus(codec)) 2259 if (!codec->bus->core.audio_component)
2255 if (!snd_hdac_i915_init(&codec->bus->core)) 2260 if (!snd_hdac_i915_init(&codec->bus->core))
2256 spec->i915_bound = true; 2261 spec->i915_bound = true;
2262 /* use i915 audio component notifier for hotplug */
2263 if (codec->bus->core.audio_component)
2264 spec->use_acomp_notifier = true;
2265 }
2266#endif
2257 2267
2258 if (is_haswell_plus(codec)) { 2268 if (is_haswell_plus(codec)) {
2259 intel_haswell_enable_all_pins(codec, true); 2269 intel_haswell_enable_all_pins(codec, true);