Skip to content

Commit 691be97

Browse files
committed
ALSA: hda - Really restrict i915 notifier to HSW+
The commit [b62232d: ALSA: hda - Limit i915 HDMI binding only for HSW and later] tried to limit the usage of i915 audio notifier to the recent Intel models and switch to the old method on pre-Haswell models. However, it assumed that the i915 component binding hasn't been done on such models, and the assumption was wrong: namely, Baytrail had already the i915 component binding due to powerwell control. Thus, the workaround wasn't applied to Baytrail. For fixing this properly, this patch introduces a new flag indicating the usage of audio notifier and codec_has_acomp() refers to this flag instead of checking the existence of audio component. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 222bde0 commit 691be97

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,19 @@ struct hdmi_spec {
152152
struct hda_pcm_stream pcm_playback;
153153

154154
/* i915/powerwell (Haswell+/Valleyview+) specific */
155+
bool use_acomp_notifier; /* use i915 eld_notify callback for hotplug */
155156
struct i915_audio_component_audio_ops i915_audio_ops;
156157
bool i915_bound; /* was i915 bound in this driver? */
157158

158159
struct hdac_chmap chmap;
159160
};
160161

161162
#ifdef CONFIG_SND_HDA_I915
162-
#define codec_has_acomp(codec) \
163-
((codec)->bus->core.audio_component != NULL)
163+
static inline bool codec_has_acomp(struct hda_codec *codec)
164+
{
165+
struct hdmi_spec *spec = codec->spec;
166+
return spec->use_acomp_notifier;
167+
}
164168
#else
165169
#define codec_has_acomp(codec) false
166170
#endif
@@ -2248,12 +2252,18 @@ static int patch_generic_hdmi(struct hda_codec *codec)
22482252
codec->spec = spec;
22492253
hdmi_array_init(spec, 4);
22502254

2255+
#ifdef CONFIG_SND_HDA_I915
22512256
/* Try to bind with i915 for Intel HSW+ codecs (if not done yet) */
2252-
if (!codec_has_acomp(codec) &&
2253-
(codec->core.vendor_id >> 16) == 0x8086 &&
2254-
is_haswell_plus(codec))
2255-
if (!snd_hdac_i915_init(&codec->bus->core))
2256-
spec->i915_bound = true;
2257+
if ((codec->core.vendor_id >> 16) == 0x8086 &&
2258+
is_haswell_plus(codec)) {
2259+
if (!codec->bus->core.audio_component)
2260+
if (!snd_hdac_i915_init(&codec->bus->core))
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
22572267

22582268
if (is_haswell_plus(codec)) {
22592269
intel_haswell_enable_all_pins(codec, true);

0 commit comments

Comments
 (0)