Skip to content

Commit 5a5d718

Browse files
sriram0123tiwai
authored andcommitted
ALSA: hda - program ICT bits to support HBR audio
On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake, KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital Converter Control #3 needs to be set explicitly for HDMI/DisplayPort High Bit Rate (HBR) audio playback to work. This was not required in earlier platforms when HBR was first introduced. The ICT bits are defined in Section 7.3.3.9 of the HDaudio 1.0a specification. Since the ICT bitfield was not specified for HDAudio 1.0 devices (before 2009), we only program it on machines more recent than Haswell. We tested that this fix is not needed on Baytrail-I (MinnowBoard Turbot) and believe by extension it also does not apply to Braswell. [ Moved AC_VERB_SET_DIGI_CONVERT_3 definition to the right place by tiwai ] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797 Signed-off-by: Sriram Periyasamy <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Subhransu S. Prusty <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent e1af344 commit 5a5d718

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

include/sound/hda_verbs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ enum {
9595
#define AC_VERB_SET_EAPD_BTLENABLE 0x70c
9696
#define AC_VERB_SET_DIGI_CONVERT_1 0x70d
9797
#define AC_VERB_SET_DIGI_CONVERT_2 0x70e
98+
#define AC_VERB_SET_DIGI_CONVERT_3 0x73e
9899
#define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f
99100
#define AC_VERB_SET_GPIO_DATA 0x715
100101
#define AC_VERB_SET_GPIO_MASK 0x716

sound/pci/hda/patch_hdmi.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
906906
hda_nid_t pin_nid, u32 stream_tag, int format)
907907
{
908908
struct hdmi_spec *spec = codec->spec;
909+
unsigned int param;
909910
int err;
910911

911912
err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format));
@@ -915,6 +916,26 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
915916
return err;
916917
}
917918

919+
if (is_haswell_plus(codec)) {
920+
921+
/*
922+
* on recent platforms IEC Coding Type is required for HBR
923+
* support, read current Digital Converter settings and set
924+
* ICT bitfield if needed.
925+
*/
926+
param = snd_hda_codec_read(codec, cvt_nid, 0,
927+
AC_VERB_GET_DIGI_CONVERT_1, 0);
928+
929+
param = (param >> 16) & ~(AC_DIG3_ICT);
930+
931+
/* on recent platforms ICT mode is required for HBR support */
932+
if (is_hbr_format(format))
933+
param |= 0x1;
934+
935+
snd_hda_codec_write(codec, cvt_nid, 0,
936+
AC_VERB_SET_DIGI_CONVERT_3, param);
937+
}
938+
918939
snd_hda_codec_setup_stream(codec, cvt_nid, stream_tag, 0, format);
919940
return 0;
920941
}

0 commit comments

Comments
 (0)