alc880_quirks.c 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  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. switch (res >> 28) {
  681. case ALC_MIC_EVENT:
  682. alc88x_simple_mic_automute(codec);
  683. break;
  684. default:
  685. alc_sku_unsol_event(codec, res);
  686. break;
  687. }
  688. }
  689. static void alc880_uniwill_p53_setup(struct hda_codec *codec)
  690. {
  691. struct alc_spec *spec = codec->spec;
  692. spec->autocfg.hp_pins[0] = 0x14;
  693. spec->autocfg.speaker_pins[0] = 0x15;
  694. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  695. }
  696. static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
  697. {
  698. unsigned int present;
  699. present = snd_hda_codec_read(codec, 0x21, 0,
  700. AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
  701. present &= HDA_AMP_VOLMASK;
  702. snd_hda_codec_amp_stereo(codec, 0x0c, HDA_OUTPUT, 0,
  703. HDA_AMP_VOLMASK, present);
  704. snd_hda_codec_amp_stereo(codec, 0x0d, HDA_OUTPUT, 0,
  705. HDA_AMP_VOLMASK, present);
  706. }
  707. static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
  708. unsigned int res)
  709. {
  710. /* Looks like the unsol event is incompatible with the standard
  711. * definition. 4bit tag is placed at 28 bit!
  712. */
  713. if ((res >> 28) == ALC_DCVOL_EVENT)
  714. alc880_uniwill_p53_dcvol_automute(codec);
  715. else
  716. alc_sku_unsol_event(codec, res);
  717. }
  718. /*
  719. * F1734 pin configuration:
  720. * HP = 0x14, speaker-out = 0x15, mic = 0x18
  721. */
  722. static const struct hda_verb alc880_pin_f1734_init_verbs[] = {
  723. {0x07, AC_VERB_SET_CONNECT_SEL, 0x01},
  724. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  725. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  726. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  727. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  728. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  729. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  730. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  731. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  732. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  733. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  734. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50},
  735. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  736. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  737. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  738. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  739. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  740. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  741. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_HP_EVENT},
  742. {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC_DCVOL_EVENT},
  743. { }
  744. };
  745. /*
  746. * ASUS pin configuration:
  747. * HP/front = 0x14, surr = 0x15, clfe = 0x16, mic = 0x18, line = 0x1a
  748. */
  749. static const struct hda_verb alc880_pin_asus_init_verbs[] = {
  750. {0x10, AC_VERB_SET_CONNECT_SEL, 0x02},
  751. {0x11, AC_VERB_SET_CONNECT_SEL, 0x00},
  752. {0x12, AC_VERB_SET_CONNECT_SEL, 0x01},
  753. {0x13, AC_VERB_SET_CONNECT_SEL, 0x00},
  754. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  755. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  756. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  757. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  758. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  759. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  760. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  761. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  762. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  763. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  764. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  765. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  766. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  767. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  768. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  769. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  770. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  771. { }
  772. };
  773. /* Enable GPIO mask and set output */
  774. #define alc880_gpio1_init_verbs alc_gpio1_init_verbs
  775. #define alc880_gpio2_init_verbs alc_gpio2_init_verbs
  776. #define alc880_gpio3_init_verbs alc_gpio3_init_verbs
  777. /* Clevo m520g init */
  778. static const struct hda_verb alc880_pin_clevo_init_verbs[] = {
  779. /* headphone output */
  780. {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
  781. /* line-out */
  782. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  783. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  784. /* Line-in */
  785. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  786. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  787. /* CD */
  788. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  789. {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  790. /* Mic1 (rear panel) */
  791. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  792. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  793. /* Mic2 (front panel) */
  794. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  795. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  796. /* headphone */
  797. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  798. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  799. /* change to EAPD mode */
  800. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  801. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  802. { }
  803. };
  804. static const struct hda_verb alc880_pin_tcl_S700_init_verbs[] = {
  805. /* change to EAPD mode */
  806. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  807. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  808. /* Headphone output */
  809. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  810. /* Front output*/
  811. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  812. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
  813. /* Line In pin widget for input */
  814. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  815. /* CD pin widget for input */
  816. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  817. /* Mic1 (rear panel) pin widget for input and vref at 80% */
  818. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  819. /* change to EAPD mode */
  820. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  821. {0x20, AC_VERB_SET_PROC_COEF, 0x3070},
  822. { }
  823. };
  824. /*
  825. * LG m1 express dual
  826. *
  827. * Pin assignment:
  828. * Rear Line-In/Out (blue): 0x14
  829. * Build-in Mic-In: 0x15
  830. * Speaker-out: 0x17
  831. * HP-Out (green): 0x1b
  832. * Mic-In/Out (red): 0x19
  833. * SPDIF-Out: 0x1e
  834. */
  835. /* To make 5.1 output working (green=Front, blue=Surr, red=CLFE) */
  836. static const hda_nid_t alc880_lg_dac_nids[3] = {
  837. 0x05, 0x02, 0x03
  838. };
  839. /* seems analog CD is not working */
  840. static const struct hda_input_mux alc880_lg_capture_source = {
  841. .num_items = 3,
  842. .items = {
  843. { "Mic", 0x1 },
  844. { "Line", 0x5 },
  845. { "Internal Mic", 0x6 },
  846. },
  847. };
  848. /* 2,4,6 channel modes */
  849. static const struct hda_verb alc880_lg_ch2_init[] = {
  850. /* set line-in and mic-in to input */
  851. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  852. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  853. { }
  854. };
  855. static const struct hda_verb alc880_lg_ch4_init[] = {
  856. /* set line-in to out and mic-in to input */
  857. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  858. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  859. { }
  860. };
  861. static const struct hda_verb alc880_lg_ch6_init[] = {
  862. /* set line-in and mic-in to output */
  863. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  864. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  865. { }
  866. };
  867. static const struct hda_channel_mode alc880_lg_ch_modes[3] = {
  868. { 2, alc880_lg_ch2_init },
  869. { 4, alc880_lg_ch4_init },
  870. { 6, alc880_lg_ch6_init },
  871. };
  872. static const struct snd_kcontrol_new alc880_lg_mixer[] = {
  873. HDA_CODEC_VOLUME("Front Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  874. HDA_BIND_MUTE("Front Playback Switch", 0x0f, 2, HDA_INPUT),
  875. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  876. HDA_BIND_MUTE("Surround Playback Switch", 0x0c, 2, HDA_INPUT),
  877. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
  878. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
  879. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
  880. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
  881. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  882. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  883. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x06, HDA_INPUT),
  884. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x06, HDA_INPUT),
  885. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x07, HDA_INPUT),
  886. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x07, HDA_INPUT),
  887. {
  888. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  889. .name = "Channel Mode",
  890. .info = alc_ch_mode_info,
  891. .get = alc_ch_mode_get,
  892. .put = alc_ch_mode_put,
  893. },
  894. { } /* end */
  895. };
  896. static const struct hda_verb alc880_lg_init_verbs[] = {
  897. /* set capture source to mic-in */
  898. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  899. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  900. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  901. /* mute all amp mixer inputs */
  902. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
  903. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(6)},
  904. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(7)},
  905. /* line-in to input */
  906. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  907. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  908. /* built-in mic */
  909. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  910. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  911. /* speaker-out */
  912. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  913. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  914. /* mic-in to input */
  915. {0x11, AC_VERB_SET_CONNECT_SEL, 0x01},
  916. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  917. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  918. /* HP-out */
  919. {0x13, AC_VERB_SET_CONNECT_SEL, 0x03},
  920. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  921. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  922. /* jack sense */
  923. {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  924. { }
  925. };
  926. /* toggle speaker-output according to the hp-jack state */
  927. static void alc880_lg_setup(struct hda_codec *codec)
  928. {
  929. struct alc_spec *spec = codec->spec;
  930. spec->autocfg.hp_pins[0] = 0x1b;
  931. spec->autocfg.speaker_pins[0] = 0x17;
  932. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  933. }
  934. #ifdef CONFIG_SND_HDA_POWER_SAVE
  935. static const struct hda_amp_list alc880_lg_loopbacks[] = {
  936. { 0x0b, HDA_INPUT, 1 },
  937. { 0x0b, HDA_INPUT, 6 },
  938. { 0x0b, HDA_INPUT, 7 },
  939. { } /* end */
  940. };
  941. #endif
  942. /*
  943. * Test configuration for debugging
  944. *
  945. * Almost all inputs/outputs are enabled. I/O pins can be configured via
  946. * enum controls.
  947. */
  948. #ifdef CONFIG_SND_DEBUG
  949. static const hda_nid_t alc880_test_dac_nids[4] = {
  950. 0x02, 0x03, 0x04, 0x05
  951. };
  952. static const struct hda_input_mux alc880_test_capture_source = {
  953. .num_items = 7,
  954. .items = {
  955. { "In-1", 0x0 },
  956. { "In-2", 0x1 },
  957. { "In-3", 0x2 },
  958. { "In-4", 0x3 },
  959. { "CD", 0x4 },
  960. { "Front", 0x5 },
  961. { "Surround", 0x6 },
  962. },
  963. };
  964. static const struct hda_channel_mode alc880_test_modes[4] = {
  965. { 2, NULL },
  966. { 4, NULL },
  967. { 6, NULL },
  968. { 8, NULL },
  969. };
  970. static int alc_test_pin_ctl_info(struct snd_kcontrol *kcontrol,
  971. struct snd_ctl_elem_info *uinfo)
  972. {
  973. static const char * const texts[] = {
  974. "N/A", "Line Out", "HP Out",
  975. "In Hi-Z", "In 50%", "In Grd", "In 80%", "In 100%"
  976. };
  977. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  978. uinfo->count = 1;
  979. uinfo->value.enumerated.items = 8;
  980. if (uinfo->value.enumerated.item >= 8)
  981. uinfo->value.enumerated.item = 7;
  982. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  983. return 0;
  984. }
  985. static int alc_test_pin_ctl_get(struct snd_kcontrol *kcontrol,
  986. struct snd_ctl_elem_value *ucontrol)
  987. {
  988. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  989. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  990. unsigned int pin_ctl, item = 0;
  991. pin_ctl = snd_hda_codec_read(codec, nid, 0,
  992. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  993. if (pin_ctl & AC_PINCTL_OUT_EN) {
  994. if (pin_ctl & AC_PINCTL_HP_EN)
  995. item = 2;
  996. else
  997. item = 1;
  998. } else if (pin_ctl & AC_PINCTL_IN_EN) {
  999. switch (pin_ctl & AC_PINCTL_VREFEN) {
  1000. case AC_PINCTL_VREF_HIZ: item = 3; break;
  1001. case AC_PINCTL_VREF_50: item = 4; break;
  1002. case AC_PINCTL_VREF_GRD: item = 5; break;
  1003. case AC_PINCTL_VREF_80: item = 6; break;
  1004. case AC_PINCTL_VREF_100: item = 7; break;
  1005. }
  1006. }
  1007. ucontrol->value.enumerated.item[0] = item;
  1008. return 0;
  1009. }
  1010. static int alc_test_pin_ctl_put(struct snd_kcontrol *kcontrol,
  1011. struct snd_ctl_elem_value *ucontrol)
  1012. {
  1013. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1014. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1015. static const unsigned int ctls[] = {
  1016. 0, AC_PINCTL_OUT_EN, AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN,
  1017. AC_PINCTL_IN_EN | AC_PINCTL_VREF_HIZ,
  1018. AC_PINCTL_IN_EN | AC_PINCTL_VREF_50,
  1019. AC_PINCTL_IN_EN | AC_PINCTL_VREF_GRD,
  1020. AC_PINCTL_IN_EN | AC_PINCTL_VREF_80,
  1021. AC_PINCTL_IN_EN | AC_PINCTL_VREF_100,
  1022. };
  1023. unsigned int old_ctl, new_ctl;
  1024. old_ctl = snd_hda_codec_read(codec, nid, 0,
  1025. AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
  1026. new_ctl = ctls[ucontrol->value.enumerated.item[0]];
  1027. if (old_ctl != new_ctl) {
  1028. int val;
  1029. snd_hda_codec_write_cache(codec, nid, 0,
  1030. AC_VERB_SET_PIN_WIDGET_CONTROL,
  1031. new_ctl);
  1032. val = ucontrol->value.enumerated.item[0] >= 3 ?
  1033. HDA_AMP_MUTE : 0;
  1034. snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
  1035. HDA_AMP_MUTE, val);
  1036. return 1;
  1037. }
  1038. return 0;
  1039. }
  1040. static int alc_test_pin_src_info(struct snd_kcontrol *kcontrol,
  1041. struct snd_ctl_elem_info *uinfo)
  1042. {
  1043. static const char * const texts[] = {
  1044. "Front", "Surround", "CLFE", "Side"
  1045. };
  1046. uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
  1047. uinfo->count = 1;
  1048. uinfo->value.enumerated.items = 4;
  1049. if (uinfo->value.enumerated.item >= 4)
  1050. uinfo->value.enumerated.item = 3;
  1051. strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
  1052. return 0;
  1053. }
  1054. static int alc_test_pin_src_get(struct snd_kcontrol *kcontrol,
  1055. struct snd_ctl_elem_value *ucontrol)
  1056. {
  1057. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1058. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1059. unsigned int sel;
  1060. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
  1061. ucontrol->value.enumerated.item[0] = sel & 3;
  1062. return 0;
  1063. }
  1064. static int alc_test_pin_src_put(struct snd_kcontrol *kcontrol,
  1065. struct snd_ctl_elem_value *ucontrol)
  1066. {
  1067. struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
  1068. hda_nid_t nid = (hda_nid_t)kcontrol->private_value;
  1069. unsigned int sel;
  1070. sel = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0) & 3;
  1071. if (ucontrol->value.enumerated.item[0] != sel) {
  1072. sel = ucontrol->value.enumerated.item[0] & 3;
  1073. snd_hda_codec_write_cache(codec, nid, 0,
  1074. AC_VERB_SET_CONNECT_SEL, sel);
  1075. return 1;
  1076. }
  1077. return 0;
  1078. }
  1079. #define PIN_CTL_TEST(xname,nid) { \
  1080. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  1081. .name = xname, \
  1082. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  1083. .info = alc_test_pin_ctl_info, \
  1084. .get = alc_test_pin_ctl_get, \
  1085. .put = alc_test_pin_ctl_put, \
  1086. .private_value = nid \
  1087. }
  1088. #define PIN_SRC_TEST(xname,nid) { \
  1089. .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
  1090. .name = xname, \
  1091. .subdevice = HDA_SUBDEV_NID_FLAG | nid, \
  1092. .info = alc_test_pin_src_info, \
  1093. .get = alc_test_pin_src_get, \
  1094. .put = alc_test_pin_src_put, \
  1095. .private_value = nid \
  1096. }
  1097. static const struct snd_kcontrol_new alc880_test_mixer[] = {
  1098. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1099. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1100. HDA_CODEC_VOLUME("CLFE Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
  1101. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  1102. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1103. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1104. HDA_BIND_MUTE("CLFE Playback Switch", 0x0e, 2, HDA_INPUT),
  1105. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  1106. PIN_CTL_TEST("Front Pin Mode", 0x14),
  1107. PIN_CTL_TEST("Surround Pin Mode", 0x15),
  1108. PIN_CTL_TEST("CLFE Pin Mode", 0x16),
  1109. PIN_CTL_TEST("Side Pin Mode", 0x17),
  1110. PIN_CTL_TEST("In-1 Pin Mode", 0x18),
  1111. PIN_CTL_TEST("In-2 Pin Mode", 0x19),
  1112. PIN_CTL_TEST("In-3 Pin Mode", 0x1a),
  1113. PIN_CTL_TEST("In-4 Pin Mode", 0x1b),
  1114. PIN_SRC_TEST("In-1 Pin Source", 0x18),
  1115. PIN_SRC_TEST("In-2 Pin Source", 0x19),
  1116. PIN_SRC_TEST("In-3 Pin Source", 0x1a),
  1117. PIN_SRC_TEST("In-4 Pin Source", 0x1b),
  1118. HDA_CODEC_VOLUME("In-1 Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1119. HDA_CODEC_MUTE("In-1 Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1120. HDA_CODEC_VOLUME("In-2 Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1121. HDA_CODEC_MUTE("In-2 Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1122. HDA_CODEC_VOLUME("In-3 Playback Volume", 0x0b, 0x2, HDA_INPUT),
  1123. HDA_CODEC_MUTE("In-3 Playback Switch", 0x0b, 0x2, HDA_INPUT),
  1124. HDA_CODEC_VOLUME("In-4 Playback Volume", 0x0b, 0x3, HDA_INPUT),
  1125. HDA_CODEC_MUTE("In-4 Playback Switch", 0x0b, 0x3, HDA_INPUT),
  1126. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x4, HDA_INPUT),
  1127. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x4, HDA_INPUT),
  1128. {
  1129. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  1130. .name = "Channel Mode",
  1131. .info = alc_ch_mode_info,
  1132. .get = alc_ch_mode_get,
  1133. .put = alc_ch_mode_put,
  1134. },
  1135. { } /* end */
  1136. };
  1137. static const struct hda_verb alc880_test_init_verbs[] = {
  1138. /* Unmute inputs of 0x0c - 0x0f */
  1139. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1140. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1141. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1142. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1143. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1144. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1145. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1146. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1147. /* Vol output for 0x0c-0x0f */
  1148. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1149. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1150. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1151. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1152. /* Set output pins 0x14-0x17 */
  1153. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1154. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1155. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1156. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1157. /* Unmute output pins 0x14-0x17 */
  1158. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1159. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1160. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1161. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1162. /* Set input pins 0x18-0x1c */
  1163. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1164. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1165. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1166. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1167. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1168. /* Mute input pins 0x18-0x1b */
  1169. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1170. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1171. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1172. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1173. /* ADC set up */
  1174. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1175. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1176. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1177. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1178. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1179. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1180. /* Analog input/passthru */
  1181. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1182. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1183. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1184. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1185. {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1186. { }
  1187. };
  1188. #endif
  1189. /*
  1190. */
  1191. static const char * const alc880_models[ALC880_MODEL_LAST] = {
  1192. [ALC880_3ST] = "3stack",
  1193. [ALC880_TCL_S700] = "tcl",
  1194. [ALC880_3ST_DIG] = "3stack-digout",
  1195. [ALC880_CLEVO] = "clevo",
  1196. [ALC880_5ST] = "5stack",
  1197. [ALC880_5ST_DIG] = "5stack-digout",
  1198. [ALC880_W810] = "w810",
  1199. [ALC880_Z71V] = "z71v",
  1200. [ALC880_6ST] = "6stack",
  1201. [ALC880_6ST_DIG] = "6stack-digout",
  1202. [ALC880_ASUS] = "asus",
  1203. [ALC880_ASUS_W1V] = "asus-w1v",
  1204. [ALC880_ASUS_DIG] = "asus-dig",
  1205. [ALC880_ASUS_DIG2] = "asus-dig2",
  1206. [ALC880_UNIWILL_DIG] = "uniwill",
  1207. [ALC880_UNIWILL_P53] = "uniwill-p53",
  1208. [ALC880_FUJITSU] = "fujitsu",
  1209. [ALC880_F1734] = "F1734",
  1210. [ALC880_LG] = "lg",
  1211. #ifdef CONFIG_SND_DEBUG
  1212. [ALC880_TEST] = "test",
  1213. #endif
  1214. [ALC880_AUTO] = "auto",
  1215. };
  1216. static const struct snd_pci_quirk alc880_cfg_tbl[] = {
  1217. SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_W810),
  1218. SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_5ST_DIG),
  1219. SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_6ST),
  1220. SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_3ST_DIG),
  1221. SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_6ST_DIG),
  1222. SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_6ST_DIG),
  1223. SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_6ST_DIG),
  1224. SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
  1225. SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
  1226. SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
  1227. SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
  1228. SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
  1229. SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
  1230. SND_PCI_QUIRK(0x1043, 0x1113, "ASUS", ALC880_ASUS_DIG),
  1231. SND_PCI_QUIRK(0x1043, 0x1123, "ASUS", ALC880_ASUS_DIG),
  1232. SND_PCI_QUIRK(0x1043, 0x1173, "ASUS", ALC880_ASUS_DIG),
  1233. SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_Z71V),
  1234. /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */
  1235. SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG),
  1236. SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG),
  1237. SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG),
  1238. SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG),
  1239. SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST),
  1240. SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST),
  1241. SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_ASUS), /* default ASUS */
  1242. SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_3ST),
  1243. SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_3ST),
  1244. SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_5ST),
  1245. SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_5ST),
  1246. SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_5ST),
  1247. SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_6ST_DIG),
  1248. SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_6ST_DIG),
  1249. SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_6ST_DIG),
  1250. SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_6ST_DIG),
  1251. SND_PCI_QUIRK(0x1558, 0x0520, "Clevo m520G", ALC880_CLEVO),
  1252. SND_PCI_QUIRK(0x1558, 0x0660, "Clevo m655n", ALC880_CLEVO),
  1253. SND_PCI_QUIRK(0x1558, 0x5401, "ASUS", ALC880_ASUS_DIG2),
  1254. SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_5ST_DIG),
  1255. SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_UNIWILL_DIG),
  1256. SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_F1734),
  1257. SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
  1258. SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
  1259. SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
  1260. SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
  1261. SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
  1262. SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
  1263. SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FUJITSU),
  1264. SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_F1734),
  1265. SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU),
  1266. SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG),
  1267. SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG),
  1268. SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG),
  1269. SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700),
  1270. SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_6ST_DIG), /* broken BIOS */
  1271. SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_6ST_DIG),
  1272. SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_5ST_DIG),
  1273. SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_5ST_DIG),
  1274. SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_5ST_DIG),
  1275. SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_3ST_DIG),
  1276. SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_5ST_DIG),
  1277. SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_3ST_DIG),
  1278. SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_3ST_DIG),
  1279. SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_5ST_DIG),
  1280. SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_5ST_DIG),
  1281. SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_5ST_DIG),
  1282. /* default Intel */
  1283. SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_3ST),
  1284. SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_5ST_DIG),
  1285. SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_6ST_DIG),
  1286. {}
  1287. };
  1288. /*
  1289. * ALC880 codec presets
  1290. */
  1291. static const struct alc_config_preset alc880_presets[] = {
  1292. [ALC880_3ST] = {
  1293. .mixers = { alc880_three_stack_mixer },
  1294. .init_verbs = { alc880_volume_init_verbs,
  1295. alc880_pin_3stack_init_verbs },
  1296. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1297. .dac_nids = alc880_dac_nids,
  1298. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1299. .channel_mode = alc880_threestack_modes,
  1300. .need_dac_fix = 1,
  1301. .input_mux = &alc880_capture_source,
  1302. },
  1303. [ALC880_3ST_DIG] = {
  1304. .mixers = { alc880_three_stack_mixer },
  1305. .init_verbs = { alc880_volume_init_verbs,
  1306. alc880_pin_3stack_init_verbs },
  1307. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1308. .dac_nids = alc880_dac_nids,
  1309. .dig_out_nid = ALC880_DIGOUT_NID,
  1310. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1311. .channel_mode = alc880_threestack_modes,
  1312. .need_dac_fix = 1,
  1313. .input_mux = &alc880_capture_source,
  1314. },
  1315. [ALC880_TCL_S700] = {
  1316. .mixers = { alc880_tcl_s700_mixer },
  1317. .init_verbs = { alc880_volume_init_verbs,
  1318. alc880_pin_tcl_S700_init_verbs,
  1319. alc880_gpio2_init_verbs },
  1320. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1321. .dac_nids = alc880_dac_nids,
  1322. .adc_nids = alc880_adc_nids_alt, /* FIXME: correct? */
  1323. .num_adc_nids = 1, /* single ADC */
  1324. .hp_nid = 0x03,
  1325. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1326. .channel_mode = alc880_2_jack_modes,
  1327. .input_mux = &alc880_capture_source,
  1328. },
  1329. [ALC880_5ST] = {
  1330. .mixers = { alc880_three_stack_mixer,
  1331. alc880_five_stack_mixer},
  1332. .init_verbs = { alc880_volume_init_verbs,
  1333. alc880_pin_5stack_init_verbs },
  1334. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1335. .dac_nids = alc880_dac_nids,
  1336. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1337. .channel_mode = alc880_fivestack_modes,
  1338. .input_mux = &alc880_capture_source,
  1339. },
  1340. [ALC880_5ST_DIG] = {
  1341. .mixers = { alc880_three_stack_mixer,
  1342. alc880_five_stack_mixer },
  1343. .init_verbs = { alc880_volume_init_verbs,
  1344. alc880_pin_5stack_init_verbs },
  1345. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1346. .dac_nids = alc880_dac_nids,
  1347. .dig_out_nid = ALC880_DIGOUT_NID,
  1348. .num_channel_mode = ARRAY_SIZE(alc880_fivestack_modes),
  1349. .channel_mode = alc880_fivestack_modes,
  1350. .input_mux = &alc880_capture_source,
  1351. },
  1352. [ALC880_6ST] = {
  1353. .mixers = { alc880_six_stack_mixer },
  1354. .init_verbs = { alc880_volume_init_verbs,
  1355. alc880_pin_6stack_init_verbs },
  1356. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1357. .dac_nids = alc880_6st_dac_nids,
  1358. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1359. .channel_mode = alc880_sixstack_modes,
  1360. .input_mux = &alc880_6stack_capture_source,
  1361. },
  1362. [ALC880_6ST_DIG] = {
  1363. .mixers = { alc880_six_stack_mixer },
  1364. .init_verbs = { alc880_volume_init_verbs,
  1365. alc880_pin_6stack_init_verbs },
  1366. .num_dacs = ARRAY_SIZE(alc880_6st_dac_nids),
  1367. .dac_nids = alc880_6st_dac_nids,
  1368. .dig_out_nid = ALC880_DIGOUT_NID,
  1369. .num_channel_mode = ARRAY_SIZE(alc880_sixstack_modes),
  1370. .channel_mode = alc880_sixstack_modes,
  1371. .input_mux = &alc880_6stack_capture_source,
  1372. },
  1373. [ALC880_W810] = {
  1374. .mixers = { alc880_w810_base_mixer },
  1375. .init_verbs = { alc880_volume_init_verbs,
  1376. alc880_pin_w810_init_verbs,
  1377. alc880_gpio2_init_verbs },
  1378. .num_dacs = ARRAY_SIZE(alc880_w810_dac_nids),
  1379. .dac_nids = alc880_w810_dac_nids,
  1380. .dig_out_nid = ALC880_DIGOUT_NID,
  1381. .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
  1382. .channel_mode = alc880_w810_modes,
  1383. .input_mux = &alc880_capture_source,
  1384. },
  1385. [ALC880_Z71V] = {
  1386. .mixers = { alc880_z71v_mixer },
  1387. .init_verbs = { alc880_volume_init_verbs,
  1388. alc880_pin_z71v_init_verbs },
  1389. .num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids),
  1390. .dac_nids = alc880_z71v_dac_nids,
  1391. .dig_out_nid = ALC880_DIGOUT_NID,
  1392. .hp_nid = 0x03,
  1393. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1394. .channel_mode = alc880_2_jack_modes,
  1395. .input_mux = &alc880_capture_source,
  1396. },
  1397. [ALC880_F1734] = {
  1398. .mixers = { alc880_f1734_mixer },
  1399. .init_verbs = { alc880_volume_init_verbs,
  1400. alc880_pin_f1734_init_verbs },
  1401. .num_dacs = ARRAY_SIZE(alc880_f1734_dac_nids),
  1402. .dac_nids = alc880_f1734_dac_nids,
  1403. .hp_nid = 0x02,
  1404. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1405. .channel_mode = alc880_2_jack_modes,
  1406. .input_mux = &alc880_f1734_capture_source,
  1407. .unsol_event = alc880_uniwill_p53_unsol_event,
  1408. .setup = alc880_uniwill_p53_setup,
  1409. .init_hook = alc_hp_automute,
  1410. },
  1411. [ALC880_ASUS] = {
  1412. .mixers = { alc880_asus_mixer },
  1413. .init_verbs = { alc880_volume_init_verbs,
  1414. alc880_pin_asus_init_verbs,
  1415. alc880_gpio1_init_verbs },
  1416. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1417. .dac_nids = alc880_asus_dac_nids,
  1418. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1419. .channel_mode = alc880_asus_modes,
  1420. .need_dac_fix = 1,
  1421. .input_mux = &alc880_capture_source,
  1422. },
  1423. [ALC880_ASUS_DIG] = {
  1424. .mixers = { alc880_asus_mixer },
  1425. .init_verbs = { alc880_volume_init_verbs,
  1426. alc880_pin_asus_init_verbs,
  1427. alc880_gpio1_init_verbs },
  1428. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1429. .dac_nids = alc880_asus_dac_nids,
  1430. .dig_out_nid = ALC880_DIGOUT_NID,
  1431. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1432. .channel_mode = alc880_asus_modes,
  1433. .need_dac_fix = 1,
  1434. .input_mux = &alc880_capture_source,
  1435. },
  1436. [ALC880_ASUS_DIG2] = {
  1437. .mixers = { alc880_asus_mixer },
  1438. .init_verbs = { alc880_volume_init_verbs,
  1439. alc880_pin_asus_init_verbs,
  1440. alc880_gpio2_init_verbs }, /* use GPIO2 */
  1441. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1442. .dac_nids = alc880_asus_dac_nids,
  1443. .dig_out_nid = ALC880_DIGOUT_NID,
  1444. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1445. .channel_mode = alc880_asus_modes,
  1446. .need_dac_fix = 1,
  1447. .input_mux = &alc880_capture_source,
  1448. },
  1449. [ALC880_ASUS_W1V] = {
  1450. .mixers = { alc880_asus_mixer, alc880_asus_w1v_mixer },
  1451. .init_verbs = { alc880_volume_init_verbs,
  1452. alc880_pin_asus_init_verbs,
  1453. alc880_gpio1_init_verbs },
  1454. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1455. .dac_nids = alc880_asus_dac_nids,
  1456. .dig_out_nid = ALC880_DIGOUT_NID,
  1457. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1458. .channel_mode = alc880_asus_modes,
  1459. .need_dac_fix = 1,
  1460. .input_mux = &alc880_capture_source,
  1461. },
  1462. [ALC880_UNIWILL_DIG] = {
  1463. .mixers = { alc880_asus_mixer },
  1464. .init_verbs = { alc880_volume_init_verbs,
  1465. alc880_pin_asus_init_verbs },
  1466. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1467. .dac_nids = alc880_asus_dac_nids,
  1468. .dig_out_nid = ALC880_DIGOUT_NID,
  1469. .num_channel_mode = ARRAY_SIZE(alc880_asus_modes),
  1470. .channel_mode = alc880_asus_modes,
  1471. .need_dac_fix = 1,
  1472. .input_mux = &alc880_capture_source,
  1473. },
  1474. [ALC880_UNIWILL] = {
  1475. .mixers = { alc880_uniwill_mixer },
  1476. .init_verbs = { alc880_volume_init_verbs,
  1477. alc880_uniwill_init_verbs },
  1478. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1479. .dac_nids = alc880_asus_dac_nids,
  1480. .dig_out_nid = ALC880_DIGOUT_NID,
  1481. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1482. .channel_mode = alc880_threestack_modes,
  1483. .need_dac_fix = 1,
  1484. .input_mux = &alc880_capture_source,
  1485. .unsol_event = alc880_uniwill_unsol_event,
  1486. .setup = alc880_uniwill_setup,
  1487. .init_hook = alc880_uniwill_init_hook,
  1488. },
  1489. [ALC880_UNIWILL_P53] = {
  1490. .mixers = { alc880_uniwill_p53_mixer },
  1491. .init_verbs = { alc880_volume_init_verbs,
  1492. alc880_uniwill_p53_init_verbs },
  1493. .num_dacs = ARRAY_SIZE(alc880_asus_dac_nids),
  1494. .dac_nids = alc880_asus_dac_nids,
  1495. .num_channel_mode = ARRAY_SIZE(alc880_w810_modes),
  1496. .channel_mode = alc880_threestack_modes,
  1497. .input_mux = &alc880_capture_source,
  1498. .unsol_event = alc880_uniwill_p53_unsol_event,
  1499. .setup = alc880_uniwill_p53_setup,
  1500. .init_hook = alc_hp_automute,
  1501. },
  1502. [ALC880_FUJITSU] = {
  1503. .mixers = { alc880_fujitsu_mixer },
  1504. .init_verbs = { alc880_volume_init_verbs,
  1505. alc880_uniwill_p53_init_verbs,
  1506. alc880_beep_init_verbs },
  1507. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1508. .dac_nids = alc880_dac_nids,
  1509. .dig_out_nid = ALC880_DIGOUT_NID,
  1510. .num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
  1511. .channel_mode = alc880_2_jack_modes,
  1512. .input_mux = &alc880_capture_source,
  1513. .unsol_event = alc880_uniwill_p53_unsol_event,
  1514. .setup = alc880_uniwill_p53_setup,
  1515. .init_hook = alc_hp_automute,
  1516. },
  1517. [ALC880_CLEVO] = {
  1518. .mixers = { alc880_three_stack_mixer },
  1519. .init_verbs = { alc880_volume_init_verbs,
  1520. alc880_pin_clevo_init_verbs },
  1521. .num_dacs = ARRAY_SIZE(alc880_dac_nids),
  1522. .dac_nids = alc880_dac_nids,
  1523. .hp_nid = 0x03,
  1524. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  1525. .channel_mode = alc880_threestack_modes,
  1526. .need_dac_fix = 1,
  1527. .input_mux = &alc880_capture_source,
  1528. },
  1529. [ALC880_LG] = {
  1530. .mixers = { alc880_lg_mixer },
  1531. .init_verbs = { alc880_volume_init_verbs,
  1532. alc880_lg_init_verbs },
  1533. .num_dacs = ARRAY_SIZE(alc880_lg_dac_nids),
  1534. .dac_nids = alc880_lg_dac_nids,
  1535. .dig_out_nid = ALC880_DIGOUT_NID,
  1536. .num_channel_mode = ARRAY_SIZE(alc880_lg_ch_modes),
  1537. .channel_mode = alc880_lg_ch_modes,
  1538. .need_dac_fix = 1,
  1539. .input_mux = &alc880_lg_capture_source,
  1540. .unsol_event = alc_sku_unsol_event,
  1541. .setup = alc880_lg_setup,
  1542. .init_hook = alc_hp_automute,
  1543. #ifdef CONFIG_SND_HDA_POWER_SAVE
  1544. .loopbacks = alc880_lg_loopbacks,
  1545. #endif
  1546. },
  1547. #ifdef CONFIG_SND_DEBUG
  1548. [ALC880_TEST] = {
  1549. .mixers = { alc880_test_mixer },
  1550. .init_verbs = { alc880_test_init_verbs },
  1551. .num_dacs = ARRAY_SIZE(alc880_test_dac_nids),
  1552. .dac_nids = alc880_test_dac_nids,
  1553. .dig_out_nid = ALC880_DIGOUT_NID,
  1554. .num_channel_mode = ARRAY_SIZE(alc880_test_modes),
  1555. .channel_mode = alc880_test_modes,
  1556. .input_mux = &alc880_test_capture_source,
  1557. },
  1558. #endif
  1559. };