aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorMengdong Lin <mengdong.lin@intel.com>2014-01-08 15:55:32 -0500
committerTakashi Iwai <tiwai@suse.de>2014-01-09 01:30:17 -0500
commit75dcbe4dc251ebc28cdf0797b85774cdf53a4d29 (patch)
tree422d6f0e7aae458e97c7eec040c81e19bb6656ac /sound/pci
parent3adadd280a5a78efabdec394c1e745a3f5a1cc18 (diff)
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: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_hdmi.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 670da3eaf882..64f0a5e73a25 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -46,6 +46,9 @@ module_param(static_hdmi_pcm, bool, 0644);
46MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); 46MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
47 47
48#define is_haswell(codec) ((codec)->vendor_id == 0x80862807) 48#define is_haswell(codec) ((codec)->vendor_id == 0x80862807)
49#define is_broadwell(codec) ((codec)->vendor_id == 0x80862808)
50#define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec))
51
49#define is_valleyview(codec) ((codec)->vendor_id == 0x80862882) 52#define is_valleyview(codec) ((codec)->vendor_id == 0x80862882)
50 53
51struct hdmi_spec_per_cvt { 54struct hdmi_spec_per_cvt {
@@ -1101,7 +1104,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
1101 if (!channels) 1104 if (!channels)
1102 return; 1105 return;
1103 1106
1104 if (is_haswell(codec)) 1107 if (is_haswell_plus(codec))
1105 snd_hda_codec_write(codec, pin_nid, 0, 1108 snd_hda_codec_write(codec, pin_nid, 0,
1106 AC_VERB_SET_AMP_GAIN_MUTE, 1109 AC_VERB_SET_AMP_GAIN_MUTE,
1107 AMP_OUT_UNMUTE); 1110 AMP_OUT_UNMUTE);
@@ -1280,7 +1283,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
1280 struct hdmi_spec *spec = codec->spec; 1283 struct hdmi_spec *spec = codec->spec;
1281 int err; 1284 int err;
1282 1285
1283 if (is_haswell(codec)) 1286 if (is_haswell_plus(codec))
1284 haswell_verify_D0(codec, cvt_nid, pin_nid); 1287 haswell_verify_D0(codec, cvt_nid, pin_nid);
1285 1288
1286 err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format)); 1289 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 mux_idx); 1424 mux_idx);
1422 1425
1423 /* configure unused pins to choose other converters */ 1426 /* configure unused pins to choose other converters */
1424 if (is_haswell(codec) || is_valleyview(codec)) 1427 if (is_haswell_plus(codec) || is_valleyview(codec))
1425 intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx); 1428 intel_not_share_assigned_cvt(codec, per_pin->pin_nid, mux_idx);
1426 1429
1427 snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); 1430 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 if (get_defcfg_connect(config) == AC_JACK_PORT_NONE) 1614 if (get_defcfg_connect(config) == AC_JACK_PORT_NONE)
1612 return 0; 1615 return 0;
1613 1616
1614 if (is_haswell(codec)) 1617 if (is_haswell_plus(codec))
1615 intel_haswell_fixup_connect_list(codec, pin_nid); 1618 intel_haswell_fixup_connect_list(codec, pin_nid);
1616 1619
1617 pin_idx = spec->num_pins; 1620 pin_idx = spec->num_pins;
@@ -2249,7 +2252,7 @@ static int patch_generic_hdmi(struct hda_codec *codec)
2249 codec->spec = spec; 2252 codec->spec = spec;
2250 hdmi_array_init(spec, 4); 2253 hdmi_array_init(spec, 4);
2251 2254
2252 if (is_haswell(codec)) { 2255 if (is_haswell_plus(codec)) {
2253 intel_haswell_enable_all_pins(codec, true); 2256 intel_haswell_enable_all_pins(codec, true);
2254 intel_haswell_fixup_enable_dp12(codec); 2257 intel_haswell_fixup_enable_dp12(codec);
2255 } 2258 }
@@ -2264,7 +2267,7 @@ static int patch_generic_hdmi(struct hda_codec *codec)
2264 return -EINVAL; 2267 return -EINVAL;
2265 } 2268 }
2266 codec->patch_ops = generic_hdmi_patch_ops; 2269 codec->patch_ops = generic_hdmi_patch_ops;
2267 if (is_haswell(codec)) { 2270 if (is_haswell_plus(codec)) {
2268 codec->patch_ops.set_power_state = haswell_set_power_state; 2271 codec->patch_ops.set_power_state = haswell_set_power_state;
2269 codec->dp_mst = true; 2272 codec->dp_mst = true;
2270 } 2273 }