patch_nvhdmi.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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_32000 | 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. return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
  179. }
  180. static int nvhdmi_dig_playback_pcm_prepare_8ch(struct hda_pcm_stream *hinfo,
  181. struct hda_codec *codec,
  182. unsigned int stream_tag,
  183. unsigned int format,
  184. struct snd_pcm_substream *substream)
  185. {
  186. int chs;
  187. unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id;
  188. int i;
  189. mutex_lock(&codec->spdif_mutex);
  190. chs = substream->runtime->channels;
  191. chan = chs ? (chs - 1) : 1;
  192. switch (chs) {
  193. default:
  194. case 0:
  195. case 2:
  196. chanmask = 0x00;
  197. break;
  198. case 4:
  199. chanmask = 0x08;
  200. break;
  201. case 6:
  202. chanmask = 0x0b;
  203. break;
  204. case 8:
  205. chanmask = 0x13;
  206. break;
  207. }
  208. dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
  209. dataDCC2 = 0x2;
  210. /* set the Audio InforFrame Channel Allocation */
  211. snd_hda_codec_write(codec, 0x1, 0,
  212. Nv_VERB_SET_Channel_Allocation, chanmask);
  213. /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
  214. if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
  215. snd_hda_codec_write(codec,
  216. nvhdmi_master_con_nid_7x,
  217. 0,
  218. AC_VERB_SET_DIGI_CONVERT_1,
  219. codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
  220. /* set the stream id */
  221. snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
  222. AC_VERB_SET_CHANNEL_STREAMID, (stream_tag << 4) | 0x0);
  223. /* set the stream format */
  224. snd_hda_codec_write(codec, nvhdmi_master_con_nid_7x, 0,
  225. AC_VERB_SET_STREAM_FORMAT, format);
  226. /* turn on again (if needed) */
  227. /* enable and set the channel status audio/data flag */
  228. if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE)) {
  229. snd_hda_codec_write(codec,
  230. nvhdmi_master_con_nid_7x,
  231. 0,
  232. AC_VERB_SET_DIGI_CONVERT_1,
  233. codec->spdif_ctls & 0xff);
  234. snd_hda_codec_write(codec,
  235. nvhdmi_master_con_nid_7x,
  236. 0,
  237. AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
  238. }
  239. for (i = 0; i < 4; i++) {
  240. if (chs == 2)
  241. channel_id = 0;
  242. else
  243. channel_id = i * 2;
  244. /* turn off SPDIF once;
  245. *otherwise the IEC958 bits won't be updated
  246. */
  247. if (codec->spdif_status_reset &&
  248. (codec->spdif_ctls & AC_DIG1_ENABLE))
  249. snd_hda_codec_write(codec,
  250. nvhdmi_con_nids_7x[i],
  251. 0,
  252. AC_VERB_SET_DIGI_CONVERT_1,
  253. codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
  254. /* set the stream id */
  255. snd_hda_codec_write(codec,
  256. nvhdmi_con_nids_7x[i],
  257. 0,
  258. AC_VERB_SET_CHANNEL_STREAMID,
  259. (stream_tag << 4) | channel_id);
  260. /* set the stream format */
  261. snd_hda_codec_write(codec,
  262. nvhdmi_con_nids_7x[i],
  263. 0,
  264. AC_VERB_SET_STREAM_FORMAT,
  265. format);
  266. /* turn on again (if needed) */
  267. /* enable and set the channel status audio/data flag */
  268. if (codec->spdif_status_reset &&
  269. (codec->spdif_ctls & AC_DIG1_ENABLE)) {
  270. snd_hda_codec_write(codec,
  271. nvhdmi_con_nids_7x[i],
  272. 0,
  273. AC_VERB_SET_DIGI_CONVERT_1,
  274. codec->spdif_ctls & 0xff);
  275. snd_hda_codec_write(codec,
  276. nvhdmi_con_nids_7x[i],
  277. 0,
  278. AC_VERB_SET_DIGI_CONVERT_2, dataDCC2);
  279. }
  280. }
  281. /* set the Audio Info Frame Checksum */
  282. snd_hda_codec_write(codec, 0x1, 0,
  283. Nv_VERB_SET_Info_Frame_Checksum,
  284. (0x71 - chan - chanmask));
  285. mutex_unlock(&codec->spdif_mutex);
  286. return 0;
  287. }
  288. static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
  289. struct hda_codec *codec,
  290. unsigned int stream_tag,
  291. unsigned int format,
  292. struct snd_pcm_substream *substream)
  293. {
  294. struct hdmi_spec *spec = codec->spec;
  295. return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag,
  296. format, substream);
  297. }
  298. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
  299. .substreams = 1,
  300. .channels_min = 2,
  301. .ops = {
  302. .open = hdmi_pcm_open,
  303. .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
  304. },
  305. };
  306. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_7x = {
  307. .substreams = 1,
  308. .channels_min = 2,
  309. .channels_max = 8,
  310. .nid = nvhdmi_master_con_nid_7x,
  311. .rates = SUPPORTED_RATES,
  312. .maxbps = SUPPORTED_MAXBPS,
  313. .formats = SUPPORTED_FORMATS,
  314. .ops = {
  315. .open = nvhdmi_dig_playback_pcm_open,
  316. .close = nvhdmi_dig_playback_pcm_close_8ch_7x,
  317. .prepare = nvhdmi_dig_playback_pcm_prepare_8ch
  318. },
  319. };
  320. static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = {
  321. .substreams = 1,
  322. .channels_min = 2,
  323. .channels_max = 2,
  324. .nid = nvhdmi_master_con_nid_7x,
  325. .rates = SUPPORTED_RATES,
  326. .maxbps = SUPPORTED_MAXBPS,
  327. .formats = SUPPORTED_FORMATS,
  328. .ops = {
  329. .open = nvhdmi_dig_playback_pcm_open,
  330. .close = nvhdmi_dig_playback_pcm_close_2ch,
  331. .prepare = nvhdmi_dig_playback_pcm_prepare_2ch
  332. },
  333. };
  334. static int nvhdmi_build_pcms_8ch_89(struct hda_codec *codec)
  335. {
  336. struct hdmi_spec *spec = codec->spec;
  337. struct hda_pcm *info = spec->pcm_rec;
  338. int i;
  339. codec->num_pcms = spec->num_cvts;
  340. codec->pcm_info = info;
  341. for (i = 0; i < codec->num_pcms; i++, info++) {
  342. unsigned int chans;
  343. chans = get_wcaps(codec, spec->cvt[i]);
  344. chans = get_wcaps_channels(chans);
  345. info->name = nvhdmi_pcm_names[i];
  346. info->pcm_type = HDA_PCM_TYPE_HDMI;
  347. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  348. = nvhdmi_pcm_digital_playback_8ch_89;
  349. info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->cvt[i];
  350. info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = chans;
  351. }
  352. return 0;
  353. }
  354. static int nvhdmi_build_pcms_8ch_7x(struct hda_codec *codec)
  355. {
  356. struct hdmi_spec *spec = codec->spec;
  357. struct hda_pcm *info = spec->pcm_rec;
  358. codec->num_pcms = 1;
  359. codec->pcm_info = info;
  360. info->name = "NVIDIA HDMI";
  361. info->pcm_type = HDA_PCM_TYPE_HDMI;
  362. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  363. = nvhdmi_pcm_digital_playback_8ch_7x;
  364. return 0;
  365. }
  366. static int nvhdmi_build_pcms_2ch(struct hda_codec *codec)
  367. {
  368. struct hdmi_spec *spec = codec->spec;
  369. struct hda_pcm *info = spec->pcm_rec;
  370. codec->num_pcms = 1;
  371. codec->pcm_info = info;
  372. info->name = "NVIDIA HDMI";
  373. info->pcm_type = HDA_PCM_TYPE_HDMI;
  374. info->stream[SNDRV_PCM_STREAM_PLAYBACK]
  375. = nvhdmi_pcm_digital_playback_2ch;
  376. return 0;
  377. }
  378. static struct hda_codec_ops nvhdmi_patch_ops_8ch_89 = {
  379. .build_controls = nvhdmi_build_controls,
  380. .build_pcms = nvhdmi_build_pcms_8ch_89,
  381. .init = nvhdmi_init,
  382. .free = nvhdmi_free,
  383. .unsol_event = hdmi_unsol_event,
  384. };
  385. static struct hda_codec_ops nvhdmi_patch_ops_8ch_7x = {
  386. .build_controls = nvhdmi_build_controls,
  387. .build_pcms = nvhdmi_build_pcms_8ch_7x,
  388. .init = nvhdmi_init,
  389. .free = nvhdmi_free,
  390. };
  391. static struct hda_codec_ops nvhdmi_patch_ops_2ch = {
  392. .build_controls = nvhdmi_build_controls,
  393. .build_pcms = nvhdmi_build_pcms_2ch,
  394. .init = nvhdmi_init,
  395. .free = nvhdmi_free,
  396. };
  397. static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
  398. {
  399. struct hdmi_spec *spec;
  400. int i;
  401. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  402. if (spec == NULL)
  403. return -ENOMEM;
  404. codec->spec = spec;
  405. spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
  406. spec->old_pin_detect = 1;
  407. if (hdmi_parse_codec(codec) < 0) {
  408. codec->spec = NULL;
  409. kfree(spec);
  410. return -EINVAL;
  411. }
  412. codec->patch_ops = nvhdmi_patch_ops_8ch_89;
  413. for (i = 0; i < spec->num_pins; i++)
  414. snd_hda_eld_proc_new(codec, &spec->sink_eld[i], i);
  415. init_channel_allocations();
  416. return 0;
  417. }
  418. static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
  419. {
  420. struct hdmi_spec *spec;
  421. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  422. if (spec == NULL)
  423. return -ENOMEM;
  424. codec->spec = spec;
  425. spec->multiout.num_dacs = 0; /* no analog */
  426. spec->multiout.max_channels = 8;
  427. spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
  428. spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
  429. spec->old_pin_detect = 1;
  430. codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
  431. return 0;
  432. }
  433. static int patch_nvhdmi_2ch(struct hda_codec *codec)
  434. {
  435. struct hdmi_spec *spec;
  436. spec = kzalloc(sizeof(*spec), GFP_KERNEL);
  437. if (spec == NULL)
  438. return -ENOMEM;
  439. codec->spec = spec;
  440. spec->multiout.num_dacs = 0; /* no analog */
  441. spec->multiout.max_channels = 2;
  442. spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
  443. spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
  444. spec->old_pin_detect = 1;
  445. codec->patch_ops = nvhdmi_patch_ops_2ch;
  446. return 0;
  447. }
  448. /*
  449. * patch entries
  450. */
  451. static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
  452. { .id = 0x10de0002, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
  453. { .id = 0x10de0003, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
  454. { .id = 0x10de0005, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
  455. { .id = 0x10de0006, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
  456. { .id = 0x10de0007, .name = "MCP79/7A HDMI", .patch = patch_nvhdmi_8ch_7x },
  457. { .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  458. { .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  459. { .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_nvhdmi_8ch_89 },
  460. { .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  461. { .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  462. { .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  463. { .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  464. { .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  465. { .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  466. { .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  467. { .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  468. { .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  469. { .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  470. { .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  471. { .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  472. { .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  473. { .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  474. { .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  475. { .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_nvhdmi_8ch_89 },
  476. { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
  477. { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
  478. {} /* terminator */
  479. };
  480. MODULE_ALIAS("snd-hda-codec-id:10de0002");
  481. MODULE_ALIAS("snd-hda-codec-id:10de0003");
  482. MODULE_ALIAS("snd-hda-codec-id:10de0005");
  483. MODULE_ALIAS("snd-hda-codec-id:10de0006");
  484. MODULE_ALIAS("snd-hda-codec-id:10de0007");
  485. MODULE_ALIAS("snd-hda-codec-id:10de000a");
  486. MODULE_ALIAS("snd-hda-codec-id:10de000b");
  487. MODULE_ALIAS("snd-hda-codec-id:10de000c");
  488. MODULE_ALIAS("snd-hda-codec-id:10de000d");
  489. MODULE_ALIAS("snd-hda-codec-id:10de0010");
  490. MODULE_ALIAS("snd-hda-codec-id:10de0011");
  491. MODULE_ALIAS("snd-hda-codec-id:10de0012");
  492. MODULE_ALIAS("snd-hda-codec-id:10de0013");
  493. MODULE_ALIAS("snd-hda-codec-id:10de0014");
  494. MODULE_ALIAS("snd-hda-codec-id:10de0018");
  495. MODULE_ALIAS("snd-hda-codec-id:10de0019");
  496. MODULE_ALIAS("snd-hda-codec-id:10de001a");
  497. MODULE_ALIAS("snd-hda-codec-id:10de001b");
  498. MODULE_ALIAS("snd-hda-codec-id:10de001c");
  499. MODULE_ALIAS("snd-hda-codec-id:10de0040");
  500. MODULE_ALIAS("snd-hda-codec-id:10de0041");
  501. MODULE_ALIAS("snd-hda-codec-id:10de0042");
  502. MODULE_ALIAS("snd-hda-codec-id:10de0043");
  503. MODULE_ALIAS("snd-hda-codec-id:10de0044");
  504. MODULE_ALIAS("snd-hda-codec-id:10de0067");
  505. MODULE_ALIAS("snd-hda-codec-id:10de8001");
  506. MODULE_LICENSE("GPL");
  507. MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec");
  508. static struct hda_codec_preset_list nvhdmi_list = {
  509. .preset = snd_hda_preset_nvhdmi,
  510. .owner = THIS_MODULE,
  511. };
  512. static int __init patch_nvhdmi_init(void)
  513. {
  514. return snd_hda_add_codec_preset(&nvhdmi_list);
  515. }
  516. static void __exit patch_nvhdmi_exit(void)
  517. {
  518. snd_hda_delete_codec_preset(&nvhdmi_list);
  519. }
  520. module_init(patch_nvhdmi_init)
  521. module_exit(patch_nvhdmi_exit)