alc880_quirks.c 43 KB

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