alc880_quirks.c 59 KB

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