1 From: Takashi Iwai <tiwai@suse.de>
2 Subject: ALSA: hda - update ATI HDMI codec support
3 Patch-mainline: 2.6.28-rc1
6 Updates for HDMI support; 8-ch LPCM is capable.
8 Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 diff -ruN a/sound/pci/hda/patch_atihdmi.c b/sound/pci/hda/patch_atihdmi.c
12 --- a/sound/pci/hda/patch_atihdmi.c
13 +++ b/sound/pci/hda/patch_atihdmi.c
15 struct hda_pcm pcm_rec;
18 +#define CVT_NID 0x02 /* audio converter */
19 +#define PIN_NID 0x03 /* HDMI output pin */
21 static struct hda_verb atihdmi_basic_init[] = {
22 /* enable digital output on pin widget */
23 { 0x03, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
26 snd_hda_sequence_write(codec, atihdmi_basic_init);
27 /* SI codec requires to unmute the pin */
28 - if (get_wcaps(codec, 0x03) & AC_WCAP_OUT_AMP)
29 - snd_hda_codec_write(codec, 0x03, 0, AC_VERB_SET_AMP_GAIN_MUTE,
30 + if (get_wcaps(codec, PIN_NID) & AC_WCAP_OUT_AMP)
31 + snd_hda_codec_write(codec, PIN_NID, 0,
32 + AC_VERB_SET_AMP_GAIN_MUTE,
37 struct snd_pcm_substream *substream)
39 struct atihdmi_spec *spec = codec->spec;
40 - return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
42 + int chans = substream->runtime->channels;
45 + err = snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
49 + snd_hda_codec_write(codec, CVT_NID, 0, AC_VERB_SET_CVT_CHAN_COUNT,
52 + for (i = 0; i < chans; i++) {
53 + snd_hda_codec_write(codec, CVT_NID, 0,
54 + AC_VERB_SET_HDMI_CHAN_SLOT,
60 static struct hda_pcm_stream atihdmi_pcm_digital_playback = {
64 - .nid = 0x2, /* NID to query formats and rates and setup streams */
65 + .nid = CVT_NID, /* NID to query formats and rates and setup streams */
67 .open = atihdmi_dig_playback_pcm_open,
68 .close = atihdmi_dig_playback_pcm_close,
71 struct atihdmi_spec *spec = codec->spec;
72 struct hda_pcm *info = &spec->pcm_rec;
76 codec->pcm_info = info;
78 info->pcm_type = HDA_PCM_TYPE_HDMI;
79 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = atihdmi_pcm_digital_playback;
81 + /* FIXME: we must check ELD and change the PCM parameters dynamically
83 + chans = get_wcaps(codec, CVT_NID);
84 + chans = (chans & AC_WCAP_CHAN_CNT_EXT) >> 13;
85 + chans = ((chans << 1) | 1) + 1;
86 + info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = chans;
93 spec->multiout.num_dacs = 0; /* no analog */
94 spec->multiout.max_channels = 2;
95 - spec->multiout.dig_out_nid = 0x2; /* NID for copying analog to digital,
96 - * seems to be unused in pure-digital
98 + /* NID for copying analog to digital,
99 + * seems to be unused in pure-digital
102 + spec->multiout.dig_out_nid = CVT_NID;
104 codec->patch_ops = atihdmi_patch_ops;
107 { .id = 0x10027919, .name = "ATI RS600 HDMI", .patch = patch_atihdmi },
108 { .id = 0x1002791a, .name = "ATI RS690/780 HDMI", .patch = patch_atihdmi },
109 { .id = 0x1002aa01, .name = "ATI R6xx HDMI", .patch = patch_atihdmi },
110 + { .id = 0x10951390, .name = "SiI1390 HDMI", .patch = patch_atihdmi },
111 { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_atihdmi },
112 { .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_atihdmi },
114 diff -ruN a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
115 --- a/Documentation/sound/alsa/ALSA-Configuration.txt
116 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt
121 - Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8),
122 - ATI SB450, SB600, RS600,
123 + Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10,
125 + ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620,
126 + RV630, RV635, RV670, RV770,