alc880_quirks.c 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. /*
  2. * ALC880 quirk models
  3. * included by patch_realtek.c
  4. */
  5. /* ALC880 board config type */
  6. enum {
  7. ALC880_AUTO,
  8. ALC880_3ST,
  9. ALC880_3ST_DIG,
  10. ALC880_5ST,
  11. ALC880_5ST_DIG,
  12. ALC880_Z71V,
  13. ALC880_6ST,
  14. ALC880_6ST_DIG,
  15. ALC880_F1734,
  16. ALC880_ASUS,
  17. ALC880_ASUS_DIG,
  18. ALC880_ASUS_W1V,
  19. ALC880_ASUS_DIG2,
  20. ALC880_UNIWILL_DIG,
  21. ALC880_UNIWILL,
  22. ALC880_UNIWILL_P53,
  23. #ifdef CONFIG_SND_DEBUG
  24. ALC880_TEST,
  25. #endif
  26. ALC880_MODEL_LAST /* last tag */
  27. };
  28. /*
  29. * ALC880 3-stack model
  30. *
  31. * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
  32. * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
  33. * F-Mic = 0x1b, HP = 0x19
  34. */
  35. static const hda_nid_t alc880_dac_nids[4] = {
  36. /* front, rear, clfe, rear_surr */
  37. 0x02, 0x05, 0x04, 0x03
  38. };
  39. static const hda_nid_t alc880_adc_nids[3] = {
  40. /* ADC0-2 */
  41. 0x07, 0x08, 0x09,
  42. };
  43. /* The datasheet says the node 0x07 is connected from inputs,
  44. * but it shows zero connection in the real implementation on some devices.
  45. * Note: this is a 915GAV bug, fixed on 915GLV
  46. */
  47. static const hda_nid_t alc880_adc_nids_alt[2] = {
  48. /* ADC1-2 */
  49. 0x08, 0x09,
  50. };
  51. #define ALC880_DIGOUT_NID 0x06
  52. #define ALC880_DIGIN_NID 0x0a
  53. #define ALC880_PIN_CD_NID 0x1c
  54. static const struct hda_input_mux alc880_capture_source = {
  55. .num_items = 4,
  56. .items = {
  57. { "Mic", 0x0 },
  58. { "Front Mic", 0x3 },
  59. { "Line", 0x2 },
  60. { "CD", 0x4 },
  61. },
  62. };
  63. /* channel source setting (2/6 channel selection for 3-stack) */
  64. /* 2ch mode */
  65. static const struct hda_verb alc880_threestack_ch2_init[] = {
  66. /* set line-in to input, mute it */
  67. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  68. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  69. /* set mic-in to input vref 80%, mute it */
  70. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  71. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  72. { } /* end */
  73. };
  74. /* 6ch mode */
  75. static const struct hda_verb alc880_threestack_ch6_init[] = {
  76. /* set line-in to output, unmute it */
  77. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  78. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  79. /* set mic-in to output, unmute it */
  80. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  81. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  82. { } /* end */
  83. };
  84. static const struct hda_channel_mode alc880_threestack_modes[2] = {
  85. { 2, alc880_threestack_ch2_init },
  86. { 6, alc880_threestack_ch6_init },
  87. };
  88. static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
  89. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  90. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  91. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  92. HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
  93. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  94. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  95. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  96. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  97. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  98. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  99. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  100. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  101. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  102. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  103. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
  104. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
  105. HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
  106. {
  107. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  108. .name = "Channel Mode",
  109. .info = alc_ch_mode_info,
  110. .get = alc_ch_mode_get,
  111. .put = alc_ch_mode_put,
  112. },
  113. { } /* end */
  114. };
  115. /*
  116. * ALC880 5-stack model
  117. *
  118. * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
  119. * Side = 0x02 (0xd)
  120. * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
  121. * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
  122. */
  123. /* additional mixers to alc880_three_stack_mixer */
  124. static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
  125. HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  126. HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
  127. { } /* end */
  128. };
  129. /* channel source setting (6/8 channel selection for 5-stack) */
  130. /* 6ch mode */
  131. static const struct hda_verb alc880_fivestack_ch6_init[] = {
  132. /* set line-in to input, mute it */
  133. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  134. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  135. { } /* end */
  136. };
  137. /* 8ch mode */
  138. static const struct hda_verb alc880_fivestack_ch8_init[] = {
  139. /* set line-in to output, unmute it */
  140. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  141. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  142. { } /* end */
  143. };
  144. static const struct hda_channel_mode alc880_fivestack_modes[2] = {
  145. { 6, alc880_fivestack_ch6_init },
  146. { 8, alc880_fivestack_ch8_init },
  147. };
  148. /*
  149. * ALC880 6-stack model
  150. *
  151. * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
  152. * Side = 0x05 (0x0f)
  153. * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
  154. * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
  155. */
  156. static const hda_nid_t alc880_6st_dac_nids[4] = {
  157. /* front, rear, clfe, rear_surr */
  158. 0x02, 0x03, 0x04, 0x05
  159. };
  160. static const struct hda_input_mux alc880_6stack_capture_source = {
  161. .num_items = 4,
  162. .items = {
  163. { "Mic", 0x0 },
  164. { "Front Mic", 0x1 },
  165. { "Line", 0x2 },
  166. { "CD", 0x4 },
  167. },
  168. };
  169. /* fixed 8-channels */
  170. static const struct hda_channel_mode alc880_sixstack_modes[1] = {
  171. { 8, NULL },
  172. };
  173. static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
  174. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  175. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  176. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  177. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  178. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  179. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  180. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  181. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  182. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  183. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  184. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  185. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  186. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  187. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  188. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  189. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  190. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  191. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  192. {
  193. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  194. .name = "Channel Mode",
  195. .info = alc_ch_mode_info,
  196. .get = alc_ch_mode_get,
  197. .put = alc_ch_mode_put,
  198. },
  199. { } /* end */
  200. };
  201. static const hda_nid_t alc880_w810_dac_nids[3] = {
  202. /* front, rear/surround, clfe */
  203. 0x02, 0x03, 0x04
  204. };
  205. /*
  206. * Z710V model
  207. *
  208. * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
  209. * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
  210. * Line = 0x1a
  211. */
  212. static const hda_nid_t alc880_z71v_dac_nids[1] = {
  213. 0x02
  214. };
  215. #define ALC880_Z71V_HP_DAC 0x03
  216. /* fixed 2 channels */
  217. static const struct hda_channel_mode alc880_2_jack_modes[1] = {
  218. { 2, NULL }
  219. };
  220. static const struct snd_kcontrol_new alc880_z71v_mixer[] = {
  221. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  222. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  223. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  224. HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
  225. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  226. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  227. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  228. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  229. { } /* end */
  230. };
  231. /*
  232. * ALC880 F1734 model
  233. *
  234. * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
  235. * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
  236. */
  237. static const hda_nid_t alc880_f1734_dac_nids[1] = {
  238. 0x03
  239. };
  240. #define ALC880_F1734_HP_DAC 0x02
  241. static const struct snd_kcontrol_new alc880_f1734_mixer[] = {
  242. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  243. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  244. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  245. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  246. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  247. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  248. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  249. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  250. { } /* end */
  251. };
  252. static const struct hda_input_mux alc880_f1734_capture_source = {
  253. .num_items = 2,
  254. .items = {
  255. { "Mic", 0x1 },
  256. { "CD", 0x4 },
  257. },
  258. };
  259. /*
  260. * ALC880 ASUS model
  261. *
  262. * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
  263. * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
  264. * Mic = 0x18, Line = 0x1a
  265. */
  266. #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
  267. #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
  268. static const struct snd_kcontrol_new alc880_asus_mixer[] = {
  269. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  270. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  271. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  272. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  273. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  274. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  275. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  276. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  277. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  278. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  279. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  280. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  281. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  282. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  283. {
  284. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  285. .name = "Channel Mode",
  286. .info = alc_ch_mode_info,
  287. .get = alc_ch_mode_get,
  288. .put = alc_ch_mode_put,
  289. },
  290. { } /* end */
  291. };
  292. /*
  293. * ALC880 ASUS W1V model
  294. *
  295. * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
  296. * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
  297. * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
  298. */
  299. /* additional mixers to alc880_asus_mixer */
  300. static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
  301. HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
  302. HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
  303. { } /* end */
  304. };
  305. /* Uniwill */
  306. static const struct snd_kcontrol_new alc880_uniwill_mixer[] = {
  307. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  308. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  309. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  310. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  311. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  312. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  313. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  314. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  315. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  316. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  317. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  318. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  319. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  320. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  321. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  322. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  323. {
  324. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  325. .name = "Channel Mode",
  326. .info = alc_ch_mode_info,
  327. .get = alc_ch_mode_get,
  328. .put = alc_ch_mode_put,
  329. },
  330. { } /* end */
  331. };
  332. static const struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
  333. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  334. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  335. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  336. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  337. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  338. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  339. { } /* end */
  340. };
  341. /*
  342. * initialize the codec volumes, etc
  343. */
  344. /*
  345. * generic initialization of ADC, input mixers and output mixers
  346. */
  347. static const struct hda_verb alc880_volume_init_verbs[] = {
  348. /*
  349. * Unmute ADC0-2 and set the default input to mic-in
  350. */
  351. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  352. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  353. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  354. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  355. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  356. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  357. /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
  358. * mixer widget
  359. * Note: PASD motherboards uses the Line In 2 as the input for front
  360. * panel mic (mic 2)
  361. */
  362. /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
  363. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  364. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  365. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  366. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  367. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  368. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
  369. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
  370. /*
  371. * Set up output mixers (0x0c - 0x0f)
  372. */
  373. /* set vol=0 to output mixers */
  374. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  375. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  376. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  377. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  378. /* set up input amps for analog loopback */
  379. /* Amp Indices: DAC = 0, mixer = 1 */
  380. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  381. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  382. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  383. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  384. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  385. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  386. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  387. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  388. { }
  389. };
  390. /*
  391. * 3-stack pin configuration:
  392. * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
  393. */
  394. static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
  395. /*
  396. * preset connection lists of input pins
  397. * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
  398. */
  399. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
  400. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  401. {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
  402. /*
  403. * Set pin mode and muting
  404. */
  405. /* set front pin widgets 0x14 for output */
  406. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  407. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  408. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  409. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  410. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  411. /* Mic2 (as headphone out) for HP output */
  412. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  413. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  414. /* Line In pin widget for input */
  415. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  416. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  417. /* Line2 (as front mic) pin widget for input and vref at 80% */
  418. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  419. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  420. /* CD pin widget for input */
  421. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  422. { }
  423. };
  424. /*
  425. * 5-stack pin configuration:
  426. * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
  427. * line-in/side = 0x1a, f-mic = 0x1b
  428. */
  429. static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
  430. /*
  431. * preset connection lists of input pins
  432. * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
  433. */
  434. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  435. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
  436. /*
  437. * Set pin mode and muting
  438. */
  439. /* set pin widgets 0x14-0x17 for output */
  440. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  441. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  442. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  443. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  444. /* unmute pins for output (no gain on this amp) */
  445. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  446. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  447. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  448. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  449. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  450. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  451. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  452. /* Mic2 (as headphone out) for HP output */
  453. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  454. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  455. /* Line In pin widget for input */
  456. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  457. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  458. /* Line2 (as front mic) pin widget for input and vref at 80% */
  459. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  460. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  461. /* CD pin widget for input */
  462. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  463. { }
  464. };
  465. /*
  466. * Z71V pin configuration:
  467. * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
  468. */
  469. static const struct hda_verb alc880_pin_z71v_init_verbs[] = {
  470. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  471. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  472. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  473. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  474. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  475. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  476. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  477. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  478. { }
  479. };
  480. /*
  481. * 6-stack pin configuration:
  482. * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
  483. * f-mic = 0x19, line = 0x1a, HP = 0x1b
  484. */
  485. static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
  486. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  487. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  488. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  489. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  490. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  491. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  492. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  493. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  494. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  495. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  496. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  497. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  498. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  499. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  500. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  501. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  502. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  503. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  504. { }
  505. };
  506. /*
  507. * Uniwill pin configuration:
  508. * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
  509. * line = 0x1a
  510. */
  511. static const struct hda_verb alc880_uniwill_init_verbs[] = {
  512. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  513. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  514. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  515. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  516. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  517. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  518. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  519. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  520. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  521. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  522. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  523. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  524. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  525. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  526. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  527. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  528. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  529. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  530. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  531. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  532. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  533. /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
  534. /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
  535. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  536. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  537. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
  538. { }
  539. };
  540. /*
  541. * Uniwill P53
  542. * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
  543. */
  544. static const struct hda_verb alc880_uniwill_p53_init_verbs[] = {
  545. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  546. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  547. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  548. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  549. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  550. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  551. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  552. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  553. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  554. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  555. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  556. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  557. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  558. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  559. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  560. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  561. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  562. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  563. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  564. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  565. {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_DCVOL_EVENT},
  566. { }
  567. };
  568. static const struct hda_verb alc880_beep_init_verbs[] = {
  569. { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
  570. { }
  571. };
  572. static void alc880_uniwill_setup(struct hda_codec *codec)
  573. {
  574. struct alc_spec *spec = codec->spec;
  575. spec->autocfg.hp_pins[0] = 0x14;
  576. spec->autocfg.speaker_pins[0] = 0x15;
  577. spec->autocfg.speaker_pins[0] = 0x16;
  578. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  579. }
  580. static void alc880_uniwill_init_hook(struct hda_codec *codec)
  581. {
  582. alc_hp_automute(codec);
  583. alc88x_simple_mic_automute(codec);
  584. }
  585. static void alc880_uniwill_unsol_event(struct hda_codec *codec,
  586. unsigned int res)
  587. {
  588. /* Looks like the unsol event is incompatible with the standard
  589. * definition. 4bit tag is placed at 28 bit!
  590. */
  591. res >>= 28;
  592. switch (res) {
  593. case ALC_MIC_EVENT:
  594. alc88x_simple_mic_automute(codec);
  595. break;
  596. default:
  597. alc_exec_unsol_event(codec, res);
  598. break;
  599. }
  600. }
  601. static void alc880_uniwill_p53_setup(struct hda_codec *codec)
  602. {
  603. struct alc_spec *spec = codec->spec;
  604. spec->autocfg.hp_pins[0] = 0x14;
  605. spec->autocfg.speaker_pins[0] = 0x15;
  606. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  607. }
  608. static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
  609. {
  610. unsigned int present;
  611. present = snd_hda_codec_read(codec, 0x21, 0,
  612. AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
  613. present &= HDA_AMP_VOLMASK;
  614. snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
  615. HDA_AMP_VOLMASK, present);
  616. snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
  617. HDA_AMP_VOLMASK, present);
  618. }
  619. static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
  620. unsigned int res)
  621. {
  622. /* Looks like the unsol event is incompatible with the standard
  623. * definition. 4bit tag is placed at 28 bit!
  624. */
  625. res >>= 28;
  626. if (res == ALC_DCVOL_EVENT)
  627. alc880_uniwill_p53_dcvol_automute(codec);
  628. else
  629. alc_exec_unsol_event(codec, res);
  630. }
  631. /*
  632. * F1734 pin configuration:
  633. * HP = 0x14, speaker-out = 0x15, mic = 0x18
  634. */
  635. static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
  636. {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
  637. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  638. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  639. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  640. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  641. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  642. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  643. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  644. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  645. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  646. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  647. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
  648. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  649. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  650. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  651. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  652. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  653. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  654. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
  655. {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
  656. { }
  657. };
  658. /*
  659. * ASUS pin configuration:
  660. * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
  661. */
  662. static const struct hda_verb alc880_pin_asus_init_verbs[] = {
  663. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  664. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  665. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  666. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  667. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  668. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  669. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  670. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  671. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  672. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  673. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  674. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  675. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  676. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  677. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  678. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  679. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  680. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  681. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  682. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  683. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  684. { }
  685. };
  686. /* Enable GPIO mask and set output */
  687. #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
  688. #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
  689. #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
  690. /*
  691. * Test configuration for debugging
  692. *
  693. * Almost all inputs/outputs are enabled. I/O pins can be configured via
  694. * enum controls.
  695. */
  696. #ifdef CONFIG_SND_DEBUG
  697. static const hda_nid_t alc880_test_dac_nids[4] = {
  698. 0x02, 0x03, 0x04, 0x05
  699. };
  700. static const struct hda_input_mux alc880_test_capture_source = {
  701. .num_items = 7,
  702. .items = {
  703. { "In-1", 0x0 },
  704. { "In-2", 0x1 },
  705. { "In-3", 0x2 },
  706. { "In-4", 0x3 },
  707. { "CD", 0x4 },
  708. { "Front", 0x5 },
  709. { "Surround", 0x6 },
  710. },
  711. };
  712. static const struct hda_channel_mode alc880_test_modes[4] = {
  713. { 2, NULL },
  714. { 4, NULL },
  715. { 6, NULL },
  716. { 8, NULL },
  717. };
  718. static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
  719. struct snd_ctl_elem_info *uinfo)
  720. {
  721. static const char * const texts[] = {
  722. "N/A", "Line Out", "HP Out",
  723. "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
  724. };
  725. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  726. uinfo->count = 1;
  727. uinfo->value.enumerated.items = 8;
  728. if (uinfo->value.enumerated.item >= 8)
  729. uinfo->value.enumerated.item = 7;
  730. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  731. return 0;
  732. }
  733. static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
  734. struct snd_ctl_elem_value *ucontrol)
  735. {
  736. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  737. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  738. unsigned int pin_ctl, item = 0;
  739. pin_ctl = snd_hda_codec_read(codec, nid, 0,
  740. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  741. if (pin_ctl & AC_PINCTL_OUT_EN) {
  742. if (pin_ctl & AC_PINCTL_HP_EN)
  743. item = 2;
  744. else
  745. item = 1;
  746. } else if (pin_ctl & AC_PINCTL_IN_EN) {
  747. switch (pin_ctl & AC_PINCTL_VREFEN) {
  748. case AC_PINCTL_VREF_HIZ: item = 3; break;
  749. case AC_PINCTL_VREF_50: item = 4; break;
  750. case AC_PINCTL_VREF_GRD: item = 5; break;
  751. case AC_PINCTL_VREF_80: item = 6; break;
  752. case AC_PINCTL_VREF_100: item = 7; break;
  753. }
  754. }
  755. ucontrol->value.enumerated.item[0] = item;
  756. return 0;
  757. }
  758. static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
  759. struct snd_ctl_elem_value *ucontrol)
  760. {
  761. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  762. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  763. static const unsigned int ctls[] = {
  764. 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
  765. AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
  766. AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
  767. AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
  768. AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
  769. AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
  770. };
  771. unsigned int old_ctl, new_ctl;
  772. old_ctl = snd_hda_codec_read(codec, nid, 0,
  773. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  774. new_ctl = ctls[ucontrol->value.enumerated.item[0]];
  775. if (old_ctl != new_ctl) {
  776. int val;
  777. snd_hda_codec_write_cache(codec, nid, 0,
  778. AC_VERB_SET_PIN_WIDGET_CONTROL,
  779. new_ctl);
  780. val = ucontrol->value.enumerated.item[0] >= 3 ?
  781. HDA_AMP_MUTE : 0;
  782. snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
  783. HDA_AMP_MUTE, val);
  784. return 1;
  785. }
  786. return 0;
  787. }
  788. static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
  789. struct snd_ctl_elem_info *uinfo)
  790. {
  791. static const char * const texts[] = {
  792. "Front", "Surround", "CLFE", "Side"
  793. };
  794. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  795. uinfo->count = 1;
  796. uinfo->value.enumerated.items = 4;
  797. if (uinfo->value.enumerated.item >= 4)
  798. uinfo->value.enumerated.item = 3;
  799. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  800. return 0;
  801. }
  802. static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
  803. struct snd_ctl_elem_value *ucontrol)
  804. {
  805. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  806. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  807. unsigned int sel;
  808. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
  809. ucontrol->value.enumerated.item[0] = sel & 3;
  810. return 0;
  811. }
  812. static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
  813. struct snd_ctl_elem_value *ucontrol)
  814. {
  815. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  816. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  817. unsigned int sel;
  818. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
  819. if (ucontrol->value.enumerated.item[0] != sel) {
  820. sel = ucontrol->value.enumerated.item[0] & 3;
  821. snd_hda_codec_write_cache(codec, nid, 0,
  822. AC_VERB_SET_CONNECT_SEL, sel);
  823. return 1;
  824. }
  825. return 0;
  826. }
  827. #define PIN_CTL_TEST(xname,nid) { \
  828. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  829. .name = xname, \
  830. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  831. .info = alc_test_pin_ctl_info, \
  832. .get = alc_test_pin_ctl_get, \
  833. .put = alc_test_pin_ctl_put, \
  834. .private_value = nid \
  835. }
  836. #define PIN_SRC_TEST(xname,nid) { \
  837. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  838. .name = xname, \
  839. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  840. .info = alc_test_pin_src_info, \
  841. .get = alc_test_pin_src_get, \
  842. .put = alc_test_pin_src_put, \
  843. .private_value = nid \
  844. }
  845. static const struct snd_kcontrol_new alc880_test_mixer[] = {
  846. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  847. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  848. HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
  849. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  850. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  851. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  852. HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
  853. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  854. PIN_CTL_TEST("Front Pin Mode", 0x14),
  855. PIN_CTL_TEST("Surround Pin Mode", 0x15),
  856. PIN_CTL_TEST("CLFE Pin Mode", 0x16),
  857. PIN_CTL_TEST("Side Pin Mode", 0x17),
  858. PIN_CTL_TEST("In-1 Pin Mode", 0x18),
  859. PIN_CTL_TEST("In-2 Pin Mode", 0x19),
  860. PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
  861. PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
  862. PIN_SRC_TEST("In-1 Pin Source", 0x18),
  863. PIN_SRC_TEST("In-2 Pin Source", 0x19),
  864. PIN_SRC_TEST("In-3 Pin Source", 0x1a),
  865. PIN_SRC_TEST("In-4 Pin Source", 0x1b),
  866. HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
  867. HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
  868. HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
  869. HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
  870. HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
  871. HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
  872. HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
  873. HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
  874. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
  875. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
  876. {
  877. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  878. .name = "Channel Mode",
  879. .info = alc_ch_mode_info,
  880. .get = alc_ch_mode_get,
  881. .put = alc_ch_mode_put,
  882. },
  883. { } /* end */
  884. };
  885. static const struct hda_verb alc880_test_init_verbs[] = {
  886. /* Unmute inputs of 0x0c - 0x0f */
  887. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  888. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  889. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  890. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  891. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  892. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  893. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  894. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  895. /* Vol output for 0x0c-0x0f */
  896. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  897. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  898. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  899. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  900. /* Set output pins 0x14-0x17 */
  901. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  902. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  903. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  904. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  905. /* Unmute output pins 0x14-0x17 */
  906. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  907. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  908. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  909. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  910. /* Set input pins 0x18-0x1c */
  911. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  912. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  913. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  914. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  915. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  916. /* Mute input pins 0x18-0x1b */
  917. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  918. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  919. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  920. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  921. /* ADC set up */
  922. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  923. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  924. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  925. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  926. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  927. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  928. /* Analog input/passthru */
  929. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  930. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  931. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  932. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  933. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  934. { }
  935. };
  936. #endif
  937. /*
  938. */
  939. static const char * const alc880_models[ALC880_MODEL_LAST] = {
  940. [ALC880_3ST] = "3stack",
  941. [ALC880_3ST_DIG] = "3stack-digout",
  942. [ALC880_5ST] = "5stack",
  943. [ALC880_5ST_DIG] = "5stack-digout",
  944. [ALC880_Z71V] = "z71v",
  945. [ALC880_6ST] = "6stack",
  946. [ALC880_6ST_DIG] = "6stack-digout",
  947. [ALC880_ASUS] = "asus",
  948. [ALC880_ASUS_W1V] = "asus-w1v",
  949. [ALC880_ASUS_DIG] = "asus-dig",
  950. [ALC880_ASUS_DIG2] = "asus-dig2",
  951. [ALC880_UNIWILL_DIG] = "uniwill",
  952. [ALC880_UNIWILL_P53] = "uniwill-p53",
  953. [ALC880_F1734] = "F1734",
  954. #ifdef CONFIG_SND_DEBUG
  955. [ALC880_TEST] = "test",
  956. #endif
  957. [ALC880_AUTO] = "auto",
  958. };
  959. static const struct snd_pci_quirk alc880_cfg_tbl[] = {
  960. SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
  961. SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
  962. SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
  963. SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
  964. SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
  965. SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
  966. SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
  967. SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
  968. SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
  969. SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
  970. SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
  971. SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
  972. SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
  973. SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
  974. SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
  975. SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
  976. /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
  977. SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
  978. SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
  979. SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
  980. SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
  981. SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
  982. SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
  983. SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
  984. SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
  985. SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
  986. SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
  987. SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
  988. SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
  989. SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
  990. SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
  991. SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
  992. SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
  993. SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
  994. SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
  995. SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
  996. SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
  997. SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
  998. SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
  999. SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
  1000. SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
  1001. SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
  1002. SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
  1003. SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
  1004. SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
  1005. SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
  1006. SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
  1007. SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
  1008. SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
  1009. SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
  1010. SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
  1011. SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
  1012. SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
  1013. SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
  1014. SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
  1015. /* default Intel */
  1016. SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
  1017. SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
  1018. SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
  1019. {}
  1020. };
  1021. /*
  1022. * ALC880 codec presets
  1023. */
  1024. static const struct alc_config_preset alc880_presets[] = {
  1025. [ALC880_3ST] = {
  1026. .mixers = { alc880_three_stack_mixer },
  1027. .init_verbs = { alc880_volume_init_verbs,
  1028. alc880_pin_3stack_init_verbs },
  1029. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1030. .dac_nids = alc880_dac_nids,
  1031. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1032. .channel_mode = alc880_threestack_modes,
  1033. .need_dac_fix = 1,
  1034. .input_mux = &alc880_capture_source,
  1035. },
  1036. [ALC880_3ST_DIG] = {
  1037. .mixers = { alc880_three_stack_mixer },
  1038. .init_verbs = { alc880_volume_init_verbs,
  1039. alc880_pin_3stack_init_verbs },
  1040. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1041. .dac_nids = alc880_dac_nids,
  1042. .dig_out_nid = ALC880_DIGOUT_NID,
  1043. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1044. .channel_mode = alc880_threestack_modes,
  1045. .need_dac_fix = 1,
  1046. .input_mux = &alc880_capture_source,
  1047. },
  1048. [ALC880_5ST] = {
  1049. .mixers = { alc880_three_stack_mixer,
  1050. alc880_five_stack_mixer},
  1051. .init_verbs = { alc880_volume_init_verbs,
  1052. alc880_pin_5stack_init_verbs },
  1053. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1054. .dac_nids = alc880_dac_nids,
  1055. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1056. .channel_mode = alc880_fivestack_modes,
  1057. .input_mux = &alc880_capture_source,
  1058. },
  1059. [ALC880_5ST_DIG] = {
  1060. .mixers = { alc880_three_stack_mixer,
  1061. alc880_five_stack_mixer },
  1062. .init_verbs = { alc880_volume_init_verbs,
  1063. alc880_pin_5stack_init_verbs },
  1064. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1065. .dac_nids = alc880_dac_nids,
  1066. .dig_out_nid = ALC880_DIGOUT_NID,
  1067. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1068. .channel_mode = alc880_fivestack_modes,
  1069. .input_mux = &alc880_capture_source,
  1070. },
  1071. [ALC880_6ST] = {
  1072. .mixers = { alc880_six_stack_mixer },
  1073. .init_verbs = { alc880_volume_init_verbs,
  1074. alc880_pin_6stack_init_verbs },
  1075. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1076. .dac_nids = alc880_6st_dac_nids,
  1077. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1078. .channel_mode = alc880_sixstack_modes,
  1079. .input_mux = &alc880_6stack_capture_source,
  1080. },
  1081. [ALC880_6ST_DIG] = {
  1082. .mixers = { alc880_six_stack_mixer },
  1083. .init_verbs = { alc880_volume_init_verbs,
  1084. alc880_pin_6stack_init_verbs },
  1085. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1086. .dac_nids = alc880_6st_dac_nids,
  1087. .dig_out_nid = ALC880_DIGOUT_NID,
  1088. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1089. .channel_mode = alc880_sixstack_modes,
  1090. .input_mux = &alc880_6stack_capture_source,
  1091. },
  1092. [ALC880_Z71V] = {
  1093. .mixers = { alc880_z71v_mixer },
  1094. .init_verbs = { alc880_volume_init_verbs,
  1095. alc880_pin_z71v_init_verbs },
  1096. .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
  1097. .dac_nids = alc880_z71v_dac_nids,
  1098. .dig_out_nid = ALC880_DIGOUT_NID,
  1099. .hp_nid = 0x03,
  1100. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1101. .channel_mode = alc880_2_jack_modes,
  1102. .input_mux = &alc880_capture_source,
  1103. },
  1104. [ALC880_F1734] = {
  1105. .mixers = { alc880_f1734_mixer },
  1106. .init_verbs = { alc880_volume_init_verbs,
  1107. alc880_pin_f1734_init_verbs },
  1108. .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
  1109. .dac_nids = alc880_f1734_dac_nids,
  1110. .hp_nid = 0x02,
  1111. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1112. .channel_mode = alc880_2_jack_modes,
  1113. .input_mux = &alc880_f1734_capture_source,
  1114. .unsol_event = alc880_uniwill_p53_unsol_event,
  1115. .setup = alc880_uniwill_p53_setup,
  1116. .init_hook = alc_hp_automute,
  1117. },
  1118. [ALC880_ASUS] = {
  1119. .mixers = { alc880_asus_mixer },
  1120. .init_verbs = { alc880_volume_init_verbs,
  1121. alc880_pin_asus_init_verbs,
  1122. alc880_gpio1_init_verbs },
  1123. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1124. .dac_nids = alc880_asus_dac_nids,
  1125. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1126. .channel_mode = alc880_asus_modes,
  1127. .need_dac_fix = 1,
  1128. .input_mux = &alc880_capture_source,
  1129. },
  1130. [ALC880_ASUS_DIG] = {
  1131. .mixers = { alc880_asus_mixer },
  1132. .init_verbs = { alc880_volume_init_verbs,
  1133. alc880_pin_asus_init_verbs,
  1134. alc880_gpio1_init_verbs },
  1135. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1136. .dac_nids = alc880_asus_dac_nids,
  1137. .dig_out_nid = ALC880_DIGOUT_NID,
  1138. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1139. .channel_mode = alc880_asus_modes,
  1140. .need_dac_fix = 1,
  1141. .input_mux = &alc880_capture_source,
  1142. },
  1143. [ALC880_ASUS_DIG2] = {
  1144. .mixers = { alc880_asus_mixer },
  1145. .init_verbs = { alc880_volume_init_verbs,
  1146. alc880_pin_asus_init_verbs,
  1147. alc880_gpio2_init_verbs }, /* use GPIO2 */
  1148. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1149. .dac_nids = alc880_asus_dac_nids,
  1150. .dig_out_nid = ALC880_DIGOUT_NID,
  1151. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1152. .channel_mode = alc880_asus_modes,
  1153. .need_dac_fix = 1,
  1154. .input_mux = &alc880_capture_source,
  1155. },
  1156. [ALC880_ASUS_W1V] = {
  1157. .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
  1158. .init_verbs = { alc880_volume_init_verbs,
  1159. alc880_pin_asus_init_verbs,
  1160. alc880_gpio1_init_verbs },
  1161. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1162. .dac_nids = alc880_asus_dac_nids,
  1163. .dig_out_nid = ALC880_DIGOUT_NID,
  1164. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1165. .channel_mode = alc880_asus_modes,
  1166. .need_dac_fix = 1,
  1167. .input_mux = &alc880_capture_source,
  1168. },
  1169. [ALC880_UNIWILL_DIG] = {
  1170. .mixers = { alc880_asus_mixer },
  1171. .init_verbs = { alc880_volume_init_verbs,
  1172. alc880_pin_asus_init_verbs },
  1173. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1174. .dac_nids = alc880_asus_dac_nids,
  1175. .dig_out_nid = ALC880_DIGOUT_NID,
  1176. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1177. .channel_mode = alc880_asus_modes,
  1178. .need_dac_fix = 1,
  1179. .input_mux = &alc880_capture_source,
  1180. },
  1181. [ALC880_UNIWILL] = {
  1182. .mixers = { alc880_uniwill_mixer },
  1183. .init_verbs = { alc880_volume_init_verbs,
  1184. alc880_uniwill_init_verbs },
  1185. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1186. .dac_nids = alc880_asus_dac_nids,
  1187. .dig_out_nid = ALC880_DIGOUT_NID,
  1188. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1189. .channel_mode = alc880_threestack_modes,
  1190. .need_dac_fix = 1,
  1191. .input_mux = &alc880_capture_source,
  1192. .unsol_event = alc880_uniwill_unsol_event,
  1193. .setup = alc880_uniwill_setup,
  1194. .init_hook = alc880_uniwill_init_hook,
  1195. },
  1196. [ALC880_UNIWILL_P53] = {
  1197. .mixers = { alc880_uniwill_p53_mixer },
  1198. .init_verbs = { alc880_volume_init_verbs,
  1199. alc880_uniwill_p53_init_verbs },
  1200. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1201. .dac_nids = alc880_asus_dac_nids,
  1202. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1203. .channel_mode = alc880_threestack_modes,
  1204. .input_mux = &alc880_capture_source,
  1205. .unsol_event = alc880_uniwill_p53_unsol_event,
  1206. .setup = alc880_uniwill_p53_setup,
  1207. .init_hook = alc_hp_automute,
  1208. },
  1209. #ifdef CONFIG_SND_DEBUG
  1210. [ALC880_TEST] = {
  1211. .mixers = { alc880_test_mixer },
  1212. .init_verbs = { alc880_test_init_verbs },
  1213. .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
  1214. .dac_nids = alc880_test_dac_nids,
  1215. .dig_out_nid = ALC880_DIGOUT_NID,
  1216. .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
  1217. .channel_mode = alc880_test_modes,
  1218. .input_mux = &alc880_test_capture_source,
  1219. },
  1220. #endif
  1221. };