Commit 75dcbe4d authored by Mengdong Lin's avatar Mengdong Lin Committed by Takashi Iwai

ALSA: hda/hdmi - apply all Haswell fix-ups to Broadwell display codec

Broadwell and Haswell have the same behavior on display audio. So this patch
defines is_haswell_plus() to include codecs for both Haswell and its successor
Broadwell, and apply all Haswell fix-ups to Broadwell.
Signed-off-by: default avatarMengdong Lin <mengdong.lin@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3adadd28
...@@ -46,6 +46,9 @@ module_param(static_hdmi_pcm, bool, 0644); ...@@ -46,6 +46,9 @@ module_param(static_hdmi_pcm, bool, 0644);
MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
#define is_haswell(codec) ((codec)->vendor_id == 0x80862807) #define is_haswell(codec) ((codec)->vendor_id == 0x80862807)
#define is_broadwell(codec) ((codec)->vendor_id == 0x80862808)
#define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec))
#define is_valleyview(codec) ((codec)->vendor_id == 0x80862882) #define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
struct hdmi_spec_per_cvt { struct hdmi_spec_per_cvt {
...@@ -1101,7 +1104,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, ...@@ -1101,7 +1104,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
if (!channels) if (!channels)
return; return;
if (is_haswell(codec)) if (is_haswell_plus(codec))
snd_hda_codec_write(codec, pin_nid, 0, snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_OUT_UNMUTE); AMP_OUT_UNMUTE);
...@@ -1280,7 +1283,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, ...@@ -1280,7 +1283,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
int err; int err;
if (is_haswell(codec)) if (is_haswell_plus(codec))
haswell_verify_D0(codec, cvt_nid, pin_nid); haswell_verify_D0(codec, cvt_nid, pin_nid);
err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format)); err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format));
...@@ -1421,7 +1424,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -1421,7 +1424,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
mux_idx); mux_idx);
/* configure unused pins to choose other converters */ /* configure unused pins to choose other converters */
if (is_haswell(codec) || is_valleyview(codec)) if (is_haswell_plus(codec) || is_valleyview(codec))
intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx); intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx);
snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid);
...@@ -1611,7 +1614,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) ...@@ -1611,7 +1614,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
if (get_defcfg_connect(config) == AC_JACK_PORT_NONE) if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
return 0; return 0;
if (is_haswell(codec)) if (is_haswell_plus(codec))
intel_haswell_fixup_connect_list(codec, pin_nid); intel_haswell_fixup_connect_list(codec, pin_nid);
pin_idx = spec->num_pins; pin_idx = spec->num_pins;
...@@ -2249,7 +2252,7 @@ static int patch_generic_hdmi(struct hda_codec *codec) ...@@ -2249,7 +2252,7 @@ static int patch_generic_hdmi(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
hdmi_array_init(spec, 4); hdmi_array_init(spec, 4);
if (is_haswell(codec)) { if (is_haswell_plus(codec)) {
intel_haswell_enable_all_pins(codec, true); intel_haswell_enable_all_pins(codec, true);
intel_haswell_fixup_enable_dp12(codec); intel_haswell_fixup_enable_dp12(codec);
} }
...@@ -2264,7 +2267,7 @@ static int patch_generic_hdmi(struct hda_codec *codec) ...@@ -2264,7 +2267,7 @@ static int patch_generic_hdmi(struct hda_codec *codec)
return -EINVAL; return -EINVAL;
} }
codec->patch_ops = generic_hdmi_patch_ops; codec->patch_ops = generic_hdmi_patch_ops;
if (is_haswell(codec)) { if (is_haswell_plus(codec)) {
codec->patch_ops.set_power_state = haswell_set_power_state; codec->patch_ops.set_power_state = haswell_set_power_state;
codec->dp_mst = true; codec->dp_mst = true;
} }
......
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