alc880_quirks.c 65 KB

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