Skip to content

Commit 2c1c9b8

Browse files
committed
ALSA: hda - Override HDMI setup_stream ops for Intel HSW+
Instead of checking at each time with is_haswell_plus() macro, override the setup_stream ops itself for HSW+ chips. Signed-off-by: Takashi Iwai <[email protected]>
1 parent 44bb6d0 commit 2c1c9b8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,6 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
864864
struct hdmi_spec *spec = codec->spec;
865865
int err;
866866

867-
if (is_haswell_plus(codec))
868-
haswell_verify_D0(codec, cvt_nid, pin_nid);
869-
870867
err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format));
871868

872869
if (err) {
@@ -2307,6 +2304,14 @@ static void register_i915_notifier(struct hda_codec *codec)
23072304
snd_hdac_i915_register_notifier(&spec->i915_audio_ops);
23082305
}
23092306

2307+
/* setup_stream ops override for HSW+ */
2308+
static int i915_hsw_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
2309+
hda_nid_t pin_nid, u32 stream_tag, int format)
2310+
{
2311+
haswell_verify_D0(codec, cvt_nid, pin_nid);
2312+
return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
2313+
}
2314+
23102315
/* Intel Haswell and onwards; audio component with eld notifier */
23112316
static int patch_i915_hsw_hdmi(struct hda_codec *codec)
23122317
{
@@ -2338,6 +2343,8 @@ static int patch_i915_hsw_hdmi(struct hda_codec *codec)
23382343
codec->depop_delay = 0;
23392344
codec->auto_runtime_pm = 1;
23402345

2346+
spec->ops.setup_stream = i915_hsw_setup_stream;
2347+
23412348
err = hdmi_parse_codec(codec);
23422349
if (err < 0) {
23432350
generic_spec_free(codec);

0 commit comments

Comments
 (0)