patch_nvhdmi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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. #include <linux/init.h>
  25. #include <linux/delay.h>
  26. #include <linux/slab.h>
  27. #include <sound/core.h>
  28. #include "hda_codec.h"
  29. #include "hda_local.h"
  30. #define MAX_HDMI_CVTS 1
  31. #define MAX_HDMI_PINS 1
  32. #include "patch_hdmi.c"
  33. static char *nvhdmi_pcm_names[MAX_HDMI_CVTS] = {
  34. "NVIDIA HDMI",
  35. };
  36. /* define below to restrict the supported rates and formats */
  37. /* #define LIMITED_RATE_FMT_SUPPORT */
  38. enum HDACodec {
  39. HDA_CODEC_NVIDIA_MCP7X,
  40. HDA_CODEC_NVIDIA_MCP89,
  41. HDA_CODEC_NVIDIA_GT21X,
  42. HDA_CODEC_INVALID
  43. };
  44. #define Nv_VERB_SET_Channel_Allocation 0xF79
  45. #define Nv_VERB_SET_Info_Frame_Checksum 0xF7A
  46. #define Nv_VERB_SET_Audio_Protection_On 0xF98
  47. #define Nv_VERB_SET_Audio_Protection_Off 0xF99
  48. #define nvhdmi_master_con_nid_7x 0x04
  49. #define nvhdmi_master_pin_nid_7x 0x05
  50. #define nvhdmi_master_con_nid_89 0x04
  51. #define nvhdmi_master_pin_nid_89 0x05
  52. static hda_nid_t nvhdmi_con_nids_7x[4] = {
  53. /*front, rear, clfe, rear_surr */
  54. 0x6, 0x8, 0xa, 0xc,
  55. };
  56. static struct hda_verb nvhdmi_basic_init_7x[] = {
  57. /* set audio protect on */
  58. { 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1},
  59. /* enable digital output on pin widget */
  60. { 0x5, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
  61. { 0x7, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
  62. { 0x9, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
  63. { 0xb, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
  64. { 0xd, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x5 },
  65. {} /* terminator */
  66. };
  67. #ifdef LIMITED_RATE_FMT_SUPPORT
  68. /* support only the safe format and rate */
  69. #define SUPPORTED_RATES SNDRV_PCM_RATE_48000
  70. #define SUPPORTED_MAXBPS 16
  71. #define SUPPORTED_FORMATS SNDRV_PCM_FMTBIT_S16_LE
  72. #else
  73. /* support all rates and formats */
  74. #define SUPPORTED_RATES \
  75. (SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
  76. SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
  77. SNDRV_PCM_RATE_192000)
  78. #define SUPPORTED_MAXBPS 24
  79. #define SUPPORTED_FORMATS \
  80. (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
  81. #endif
  82. /*
  83. * Controls
  84. */
  85. static int nvhdmi_build_controls(struct hda_codec *codec)
  86. {
  87. struct hdmi_spec *spec = codec->spec;
  88. int err;
  89. int i;
  90. if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
  91. || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
  92. for (i = 0; i < codec->num_pcms; i++) {
  93. err = snd_hda_create_spdif_out_ctls(codec,
  94. spec->cvt[i]);
  95. if (err < 0)
  96. return err;
  97. }
  98. } else {
  99. err = snd_hda_create_spdif_out_ctls(codec,
  100. spec->multiout.dig_out_nid);
  101. if (err < 0)
  102. return err;
  103. }
  104. return 0;
  105. }
  106. static int nvhdmi_init(struct hda_codec *codec)
  107. {
  108. struct hdmi_spec *spec = codec->spec;
  109. int i;
  110. if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
  111. || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
  112. for (i = 0; spec->pin[i]; i++) {
  113. hdmi_enable_output(codec, spec->pin[i]);
  114. snd_hda_codec_write(codec, spec->pin[i], 0,
  115. AC_VERB_SET_UNSOLICITED_ENABLE,
  116. AC_USRSP_EN | spec->pin[i]);
  117. }
  118. } else {
  119. snd_hda_sequence_write(codec, nvhdmi_basic_init_7x);
  120. }
  121. return 0;
  122. }
  123. static void nvhdmi_free(struct hda_codec *codec)
  124. {
  125. struct hdmi_spec *spec = codec->spec;
  126. int i;
  127. if ((spec->codec_type == HDA_CODEC_NVIDIA_MCP89)
  128. || (spec->codec_type == HDA_CODEC_NVIDIA_GT21X)) {
  129. for (i = 0; i < spec->num_pins; i++)
  130. snd_hda_eld_proc_free(codec, &spec->sink_eld[i]);
  131. }
  132. kfree(spec);
  133. }
  134. /*
  135. * Digital out
  136. */
  137. static int nvhdmi_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
  138. struct hda_codec *codec,
  139. struct snd_pcm_substream *substream)
  140. {
  141. struct hdmi_spec *spec = codec->spec;
  142. return snd_hda_multi_out_dig_open(codec, &spec->multiout);
  143. }
  144. static int nvhdmi_dig_playback_pcm_close_8ch_7x(struct hda_pcm_stream *hinfo,
  145. struct hda_codec *codec,
  146. struct snd_pcm_substream *substream)
  147. {
  148. struct hdmi_spec *spec = codec->spec;
  149. int i;
  150. snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x,
  151. 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
  152. for (i = 0; i < 4; i++) {
  153. /* set the stream id */
  154. snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
  155. AC_VERB_SET_CHANNEL_STREAMID, 0);
  156. /* set the stream format */
  157. snd_hda_codec_write(codec, nvhdmi_con_nids_7x[i], 0,
  158. AC_VERB_SET_STREAM_FORMAT, 0);
  159. }
  160. return snd_hda_multi_out_dig_close(codec, &spec->multiout);
  161. }
  162. static int nvhdmi_dig_playback_pcm_close_2ch(struct hda_pcm_stream *hinfo,
  163. struct hda_codec *codec,
  164. struct snd_pcm_substream *substream)
  165. {
  166. struct hdmi_spec *spec = codec->spec;
  167. return snd_hda_multi_out_dig_close(codec, &spec->multiout);
  168. }
  169. static int nvhdmi_dig_playback_pcm_prepare_8ch_89(struct hda_pcm_stream *hinfo,
  170. struct hda_codec *codec,
  171. unsigned int stream_tag,
  172. unsigned int format,
  173. struct snd_pcm_substream *substream)
  174. {
  175. hdmi_set_channel_count(codec, hinfo->nid,
  176. substream->runtime->channels);
  177. hdmi_setup_audio_infoframe(codec, hinfo->nid, substream);
  178. hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
  179. return 0;
  180. }
  181. static int nvhdmi_dig_playback_pcm_prepare_8ch(struct hda_pcm_stream *hinfo,
  182. struct hda_codec *codec,
  183. unsigned int stream_tag,
  184. unsigned int format,
  185. struct snd_pcm_substream *substream)
  186. {
  187. int chs;
  188. unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id;
  189. int i;
  190. mutex_lock(&codec->spdif_mutex);
  191. chs = substream->runtime->channels;
  192. chan = chs ? (chs - 1) : 1;
  193. switch (chs) {
  194. default:
  195. case 0:
  196. case 2:
  197. chanmask = 0x00;
  198. break;
  199. case 4:
  200. chanmask = 0x08;
  201. break;
  202. case 6:
  203. chanmask = 0x0b;
  204. break;
  205. case 8:
  206. chanmask = 0x13;
  207. break;
  208. }
  209. dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
  210. dataDCC2 = 0x2;
  211. /* set the Audio InforFrame Channel Allocation */
  212. snd_hda_codec_write(codec, 0x1, 0,
  213. Nv_VERB_SET_Channel_Allocation, chanmask);
  214. /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
  215. if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
  216. snd_hda_codec_write(codec,
  217. nvhdmi_master_con_nid_7x,
  218. 0,
  219. AC_VERB_SET_DIGI_CONVERT_1,
  220. codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
  221. /* set the stream id */
  222. snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
  223. AC_VERB_SET_CHANNEL_STREAMID, (stream_tag << 4) | 0x0);
  224. /* set the stream format */
  225. snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
  226. AC_VERB_SET_STREAM_FORMAT, format);
  227. /* turn on again (if needed) */
  228. /* enable and set the channel status audio/data flag */
  229. if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
  230. snd_hda_codec_write(codec,
  231. nvhdmi_master_con_nid_7x,
  232. 0,
  233. AC_VERB_SET_DIGI_CONVERT_1,
  234. codec->spdif_ctls & 0xff);
  235. snd_hda_codec_write(codec,
  236. nvhdmi_master_con_nid_7x,
  237. 0,
  238. AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
  239. }
  240. for (i = 0; i < 4; i++) {
  241. if (chs == 2)
  242. channel_id = 0;
  243. else
  244. channel_id = i * 2;
  245. /* turn off SPDIF once;
  246. *otherwise the IEC958 bits won't be updated
  247. */
  248. if (codec->spdif_status_reset &&
  249. (codec->spdif_ctls & AC_DIG1_ENABLE))
  250. snd_hda_codec_write(codec,
  251. nvhdmi_con_nids_7x[i],
  252. 0,
  253. AC_VERB_SET_DIGI_CONVERT_1,
  254. codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
  255. /* set the stream id */
  256. snd_hda_codec_write(codec,
  257. nvhdmi_con_nids_7x[i],
  258. 0,
  259. AC_VERB_SET_CHANNEL_STREAMID,
  260. (stream_tag << 4) | channel_id);
  261. /* set the stream format */
  262. snd_hda_codec_write(codec,
  263. nvhdmi_con_nids_7x[i],
  264. 0,
  265. AC_VERB_SET_STREAM_FORMAT,
  266. format);
  267. /* turn on again (if needed) */
  268. /* enable and set the channel status audio/data flag */
  269. if (codec->spdif_status_reset &&
  270. (codec->spdif_ctls & AC_DIG1_ENABLE)) {
  271. snd_hda_codec_write(codec,
  272. nvhdmi_con_nids_7x[i],
  273. 0,
  274. AC_VERB_SET_DIGI_CONVERT_1,
  275. codec->spdif_ctls & 0xff);
  276. snd_hda_codec_write(codec,
  277. nvhdmi_con_nids_7x[i],
  278. 0,
  279. AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
  280. }
  281. }
  282. /* set the Audio Info Frame Checksum */
  283. snd_hda_codec_write(codec, 0x1, 0,
  284. Nv_VERB_SET_Info_Frame_Checksum,
  285. (0x71 - chan - chanmask));
  286. mutex_unlock(&codec->spdif_mutex);
  287. return 0;
  288. }
  289. static int nvhdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
  290. struct hda_codec *codec,
  291. struct snd_pcm_substream *substream)
  292. {
  293. return 0;
  294. }
  295. static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
  296. struct hda_codec *codec,
  297. unsigned int stream_tag,
  298. unsigned int format,
  299. struct snd_pcm_substream *substream)
  300. {
  301. struct hdmi_spec *spec = codec->spec;
  302. return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
  303. format, substream);
  304. }
  305. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
  306. .substreams = 1,
  307. .channels_min = 2,
  308. .rates = SUPPORTED_RATES,
  309. .maxbps = SUPPORTED_MAXBPS,
  310. .formats = SUPPORTED_FORMATS,
  311. .ops = {
  312. .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
  313. .cleanup = nvhdmi_playback_pcm_cleanup,
  314. },
  315. };
  316. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_7x = {
  317. .substreams = 1,
  318. .channels_min = 2,
  319. .channels_max = 8,
  320. .nid = nvhdmi_master_con_nid_7x,
  321. .rates = SUPPORTED_RATES,
  322. .maxbps = SUPPORTED_MAXBPS,
  323. .formats = SUPPORTED_FORMATS,
  324. .ops = {
  325. .open = nvhdmi_dig_playback_pcm_open,
  326. .close = nvhdmi_dig_playback_pcm_close_8ch_7x,
  327. .prepare = nvhdmi_dig_playback_pcm_prepare_8ch
  328. },
  329. };
  330. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = {
  331. .substreams = 1,
  332. .channels_min = 2,
  333. .channels_max = 2,
  334. .nid = nvhdmi_master_con_nid_7x,
  335. .rates = SUPPORTED_RATES,
  336. .maxbps = SUPPORTED_MAXBPS,
  337. .formats = SUPPORTED_FORMATS,
  338. .ops = {
  339. .open = nvhdmi_dig_playback_pcm_open,
  340. .close = nvhdmi_dig_playback_pcm_close_2ch,
  341. .prepare = nvhdmi_dig_playback_pcm_prepare_2ch
  342. },
  343. };
  344. static int nvhdmi_build_pcms_8ch_89(struct hda_codec *codec)
  345. {
  346. struct hdmi_spec *spec = codec->spec;
  347. struct hda_pcm *info = spec->pcm_rec;
  348. int i;
  349. codec->num_pcms = spec->num_cvts;
  350. codec->pcm_info = info;
  351. for (i = 0; i < codec->num_pcms; i++, info++) {
  352. unsigned int chans;
  353. chans = get_wcaps(codec, spec->cvt[i]);
  354. chans = get_wcaps_channels(chans);
  355. info->name = nvhdmi_pcm_names[i];
  356. info->pcm_type = HDA_PCM_TYPE_HDMI;
  357. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  358. = nvhdmi_pcm_digital_playback_8ch_89;
  359. info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->cvt[i];
  360. info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = chans;
  361. }
  362. return 0;
  363. }
  364. static int nvhdmi_build_pcms_8ch_7x(struct hda_codec *codec)
  365. {
  366. struct hdmi_spec *spec = codec->spec;
  367. struct hda_pcm *info = spec->pcm_rec;
  368. codec->num_pcms = 1;
  369. codec->pcm_info = info;
  370. info->name = "NVIDIA HDMI";
  371. info->pcm_type = HDA_PCM_TYPE_HDMI;
  372. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  373. = nvhdmi_pcm_digital_playback_8ch_7x;
  374. return 0;
  375. }
  376. static int nvhdmi_build_pcms_2ch(struct hda_codec *codec)
  377. {
  378. struct hdmi_spec *spec = codec->spec;
  379. struct hda_pcm *info = spec->pcm_rec;
  380. codec->num_pcms = 1;
  381. codec->pcm_info = info;
  382. info->name = "NVIDIA HDMI";
  383. info->pcm_type = HDA_PCM_TYPE_HDMI;
  384. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  385. = nvhdmi_pcm_digital_playback_2ch;
  386. return 0;
  387. }
  388. static struct hda_codec_ops nvhdmi_patch_ops_8ch_89 = {
  389. .build_controls = nvhdmi_build_controls,
  390. .build_pcms = nvhdmi_build_pcms_8ch_89,
  391. .init = nvhdmi_init,
  392. .free = nvhdmi_free,
  393. .unsol_event = hdmi_unsol_event,
  394. };
  395. static struct hda_codec_ops nvhdmi_patch_ops_8ch_7x = {
  396. .build_controls = nvhdmi_build_controls,
  397. .build_pcms = nvhdmi_build_pcms_8ch_7x,
  398. .init = nvhdmi_init,
  399. .free = nvhdmi_free,
  400. };
  401. static struct hda_codec_ops nvhdmi_patch_ops_2ch = {
  402. .build_controls = nvhdmi_build_controls,
  403. .build_pcms = nvhdmi_build_pcms_2ch,
  404. .init = nvhdmi_init,
  405. .free = nvhdmi_free,
  406. };
  407. static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
  408. {
  409. struct hdmi_spec *spec;
  410. int i;
  411. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  412. if (spec == NULL)
  413. return -ENOMEM;
  414. codec->spec = spec;
  415. spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
  416. if (hdmi_parse_codec(codec) < 0) {
  417. codec->spec = NULL;
  418. kfree(spec);
  419. return -EINVAL;
  420. }
  421. codec->patch_ops = nvhdmi_patch_ops_8ch_89;
  422. for (i = 0; i < spec->num_pins; i++)
  423. snd_hda_eld_proc_new(codec, &spec->sink_eld[i], i);
  424. init_channel_allocations();
  425. return 0;
  426. }
  427. static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
  428. {
  429. struct hdmi_spec *spec;
  430. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  431. if (spec == NULL)
  432. return -ENOMEM;
  433. codec->spec = spec;
  434. spec->multiout.num_dacs = 0; /* no analog */
  435. spec->multiout.max_channels = 8;
  436. spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
  437. spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
  438. codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
  439. return 0;
  440. }
  441. static int patch_nvhdmi_2ch(struct hda_codec *codec)
  442. {
  443. struct hdmi_spec *spec;
  444. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  445. if (spec == NULL)
  446. return -ENOMEM;
  447. codec->spec = spec;
  448. spec->multiout.num_dacs = 0; /* no analog */
  449. spec->multiout.max_channels = 2;
  450. spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
  451. spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
  452. codec->patch_ops = nvhdmi_patch_ops_2ch;
  453. return 0;
  454. }
  455. /*
  456. * patch entries
  457. */
  458. static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
  459. { .id = 0x10de0002, .name = "MCP77/78 HDMI",
  460. .patch = patch_nvhdmi_8ch_7x },
  461. { .id = 0x10de0003, .name = "MCP77/78 HDMI",
  462. .patch = patch_nvhdmi_8ch_7x },
  463. { .id = 0x10de0005, .name = "MCP77/78 HDMI",
  464. .patch = patch_nvhdmi_8ch_7x },
  465. { .id = 0x10de0006, .name = "MCP77/78 HDMI",
  466. .patch = patch_nvhdmi_8ch_7x },
  467. { .id = 0x10de0007, .name = "MCP79/7A HDMI",
  468. .patch = patch_nvhdmi_8ch_7x },
  469. { .id = 0x10de000a, .name = "GT220 HDMI",
  470. .patch = patch_nvhdmi_8ch_89 },
  471. { .id = 0x10de000b, .name = "GT21x HDMI",
  472. .patch = patch_nvhdmi_8ch_89 },
  473. { .id = 0x10de000c, .name = "MCP89 HDMI",
  474. .patch = patch_nvhdmi_8ch_89 },
  475. { .id = 0x10de000d, .name = "GT240 HDMI",
  476. .patch = patch_nvhdmi_8ch_89 },
  477. { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
  478. { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
  479. {} /* terminator */
  480. };
  481. MODULE_ALIAS("snd-hda-codec-id:10de0002");
  482. MODULE_ALIAS("snd-hda-codec-id:10de0003");
  483. MODULE_ALIAS("snd-hda-codec-id:10de0005");
  484. MODULE_ALIAS("snd-hda-codec-id:10de0006");
  485. MODULE_ALIAS("snd-hda-codec-id:10de0007");
  486. MODULE_ALIAS("snd-hda-codec-id:10de000a");
  487. MODULE_ALIAS("snd-hda-codec-id:10de000b");
  488. MODULE_ALIAS("snd-hda-codec-id:10de000c");
  489. MODULE_ALIAS("snd-hda-codec-id:10de000d");
  490. MODULE_ALIAS("snd-hda-codec-id:10de0067");
  491. MODULE_ALIAS("snd-hda-codec-id:10de8001");
  492. MODULE_LICENSE("GPL");
  493. MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec");
  494. static struct hda_codec_preset_list nvhdmi_list = {
  495. .preset = snd_hda_preset_nvhdmi,
  496. .owner = THIS_MODULE,
  497. };
  498. static int __init patch_nvhdmi_init(void)
  499. {
  500. return snd_hda_add_codec_preset(&nvhdmi_list);
  501. }
  502. static void __exit patch_nvhdmi_exit(void)
  503. {
  504. snd_hda_delete_codec_preset(&nvhdmi_list);
  505. }
  506. module_init(patch_nvhdmi_init)
  507. module_exit(patch_nvhdmi_exit)