]> bbs.cooldavid.org Git - net-next-2.6.git/blame - sound/pci/hda/patch_nvhdmi.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
[net-next-2.6.git] / sound / pci / hda / patch_nvhdmi.c
CommitLineData
9a10eb21
WN
1/*
2 * Universal Interface for Intel High Definition Audio Codec
3 *
4 * HD audio interface patch for NVIDIA HDMI codecs
5 *
6 * Copyright (c) 2008 NVIDIA Corp. All rights reserved.
7 * Copyright (c) 2008 Wei Ni <wni@nvidia.com>
8 *
9 *
10 * This driver is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This driver is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#include <linux/init.h>
26#include <linux/delay.h>
27#include <linux/slab.h>
28#include <sound/core.h>
29#include "hda_codec.h"
30#include "hda_local.h"
31
079d88cc
WF
32#define MAX_HDMI_CVTS 1
33#define MAX_HDMI_PINS 1
34
35#include "patch_hdmi.c"
36
37static char *nvhdmi_pcm_names[MAX_HDMI_CVTS] = {
38 "NVIDIA HDMI",
39};
40
f0613d57 41/* define below to restrict the supported rates and formats */
491dc043 42/* #define LIMITED_RATE_FMT_SUPPORT */
f0613d57 43
25045705
WN
44enum HDACodec {
45 HDA_CODEC_NVIDIA_MCP7X,
46 HDA_CODEC_NVIDIA_MCP89,
47 HDA_CODEC_NVIDIA_GT21X,
48 HDA_CODEC_INVALID
9a10eb21
WN
49};
50
a3d6ab97
WN
51#define Nv_VERB_SET_Channel_Allocation 0xF79
52#define Nv_VERB_SET_Info_Frame_Checksum 0xF7A
53#define Nv_VERB_SET_Audio_Protection_On 0xF98
54#define Nv_VERB_SET_Audio_Protection_Off 0xF99
55
25045705
WN
56#define nvhdmi_master_con_nid_7x 0x04
57#define nvhdmi_master_pin_nid_7x 0x05
a3d6ab97 58
25045705
WN
59#define nvhdmi_master_con_nid_89 0x04
60#define nvhdmi_master_pin_nid_89 0x05
61
62static hda_nid_t nvhdmi_con_nids_7x[4] = {
a3d6ab97
WN
63 /*front, rear, clfe, rear_surr */
64 0x6, 0x8, 0xa, 0xc,
65};
66
25045705 67static struct hda_verb nvhdmi_basic_init_7x[] = {
a3d6ab97
WN
68 /* set audio protect on */
69 { 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1},
9a10eb21 70 /* enable digital output on pin widget */
a3d6ab97
WN
71 { 0x5, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
72 { 0x7, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
73 { 0x9, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
74 { 0xb, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
75 { 0xd, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
9a10eb21
WN
76 {} /* terminator */
77};
78
f0613d57
TI
79#ifdef LIMITED_RATE_FMT_SUPPORT
80/* support only the safe format and rate */
81#define SUPPORTED_RATES SNDRV_PCM_RATE_48000
82#define SUPPORTED_MAXBPS 16
83#define SUPPORTED_FORMATS SNDRV_PCM_FMTBIT_S16_LE
84#else
85/* support all rates and formats */
86#define SUPPORTED_RATES \
87 (SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
88 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
89 SNDRV_PCM_RATE_192000)
90#define SUPPORTED_MAXBPS 24
91#define SUPPORTED_FORMATS \
92 (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
93#endif
94
9a10eb21
WN
95/*
96 * Controls
97 */
98static int nvhdmi_build_controls(struct hda_codec *codec)
99{
079d88cc 100 struct hdmi_spec *spec = codec->spec;
9a10eb21 101 int err;
25045705 102 int i;
9a10eb21 103
25045705
WN
104 if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
105 || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
106 for (i = 0; i < codec->num_pcms; i++) {
107 err = snd_hda_create_spdif_out_ctls(codec,
108 spec->cvt[i]);
109 if (err < 0)
110 return err;
111 }
112 } else {
113 err = snd_hda_create_spdif_out_ctls(codec,
114 spec->multiout.dig_out_nid);
115 if (err < 0)
116 return err;
117 }
9a10eb21
WN
118
119 return 0;
120}
121
122static int nvhdmi_init(struct hda_codec *codec)
123{
079d88cc 124 struct hdmi_spec *spec = codec->spec;
25045705
WN
125 int i;
126 if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
127 || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
128 for (i = 0; spec->pin[i]; i++) {
129 hdmi_enable_output(codec, spec->pin[i]);
130 snd_hda_codec_write(codec, spec->pin[i], 0,
131 AC_VERB_SET_UNSOLICITED_ENABLE,
132 AC_USRSP_EN | spec->pin[i]);
133 }
134 } else {
135 snd_hda_sequence_write(codec, nvhdmi_basic_init_7x);
136 }
9a10eb21
WN
137 return 0;
138}
139
25045705
WN
140static void nvhdmi_free(struct hda_codec *codec)
141{
079d88cc 142 struct hdmi_spec *spec = codec->spec;
25045705
WN
143 int i;
144
145 if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
146 || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
147 for (i = 0; i < spec->num_pins; i++)
148 snd_hda_eld_proc_free(codec, &spec->sink_eld[i]);
149 }
150
151 kfree(spec);
152}
153
9a10eb21
WN
154/*
155 * Digital out
156 */
157static int nvhdmi_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
a3d6ab97
WN
158 struct hda_codec *codec,
159 struct snd_pcm_substream *substream)
9a10eb21 160{
079d88cc 161 struct hdmi_spec *spec = codec->spec;
9a10eb21
WN
162 return snd_hda_multi_out_dig_open(codec, &spec->multiout);
163}
164
25045705 165static int nvhdmi_dig_playback_pcm_close_8ch_7x(struct hda_pcm_stream *hinfo,
a3d6ab97
WN
166 struct hda_codec *codec,
167 struct snd_pcm_substream *substream)
9a10eb21 168{
079d88cc 169 struct hdmi_spec *spec = codec->spec;
a3d6ab97
WN
170 int i;
171
25045705 172 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x,
a3d6ab97
WN
173 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
174 for (i = 0; i < 4; i++) {
175 /* set the stream id */
25045705 176 snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
a3d6ab97
WN
177 AC_VERB_SET_CHANNEL_STREAMID, 0);
178 /* set the stream format */
25045705 179 snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
a3d6ab97
WN
180 AC_VERB_SET_STREAM_FORMAT, 0);
181 }
182
9a10eb21
WN
183 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
184}
185
a3d6ab97
WN
186static int nvhdmi_dig_playback_pcm_close_2ch(struct hda_pcm_stream *hinfo,
187 struct hda_codec *codec,
188 struct snd_pcm_substream *substream)
189{
079d88cc 190 struct hdmi_spec *spec = codec->spec;
a3d6ab97
WN
191 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
192}
193
25045705
WN
194static int nvhdmi_dig_playback_pcm_prepare_8ch_89(struct hda_pcm_stream *hinfo,
195 struct hda_codec *codec,
196 unsigned int stream_tag,
197 unsigned int format,
198 struct snd_pcm_substream *substream)
199{
200 hdmi_set_channel_count(codec, hinfo->nid,
201 substream->runtime->channels);
202
203 hdmi_setup_audio_infoframe(codec, hinfo->nid, substream);
204
ea87d1c4 205 return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
25045705
WN
206}
207
a3d6ab97
WN
208static int nvhdmi_dig_playback_pcm_prepare_8ch(struct hda_pcm_stream *hinfo,
209 struct hda_codec *codec,
210 unsigned int stream_tag,
211 unsigned int format,
212 struct snd_pcm_substream *substream)
213{
214 int chs;
215 unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id;
216 int i;
217
218 mutex_lock(&codec->spdif_mutex);
219
220 chs = substream->runtime->channels;
221 chan = chs ? (chs - 1) : 1;
222
223 switch (chs) {
224 default:
225 case 0:
226 case 2:
227 chanmask = 0x00;
228 break;
229 case 4:
230 chanmask = 0x08;
231 break;
232 case 6:
233 chanmask = 0x0b;
234 break;
235 case 8:
236 chanmask = 0x13;
237 break;
238 }
239 dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
240 dataDCC2 = 0x2;
241
242 /* set the Audio InforFrame Channel Allocation */
243 snd_hda_codec_write(codec, 0x1, 0,
244 Nv_VERB_SET_Channel_Allocation, chanmask);
245
246 /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
247 if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
248 snd_hda_codec_write(codec,
25045705 249 nvhdmi_master_con_nid_7x,
a3d6ab97
WN
250 0,
251 AC_VERB_SET_DIGI_CONVERT_1,
252 codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
253
254 /* set the stream id */
25045705 255 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
a3d6ab97
WN
256 AC_VERB_SET_CHANNEL_STREAMID, (stream_tag << 4) | 0x0);
257
258 /* set the stream format */
25045705 259 snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
a3d6ab97
WN
260 AC_VERB_SET_STREAM_FORMAT, format);
261
262 /* turn on again (if needed) */
263 /* enable and set the channel status audio/data flag */
264 if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
265 snd_hda_codec_write(codec,
25045705 266 nvhdmi_master_con_nid_7x,
a3d6ab97
WN
267 0,
268 AC_VERB_SET_DIGI_CONVERT_1,
269 codec->spdif_ctls & 0xff);
270 snd_hda_codec_write(codec,
25045705 271 nvhdmi_master_con_nid_7x,
a3d6ab97
WN
272 0,
273 AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
274 }
275
276 for (i = 0; i < 4; i++) {
277 if (chs == 2)
278 channel_id = 0;
279 else
280 channel_id = i * 2;
281
282 /* turn off SPDIF once;
283 *otherwise the IEC958 bits won't be updated
284 */
285 if (codec->spdif_status_reset &&
286 (codec->spdif_ctls & AC_DIG1_ENABLE))
287 snd_hda_codec_write(codec,
25045705 288 nvhdmi_con_nids_7x[i],
a3d6ab97
WN
289 0,
290 AC_VERB_SET_DIGI_CONVERT_1,
291 codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
292 /* set the stream id */
293 snd_hda_codec_write(codec,
25045705 294 nvhdmi_con_nids_7x[i],
a3d6ab97
WN
295 0,
296 AC_VERB_SET_CHANNEL_STREAMID,
297 (stream_tag << 4) | channel_id);
298 /* set the stream format */
299 snd_hda_codec_write(codec,
25045705 300 nvhdmi_con_nids_7x[i],
a3d6ab97
WN
301 0,
302 AC_VERB_SET_STREAM_FORMAT,
303 format);
304 /* turn on again (if needed) */
305 /* enable and set the channel status audio/data flag */
306 if (codec->spdif_status_reset &&
307 (codec->spdif_ctls & AC_DIG1_ENABLE)) {
308 snd_hda_codec_write(codec,
25045705 309 nvhdmi_con_nids_7x[i],
a3d6ab97
WN
310 0,
311 AC_VERB_SET_DIGI_CONVERT_1,
312 codec->spdif_ctls & 0xff);
313 snd_hda_codec_write(codec,
25045705 314 nvhdmi_con_nids_7x[i],
a3d6ab97
WN
315 0,
316 AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
317 }
318 }
319
320 /* set the Audio Info Frame Checksum */
321 snd_hda_codec_write(codec, 0x1, 0,
322 Nv_VERB_SET_Info_Frame_Checksum,
323 (0x71 - chan - chanmask));
324
325 mutex_unlock(&codec->spdif_mutex);
326 return 0;
327}
328
25045705
WN
329static int nvhdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
330 struct hda_codec *codec,
331 struct snd_pcm_substream *substream)
332{
333 return 0;
334}
335
a3d6ab97
WN
336static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
337 struct hda_codec *codec,
338 unsigned int stream_tag,
339 unsigned int format,
340 struct snd_pcm_substream *substream)
9a10eb21 341{
079d88cc 342 struct hdmi_spec *spec = codec->spec;
9a10eb21 343 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
a3d6ab97 344 format, substream);
9a10eb21
WN
345}
346
25045705
WN
347static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
348 .substreams = 1,
349 .channels_min = 2,
25045705 350 .ops = {
bbbe3390 351 .open = hdmi_pcm_open,
25045705
WN
352 .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
353 .cleanup = nvhdmi_playback_pcm_cleanup,
354 },
355};
356
357static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_7x = {
a3d6ab97
WN
358 .substreams = 1,
359 .channels_min = 2,
360 .channels_max = 8,
25045705 361 .nid = nvhdmi_master_con_nid_7x,
f0613d57
TI
362 .rates = SUPPORTED_RATES,
363 .maxbps = SUPPORTED_MAXBPS,
364 .formats = SUPPORTED_FORMATS,
a3d6ab97
WN
365 .ops = {
366 .open = nvhdmi_dig_playback_pcm_open,
25045705 367 .close = nvhdmi_dig_playback_pcm_close_8ch_7x,
a3d6ab97
WN
368 .prepare = nvhdmi_dig_playback_pcm_prepare_8ch
369 },
370};
371
372static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = {
9a10eb21
WN
373 .substreams = 1,
374 .channels_min = 2,
375 .channels_max = 2,
25045705 376 .nid = nvhdmi_master_con_nid_7x,
f0613d57
TI
377 .rates = SUPPORTED_RATES,
378 .maxbps = SUPPORTED_MAXBPS,
379 .formats = SUPPORTED_FORMATS,
9a10eb21
WN
380 .ops = {
381 .open = nvhdmi_dig_playback_pcm_open,
a3d6ab97
WN
382 .close = nvhdmi_dig_playback_pcm_close_2ch,
383 .prepare = nvhdmi_dig_playback_pcm_prepare_2ch
9a10eb21
WN
384 },
385};
386
25045705
WN
387static int nvhdmi_build_pcms_8ch_89(struct hda_codec *codec)
388{
079d88cc 389 struct hdmi_spec *spec = codec->spec;
25045705
WN
390 struct hda_pcm *info = spec->pcm_rec;
391 int i;
392
393 codec->num_pcms = spec->num_cvts;
394 codec->pcm_info = info;
395
396 for (i = 0; i < codec->num_pcms; i++, info++) {
397 unsigned int chans;
398
399 chans = get_wcaps(codec, spec->cvt[i]);
400 chans = get_wcaps_channels(chans);
401
402 info->name = nvhdmi_pcm_names[i];
403 info->pcm_type = HDA_PCM_TYPE_HDMI;
404 info->stream[SNDRV_PCM_STREAM_PLAYBACK]
405 = nvhdmi_pcm_digital_playback_8ch_89;
406 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->cvt[i];
407 info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = chans;
408 }
409
410 return 0;
411}
412
413static int nvhdmi_build_pcms_8ch_7x(struct hda_codec *codec)
9a10eb21 414{
079d88cc 415 struct hdmi_spec *spec = codec->spec;
25045705 416 struct hda_pcm *info = spec->pcm_rec;
9a10eb21
WN
417
418 codec->num_pcms = 1;
419 codec->pcm_info = info;
420
421 info->name = "NVIDIA HDMI";
ec4e86ba 422 info->pcm_type = HDA_PCM_TYPE_HDMI;
a3d6ab97 423 info->stream[SNDRV_PCM_STREAM_PLAYBACK]
25045705 424 = nvhdmi_pcm_digital_playback_8ch_7x;
a3d6ab97
WN
425
426 return 0;
427}
428
429static int nvhdmi_build_pcms_2ch(struct hda_codec *codec)
430{
079d88cc 431 struct hdmi_spec *spec = codec->spec;
25045705 432 struct hda_pcm *info = spec->pcm_rec;
a3d6ab97
WN
433
434 codec->num_pcms = 1;
435 codec->pcm_info = info;
436
437 info->name = "NVIDIA HDMI";
438 info->pcm_type = HDA_PCM_TYPE_HDMI;
439 info->stream[SNDRV_PCM_STREAM_PLAYBACK]
440 = nvhdmi_pcm_digital_playback_2ch;
9a10eb21
WN
441
442 return 0;
443}
444
25045705
WN
445static struct hda_codec_ops nvhdmi_patch_ops_8ch_89 = {
446 .build_controls = nvhdmi_build_controls,
447 .build_pcms = nvhdmi_build_pcms_8ch_89,
448 .init = nvhdmi_init,
449 .free = nvhdmi_free,
079d88cc 450 .unsol_event = hdmi_unsol_event,
25045705 451};
9a10eb21 452
25045705 453static struct hda_codec_ops nvhdmi_patch_ops_8ch_7x = {
a3d6ab97 454 .build_controls = nvhdmi_build_controls,
25045705 455 .build_pcms = nvhdmi_build_pcms_8ch_7x,
a3d6ab97
WN
456 .init = nvhdmi_init,
457 .free = nvhdmi_free,
458};
459
460static struct hda_codec_ops nvhdmi_patch_ops_2ch = {
9a10eb21 461 .build_controls = nvhdmi_build_controls,
a3d6ab97 462 .build_pcms = nvhdmi_build_pcms_2ch,
9a10eb21
WN
463 .init = nvhdmi_init,
464 .free = nvhdmi_free,
465};
466
25045705
WN
467static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
468{
079d88cc 469 struct hdmi_spec *spec;
25045705
WN
470 int i;
471
472 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
473 if (spec == NULL)
474 return -ENOMEM;
475
476 codec->spec = spec;
477 spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
38faddb1 478 spec->old_pin_detect = 1;
25045705 479
079d88cc 480 if (hdmi_parse_codec(codec) < 0) {
25045705
WN
481 codec->spec = NULL;
482 kfree(spec);
483 return -EINVAL;
484 }
485 codec->patch_ops = nvhdmi_patch_ops_8ch_89;
486
487 for (i = 0; i < spec->num_pins; i++)
488 snd_hda_eld_proc_new(codec, &spec->sink_eld[i], i);
489
490 init_channel_allocations();
491
492 return 0;
493}
494
495static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
a3d6ab97 496{
079d88cc 497 struct hdmi_spec *spec;
a3d6ab97
WN
498
499 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
500 if (spec == NULL)
501 return -ENOMEM;
502
503 codec->spec = spec;
504
505 spec->multiout.num_dacs = 0; /* no analog */
506 spec->multiout.max_channels = 8;
25045705
WN
507 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
508 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
38faddb1 509 spec->old_pin_detect = 1;
a3d6ab97 510
25045705 511 codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
a3d6ab97
WN
512
513 return 0;
514}
515
516static int patch_nvhdmi_2ch(struct hda_codec *codec)
9a10eb21 517{
079d88cc 518 struct hdmi_spec *spec;
9a10eb21
WN
519
520 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
521 if (spec == NULL)
522 return -ENOMEM;
523
524 codec->spec = spec;
525
a3d6ab97 526 spec->multiout.num_dacs = 0; /* no analog */
9a10eb21 527 spec->multiout.max_channels = 2;
25045705
WN
528 spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
529 spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
38faddb1 530 spec->old_pin_detect = 1;
9a10eb21 531
a3d6ab97 532 codec->patch_ops = nvhdmi_patch_ops_2ch;
9a10eb21
WN
533
534 return 0;
535}
536
537/*
538 * patch entries
539 */
1289e9e8 540static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
9cf2657d
SW
541 { .id = 0x10de0002, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
542 { .id = 0x10de0003, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
543 { .id = 0x10de0005, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
544 { .id = 0x10de0006, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
545 { .id = 0x10de0007, .name = "MCP79/7A HDMI", .patch = patch_nvhdmi_8ch_7x },
546 { .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
547 { .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
548 { .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_nvhdmi_8ch_89 },
549 { .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
550 { .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
551 { .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
552 { .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
553 { .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
554 { .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
555 { .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
556 { .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
557 { .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
558 { .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
559 { .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
560 { .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
561 { .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
562 { .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
563 { .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
564 { .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
565 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
566 { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
9a10eb21
WN
567 {} /* terminator */
568};
1289e9e8
TI
569
570MODULE_ALIAS("snd-hda-codec-id:10de0002");
f8ff035e 571MODULE_ALIAS("snd-hda-codec-id:10de0003");
e2e527ae 572MODULE_ALIAS("snd-hda-codec-id:10de0005");
f84e3e91 573MODULE_ALIAS("snd-hda-codec-id:10de0006");
1289e9e8 574MODULE_ALIAS("snd-hda-codec-id:10de0007");
e933e9e5 575MODULE_ALIAS("snd-hda-codec-id:10de000a");
ea823c08
TI
576MODULE_ALIAS("snd-hda-codec-id:10de000b");
577MODULE_ALIAS("snd-hda-codec-id:10de000c");
25045705 578MODULE_ALIAS("snd-hda-codec-id:10de000d");
9cf2657d
SW
579MODULE_ALIAS("snd-hda-codec-id:10de0010");
580MODULE_ALIAS("snd-hda-codec-id:10de0011");
581MODULE_ALIAS("snd-hda-codec-id:10de0012");
582MODULE_ALIAS("snd-hda-codec-id:10de0013");
583MODULE_ALIAS("snd-hda-codec-id:10de0014");
584MODULE_ALIAS("snd-hda-codec-id:10de0018");
585MODULE_ALIAS("snd-hda-codec-id:10de0019");
586MODULE_ALIAS("snd-hda-codec-id:10de001a");
587MODULE_ALIAS("snd-hda-codec-id:10de001b");
588MODULE_ALIAS("snd-hda-codec-id:10de001c");
589MODULE_ALIAS("snd-hda-codec-id:10de0040");
590MODULE_ALIAS("snd-hda-codec-id:10de0041");
591MODULE_ALIAS("snd-hda-codec-id:10de0042");
592MODULE_ALIAS("snd-hda-codec-id:10de0043");
593MODULE_ALIAS("snd-hda-codec-id:10de0044");
ea823c08
TI
594MODULE_ALIAS("snd-hda-codec-id:10de0067");
595MODULE_ALIAS("snd-hda-codec-id:10de8001");
1289e9e8
TI
596
597MODULE_LICENSE("GPL");
25045705 598MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec");
1289e9e8
TI
599
600static struct hda_codec_preset_list nvhdmi_list = {
601 .preset = snd_hda_preset_nvhdmi,
602 .owner = THIS_MODULE,
603};
604
605static int __init patch_nvhdmi_init(void)
606{
607 return snd_hda_add_codec_preset(&nvhdmi_list);
608}
609
610static void __exit patch_nvhdmi_exit(void)
611{
612 snd_hda_delete_codec_preset(&nvhdmi_list);
613}
614
615module_init(patch_nvhdmi_init)
616module_exit(patch_nvhdmi_exit)