alc880_quirks.c 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893
  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_W810,
  13. ALC880_Z71V,
  14. ALC880_6ST,
  15. ALC880_6ST_DIG,
  16. ALC880_F1734,
  17. ALC880_ASUS,
  18. ALC880_ASUS_DIG,
  19. ALC880_ASUS_W1V,
  20. ALC880_ASUS_DIG2,
  21. ALC880_FUJITSU,
  22. ALC880_UNIWILL_DIG,
  23. ALC880_UNIWILL,
  24. ALC880_UNIWILL_P53,
  25. ALC880_CLEVO,
  26. ALC880_TCL_S700,
  27. ALC880_LG,
  28. ALC880_LG_LW,
  29. ALC880_MEDION_RIM,
  30. #ifdef CONFIG_SND_DEBUG
  31. ALC880_TEST,
  32. #endif
  33. ALC880_MODEL_LAST /* last tag */
  34. };
  35. /*
  36. * ALC880 3-stack model
  37. *
  38. * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
  39. * Pin assignment: Front = 0x14, Line-In/Surr = 0x1a, Mic/CLFE = 0x18,
  40. * F-Mic = 0x1b, HP = 0x19
  41. */
  42. static const hda_nid_t alc880_dac_nids[4] = {
  43. /* front, rear, clfe, rear_surr */
  44. 0x02, 0x05, 0x04, 0x03
  45. };
  46. static const hda_nid_t alc880_adc_nids[3] = {
  47. /* ADC0-2 */
  48. 0x07, 0x08, 0x09,
  49. };
  50. /* The datasheet says the node 0x07 is connected from inputs,
  51. * but it shows zero connection in the real implementation on some devices.
  52. * Note: this is a 915GAV bug, fixed on 915GLV
  53. */
  54. static const hda_nid_t alc880_adc_nids_alt[2] = {
  55. /* ADC1-2 */
  56. 0x08, 0x09,
  57. };
  58. #define ALC880_DIGOUT_NID 0x06
  59. #define ALC880_DIGIN_NID 0x0a
  60. #define ALC880_PIN_CD_NID 0x1c
  61. static const struct hda_input_mux alc880_capture_source = {
  62. .num_items = 4,
  63. .items = {
  64. { "Mic", 0x0 },
  65. { "Front Mic", 0x3 },
  66. { "Line", 0x2 },
  67. { "CD", 0x4 },
  68. },
  69. };
  70. /* channel source setting (2/6 channel selection for 3-stack) */
  71. /* 2ch mode */
  72. static const struct hda_verb alc880_threestack_ch2_init[] = {
  73. /* set line-in to input, mute it */
  74. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  75. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  76. /* set mic-in to input vref 80%, mute it */
  77. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  78. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  79. { } /* end */
  80. };
  81. /* 6ch mode */
  82. static const struct hda_verb alc880_threestack_ch6_init[] = {
  83. /* set line-in to output, unmute it */
  84. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  85. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  86. /* set mic-in to output, unmute it */
  87. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  88. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  89. { } /* end */
  90. };
  91. static const struct hda_channel_mode alc880_threestack_modes[2] = {
  92. { 2, alc880_threestack_ch2_init },
  93. { 6, alc880_threestack_ch6_init },
  94. };
  95. static const struct snd_kcontrol_new alc880_three_stack_mixer[] = {
  96. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  97. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  98. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  99. HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
  100. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  101. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  102. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  103. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  104. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  105. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  106. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  107. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  108. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  109. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  110. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
  111. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
  112. HDA_CODEC_MUTE("Headphone Playback Switch", 0x19, 0x0, HDA_OUTPUT),
  113. {
  114. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  115. .name = "Channel Mode",
  116. .info = alc_ch_mode_info,
  117. .get = alc_ch_mode_get,
  118. .put = alc_ch_mode_put,
  119. },
  120. { } /* end */
  121. };
  122. /*
  123. * ALC880 5-stack model
  124. *
  125. * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0d),
  126. * Side = 0x02 (0xd)
  127. * Pin assignment: Front = 0x14, Surr = 0x17, CLFE = 0x16
  128. * Line-In/Side = 0x1a, Mic = 0x18, F-Mic = 0x1b, HP = 0x19
  129. */
  130. /* additional mixers to alc880_three_stack_mixer */
  131. static const struct snd_kcontrol_new alc880_five_stack_mixer[] = {
  132. HDA_CODEC_VOLUME("Side Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  133. HDA_BIND_MUTE("Side Playback Switch", 0x0d, 2, HDA_INPUT),
  134. { } /* end */
  135. };
  136. /* channel source setting (6/8 channel selection for 5-stack) */
  137. /* 6ch mode */
  138. static const struct hda_verb alc880_fivestack_ch6_init[] = {
  139. /* set line-in to input, mute it */
  140. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  141. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  142. { } /* end */
  143. };
  144. /* 8ch mode */
  145. static const struct hda_verb alc880_fivestack_ch8_init[] = {
  146. /* set line-in to output, unmute it */
  147. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  148. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  149. { } /* end */
  150. };
  151. static const struct hda_channel_mode alc880_fivestack_modes[2] = {
  152. { 6, alc880_fivestack_ch6_init },
  153. { 8, alc880_fivestack_ch8_init },
  154. };
  155. /*
  156. * ALC880 6-stack model
  157. *
  158. * DAC: Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e),
  159. * Side = 0x05 (0x0f)
  160. * Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, Side = 0x17,
  161. * Mic = 0x18, F-Mic = 0x19, Line = 0x1a, HP = 0x1b
  162. */
  163. static const hda_nid_t alc880_6st_dac_nids[4] = {
  164. /* front, rear, clfe, rear_surr */
  165. 0x02, 0x03, 0x04, 0x05
  166. };
  167. static const struct hda_input_mux alc880_6stack_capture_source = {
  168. .num_items = 4,
  169. .items = {
  170. { "Mic", 0x0 },
  171. { "Front Mic", 0x1 },
  172. { "Line", 0x2 },
  173. { "CD", 0x4 },
  174. },
  175. };
  176. /* fixed 8-channels */
  177. static const struct hda_channel_mode alc880_sixstack_modes[1] = {
  178. { 8, NULL },
  179. };
  180. static const struct snd_kcontrol_new alc880_six_stack_mixer[] = {
  181. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  182. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  183. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  184. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  185. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  186. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  187. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  188. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  189. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  190. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  191. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  192. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  193. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  194. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  195. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  196. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  197. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  198. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  199. {
  200. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  201. .name = "Channel Mode",
  202. .info = alc_ch_mode_info,
  203. .get = alc_ch_mode_get,
  204. .put = alc_ch_mode_put,
  205. },
  206. { } /* end */
  207. };
  208. /*
  209. * ALC880 W810 model
  210. *
  211. * W810 has rear IO for:
  212. * Front (DAC 02)
  213. * Surround (DAC 03)
  214. * Center/LFE (DAC 04)
  215. * Digital out (06)
  216. *
  217. * The system also has a pair of internal speakers, and a headphone jack.
  218. * These are both connected to Line2 on the codec, hence to DAC 02.
  219. *
  220. * There is a variable resistor to control the speaker or headphone
  221. * volume. This is a hardware-only device without a software API.
  222. *
  223. * Plugging headphones in will disable the internal speakers. This is
  224. * implemented in hardware, not via the driver using jack sense. In
  225. * a similar fashion, plugging into the rear socket marked "front" will
  226. * disable both the speakers and headphones.
  227. *
  228. * For input, there's a microphone jack, and an "audio in" jack.
  229. * These may not do anything useful with this driver yet, because I
  230. * haven't setup any initialization verbs for these yet...
  231. */
  232. static const hda_nid_t alc880_w810_dac_nids[3] = {
  233. /* front, rear/surround, clfe */
  234. 0x02, 0x03, 0x04
  235. };
  236. /* fixed 6 channels */
  237. static const struct hda_channel_mode alc880_w810_modes[1] = {
  238. { 6, NULL }
  239. };
  240. /* Pin assignment: Front = 0x14, Surr = 0x15, CLFE = 0x16, HP = 0x1b */
  241. static const struct snd_kcontrol_new alc880_w810_base_mixer[] = {
  242. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  243. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  244. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  245. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  246. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  247. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  248. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  249. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  250. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  251. { } /* end */
  252. };
  253. /*
  254. * Z710V model
  255. *
  256. * DAC: Front = 0x02 (0x0c), HP = 0x03 (0x0d)
  257. * Pin assignment: Front = 0x14, HP = 0x15, Mic = 0x18, Mic2 = 0x19(?),
  258. * Line = 0x1a
  259. */
  260. static const hda_nid_t alc880_z71v_dac_nids[1] = {
  261. 0x02
  262. };
  263. #define ALC880_Z71V_HP_DAC 0x03
  264. /* fixed 2 channels */
  265. static const struct hda_channel_mode alc880_2_jack_modes[1] = {
  266. { 2, NULL }
  267. };
  268. static const struct snd_kcontrol_new alc880_z71v_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("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  272. HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
  273. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  274. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  275. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  276. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  277. { } /* end */
  278. };
  279. /*
  280. * ALC880 F1734 model
  281. *
  282. * DAC: HP = 0x02 (0x0c), Front = 0x03 (0x0d)
  283. * Pin assignment: HP = 0x14, Front = 0x15, Mic = 0x18
  284. */
  285. static const hda_nid_t alc880_f1734_dac_nids[1] = {
  286. 0x03
  287. };
  288. #define ALC880_F1734_HP_DAC 0x02
  289. static const struct snd_kcontrol_new alc880_f1734_mixer[] = {
  290. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  291. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  292. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  293. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  294. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  295. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  296. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  297. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  298. { } /* end */
  299. };
  300. static const struct hda_input_mux alc880_f1734_capture_source = {
  301. .num_items = 2,
  302. .items = {
  303. { "Mic", 0x1 },
  304. { "CD", 0x4 },
  305. },
  306. };
  307. /*
  308. * ALC880 ASUS model
  309. *
  310. * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
  311. * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
  312. * Mic = 0x18, Line = 0x1a
  313. */
  314. #define alc880_asus_dac_nids alc880_w810_dac_nids /* identical with w810 */
  315. #define alc880_asus_modes alc880_threestack_modes /* 2/6 channel mode */
  316. static const struct snd_kcontrol_new alc880_asus_mixer[] = {
  317. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  318. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  319. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  320. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  321. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  322. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  323. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  324. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  325. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  326. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  327. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  328. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  329. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  330. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  331. {
  332. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  333. .name = "Channel Mode",
  334. .info = alc_ch_mode_info,
  335. .get = alc_ch_mode_get,
  336. .put = alc_ch_mode_put,
  337. },
  338. { } /* end */
  339. };
  340. /*
  341. * ALC880 ASUS W1V model
  342. *
  343. * DAC: HP/Front = 0x02 (0x0c), Surr = 0x03 (0x0d), CLFE = 0x04 (0x0e)
  344. * Pin assignment: HP/Front = 0x14, Surr = 0x15, CLFE = 0x16,
  345. * Mic = 0x18, Line = 0x1a, Line2 = 0x1b
  346. */
  347. /* additional mixers to alc880_asus_mixer */
  348. static const struct snd_kcontrol_new alc880_asus_w1v_mixer[] = {
  349. HDA_CODEC_VOLUME("Line2 Playback Volume", 0x0b, 0x03, HDA_INPUT),
  350. HDA_CODEC_MUTE("Line2 Playback Switch", 0x0b, 0x03, HDA_INPUT),
  351. { } /* end */
  352. };
  353. /* TCL S700 */
  354. static const struct snd_kcontrol_new alc880_tcl_s700_mixer[] = {
  355. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  356. HDA_CODEC_MUTE("Front Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  357. HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  358. HDA_CODEC_VOLUME("CD Playback Volume", 0x0B, 0x04, HDA_INPUT),
  359. HDA_CODEC_MUTE("CD Playback Switch", 0x0B, 0x04, HDA_INPUT),
  360. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0B, 0x0, HDA_INPUT),
  361. HDA_CODEC_MUTE("Mic Playback Switch", 0x0B, 0x0, HDA_INPUT),
  362. HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
  363. HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
  364. { } /* end */
  365. };
  366. /* Uniwill */
  367. static const struct snd_kcontrol_new alc880_uniwill_mixer[] = {
  368. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  369. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  370. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  371. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  372. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  373. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  374. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  375. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  376. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  377. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  378. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  379. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  380. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  381. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  382. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  383. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  384. {
  385. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  386. .name = "Channel Mode",
  387. .info = alc_ch_mode_info,
  388. .get = alc_ch_mode_get,
  389. .put = alc_ch_mode_put,
  390. },
  391. { } /* end */
  392. };
  393. static const struct snd_kcontrol_new alc880_fujitsu_mixer[] = {
  394. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  395. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  396. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  397. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  398. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  399. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  400. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  401. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  402. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  403. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  404. { } /* end */
  405. };
  406. static const struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
  407. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  408. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  409. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  410. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  411. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  412. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  413. { } /* end */
  414. };
  415. /*
  416. * initialize the codec volumes, etc
  417. */
  418. /*
  419. * generic initialization of ADC, input mixers and output mixers
  420. */
  421. static const struct hda_verb alc880_volume_init_verbs[] = {
  422. /*
  423. * Unmute ADC0-2 and set the default input to mic-in
  424. */
  425. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  426. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  427. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  428. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  429. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  430. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  431. /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback
  432. * mixer widget
  433. * Note: PASD motherboards uses the Line In 2 as the input for front
  434. * panel mic (mic 2)
  435. */
  436. /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */
  437. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  438. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  439. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  440. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  441. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  442. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
  443. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
  444. /*
  445. * Set up output mixers (0x0c - 0x0f)
  446. */
  447. /* set vol=0 to output mixers */
  448. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  449. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  450. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  451. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  452. /* set up input amps for analog loopback */
  453. /* Amp Indices: DAC = 0, mixer = 1 */
  454. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  455. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  456. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  457. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  458. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  459. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  460. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  461. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  462. { }
  463. };
  464. /*
  465. * 3-stack pin configuration:
  466. * front = 0x14, mic/clfe = 0x18, HP = 0x19, line/surr = 0x1a, f-mic = 0x1b
  467. */
  468. static const struct hda_verb alc880_pin_3stack_init_verbs[] = {
  469. /*
  470. * preset connection lists of input pins
  471. * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
  472. */
  473. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
  474. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  475. {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
  476. /*
  477. * Set pin mode and muting
  478. */
  479. /* set front pin widgets 0x14 for output */
  480. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  481. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  482. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  483. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  484. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  485. /* Mic2 (as headphone out) for HP output */
  486. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  487. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  488. /* Line In pin widget for input */
  489. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  490. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  491. /* Line2 (as front mic) pin widget for input and vref at 80% */
  492. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  493. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  494. /* CD pin widget for input */
  495. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  496. { }
  497. };
  498. /*
  499. * 5-stack pin configuration:
  500. * front = 0x14, surround = 0x17, clfe = 0x16, mic = 0x18, HP = 0x19,
  501. * line-in/side = 0x1a, f-mic = 0x1b
  502. */
  503. static const struct hda_verb alc880_pin_5stack_init_verbs[] = {
  504. /*
  505. * preset connection lists of input pins
  506. * 0 = front, 1 = rear_surr, 2 = CLFE, 3 = surround
  507. */
  508. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  509. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/side */
  510. /*
  511. * Set pin mode and muting
  512. */
  513. /* set pin widgets 0x14-0x17 for output */
  514. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  515. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  516. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  517. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  518. /* unmute pins for output (no gain on this amp) */
  519. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  520. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  521. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  522. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  523. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  524. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  525. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  526. /* Mic2 (as headphone out) for HP output */
  527. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  528. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  529. /* Line In pin widget for input */
  530. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  531. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  532. /* Line2 (as front mic) pin widget for input and vref at 80% */
  533. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  534. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  535. /* CD pin widget for input */
  536. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  537. { }
  538. };
  539. /*
  540. * W810 pin configuration:
  541. * front = 0x14, surround = 0x15, clfe = 0x16, HP = 0x1b
  542. */
  543. static const struct hda_verb alc880_pin_w810_init_verbs[] = {
  544. /* hphone/speaker input selector: front DAC */
  545. {0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
  546. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  547. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  548. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  549. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  550. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  551. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  552. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  553. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  554. { }
  555. };
  556. /*
  557. * Z71V pin configuration:
  558. * Speaker-out = 0x14, HP = 0x15, Mic = 0x18, Line-in = 0x1a, Mic2 = 0x1b (?)
  559. */
  560. static const struct hda_verb alc880_pin_z71v_init_verbs[] = {
  561. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  562. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  563. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  564. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  565. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  566. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  567. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  568. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  569. { }
  570. };
  571. /*
  572. * 6-stack pin configuration:
  573. * front = 0x14, surr = 0x15, clfe = 0x16, side = 0x17, mic = 0x18,
  574. * f-mic = 0x19, line = 0x1a, HP = 0x1b
  575. */
  576. static const struct hda_verb alc880_pin_6stack_init_verbs[] = {
  577. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  578. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  579. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  580. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  581. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  582. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  583. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  584. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  585. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  586. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  587. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  588. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  589. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  590. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  591. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  592. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  593. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  594. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  595. { }
  596. };
  597. /*
  598. * Uniwill pin configuration:
  599. * HP = 0x14, InternalSpeaker = 0x15, mic = 0x18, internal mic = 0x19,
  600. * line = 0x1a
  601. */
  602. static const struct hda_verb alc880_uniwill_init_verbs[] = {
  603. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  604. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  605. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  606. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  607. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  608. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  609. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  610. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  611. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  612. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  613. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  614. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  615. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  616. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  617. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  618. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  619. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  620. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  621. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  622. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  623. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  624. /* {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, */
  625. /* {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, */
  626. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  627. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  628. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
  629. { }
  630. };
  631. /*
  632. * Uniwill P53
  633. * HP = 0x14, InternalSpeaker = 0x15, mic = 0x19,
  634. */
  635. static const struct hda_verb alc880_uniwill_p53_init_verbs[] = {
  636. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  637. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  638. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  639. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  640. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  641. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  642. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  643. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  644. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  645. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  646. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  647. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
  648. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
  649. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  650. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  651. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  652. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  653. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  654. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  655. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  656. {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_DCVOL_EVENT},
  657. { }
  658. };
  659. static const struct hda_verb alc880_beep_init_verbs[] = {
  660. { 0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) },
  661. { }
  662. };
  663. static void alc880_uniwill_setup(struct hda_codec *codec)
  664. {
  665. struct alc_spec *spec = codec->spec;
  666. spec->autocfg.hp_pins[0] = 0x14;
  667. spec->autocfg.speaker_pins[0] = 0x15;
  668. spec->autocfg.speaker_pins[0] = 0x16;
  669. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  670. }
  671. static void alc880_uniwill_init_hook(struct hda_codec *codec)
  672. {
  673. alc_hp_automute(codec);
  674. alc88x_simple_mic_automute(codec);
  675. }
  676. static void alc880_uniwill_unsol_event(struct hda_codec *codec,
  677. unsigned int res)
  678. {
  679. /* Looks like the unsol event is incompatible with the standard
  680. * definition. 4bit tag is placed at 28 bit!
  681. */
  682. switch (res >> 28) {
  683. case ALC_MIC_EVENT:
  684. alc88x_simple_mic_automute(codec);
  685. break;
  686. default:
  687. alc_sku_unsol_event(codec, res);
  688. break;
  689. }
  690. }
  691. static void alc880_uniwill_p53_setup(struct hda_codec *codec)
  692. {
  693. struct alc_spec *spec = codec->spec;
  694. spec->autocfg.hp_pins[0] = 0x14;
  695. spec->autocfg.speaker_pins[0] = 0x15;
  696. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  697. }
  698. static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
  699. {
  700. unsigned int present;
  701. present = snd_hda_codec_read(codec, 0x21, 0,
  702. AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
  703. present &= HDA_AMP_VOLMASK;
  704. snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
  705. HDA_AMP_VOLMASK, present);
  706. snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
  707. HDA_AMP_VOLMASK, present);
  708. }
  709. static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
  710. unsigned int res)
  711. {
  712. /* Looks like the unsol event is incompatible with the standard
  713. * definition. 4bit tag is placed at 28 bit!
  714. */
  715. if ((res >> 28) == ALC_DCVOL_EVENT)
  716. alc880_uniwill_p53_dcvol_automute(codec);
  717. else
  718. alc_sku_unsol_event(codec, res);
  719. }
  720. /*
  721. * F1734 pin configuration:
  722. * HP = 0x14, speaker-out = 0x15, mic = 0x18
  723. */
  724. static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
  725. {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
  726. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  727. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  728. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  729. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  730. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  731. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  732. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  733. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  734. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  735. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  736. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
  737. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  738. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  739. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  740. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  741. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  742. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  743. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
  744. {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
  745. { }
  746. };
  747. /*
  748. * ASUS pin configuration:
  749. * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
  750. */
  751. static const struct hda_verb alc880_pin_asus_init_verbs[] = {
  752. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  753. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  754. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  755. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  756. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  757. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  758. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  759. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  760. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  761. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  762. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  763. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  764. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  765. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  766. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  767. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  768. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  769. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  770. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  771. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  772. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  773. { }
  774. };
  775. /* Enable GPIO mask and set output */
  776. #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
  777. #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
  778. #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
  779. /* Clevo m520g init */
  780. static const struct hda_verb alc880_pin_clevo_init_verbs[] = {
  781. /* headphone output */
  782. {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
  783. /* line-out */
  784. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  785. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  786. /* Line-in */
  787. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  788. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  789. /* CD */
  790. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  791. {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  792. /* Mic1 (rear panel) */
  793. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  794. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  795. /* Mic2 (front panel) */
  796. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  797. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  798. /* headphone */
  799. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  800. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  801. /* change to EAPD mode */
  802. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  803. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  804. { }
  805. };
  806. static const struct hda_verb alc880_pin_tcl_S700_init_verbs[] = {
  807. /* change to EAPD mode */
  808. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  809. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  810. /* Headphone output */
  811. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  812. /* Front output*/
  813. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  814. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
  815. /* Line In pin widget for input */
  816. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  817. /* CD pin widget for input */
  818. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  819. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  820. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  821. /* change to EAPD mode */
  822. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  823. {0x20, AC_VERB_SET_PROC_COEF, 0x3070},
  824. { }
  825. };
  826. /*
  827. * LG m1 express dual
  828. *
  829. * Pin assignment:
  830. * Rear Line-In/Out (blue): 0x14
  831. * Build-in Mic-In: 0x15
  832. * Speaker-out: 0x17
  833. * HP-Out (green): 0x1b
  834. * Mic-In/Out (red): 0x19
  835. * SPDIF-Out: 0x1e
  836. */
  837. /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
  838. static const hda_nid_t alc880_lg_dac_nids[3] = {
  839. 0x05, 0x02, 0x03
  840. };
  841. /* seems analog CD is not working */
  842. static const struct hda_input_mux alc880_lg_capture_source = {
  843. .num_items = 3,
  844. .items = {
  845. { "Mic", 0x1 },
  846. { "Line", 0x5 },
  847. { "Internal Mic", 0x6 },
  848. },
  849. };
  850. /* 2,4,6 channel modes */
  851. static const struct hda_verb alc880_lg_ch2_init[] = {
  852. /* set line-in and mic-in to input */
  853. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  854. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  855. { }
  856. };
  857. static const struct hda_verb alc880_lg_ch4_init[] = {
  858. /* set line-in to out and mic-in to input */
  859. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  860. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  861. { }
  862. };
  863. static const struct hda_verb alc880_lg_ch6_init[] = {
  864. /* set line-in and mic-in to output */
  865. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  866. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  867. { }
  868. };
  869. static const struct hda_channel_mode alc880_lg_ch_modes[3] = {
  870. { 2, alc880_lg_ch2_init },
  871. { 4, alc880_lg_ch4_init },
  872. { 6, alc880_lg_ch6_init },
  873. };
  874. static const struct snd_kcontrol_new alc880_lg_mixer[] = {
  875. HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  876. HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT),
  877. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  878. HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT),
  879. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
  880. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
  881. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
  882. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
  883. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  884. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  885. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT),
  886. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT),
  887. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT),
  888. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT),
  889. {
  890. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  891. .name = "Channel Mode",
  892. .info = alc_ch_mode_info,
  893. .get = alc_ch_mode_get,
  894. .put = alc_ch_mode_put,
  895. },
  896. { } /* end */
  897. };
  898. static const struct hda_verb alc880_lg_init_verbs[] = {
  899. /* set capture source to mic-in */
  900. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  901. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  902. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  903. /* mute all amp mixer inputs */
  904. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
  905. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
  906. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
  907. /* line-in to input */
  908. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  909. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  910. /* built-in mic */
  911. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  912. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  913. /* speaker-out */
  914. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  915. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  916. /* mic-in to input */
  917. {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
  918. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  919. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  920. /* HP-out */
  921. {0x13, AC_VERB_SET_CONNECT_SEL, 0x03},
  922. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  923. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  924. /* jack sense */
  925. {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  926. { }
  927. };
  928. /* toggle speaker-output according to the hp-jack state */
  929. static void alc880_lg_setup(struct hda_codec *codec)
  930. {
  931. struct alc_spec *spec = codec->spec;
  932. spec->autocfg.hp_pins[0] = 0x1b;
  933. spec->autocfg.speaker_pins[0] = 0x17;
  934. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  935. }
  936. /*
  937. * LG LW20
  938. *
  939. * Pin assignment:
  940. * Speaker-out: 0x14
  941. * Mic-In: 0x18
  942. * Built-in Mic-In: 0x19
  943. * Line-In: 0x1b
  944. * HP-Out: 0x1a
  945. * SPDIF-Out: 0x1e
  946. */
  947. static const struct hda_input_mux alc880_lg_lw_capture_source = {
  948. .num_items = 3,
  949. .items = {
  950. { "Mic", 0x0 },
  951. { "Internal Mic", 0x1 },
  952. { "Line In", 0x2 },
  953. },
  954. };
  955. #define alc880_lg_lw_modes alc880_threestack_modes
  956. static const struct snd_kcontrol_new alc880_lg_lw_mixer[] = {
  957. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  958. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  959. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  960. HDA_BIND_MUTE("Surround Playback Switch", 0x0f, 2, HDA_INPUT),
  961. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  962. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  963. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  964. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  965. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  966. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  967. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  968. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  969. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
  970. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
  971. {
  972. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  973. .name = "Channel Mode",
  974. .info = alc_ch_mode_info,
  975. .get = alc_ch_mode_get,
  976. .put = alc_ch_mode_put,
  977. },
  978. { } /* end */
  979. };
  980. static const struct hda_verb alc880_lg_lw_init_verbs[] = {
  981. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  982. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
  983. {0x12, AC_VERB_SET_CONNECT_SEL, 0x03}, /* line/surround */
  984. /* set capture source to mic-in */
  985. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  986. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  987. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  988. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
  989. /* speaker-out */
  990. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  991. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  992. /* HP-out */
  993. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  994. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  995. /* mic-in to input */
  996. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  997. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  998. /* built-in mic */
  999. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1000. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1001. /* jack sense */
  1002. {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  1003. { }
  1004. };
  1005. /* toggle speaker-output according to the hp-jack state */
  1006. static void alc880_lg_lw_setup(struct hda_codec *codec)
  1007. {
  1008. struct alc_spec *spec = codec->spec;
  1009. spec->autocfg.hp_pins[0] = 0x1b;
  1010. spec->autocfg.speaker_pins[0] = 0x14;
  1011. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1012. }
  1013. static const struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
  1014. HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1015. HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
  1016. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1017. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1018. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1019. HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1020. { } /* end */
  1021. };
  1022. static const struct hda_input_mux alc880_medion_rim_capture_source = {
  1023. .num_items = 2,
  1024. .items = {
  1025. { "Mic", 0x0 },
  1026. { "Internal Mic", 0x1 },
  1027. },
  1028. };
  1029. static const struct hda_verb alc880_medion_rim_init_verbs[] = {
  1030. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  1031. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1032. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1033. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  1034. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1035. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1036. /* Mic2 (as headphone out) for HP output */
  1037. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1038. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1039. /* Internal Speaker */
  1040. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1041. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1042. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  1043. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  1044. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  1045. { }
  1046. };
  1047. /* toggle speaker-output according to the hp-jack state */
  1048. static void alc880_medion_rim_automute(struct hda_codec *codec)
  1049. {
  1050. struct alc_spec *spec = codec->spec;
  1051. alc_hp_automute(codec);
  1052. /* toggle EAPD */
  1053. if (spec->hp_jack_present)
  1054. snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
  1055. else
  1056. snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
  1057. }
  1058. static void alc880_medion_rim_unsol_event(struct hda_codec *codec,
  1059. unsigned int res)
  1060. {
  1061. /* Looks like the unsol event is incompatible with the standard
  1062. * definition. 4bit tag is placed at 28 bit!
  1063. */
  1064. if ((res >> 28) == ALC_HP_EVENT)
  1065. alc880_medion_rim_automute(codec);
  1066. }
  1067. static void alc880_medion_rim_setup(struct hda_codec *codec)
  1068. {
  1069. struct alc_spec *spec = codec->spec;
  1070. spec->autocfg.hp_pins[0] = 0x14;
  1071. spec->autocfg.speaker_pins[0] = 0x1b;
  1072. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1073. }
  1074. #ifdef CONFIG_SND_HDA_POWER_SAVE
  1075. static const struct hda_amp_list alc880_lg_loopbacks[] = {
  1076. { 0x0b, HDA_INPUT, 1 },
  1077. { 0x0b, HDA_INPUT, 6 },
  1078. { 0x0b, HDA_INPUT, 7 },
  1079. { } /* end */
  1080. };
  1081. #endif
  1082. /*
  1083. * Test configuration for debugging
  1084. *
  1085. * Almost all inputs/outputs are enabled. I/O pins can be configured via
  1086. * enum controls.
  1087. */
  1088. #ifdef CONFIG_SND_DEBUG
  1089. static const hda_nid_t alc880_test_dac_nids[4] = {
  1090. 0x02, 0x03, 0x04, 0x05
  1091. };
  1092. static const struct hda_input_mux alc880_test_capture_source = {
  1093. .num_items = 7,
  1094. .items = {
  1095. { "In-1", 0x0 },
  1096. { "In-2", 0x1 },
  1097. { "In-3", 0x2 },
  1098. { "In-4", 0x3 },
  1099. { "CD", 0x4 },
  1100. { "Front", 0x5 },
  1101. { "Surround", 0x6 },
  1102. },
  1103. };
  1104. static const struct hda_channel_mode alc880_test_modes[4] = {
  1105. { 2, NULL },
  1106. { 4, NULL },
  1107. { 6, NULL },
  1108. { 8, NULL },
  1109. };
  1110. static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
  1111. struct snd_ctl_elem_info *uinfo)
  1112. {
  1113. static const char * const texts[] = {
  1114. "N/A", "Line Out", "HP Out",
  1115. "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
  1116. };
  1117. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  1118. uinfo->count = 1;
  1119. uinfo->value.enumerated.items = 8;
  1120. if (uinfo->value.enumerated.item >= 8)
  1121. uinfo->value.enumerated.item = 7;
  1122. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  1123. return 0;
  1124. }
  1125. static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
  1126. struct snd_ctl_elem_value *ucontrol)
  1127. {
  1128. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1129. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1130. unsigned int pin_ctl, item = 0;
  1131. pin_ctl = snd_hda_codec_read(codec, nid, 0,
  1132. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  1133. if (pin_ctl & AC_PINCTL_OUT_EN) {
  1134. if (pin_ctl & AC_PINCTL_HP_EN)
  1135. item = 2;
  1136. else
  1137. item = 1;
  1138. } else if (pin_ctl & AC_PINCTL_IN_EN) {
  1139. switch (pin_ctl & AC_PINCTL_VREFEN) {
  1140. case AC_PINCTL_VREF_HIZ: item = 3; break;
  1141. case AC_PINCTL_VREF_50: item = 4; break;
  1142. case AC_PINCTL_VREF_GRD: item = 5; break;
  1143. case AC_PINCTL_VREF_80: item = 6; break;
  1144. case AC_PINCTL_VREF_100: item = 7; break;
  1145. }
  1146. }
  1147. ucontrol->value.enumerated.item[0] = item;
  1148. return 0;
  1149. }
  1150. static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
  1151. struct snd_ctl_elem_value *ucontrol)
  1152. {
  1153. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1154. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1155. static const unsigned int ctls[] = {
  1156. 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
  1157. AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
  1158. AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
  1159. AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
  1160. AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
  1161. AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
  1162. };
  1163. unsigned int old_ctl, new_ctl;
  1164. old_ctl = snd_hda_codec_read(codec, nid, 0,
  1165. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  1166. new_ctl = ctls[ucontrol->value.enumerated.item[0]];
  1167. if (old_ctl != new_ctl) {
  1168. int val;
  1169. snd_hda_codec_write_cache(codec, nid, 0,
  1170. AC_VERB_SET_PIN_WIDGET_CONTROL,
  1171. new_ctl);
  1172. val = ucontrol->value.enumerated.item[0] >= 3 ?
  1173. HDA_AMP_MUTE : 0;
  1174. snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
  1175. HDA_AMP_MUTE, val);
  1176. return 1;
  1177. }
  1178. return 0;
  1179. }
  1180. static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
  1181. struct snd_ctl_elem_info *uinfo)
  1182. {
  1183. static const char * const texts[] = {
  1184. "Front", "Surround", "CLFE", "Side"
  1185. };
  1186. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  1187. uinfo->count = 1;
  1188. uinfo->value.enumerated.items = 4;
  1189. if (uinfo->value.enumerated.item >= 4)
  1190. uinfo->value.enumerated.item = 3;
  1191. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  1192. return 0;
  1193. }
  1194. static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
  1195. struct snd_ctl_elem_value *ucontrol)
  1196. {
  1197. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1198. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1199. unsigned int sel;
  1200. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
  1201. ucontrol->value.enumerated.item[0] = sel & 3;
  1202. return 0;
  1203. }
  1204. static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
  1205. struct snd_ctl_elem_value *ucontrol)
  1206. {
  1207. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1208. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1209. unsigned int sel;
  1210. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
  1211. if (ucontrol->value.enumerated.item[0] != sel) {
  1212. sel = ucontrol->value.enumerated.item[0] & 3;
  1213. snd_hda_codec_write_cache(codec, nid, 0,
  1214. AC_VERB_SET_CONNECT_SEL, sel);
  1215. return 1;
  1216. }
  1217. return 0;
  1218. }
  1219. #define PIN_CTL_TEST(xname,nid) { \
  1220. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  1221. .name = xname, \
  1222. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  1223. .info = alc_test_pin_ctl_info, \
  1224. .get = alc_test_pin_ctl_get, \
  1225. .put = alc_test_pin_ctl_put, \
  1226. .private_value = nid \
  1227. }
  1228. #define PIN_SRC_TEST(xname,nid) { \
  1229. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  1230. .name = xname, \
  1231. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  1232. .info = alc_test_pin_src_info, \
  1233. .get = alc_test_pin_src_get, \
  1234. .put = alc_test_pin_src_put, \
  1235. .private_value = nid \
  1236. }
  1237. static const struct snd_kcontrol_new alc880_test_mixer[] = {
  1238. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1239. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1240. HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
  1241. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  1242. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1243. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1244. HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
  1245. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  1246. PIN_CTL_TEST("Front Pin Mode", 0x14),
  1247. PIN_CTL_TEST("Surround Pin Mode", 0x15),
  1248. PIN_CTL_TEST("CLFE Pin Mode", 0x16),
  1249. PIN_CTL_TEST("Side Pin Mode", 0x17),
  1250. PIN_CTL_TEST("In-1 Pin Mode", 0x18),
  1251. PIN_CTL_TEST("In-2 Pin Mode", 0x19),
  1252. PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
  1253. PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
  1254. PIN_SRC_TEST("In-1 Pin Source", 0x18),
  1255. PIN_SRC_TEST("In-2 Pin Source", 0x19),
  1256. PIN_SRC_TEST("In-3 Pin Source", 0x1a),
  1257. PIN_SRC_TEST("In-4 Pin Source", 0x1b),
  1258. HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1259. HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1260. HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1261. HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1262. HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
  1263. HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
  1264. HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
  1265. HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
  1266. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
  1267. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
  1268. {
  1269. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  1270. .name = "Channel Mode",
  1271. .info = alc_ch_mode_info,
  1272. .get = alc_ch_mode_get,
  1273. .put = alc_ch_mode_put,
  1274. },
  1275. { } /* end */
  1276. };
  1277. static const struct hda_verb alc880_test_init_verbs[] = {
  1278. /* Unmute inputs of 0x0c - 0x0f */
  1279. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1280. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1281. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1282. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1283. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1284. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1285. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1286. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1287. /* Vol output for 0x0c-0x0f */
  1288. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1289. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1290. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1291. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1292. /* Set output pins 0x14-0x17 */
  1293. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1294. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1295. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1296. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1297. /* Unmute output pins 0x14-0x17 */
  1298. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1299. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1300. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1301. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1302. /* Set input pins 0x18-0x1c */
  1303. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1304. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1305. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1306. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1307. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1308. /* Mute input pins 0x18-0x1b */
  1309. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1310. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1311. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1312. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1313. /* ADC set up */
  1314. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1315. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1316. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1317. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1318. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1319. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1320. /* Analog input/passthru */
  1321. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1322. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1323. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1324. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1325. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1326. { }
  1327. };
  1328. #endif
  1329. /*
  1330. */
  1331. static const char * const alc880_models[ALC880_MODEL_LAST] = {
  1332. [ALC880_3ST] = "3stack",
  1333. [ALC880_TCL_S700] = "tcl",
  1334. [ALC880_3ST_DIG] = "3stack-digout",
  1335. [ALC880_CLEVO] = "clevo",
  1336. [ALC880_5ST] = "5stack",
  1337. [ALC880_5ST_DIG] = "5stack-digout",
  1338. [ALC880_W810] = "w810",
  1339. [ALC880_Z71V] = "z71v",
  1340. [ALC880_6ST] = "6stack",
  1341. [ALC880_6ST_DIG] = "6stack-digout",
  1342. [ALC880_ASUS] = "asus",
  1343. [ALC880_ASUS_W1V] = "asus-w1v",
  1344. [ALC880_ASUS_DIG] = "asus-dig",
  1345. [ALC880_ASUS_DIG2] = "asus-dig2",
  1346. [ALC880_UNIWILL_DIG] = "uniwill",
  1347. [ALC880_UNIWILL_P53] = "uniwill-p53",
  1348. [ALC880_FUJITSU] = "fujitsu",
  1349. [ALC880_F1734] = "F1734",
  1350. [ALC880_LG] = "lg",
  1351. [ALC880_LG_LW] = "lg-lw",
  1352. [ALC880_MEDION_RIM] = "medion",
  1353. #ifdef CONFIG_SND_DEBUG
  1354. [ALC880_TEST] = "test",
  1355. #endif
  1356. [ALC880_AUTO] = "auto",
  1357. };
  1358. static const struct snd_pci_quirk alc880_cfg_tbl[] = {
  1359. SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810),
  1360. SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
  1361. SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
  1362. SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
  1363. SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
  1364. SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
  1365. SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
  1366. SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
  1367. SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
  1368. SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
  1369. SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
  1370. SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
  1371. SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
  1372. SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
  1373. SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
  1374. SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
  1375. SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
  1376. /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
  1377. SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
  1378. SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
  1379. SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
  1380. SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
  1381. SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
  1382. SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
  1383. SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
  1384. SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
  1385. SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
  1386. SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
  1387. SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
  1388. SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
  1389. SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
  1390. SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
  1391. SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
  1392. SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
  1393. SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
  1394. SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
  1395. SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
  1396. SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
  1397. SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
  1398. SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
  1399. SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
  1400. SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
  1401. SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
  1402. SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM),
  1403. SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
  1404. SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
  1405. SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
  1406. SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
  1407. SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
  1408. SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
  1409. SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW),
  1410. SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
  1411. SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
  1412. SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
  1413. SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW),
  1414. SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
  1415. SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
  1416. SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
  1417. SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
  1418. SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
  1419. SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
  1420. SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
  1421. SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
  1422. SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
  1423. SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
  1424. SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
  1425. SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
  1426. SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
  1427. /* default Intel */
  1428. SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
  1429. SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
  1430. SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
  1431. {}
  1432. };
  1433. /*
  1434. * ALC880 codec presets
  1435. */
  1436. static const struct alc_config_preset alc880_presets[] = {
  1437. [ALC880_3ST] = {
  1438. .mixers = { alc880_three_stack_mixer },
  1439. .init_verbs = { alc880_volume_init_verbs,
  1440. alc880_pin_3stack_init_verbs },
  1441. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1442. .dac_nids = alc880_dac_nids,
  1443. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1444. .channel_mode = alc880_threestack_modes,
  1445. .need_dac_fix = 1,
  1446. .input_mux = &alc880_capture_source,
  1447. },
  1448. [ALC880_3ST_DIG] = {
  1449. .mixers = { alc880_three_stack_mixer },
  1450. .init_verbs = { alc880_volume_init_verbs,
  1451. alc880_pin_3stack_init_verbs },
  1452. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1453. .dac_nids = alc880_dac_nids,
  1454. .dig_out_nid = ALC880_DIGOUT_NID,
  1455. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1456. .channel_mode = alc880_threestack_modes,
  1457. .need_dac_fix = 1,
  1458. .input_mux = &alc880_capture_source,
  1459. },
  1460. [ALC880_TCL_S700] = {
  1461. .mixers = { alc880_tcl_s700_mixer },
  1462. .init_verbs = { alc880_volume_init_verbs,
  1463. alc880_pin_tcl_S700_init_verbs,
  1464. alc880_gpio2_init_verbs },
  1465. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1466. .dac_nids = alc880_dac_nids,
  1467. .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
  1468. .num_adc_nids = 1, /* single ADC */
  1469. .hp_nid = 0x03,
  1470. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1471. .channel_mode = alc880_2_jack_modes,
  1472. .input_mux = &alc880_capture_source,
  1473. },
  1474. [ALC880_5ST] = {
  1475. .mixers = { alc880_three_stack_mixer,
  1476. alc880_five_stack_mixer},
  1477. .init_verbs = { alc880_volume_init_verbs,
  1478. alc880_pin_5stack_init_verbs },
  1479. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1480. .dac_nids = alc880_dac_nids,
  1481. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1482. .channel_mode = alc880_fivestack_modes,
  1483. .input_mux = &alc880_capture_source,
  1484. },
  1485. [ALC880_5ST_DIG] = {
  1486. .mixers = { alc880_three_stack_mixer,
  1487. alc880_five_stack_mixer },
  1488. .init_verbs = { alc880_volume_init_verbs,
  1489. alc880_pin_5stack_init_verbs },
  1490. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1491. .dac_nids = alc880_dac_nids,
  1492. .dig_out_nid = ALC880_DIGOUT_NID,
  1493. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1494. .channel_mode = alc880_fivestack_modes,
  1495. .input_mux = &alc880_capture_source,
  1496. },
  1497. [ALC880_6ST] = {
  1498. .mixers = { alc880_six_stack_mixer },
  1499. .init_verbs = { alc880_volume_init_verbs,
  1500. alc880_pin_6stack_init_verbs },
  1501. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1502. .dac_nids = alc880_6st_dac_nids,
  1503. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1504. .channel_mode = alc880_sixstack_modes,
  1505. .input_mux = &alc880_6stack_capture_source,
  1506. },
  1507. [ALC880_6ST_DIG] = {
  1508. .mixers = { alc880_six_stack_mixer },
  1509. .init_verbs = { alc880_volume_init_verbs,
  1510. alc880_pin_6stack_init_verbs },
  1511. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1512. .dac_nids = alc880_6st_dac_nids,
  1513. .dig_out_nid = ALC880_DIGOUT_NID,
  1514. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1515. .channel_mode = alc880_sixstack_modes,
  1516. .input_mux = &alc880_6stack_capture_source,
  1517. },
  1518. [ALC880_W810] = {
  1519. .mixers = { alc880_w810_base_mixer },
  1520. .init_verbs = { alc880_volume_init_verbs,
  1521. alc880_pin_w810_init_verbs,
  1522. alc880_gpio2_init_verbs },
  1523. .num_dacs = ARRAY_SIZE(alc880_w810_dac_nids),
  1524. .dac_nids = alc880_w810_dac_nids,
  1525. .dig_out_nid = ALC880_DIGOUT_NID,
  1526. .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
  1527. .channel_mode = alc880_w810_modes,
  1528. .input_mux = &alc880_capture_source,
  1529. },
  1530. [ALC880_Z71V] = {
  1531. .mixers = { alc880_z71v_mixer },
  1532. .init_verbs = { alc880_volume_init_verbs,
  1533. alc880_pin_z71v_init_verbs },
  1534. .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
  1535. .dac_nids = alc880_z71v_dac_nids,
  1536. .dig_out_nid = ALC880_DIGOUT_NID,
  1537. .hp_nid = 0x03,
  1538. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1539. .channel_mode = alc880_2_jack_modes,
  1540. .input_mux = &alc880_capture_source,
  1541. },
  1542. [ALC880_F1734] = {
  1543. .mixers = { alc880_f1734_mixer },
  1544. .init_verbs = { alc880_volume_init_verbs,
  1545. alc880_pin_f1734_init_verbs },
  1546. .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
  1547. .dac_nids = alc880_f1734_dac_nids,
  1548. .hp_nid = 0x02,
  1549. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1550. .channel_mode = alc880_2_jack_modes,
  1551. .input_mux = &alc880_f1734_capture_source,
  1552. .unsol_event = alc880_uniwill_p53_unsol_event,
  1553. .setup = alc880_uniwill_p53_setup,
  1554. .init_hook = alc_hp_automute,
  1555. },
  1556. [ALC880_ASUS] = {
  1557. .mixers = { alc880_asus_mixer },
  1558. .init_verbs = { alc880_volume_init_verbs,
  1559. alc880_pin_asus_init_verbs,
  1560. alc880_gpio1_init_verbs },
  1561. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1562. .dac_nids = alc880_asus_dac_nids,
  1563. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1564. .channel_mode = alc880_asus_modes,
  1565. .need_dac_fix = 1,
  1566. .input_mux = &alc880_capture_source,
  1567. },
  1568. [ALC880_ASUS_DIG] = {
  1569. .mixers = { alc880_asus_mixer },
  1570. .init_verbs = { alc880_volume_init_verbs,
  1571. alc880_pin_asus_init_verbs,
  1572. alc880_gpio1_init_verbs },
  1573. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1574. .dac_nids = alc880_asus_dac_nids,
  1575. .dig_out_nid = ALC880_DIGOUT_NID,
  1576. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1577. .channel_mode = alc880_asus_modes,
  1578. .need_dac_fix = 1,
  1579. .input_mux = &alc880_capture_source,
  1580. },
  1581. [ALC880_ASUS_DIG2] = {
  1582. .mixers = { alc880_asus_mixer },
  1583. .init_verbs = { alc880_volume_init_verbs,
  1584. alc880_pin_asus_init_verbs,
  1585. alc880_gpio2_init_verbs }, /* use GPIO2 */
  1586. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1587. .dac_nids = alc880_asus_dac_nids,
  1588. .dig_out_nid = ALC880_DIGOUT_NID,
  1589. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1590. .channel_mode = alc880_asus_modes,
  1591. .need_dac_fix = 1,
  1592. .input_mux = &alc880_capture_source,
  1593. },
  1594. [ALC880_ASUS_W1V] = {
  1595. .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
  1596. .init_verbs = { alc880_volume_init_verbs,
  1597. alc880_pin_asus_init_verbs,
  1598. alc880_gpio1_init_verbs },
  1599. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1600. .dac_nids = alc880_asus_dac_nids,
  1601. .dig_out_nid = ALC880_DIGOUT_NID,
  1602. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1603. .channel_mode = alc880_asus_modes,
  1604. .need_dac_fix = 1,
  1605. .input_mux = &alc880_capture_source,
  1606. },
  1607. [ALC880_UNIWILL_DIG] = {
  1608. .mixers = { alc880_asus_mixer },
  1609. .init_verbs = { alc880_volume_init_verbs,
  1610. alc880_pin_asus_init_verbs },
  1611. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1612. .dac_nids = alc880_asus_dac_nids,
  1613. .dig_out_nid = ALC880_DIGOUT_NID,
  1614. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1615. .channel_mode = alc880_asus_modes,
  1616. .need_dac_fix = 1,
  1617. .input_mux = &alc880_capture_source,
  1618. },
  1619. [ALC880_UNIWILL] = {
  1620. .mixers = { alc880_uniwill_mixer },
  1621. .init_verbs = { alc880_volume_init_verbs,
  1622. alc880_uniwill_init_verbs },
  1623. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1624. .dac_nids = alc880_asus_dac_nids,
  1625. .dig_out_nid = ALC880_DIGOUT_NID,
  1626. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1627. .channel_mode = alc880_threestack_modes,
  1628. .need_dac_fix = 1,
  1629. .input_mux = &alc880_capture_source,
  1630. .unsol_event = alc880_uniwill_unsol_event,
  1631. .setup = alc880_uniwill_setup,
  1632. .init_hook = alc880_uniwill_init_hook,
  1633. },
  1634. [ALC880_UNIWILL_P53] = {
  1635. .mixers = { alc880_uniwill_p53_mixer },
  1636. .init_verbs = { alc880_volume_init_verbs,
  1637. alc880_uniwill_p53_init_verbs },
  1638. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1639. .dac_nids = alc880_asus_dac_nids,
  1640. .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
  1641. .channel_mode = alc880_threestack_modes,
  1642. .input_mux = &alc880_capture_source,
  1643. .unsol_event = alc880_uniwill_p53_unsol_event,
  1644. .setup = alc880_uniwill_p53_setup,
  1645. .init_hook = alc_hp_automute,
  1646. },
  1647. [ALC880_FUJITSU] = {
  1648. .mixers = { alc880_fujitsu_mixer },
  1649. .init_verbs = { alc880_volume_init_verbs,
  1650. alc880_uniwill_p53_init_verbs,
  1651. alc880_beep_init_verbs },
  1652. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1653. .dac_nids = alc880_dac_nids,
  1654. .dig_out_nid = ALC880_DIGOUT_NID,
  1655. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1656. .channel_mode = alc880_2_jack_modes,
  1657. .input_mux = &alc880_capture_source,
  1658. .unsol_event = alc880_uniwill_p53_unsol_event,
  1659. .setup = alc880_uniwill_p53_setup,
  1660. .init_hook = alc_hp_automute,
  1661. },
  1662. [ALC880_CLEVO] = {
  1663. .mixers = { alc880_three_stack_mixer },
  1664. .init_verbs = { alc880_volume_init_verbs,
  1665. alc880_pin_clevo_init_verbs },
  1666. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1667. .dac_nids = alc880_dac_nids,
  1668. .hp_nid = 0x03,
  1669. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1670. .channel_mode = alc880_threestack_modes,
  1671. .need_dac_fix = 1,
  1672. .input_mux = &alc880_capture_source,
  1673. },
  1674. [ALC880_LG] = {
  1675. .mixers = { alc880_lg_mixer },
  1676. .init_verbs = { alc880_volume_init_verbs,
  1677. alc880_lg_init_verbs },
  1678. .num_dacs = ARRAY_SIZE(alc880_lg_dac_nids),
  1679. .dac_nids = alc880_lg_dac_nids,
  1680. .dig_out_nid = ALC880_DIGOUT_NID,
  1681. .num_channel_mode = ARRAY_SIZE(alc880_lg_ch_modes),
  1682. .channel_mode = alc880_lg_ch_modes,
  1683. .need_dac_fix = 1,
  1684. .input_mux = &alc880_lg_capture_source,
  1685. .unsol_event = alc_sku_unsol_event,
  1686. .setup = alc880_lg_setup,
  1687. .init_hook = alc_hp_automute,
  1688. #ifdef CONFIG_SND_HDA_POWER_SAVE
  1689. .loopbacks = alc880_lg_loopbacks,
  1690. #endif
  1691. },
  1692. [ALC880_LG_LW] = {
  1693. .mixers = { alc880_lg_lw_mixer },
  1694. .init_verbs = { alc880_volume_init_verbs,
  1695. alc880_lg_lw_init_verbs },
  1696. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1697. .dac_nids = alc880_dac_nids,
  1698. .dig_out_nid = ALC880_DIGOUT_NID,
  1699. .num_channel_mode = ARRAY_SIZE(alc880_lg_lw_modes),
  1700. .channel_mode = alc880_lg_lw_modes,
  1701. .input_mux = &alc880_lg_lw_capture_source,
  1702. .unsol_event = alc_sku_unsol_event,
  1703. .setup = alc880_lg_lw_setup,
  1704. .init_hook = alc_hp_automute,
  1705. },
  1706. [ALC880_MEDION_RIM] = {
  1707. .mixers = { alc880_medion_rim_mixer },
  1708. .init_verbs = { alc880_volume_init_verbs,
  1709. alc880_medion_rim_init_verbs,
  1710. alc_gpio2_init_verbs },
  1711. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1712. .dac_nids = alc880_dac_nids,
  1713. .dig_out_nid = ALC880_DIGOUT_NID,
  1714. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1715. .channel_mode = alc880_2_jack_modes,
  1716. .input_mux = &alc880_medion_rim_capture_source,
  1717. .unsol_event = alc880_medion_rim_unsol_event,
  1718. .setup = alc880_medion_rim_setup,
  1719. .init_hook = alc880_medion_rim_automute,
  1720. },
  1721. #ifdef CONFIG_SND_DEBUG
  1722. [ALC880_TEST] = {
  1723. .mixers = { alc880_test_mixer },
  1724. .init_verbs = { alc880_test_init_verbs },
  1725. .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
  1726. .dac_nids = alc880_test_dac_nids,
  1727. .dig_out_nid = ALC880_DIGOUT_NID,
  1728. .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
  1729. .channel_mode = alc880_test_modes,
  1730. .input_mux = &alc880_test_capture_source,
  1731. },
  1732. #endif
  1733. };