alc882_quirks.c 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883
  1. /*
  2. * ALC882/ALC883/ALC888/ALC889 quirk models
  3. * included by patch_realtek.c
  4. */
  5. /* ALC882 models */
  6. enum {
  7. ALC882_AUTO,
  8. ALC882_3ST_DIG,
  9. ALC882_6ST_DIG,
  10. ALC882_W2JC,
  11. ALC882_TARGA,
  12. ALC885_MACPRO,
  13. ALC885_MBA21,
  14. ALC885_MBP3,
  15. ALC885_MB5,
  16. ALC885_MACMINI3,
  17. ALC885_IMAC24,
  18. ALC885_IMAC91,
  19. ALC883_3ST_2ch_DIG,
  20. ALC883_3ST_6ch_DIG,
  21. ALC883_3ST_6ch,
  22. ALC883_6ST_DIG,
  23. ALC883_TARGA_DIG,
  24. ALC883_TARGA_2ch_DIG,
  25. ALC883_TARGA_8ch_DIG,
  26. ALC883_ACER,
  27. ALC883_ACER_ASPIRE,
  28. ALC888_ACER_ASPIRE_4930G,
  29. ALC888_ACER_ASPIRE_6530G,
  30. ALC888_ACER_ASPIRE_8930G,
  31. ALC888_ACER_ASPIRE_7730G,
  32. ALC888_3ST_HP,
  33. ALC888_6ST_DELL,
  34. ALC883_CLEVO_M540R,
  35. ALC883_CLEVO_M720,
  36. ALC883_3ST_6ch_INTEL,
  37. ALC889A_INTEL,
  38. ALC889_INTEL,
  39. ALC889A_MB31,
  40. ALC882_MODEL_LAST,
  41. };
  42. /*
  43. * 2ch mode
  44. */
  45. static const struct hda_verb alc888_4ST_ch2_intel_init[] = {
  46. /* Mic-in jack as mic in */
  47. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  48. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  49. /* Line-in jack as Line in */
  50. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  51. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  52. /* Line-Out as Front */
  53. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
  54. { } /* end */
  55. };
  56. /*
  57. * 4ch mode
  58. */
  59. static const struct hda_verb alc888_4ST_ch4_intel_init[] = {
  60. /* Mic-in jack as mic in */
  61. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  62. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  63. /* Line-in jack as Surround */
  64. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  65. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  66. /* Line-Out as Front */
  67. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00},
  68. { } /* end */
  69. };
  70. /*
  71. * 6ch mode
  72. */
  73. static const struct hda_verb alc888_4ST_ch6_intel_init[] = {
  74. /* Mic-in jack as CLFE */
  75. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  76. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  77. /* Line-in jack as Surround */
  78. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  79. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  80. /* Line-Out as CLFE (workaround because Mic-in is not loud enough) */
  81. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
  82. { } /* end */
  83. };
  84. /*
  85. * 8ch mode
  86. */
  87. static const struct hda_verb alc888_4ST_ch8_intel_init[] = {
  88. /* Mic-in jack as CLFE */
  89. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  90. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  91. /* Line-in jack as Surround */
  92. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  93. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  94. /* Line-Out as Side */
  95. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
  96. { } /* end */
  97. };
  98. static const struct hda_channel_mode alc888_4ST_8ch_intel_modes[4] = {
  99. { 2, alc888_4ST_ch2_intel_init },
  100. { 4, alc888_4ST_ch4_intel_init },
  101. { 6, alc888_4ST_ch6_intel_init },
  102. { 8, alc888_4ST_ch8_intel_init },
  103. };
  104. static void alc889_automute_setup(struct hda_codec *codec)
  105. {
  106. struct alc_spec *spec = codec->spec;
  107. spec->autocfg.hp_pins[0] = 0x15;
  108. spec->autocfg.speaker_pins[0] = 0x14;
  109. spec->autocfg.speaker_pins[1] = 0x16;
  110. spec->autocfg.speaker_pins[2] = 0x17;
  111. spec->autocfg.speaker_pins[3] = 0x19;
  112. spec->autocfg.speaker_pins[4] = 0x1a;
  113. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  114. }
  115. static void alc889_intel_init_hook(struct hda_codec *codec)
  116. {
  117. alc889_coef_init(codec);
  118. alc_hp_automute(codec);
  119. }
  120. /*
  121. * ALC888 Acer Aspire 4930G model
  122. */
  123. static const struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
  124. /* Front Mic: set to PIN_IN (empty by default) */
  125. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  126. /* Unselect Front Mic by default in input mixer 3 */
  127. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
  128. /* Enable unsolicited event for HP jack */
  129. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  130. /* Connect Internal HP to front */
  131. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  132. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  133. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  134. /* Connect HP out to front */
  135. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  136. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  137. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  138. {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
  139. { }
  140. };
  141. /*
  142. * ALC888 Acer Aspire 6530G model
  143. */
  144. static const struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
  145. /* Route to built-in subwoofer as well as speakers */
  146. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  147. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  148. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  149. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  150. /* Bias voltage on for external mic port */
  151. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
  152. /* Front Mic: set to PIN_IN (empty by default) */
  153. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  154. /* Unselect Front Mic by default in input mixer 3 */
  155. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
  156. /* Enable unsolicited event for HP jack */
  157. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  158. /* Enable speaker output */
  159. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  160. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  161. {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
  162. /* Enable headphone output */
  163. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
  164. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  165. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  166. {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
  167. { }
  168. };
  169. /*
  170. *ALC888 Acer Aspire 7730G model
  171. */
  172. static const struct hda_verb alc888_acer_aspire_7730G_verbs[] = {
  173. /* Bias voltage on for external mic port */
  174. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
  175. /* Front Mic: set to PIN_IN (empty by default) */
  176. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  177. /* Unselect Front Mic by default in input mixer 3 */
  178. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
  179. /* Enable unsolicited event for HP jack */
  180. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  181. /* Enable speaker output */
  182. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  183. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  184. {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
  185. /* Enable headphone output */
  186. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
  187. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  188. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  189. {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
  190. /*Enable internal subwoofer */
  191. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  192. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  193. {0x17, AC_VERB_SET_CONNECT_SEL, 0x02},
  194. {0x17, AC_VERB_SET_EAPD_BTLENABLE, 2},
  195. { }
  196. };
  197. /*
  198. * ALC889 Acer Aspire 8930G model
  199. */
  200. static const struct hda_verb alc889_acer_aspire_8930g_verbs[] = {
  201. /* Front Mic: set to PIN_IN (empty by default) */
  202. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  203. /* Unselect Front Mic by default in input mixer 3 */
  204. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0xb)},
  205. /* Enable unsolicited event for HP jack */
  206. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  207. /* Connect Internal Front to Front */
  208. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  209. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  210. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  211. /* Connect Internal Rear to Rear */
  212. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  213. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  214. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x01},
  215. /* Connect Internal CLFE to CLFE */
  216. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  217. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  218. {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
  219. /* Connect HP out to Front */
  220. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
  221. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  222. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  223. /* Enable all DACs */
  224. /* DAC DISABLE/MUTE 1? */
  225. /* setting bits 1-5 disables DAC nids 0x02-0x06 apparently. Init=0x38 */
  226. {0x20, AC_VERB_SET_COEF_INDEX, 0x03},
  227. {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
  228. /* DAC DISABLE/MUTE 2? */
  229. /* some bit here disables the other DACs. Init=0x4900 */
  230. {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
  231. {0x20, AC_VERB_SET_PROC_COEF, 0x0000},
  232. /* DMIC fix
  233. * This laptop has a stereo digital microphone. The mics are only 1cm apart
  234. * which makes the stereo useless. However, either the mic or the ALC889
  235. * makes the signal become a difference/sum signal instead of standard
  236. * stereo, which is annoying. So instead we flip this bit which makes the
  237. * codec replicate the sum signal to both channels, turning it into a
  238. * normal mono mic.
  239. */
  240. /* DMIC_CONTROL? Init value = 0x0001 */
  241. {0x20, AC_VERB_SET_COEF_INDEX, 0x0b},
  242. {0x20, AC_VERB_SET_PROC_COEF, 0x0003},
  243. { }
  244. };
  245. static const struct hda_input_mux alc888_2_capture_sources[2] = {
  246. /* Front mic only available on one ADC */
  247. {
  248. .num_items = 4,
  249. .items = {
  250. { "Mic", 0x0 },
  251. { "Line", 0x2 },
  252. { "CD", 0x4 },
  253. { "Front Mic", 0xb },
  254. },
  255. },
  256. {
  257. .num_items = 3,
  258. .items = {
  259. { "Mic", 0x0 },
  260. { "Line", 0x2 },
  261. { "CD", 0x4 },
  262. },
  263. }
  264. };
  265. static const struct hda_input_mux alc888_acer_aspire_6530_sources[2] = {
  266. /* Interal mic only available on one ADC */
  267. {
  268. .num_items = 5,
  269. .items = {
  270. { "Mic", 0x0 },
  271. { "Line In", 0x2 },
  272. { "CD", 0x4 },
  273. { "Input Mix", 0xa },
  274. { "Internal Mic", 0xb },
  275. },
  276. },
  277. {
  278. .num_items = 4,
  279. .items = {
  280. { "Mic", 0x0 },
  281. { "Line In", 0x2 },
  282. { "CD", 0x4 },
  283. { "Input Mix", 0xa },
  284. },
  285. }
  286. };
  287. static const struct hda_input_mux alc889_capture_sources[3] = {
  288. /* Digital mic only available on first "ADC" */
  289. {
  290. .num_items = 5,
  291. .items = {
  292. { "Mic", 0x0 },
  293. { "Line", 0x2 },
  294. { "CD", 0x4 },
  295. { "Front Mic", 0xb },
  296. { "Input Mix", 0xa },
  297. },
  298. },
  299. {
  300. .num_items = 4,
  301. .items = {
  302. { "Mic", 0x0 },
  303. { "Line", 0x2 },
  304. { "CD", 0x4 },
  305. { "Input Mix", 0xa },
  306. },
  307. },
  308. {
  309. .num_items = 4,
  310. .items = {
  311. { "Mic", 0x0 },
  312. { "Line", 0x2 },
  313. { "CD", 0x4 },
  314. { "Input Mix", 0xa },
  315. },
  316. }
  317. };
  318. static const struct snd_kcontrol_new alc888_base_mixer[] = {
  319. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  320. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  321. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  322. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  323. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
  324. HDA_OUTPUT),
  325. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  326. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  327. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  328. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  329. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  330. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  331. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  332. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  333. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  334. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  335. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  336. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  337. { } /* end */
  338. };
  339. static const struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
  340. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  341. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  342. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  343. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  344. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
  345. HDA_OUTPUT),
  346. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  347. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  348. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  349. HDA_CODEC_VOLUME_MONO("Internal LFE Playback Volume", 0x0f, 1, 0x0, HDA_OUTPUT),
  350. HDA_BIND_MUTE_MONO("Internal LFE Playback Switch", 0x0f, 1, 2, HDA_INPUT),
  351. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  352. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  353. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  354. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  355. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  356. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  357. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  358. { } /* end */
  359. };
  360. static const struct snd_kcontrol_new alc889_acer_aspire_8930g_mixer[] = {
  361. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  362. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  363. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  364. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  365. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
  366. HDA_OUTPUT),
  367. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  368. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  369. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  370. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  371. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  372. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  373. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  374. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  375. { } /* end */
  376. };
  377. static void alc888_acer_aspire_4930g_setup(struct hda_codec *codec)
  378. {
  379. struct alc_spec *spec = codec->spec;
  380. spec->autocfg.hp_pins[0] = 0x15;
  381. spec->autocfg.speaker_pins[0] = 0x14;
  382. spec->autocfg.speaker_pins[1] = 0x16;
  383. spec->autocfg.speaker_pins[2] = 0x17;
  384. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  385. }
  386. static void alc888_acer_aspire_6530g_setup(struct hda_codec *codec)
  387. {
  388. struct alc_spec *spec = codec->spec;
  389. spec->autocfg.hp_pins[0] = 0x15;
  390. spec->autocfg.speaker_pins[0] = 0x14;
  391. spec->autocfg.speaker_pins[1] = 0x16;
  392. spec->autocfg.speaker_pins[2] = 0x17;
  393. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  394. }
  395. static void alc888_acer_aspire_7730g_setup(struct hda_codec *codec)
  396. {
  397. struct alc_spec *spec = codec->spec;
  398. spec->autocfg.hp_pins[0] = 0x15;
  399. spec->autocfg.speaker_pins[0] = 0x14;
  400. spec->autocfg.speaker_pins[1] = 0x16;
  401. spec->autocfg.speaker_pins[2] = 0x17;
  402. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  403. }
  404. static void alc889_acer_aspire_8930g_setup(struct hda_codec *codec)
  405. {
  406. struct alc_spec *spec = codec->spec;
  407. spec->autocfg.hp_pins[0] = 0x15;
  408. spec->autocfg.speaker_pins[0] = 0x14;
  409. spec->autocfg.speaker_pins[1] = 0x16;
  410. spec->autocfg.speaker_pins[2] = 0x1b;
  411. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  412. }
  413. #define ALC882_DIGOUT_NID 0x06
  414. #define ALC882_DIGIN_NID 0x0a
  415. #define ALC883_DIGOUT_NID ALC882_DIGOUT_NID
  416. #define ALC883_DIGIN_NID ALC882_DIGIN_NID
  417. #define ALC1200_DIGOUT_NID 0x10
  418. static const struct hda_channel_mode alc882_ch_modes[1] = {
  419. { 8, NULL }
  420. };
  421. /* DACs */
  422. static const hda_nid_t alc882_dac_nids[4] = {
  423. /* front, rear, clfe, rear_surr */
  424. 0x02, 0x03, 0x04, 0x05
  425. };
  426. #define alc883_dac_nids alc882_dac_nids
  427. /* ADCs */
  428. #define alc882_adc_nids alc880_adc_nids
  429. #define alc882_adc_nids_alt alc880_adc_nids_alt
  430. #define alc883_adc_nids alc882_adc_nids_alt
  431. static const hda_nid_t alc883_adc_nids_alt[1] = { 0x08 };
  432. static const hda_nid_t alc883_adc_nids_rev[2] = { 0x09, 0x08 };
  433. #define alc889_adc_nids alc880_adc_nids
  434. static const hda_nid_t alc882_capsrc_nids[3] = { 0x24, 0x23, 0x22 };
  435. static const hda_nid_t alc882_capsrc_nids_alt[2] = { 0x23, 0x22 };
  436. #define alc883_capsrc_nids alc882_capsrc_nids_alt
  437. static const hda_nid_t alc883_capsrc_nids_rev[2] = { 0x22, 0x23 };
  438. #define alc889_capsrc_nids alc882_capsrc_nids
  439. /* input MUX */
  440. /* FIXME: should be a matrix-type input source selection */
  441. static const struct hda_input_mux alc882_capture_source = {
  442. .num_items = 4,
  443. .items = {
  444. { "Mic", 0x0 },
  445. { "Front Mic", 0x1 },
  446. { "Line", 0x2 },
  447. { "CD", 0x4 },
  448. },
  449. };
  450. #define alc883_capture_source alc882_capture_source
  451. static const struct hda_input_mux alc889_capture_source = {
  452. .num_items = 3,
  453. .items = {
  454. { "Front Mic", 0x0 },
  455. { "Mic", 0x3 },
  456. { "Line", 0x2 },
  457. },
  458. };
  459. static const struct hda_input_mux mb5_capture_source = {
  460. .num_items = 3,
  461. .items = {
  462. { "Mic", 0x1 },
  463. { "Line", 0x7 },
  464. { "CD", 0x4 },
  465. },
  466. };
  467. static const struct hda_input_mux macmini3_capture_source = {
  468. .num_items = 2,
  469. .items = {
  470. { "Line", 0x2 },
  471. { "CD", 0x4 },
  472. },
  473. };
  474. static const struct hda_input_mux alc883_3stack_6ch_intel = {
  475. .num_items = 4,
  476. .items = {
  477. { "Mic", 0x1 },
  478. { "Front Mic", 0x0 },
  479. { "Line", 0x2 },
  480. { "CD", 0x4 },
  481. },
  482. };
  483. static const struct hda_input_mux alc889A_mb31_capture_source = {
  484. .num_items = 2,
  485. .items = {
  486. { "Mic", 0x0 },
  487. /* Front Mic (0x01) unused */
  488. { "Line", 0x2 },
  489. /* Line 2 (0x03) unused */
  490. /* CD (0x04) unused? */
  491. },
  492. };
  493. static const struct hda_input_mux alc889A_imac91_capture_source = {
  494. .num_items = 2,
  495. .items = {
  496. { "Mic", 0x01 },
  497. { "Line", 0x2 }, /* Not sure! */
  498. },
  499. };
  500. /*
  501. * 2ch mode
  502. */
  503. static const struct hda_channel_mode alc883_3ST_2ch_modes[1] = {
  504. { 2, NULL }
  505. };
  506. /*
  507. * 2ch mode
  508. */
  509. static const struct hda_verb alc882_3ST_ch2_init[] = {
  510. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  511. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  512. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  513. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  514. { } /* end */
  515. };
  516. /*
  517. * 4ch mode
  518. */
  519. static const struct hda_verb alc882_3ST_ch4_init[] = {
  520. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  521. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  522. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  523. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  524. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  525. { } /* end */
  526. };
  527. /*
  528. * 6ch mode
  529. */
  530. static const struct hda_verb alc882_3ST_ch6_init[] = {
  531. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  532. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  533. { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
  534. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  535. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  536. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  537. { } /* end */
  538. };
  539. static const struct hda_channel_mode alc882_3ST_6ch_modes[3] = {
  540. { 2, alc882_3ST_ch2_init },
  541. { 4, alc882_3ST_ch4_init },
  542. { 6, alc882_3ST_ch6_init },
  543. };
  544. #define alc883_3ST_6ch_modes alc882_3ST_6ch_modes
  545. /*
  546. * 2ch mode
  547. */
  548. static const struct hda_verb alc883_3ST_ch2_clevo_init[] = {
  549. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
  550. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  551. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  552. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  553. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  554. { } /* end */
  555. };
  556. /*
  557. * 4ch mode
  558. */
  559. static const struct hda_verb alc883_3ST_ch4_clevo_init[] = {
  560. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  561. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  562. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  563. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  564. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  565. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  566. { } /* end */
  567. };
  568. /*
  569. * 6ch mode
  570. */
  571. static const struct hda_verb alc883_3ST_ch6_clevo_init[] = {
  572. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  573. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  574. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  575. { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
  576. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  577. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  578. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  579. { } /* end */
  580. };
  581. static const struct hda_channel_mode alc883_3ST_6ch_clevo_modes[3] = {
  582. { 2, alc883_3ST_ch2_clevo_init },
  583. { 4, alc883_3ST_ch4_clevo_init },
  584. { 6, alc883_3ST_ch6_clevo_init },
  585. };
  586. /*
  587. * 6ch mode
  588. */
  589. static const struct hda_verb alc882_sixstack_ch6_init[] = {
  590. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
  591. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  592. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  593. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  594. { } /* end */
  595. };
  596. /*
  597. * 8ch mode
  598. */
  599. static const struct hda_verb alc882_sixstack_ch8_init[] = {
  600. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  601. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  602. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  603. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  604. { } /* end */
  605. };
  606. static const struct hda_channel_mode alc882_sixstack_modes[2] = {
  607. { 6, alc882_sixstack_ch6_init },
  608. { 8, alc882_sixstack_ch8_init },
  609. };
  610. /* Macbook Air 2,1 */
  611. static const struct hda_channel_mode alc885_mba21_ch_modes[1] = {
  612. { 2, NULL },
  613. };
  614. /*
  615. * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
  616. */
  617. /*
  618. * 2ch mode
  619. */
  620. static const struct hda_verb alc885_mbp_ch2_init[] = {
  621. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  622. { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  623. { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  624. { } /* end */
  625. };
  626. /*
  627. * 4ch mode
  628. */
  629. static const struct hda_verb alc885_mbp_ch4_init[] = {
  630. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  631. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  632. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  633. { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  634. { 0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  635. { } /* end */
  636. };
  637. static const struct hda_channel_mode alc885_mbp_4ch_modes[2] = {
  638. { 2, alc885_mbp_ch2_init },
  639. { 4, alc885_mbp_ch4_init },
  640. };
  641. /*
  642. * 2ch
  643. * Speakers/Woofer/HP = Front
  644. * LineIn = Input
  645. */
  646. static const struct hda_verb alc885_mb5_ch2_init[] = {
  647. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  648. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  649. { } /* end */
  650. };
  651. /*
  652. * 6ch mode
  653. * Speakers/HP = Front
  654. * Woofer = LFE
  655. * LineIn = Surround
  656. */
  657. static const struct hda_verb alc885_mb5_ch6_init[] = {
  658. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  659. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  660. {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
  661. { } /* end */
  662. };
  663. static const struct hda_channel_mode alc885_mb5_6ch_modes[2] = {
  664. { 2, alc885_mb5_ch2_init },
  665. { 6, alc885_mb5_ch6_init },
  666. };
  667. #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes
  668. /*
  669. * 2ch mode
  670. */
  671. static const struct hda_verb alc883_4ST_ch2_init[] = {
  672. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  673. { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  674. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  675. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  676. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  677. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  678. { } /* end */
  679. };
  680. /*
  681. * 4ch mode
  682. */
  683. static const struct hda_verb alc883_4ST_ch4_init[] = {
  684. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  685. { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  686. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  687. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  688. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  689. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  690. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  691. { } /* end */
  692. };
  693. /*
  694. * 6ch mode
  695. */
  696. static const struct hda_verb alc883_4ST_ch6_init[] = {
  697. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  698. { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  699. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  700. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  701. { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
  702. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  703. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  704. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  705. { } /* end */
  706. };
  707. /*
  708. * 8ch mode
  709. */
  710. static const struct hda_verb alc883_4ST_ch8_init[] = {
  711. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  712. { 0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  713. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
  714. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  715. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  716. { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
  717. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  718. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  719. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  720. { } /* end */
  721. };
  722. static const struct hda_channel_mode alc883_4ST_8ch_modes[4] = {
  723. { 2, alc883_4ST_ch2_init },
  724. { 4, alc883_4ST_ch4_init },
  725. { 6, alc883_4ST_ch6_init },
  726. { 8, alc883_4ST_ch8_init },
  727. };
  728. /*
  729. * 2ch mode
  730. */
  731. static const struct hda_verb alc883_3ST_ch2_intel_init[] = {
  732. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  733. { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  734. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  735. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  736. { } /* end */
  737. };
  738. /*
  739. * 4ch mode
  740. */
  741. static const struct hda_verb alc883_3ST_ch4_intel_init[] = {
  742. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  743. { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  744. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  745. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  746. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  747. { } /* end */
  748. };
  749. /*
  750. * 6ch mode
  751. */
  752. static const struct hda_verb alc883_3ST_ch6_intel_init[] = {
  753. { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  754. { 0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  755. { 0x19, AC_VERB_SET_CONNECT_SEL, 0x02 },
  756. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  757. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  758. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x01 },
  759. { } /* end */
  760. };
  761. static const struct hda_channel_mode alc883_3ST_6ch_intel_modes[3] = {
  762. { 2, alc883_3ST_ch2_intel_init },
  763. { 4, alc883_3ST_ch4_intel_init },
  764. { 6, alc883_3ST_ch6_intel_init },
  765. };
  766. /*
  767. * 2ch mode
  768. */
  769. static const struct hda_verb alc889_ch2_intel_init[] = {
  770. { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
  771. { 0x19, AC_VERB_SET_CONNECT_SEL, 0x00 },
  772. { 0x16, AC_VERB_SET_CONNECT_SEL, 0x00 },
  773. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x00 },
  774. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  775. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  776. { } /* end */
  777. };
  778. /*
  779. * 6ch mode
  780. */
  781. static const struct hda_verb alc889_ch6_intel_init[] = {
  782. { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
  783. { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
  784. { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
  785. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
  786. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  787. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  788. { } /* end */
  789. };
  790. /*
  791. * 8ch mode
  792. */
  793. static const struct hda_verb alc889_ch8_intel_init[] = {
  794. { 0x14, AC_VERB_SET_CONNECT_SEL, 0x00 },
  795. { 0x19, AC_VERB_SET_CONNECT_SEL, 0x01 },
  796. { 0x16, AC_VERB_SET_CONNECT_SEL, 0x02 },
  797. { 0x17, AC_VERB_SET_CONNECT_SEL, 0x03 },
  798. { 0x1a, AC_VERB_SET_CONNECT_SEL, 0x03 },
  799. { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  800. { 0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  801. { } /* end */
  802. };
  803. static const struct hda_channel_mode alc889_8ch_intel_modes[3] = {
  804. { 2, alc889_ch2_intel_init },
  805. { 6, alc889_ch6_intel_init },
  806. { 8, alc889_ch8_intel_init },
  807. };
  808. /*
  809. * 6ch mode
  810. */
  811. static const struct hda_verb alc883_sixstack_ch6_init[] = {
  812. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00 },
  813. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  814. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  815. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  816. { } /* end */
  817. };
  818. /*
  819. * 8ch mode
  820. */
  821. static const struct hda_verb alc883_sixstack_ch8_init[] = {
  822. { 0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  823. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  824. { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  825. { 0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  826. { } /* end */
  827. };
  828. static const struct hda_channel_mode alc883_sixstack_modes[2] = {
  829. { 6, alc883_sixstack_ch6_init },
  830. { 8, alc883_sixstack_ch8_init },
  831. };
  832. /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17
  833. * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b
  834. */
  835. static const struct snd_kcontrol_new alc882_base_mixer[] = {
  836. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  837. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  838. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  839. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  840. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  841. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  842. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  843. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  844. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  845. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  846. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  847. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  848. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  849. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  850. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  851. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  852. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  853. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  854. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  855. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  856. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  857. { } /* end */
  858. };
  859. /* Macbook Air 2,1 same control for HP and internal Speaker */
  860. static const struct snd_kcontrol_new alc885_mba21_mixer[] = {
  861. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  862. HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
  863. { }
  864. };
  865. static const struct snd_kcontrol_new alc885_mbp3_mixer[] = {
  866. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  867. HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
  868. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
  869. HDA_BIND_MUTE ("Headphone Playback Switch", 0x0e, 0x02, HDA_INPUT),
  870. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
  871. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  872. HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  873. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
  874. HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
  875. HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
  876. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
  877. { } /* end */
  878. };
  879. static const struct snd_kcontrol_new alc885_mb5_mixer[] = {
  880. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  881. HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
  882. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
  883. HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
  884. HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
  885. HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
  886. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
  887. HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
  888. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
  889. HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
  890. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
  891. HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
  892. HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
  893. HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0x00, HDA_INPUT),
  894. { } /* end */
  895. };
  896. static const struct snd_kcontrol_new alc885_macmini3_mixer[] = {
  897. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  898. HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
  899. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
  900. HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
  901. HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),
  902. HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),
  903. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),
  904. HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),
  905. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT),
  906. HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT),
  907. HDA_CODEC_VOLUME("Line Boost Volume", 0x15, 0x00, HDA_INPUT),
  908. { } /* end */
  909. };
  910. static const struct snd_kcontrol_new alc885_imac91_mixer[] = {
  911. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  912. HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
  913. { } /* end */
  914. };
  915. static const struct snd_kcontrol_new alc882_w2jc_mixer[] = {
  916. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  917. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  918. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  919. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  920. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  921. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  922. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  923. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  924. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  925. { } /* end */
  926. };
  927. static const struct snd_kcontrol_new alc882_targa_mixer[] = {
  928. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  929. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  930. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  931. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  932. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  933. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  934. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  935. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  936. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  937. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  938. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  939. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  940. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  941. { } /* end */
  942. };
  943. static const struct snd_kcontrol_new alc882_chmode_mixer[] = {
  944. {
  945. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  946. .name = "Channel Mode",
  947. .info = alc_ch_mode_info,
  948. .get = alc_ch_mode_get,
  949. .put = alc_ch_mode_put,
  950. },
  951. { } /* end */
  952. };
  953. static const struct hda_verb alc882_base_init_verbs[] = {
  954. /* Front mixer: unmute input/output amp left and right (volume = 0) */
  955. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  956. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  957. /* Rear mixer */
  958. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  959. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  960. /* CLFE mixer */
  961. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  962. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  963. /* Side mixer */
  964. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  965. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  966. /* Front Pin: output 0 (0x0c) */
  967. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  968. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  969. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  970. /* Rear Pin: output 1 (0x0d) */
  971. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  972. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  973. {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
  974. /* CLFE Pin: output 2 (0x0e) */
  975. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  976. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  977. {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
  978. /* Side Pin: output 3 (0x0f) */
  979. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  980. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  981. {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
  982. /* Mic (rear) pin: input vref at 80% */
  983. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  984. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  985. /* Front Mic pin: input vref at 80% */
  986. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  987. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  988. /* Line In pin: input */
  989. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  990. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  991. /* Line-2 In: Headphone output (output 0 - 0x0c) */
  992. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  993. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  994. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
  995. /* CD pin widget for input */
  996. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  997. /* FIXME: use matrix-type input source selection */
  998. /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
  999. /* Input mixer2 */
  1000. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1001. /* Input mixer3 */
  1002. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1003. /* ADC2: mute amp left and right */
  1004. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1005. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1006. /* ADC3: mute amp left and right */
  1007. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1008. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1009. { }
  1010. };
  1011. static const struct hda_verb alc882_adc1_init_verbs[] = {
  1012. /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
  1013. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1014. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1015. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1016. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1017. /* ADC1: mute amp left and right */
  1018. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1019. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1020. { }
  1021. };
  1022. static const struct hda_verb alc882_eapd_verbs[] = {
  1023. /* change to EAPD mode */
  1024. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  1025. {0x20, AC_VERB_SET_PROC_COEF, 0x3060},
  1026. { }
  1027. };
  1028. static const struct hda_verb alc889_eapd_verbs[] = {
  1029. {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
  1030. {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
  1031. { }
  1032. };
  1033. static const struct hda_verb alc_hp15_unsol_verbs[] = {
  1034. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
  1035. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1036. {}
  1037. };
  1038. static const struct hda_verb alc885_init_verbs[] = {
  1039. /* Front mixer: unmute input/output amp left and right (volume = 0) */
  1040. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1041. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1042. /* Rear mixer */
  1043. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1044. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1045. /* CLFE mixer */
  1046. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1047. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1048. /* Side mixer */
  1049. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1050. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1051. /* Front HP Pin: output 0 (0x0c) */
  1052. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1053. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1054. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  1055. /* Front Pin: output 0 (0x0c) */
  1056. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1057. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1058. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1059. /* Rear Pin: output 1 (0x0d) */
  1060. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1061. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1062. {0x19, AC_VERB_SET_CONNECT_SEL, 0x01},
  1063. /* CLFE Pin: output 2 (0x0e) */
  1064. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1065. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1066. {0x16, AC_VERB_SET_CONNECT_SEL, 0x02},
  1067. /* Side Pin: output 3 (0x0f) */
  1068. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1069. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1070. {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
  1071. /* Mic (rear) pin: input vref at 80% */
  1072. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1073. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1074. /* Front Mic pin: input vref at 80% */
  1075. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1076. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1077. /* Line In pin: input */
  1078. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1079. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1080. /* Mixer elements: 0x18, , 0x1a, 0x1b */
  1081. /* Input mixer1 */
  1082. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1083. /* Input mixer2 */
  1084. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1085. /* Input mixer3 */
  1086. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1087. /* ADC2: mute amp left and right */
  1088. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1089. /* ADC3: mute amp left and right */
  1090. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1091. { }
  1092. };
  1093. static const struct hda_verb alc885_init_input_verbs[] = {
  1094. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1095. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
  1096. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},
  1097. { }
  1098. };
  1099. /* Unmute Selector 24h and set the default input to front mic */
  1100. static const struct hda_verb alc889_init_input_verbs[] = {
  1101. {0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
  1102. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1103. { }
  1104. };
  1105. #define alc883_init_verbs alc882_base_init_verbs
  1106. /* Mac Pro test */
  1107. static const struct snd_kcontrol_new alc882_macpro_mixer[] = {
  1108. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1109. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1110. HDA_CODEC_MUTE("Headphone Playback Switch", 0x18, 0x0, HDA_OUTPUT),
  1111. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x01, HDA_INPUT),
  1112. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x01, HDA_INPUT),
  1113. /* FIXME: this looks suspicious...
  1114. HDA_CODEC_VOLUME("Beep Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1115. HDA_CODEC_MUTE("Beep Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1116. */
  1117. { } /* end */
  1118. };
  1119. static const struct hda_verb alc882_macpro_init_verbs[] = {
  1120. /* Front mixer: unmute input/output amp left and right (volume = 0) */
  1121. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1122. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1123. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1124. /* Front Pin: output 0 (0x0c) */
  1125. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1126. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1127. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  1128. /* Front Mic pin: input vref at 80% */
  1129. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1130. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1131. /* Speaker: output */
  1132. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1133. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1134. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x04},
  1135. /* Headphone output (output 0 - 0x0c) */
  1136. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1137. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1138. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1139. /* FIXME: use matrix-type input source selection */
  1140. /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
  1141. /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
  1142. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1143. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1144. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1145. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1146. /* Input mixer2 */
  1147. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1148. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1149. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1150. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1151. /* Input mixer3 */
  1152. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1153. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1154. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1155. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1156. /* ADC1: mute amp left and right */
  1157. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1158. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1159. /* ADC2: mute amp left and right */
  1160. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1161. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1162. /* ADC3: mute amp left and right */
  1163. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1164. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1165. { }
  1166. };
  1167. /* Macbook 5,1 */
  1168. static const struct hda_verb alc885_mb5_init_verbs[] = {
  1169. /* DACs */
  1170. {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1171. {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1172. {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1173. {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1174. /* Front mixer */
  1175. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1176. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1177. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1178. /* Surround mixer */
  1179. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1180. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1181. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1182. /* LFE mixer */
  1183. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1184. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1185. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1186. /* HP mixer */
  1187. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1188. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1189. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1190. /* Front Pin (0x0c) */
  1191. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
  1192. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1193. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1194. /* LFE Pin (0x0e) */
  1195. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
  1196. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1197. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
  1198. /* HP Pin (0x0f) */
  1199. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1200. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1201. {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
  1202. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1203. /* Front Mic pin: input vref at 80% */
  1204. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1205. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1206. /* Line In pin */
  1207. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1208. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1209. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0x1)},
  1210. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x7)},
  1211. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0x4)},
  1212. { }
  1213. };
  1214. /* Macmini 3,1 */
  1215. static const struct hda_verb alc885_macmini3_init_verbs[] = {
  1216. /* DACs */
  1217. {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1218. {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1219. {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1220. {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1221. /* Front mixer */
  1222. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1223. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1224. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1225. /* Surround mixer */
  1226. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1227. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1228. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1229. /* LFE mixer */
  1230. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1231. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1232. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1233. /* HP mixer */
  1234. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1235. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1236. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1237. /* Front Pin (0x0c) */
  1238. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
  1239. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1240. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1241. /* LFE Pin (0x0e) */
  1242. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01},
  1243. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1244. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02},
  1245. /* HP Pin (0x0f) */
  1246. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1247. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1248. {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},
  1249. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1250. /* Line In pin */
  1251. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1252. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1253. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1254. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1255. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1256. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1257. { }
  1258. };
  1259. static const struct hda_verb alc885_mba21_init_verbs[] = {
  1260. /*Internal and HP Speaker Mixer*/
  1261. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1262. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1263. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1264. /*Internal Speaker Pin (0x0c)*/
  1265. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
  1266. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1267. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1268. /* HP Pin: output 0 (0x0e) */
  1269. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
  1270. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1271. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1272. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
  1273. /* Line in (is hp when jack connected)*/
  1274. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
  1275. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1276. { }
  1277. };
  1278. /* Macbook Pro rev3 */
  1279. static const struct hda_verb alc885_mbp3_init_verbs[] = {
  1280. /* Front mixer: unmute input/output amp left and right (volume = 0) */
  1281. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1282. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1283. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1284. /* Rear mixer */
  1285. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1286. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1287. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1288. /* HP mixer */
  1289. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1290. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1291. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1292. /* Front Pin: output 0 (0x0c) */
  1293. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1294. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1295. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1296. /* HP Pin: output 0 (0x0e) */
  1297. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
  1298. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1299. {0x15, AC_VERB_SET_CONNECT_SEL, 0x02},
  1300. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1301. /* Mic (rear) pin: input vref at 80% */
  1302. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1303. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1304. /* Front Mic pin: input vref at 80% */
  1305. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1306. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1307. /* Line In pin: use output 1 when in LineOut mode */
  1308. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  1309. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1310. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
  1311. /* FIXME: use matrix-type input source selection */
  1312. /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
  1313. /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */
  1314. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1315. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1316. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1317. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1318. /* Input mixer2 */
  1319. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1320. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1321. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1322. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1323. /* Input mixer3 */
  1324. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1325. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1326. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1327. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1328. /* ADC1: mute amp left and right */
  1329. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1330. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1331. /* ADC2: mute amp left and right */
  1332. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1333. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1334. /* ADC3: mute amp left and right */
  1335. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1336. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1337. { }
  1338. };
  1339. /* iMac 9,1 */
  1340. static const struct hda_verb alc885_imac91_init_verbs[] = {
  1341. /* Internal Speaker Pin (0x0c) */
  1342. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
  1343. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1344. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1345. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
  1346. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1347. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
  1348. /* HP Pin: Rear */
  1349. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1350. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1351. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1352. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC_HP_EVENT | AC_USRSP_EN)},
  1353. /* Line in Rear */
  1354. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
  1355. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1356. /* Front Mic pin: input vref at 80% */
  1357. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1358. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1359. /* Rear mixer */
  1360. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1361. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1362. {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1363. /* Line-Out mixer: unmute input/output amp left and right (volume = 0) */
  1364. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  1365. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1366. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  1367. /* 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
  1368. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1369. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1370. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1371. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1372. /* 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
  1373. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1374. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1375. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1376. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1377. /* 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In */
  1378. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1379. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
  1380. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
  1381. {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
  1382. /* 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
  1383. {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1384. {0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
  1385. /* 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
  1386. {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1387. {0x08, AC_VERB_SET_CONNECT_SEL, 0x00},
  1388. /* 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In */
  1389. {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
  1390. {0x09, AC_VERB_SET_CONNECT_SEL, 0x00},
  1391. { }
  1392. };
  1393. /* iMac 24 mixer. */
  1394. static const struct snd_kcontrol_new alc885_imac24_mixer[] = {
  1395. HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  1396. HDA_CODEC_MUTE("Master Playback Switch", 0x0c, 0x00, HDA_INPUT),
  1397. { } /* end */
  1398. };
  1399. /* iMac 24 init verbs. */
  1400. static const struct hda_verb alc885_imac24_init_verbs[] = {
  1401. /* Internal speakers: output 0 (0x0c) */
  1402. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1403. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1404. {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
  1405. /* Internal speakers: output 0 (0x0c) */
  1406. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1407. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1408. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
  1409. /* Headphone: output 0 (0x0c) */
  1410. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1411. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1412. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1413. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1414. /* Front Mic: input vref at 80% */
  1415. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  1416. {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  1417. { }
  1418. };
  1419. /* Toggle speaker-output according to the hp-jack state */
  1420. static void alc885_imac24_setup(struct hda_codec *codec)
  1421. {
  1422. struct alc_spec *spec = codec->spec;
  1423. spec->autocfg.hp_pins[0] = 0x14;
  1424. spec->autocfg.speaker_pins[0] = 0x18;
  1425. spec->autocfg.speaker_pins[1] = 0x1a;
  1426. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1427. }
  1428. #define alc885_mb5_setup alc885_imac24_setup
  1429. #define alc885_macmini3_setup alc885_imac24_setup
  1430. /* Macbook Air 2,1 */
  1431. static void alc885_mba21_setup(struct hda_codec *codec)
  1432. {
  1433. struct alc_spec *spec = codec->spec;
  1434. spec->autocfg.hp_pins[0] = 0x14;
  1435. spec->autocfg.speaker_pins[0] = 0x18;
  1436. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1437. }
  1438. static void alc885_mbp3_setup(struct hda_codec *codec)
  1439. {
  1440. struct alc_spec *spec = codec->spec;
  1441. spec->autocfg.hp_pins[0] = 0x15;
  1442. spec->autocfg.speaker_pins[0] = 0x14;
  1443. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1444. }
  1445. static void alc885_imac91_setup(struct hda_codec *codec)
  1446. {
  1447. struct alc_spec *spec = codec->spec;
  1448. spec->autocfg.hp_pins[0] = 0x14;
  1449. spec->autocfg.speaker_pins[0] = 0x18;
  1450. spec->autocfg.speaker_pins[1] = 0x1a;
  1451. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1452. }
  1453. static const struct hda_verb alc882_targa_verbs[] = {
  1454. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1455. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1456. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1457. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1458. {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* mic/clfe */
  1459. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, /* line/surround */
  1460. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */
  1461. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1462. { } /* end */
  1463. };
  1464. /* toggle speaker-output according to the hp-jack state */
  1465. static void alc882_targa_automute(struct hda_codec *codec)
  1466. {
  1467. struct alc_spec *spec = codec->spec;
  1468. alc_hp_automute(codec);
  1469. snd_hda_codec_write_cache(codec, 1, 0, AC_VERB_SET_GPIO_DATA,
  1470. spec->hp_jack_present ? 1 : 3);
  1471. }
  1472. static void alc882_targa_setup(struct hda_codec *codec)
  1473. {
  1474. struct alc_spec *spec = codec->spec;
  1475. spec->autocfg.hp_pins[0] = 0x14;
  1476. spec->autocfg.speaker_pins[0] = 0x1b;
  1477. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1478. }
  1479. static void alc882_targa_unsol_event(struct hda_codec *codec, unsigned int res)
  1480. {
  1481. if ((res >> 26) == ALC_HP_EVENT)
  1482. alc882_targa_automute(codec);
  1483. }
  1484. static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
  1485. {
  1486. unsigned int gpiostate, gpiomask, gpiodir;
  1487. gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
  1488. AC_VERB_GET_GPIO_DATA, 0);
  1489. if (!muted)
  1490. gpiostate |= (1 << pin);
  1491. else
  1492. gpiostate &= ~(1 << pin);
  1493. gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
  1494. AC_VERB_GET_GPIO_MASK, 0);
  1495. gpiomask |= (1 << pin);
  1496. gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
  1497. AC_VERB_GET_GPIO_DIRECTION, 0);
  1498. gpiodir |= (1 << pin);
  1499. snd_hda_codec_write(codec, codec->afg, 0,
  1500. AC_VERB_SET_GPIO_MASK, gpiomask);
  1501. snd_hda_codec_write(codec, codec->afg, 0,
  1502. AC_VERB_SET_GPIO_DIRECTION, gpiodir);
  1503. msleep(1);
  1504. snd_hda_codec_write(codec, codec->afg, 0,
  1505. AC_VERB_SET_GPIO_DATA, gpiostate);
  1506. }
  1507. /* set up GPIO at initialization */
  1508. static void alc885_macpro_init_hook(struct hda_codec *codec)
  1509. {
  1510. alc882_gpio_mute(codec, 0, 0);
  1511. alc882_gpio_mute(codec, 1, 0);
  1512. }
  1513. /* set up GPIO and update auto-muting at initialization */
  1514. static void alc885_imac24_init_hook(struct hda_codec *codec)
  1515. {
  1516. alc885_macpro_init_hook(codec);
  1517. alc_hp_automute(codec);
  1518. }
  1519. /* 2ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:front) */
  1520. static const struct hda_verb alc889A_mb31_ch2_init[] = {
  1521. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
  1522. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
  1523. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
  1524. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
  1525. { } /* end */
  1526. };
  1527. /* 4ch mode (Speaker:front, Subwoofer:CLFE, Line:CLFE, Headphones:front) */
  1528. static const struct hda_verb alc889A_mb31_ch4_init[] = {
  1529. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP as front */
  1530. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
  1531. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
  1532. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
  1533. { } /* end */
  1534. };
  1535. /* 5ch mode (Speaker:front, Subwoofer:CLFE, Line:input, Headphones:rear) */
  1536. static const struct hda_verb alc889A_mb31_ch5_init[] = {
  1537. {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as rear */
  1538. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Subwoofer on */
  1539. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Line as input */
  1540. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Line off */
  1541. { } /* end */
  1542. };
  1543. /* 6ch mode (Speaker:front, Subwoofer:off, Line:CLFE, Headphones:Rear) */
  1544. static const struct hda_verb alc889A_mb31_ch6_init[] = {
  1545. {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, /* HP as front */
  1546. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Subwoofer off */
  1547. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, /* Line as output */
  1548. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, /* Line on */
  1549. { } /* end */
  1550. };
  1551. static const struct hda_channel_mode alc889A_mb31_6ch_modes[4] = {
  1552. { 2, alc889A_mb31_ch2_init },
  1553. { 4, alc889A_mb31_ch4_init },
  1554. { 5, alc889A_mb31_ch5_init },
  1555. { 6, alc889A_mb31_ch6_init },
  1556. };
  1557. #define alc883_base_mixer alc882_base_mixer
  1558. static const struct snd_kcontrol_new alc883_clevo_m720_mixer[] = {
  1559. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1560. HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
  1561. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1562. HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
  1563. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1564. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1565. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1566. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1567. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1568. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1569. { } /* end */
  1570. };
  1571. static const struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
  1572. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1573. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1574. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  1575. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1576. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1577. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1578. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1579. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1580. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1581. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1582. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1583. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1584. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1585. { } /* end */
  1586. };
  1587. static const struct snd_kcontrol_new alc883_3ST_6ch_mixer[] = {
  1588. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1589. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1590. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1591. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1592. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  1593. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  1594. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  1595. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  1596. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  1597. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1598. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1599. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1600. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1601. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1602. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1603. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1604. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1605. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1606. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1607. { } /* end */
  1608. };
  1609. static const struct snd_kcontrol_new alc883_3ST_6ch_intel_mixer[] = {
  1610. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1611. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1612. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1613. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1614. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
  1615. HDA_OUTPUT),
  1616. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  1617. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  1618. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  1619. HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
  1620. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1621. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1622. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1623. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1624. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1625. HDA_CODEC_VOLUME("Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1626. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1627. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1628. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1629. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1630. { } /* end */
  1631. };
  1632. static const struct snd_kcontrol_new alc885_8ch_intel_mixer[] = {
  1633. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1634. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1635. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1636. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1637. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0,
  1638. HDA_OUTPUT),
  1639. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  1640. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  1641. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  1642. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  1643. HDA_BIND_MUTE("Speaker Playback Switch", 0x0f, 2, HDA_INPUT),
  1644. HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
  1645. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1646. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1647. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x3, HDA_INPUT),
  1648. HDA_CODEC_VOLUME("Mic Boost Volume", 0x1b, 0, HDA_INPUT),
  1649. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x3, HDA_INPUT),
  1650. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1651. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1652. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1653. { } /* end */
  1654. };
  1655. static const struct snd_kcontrol_new alc883_fivestack_mixer[] = {
  1656. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1657. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1658. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1659. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1660. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  1661. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  1662. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  1663. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  1664. HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  1665. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1666. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1667. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1668. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1669. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1670. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1671. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1672. HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1673. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1674. HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1675. { } /* end */
  1676. };
  1677. static const struct snd_kcontrol_new alc883_targa_mixer[] = {
  1678. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1679. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1680. HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  1681. HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  1682. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
  1683. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 2, HDA_INPUT),
  1684. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
  1685. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),
  1686. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  1687. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT),
  1688. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1689. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1690. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1691. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1692. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1693. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1694. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1695. { } /* end */
  1696. };
  1697. static const struct snd_kcontrol_new alc883_targa_2ch_mixer[] = {
  1698. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1699. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1700. HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  1701. HDA_CODEC_MUTE("Speaker Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
  1702. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1703. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1704. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1705. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1706. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1707. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1708. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1709. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1710. { } /* end */
  1711. };
  1712. static const struct snd_kcontrol_new alc883_targa_8ch_mixer[] = {
  1713. HDA_CODEC_VOLUME("Side Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  1714. HDA_BIND_MUTE("Side Playback Switch", 0x0f, 2, HDA_INPUT),
  1715. HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
  1716. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  1717. HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
  1718. { } /* end */
  1719. };
  1720. static const struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
  1721. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1722. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
  1723. HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  1724. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1725. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1726. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1727. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1728. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1729. { } /* end */
  1730. };
  1731. static const struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
  1732. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
  1733. HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
  1734. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1735. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1736. HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
  1737. HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
  1738. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
  1739. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  1740. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
  1741. { } /* end */
  1742. };
  1743. static const struct snd_kcontrol_new alc889A_mb31_mixer[] = {
  1744. /* Output mixers */
  1745. HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  1746. HDA_BIND_MUTE("Front Playback Switch", 0x0c, 0x02, HDA_INPUT),
  1747. HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT),
  1748. HDA_BIND_MUTE("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),
  1749. HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x00,
  1750. HDA_OUTPUT),
  1751. HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 0x02, HDA_INPUT),
  1752. HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x00, HDA_OUTPUT),
  1753. HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 0x02, HDA_INPUT),
  1754. /* Output switches */
  1755. HDA_CODEC_MUTE("Enable Speaker", 0x14, 0x00, HDA_OUTPUT),
  1756. HDA_CODEC_MUTE("Enable Headphones", 0x15, 0x00, HDA_OUTPUT),
  1757. HDA_CODEC_MUTE_MONO("Enable LFE", 0x16, 2, 0x00, HDA_OUTPUT),
  1758. /* Boost mixers */
  1759. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0x00, HDA_INPUT),
  1760. HDA_CODEC_VOLUME("Line Boost Volume", 0x1a, 0x00, HDA_INPUT),
  1761. /* Input mixers */
  1762. HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x00, HDA_INPUT),
  1763. HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x00, HDA_INPUT),
  1764. HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
  1765. HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
  1766. { } /* end */
  1767. };
  1768. static const struct hda_bind_ctls alc883_bind_cap_vol = {
  1769. .ops = &snd_hda_bind_vol,
  1770. .values = {
  1771. HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
  1772. HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
  1773. 0
  1774. },
  1775. };
  1776. static const struct hda_bind_ctls alc883_bind_cap_switch = {
  1777. .ops = &snd_hda_bind_sw,
  1778. .values = {
  1779. HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
  1780. HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
  1781. 0
  1782. },
  1783. };
  1784. static const struct snd_kcontrol_new alc883_chmode_mixer[] = {
  1785. {
  1786. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  1787. .name = "Channel Mode",
  1788. .info = alc_ch_mode_info,
  1789. .get = alc_ch_mode_get,
  1790. .put = alc_ch_mode_put,
  1791. },
  1792. { } /* end */
  1793. };
  1794. static const struct hda_verb alc883_clevo_m540r_verbs[] = {
  1795. /* HP */
  1796. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  1797. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1798. /* Int speaker */
  1799. /*{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},*/
  1800. /* enable unsolicited event */
  1801. /*
  1802. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1803. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
  1804. */
  1805. { } /* end */
  1806. };
  1807. static const struct hda_verb alc883_clevo_m720_verbs[] = {
  1808. /* HP */
  1809. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  1810. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1811. /* Int speaker */
  1812. {0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
  1813. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1814. /* enable unsolicited event */
  1815. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1816. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
  1817. { } /* end */
  1818. };
  1819. static const struct hda_verb alc883_targa_verbs[] = {
  1820. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  1821. {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
  1822. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1823. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1824. /* Connect Line-Out side jack (SPDIF) to Side */
  1825. {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1826. {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1827. {0x17, AC_VERB_SET_CONNECT_SEL, 0x03},
  1828. /* Connect Mic jack to CLFE */
  1829. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1830. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1831. {0x18, AC_VERB_SET_CONNECT_SEL, 0x02},
  1832. /* Connect Line-in jack to Surround */
  1833. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1834. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1835. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01},
  1836. /* Connect HP out jack to Front */
  1837. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1838. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1839. {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00},
  1840. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1841. { } /* end */
  1842. };
  1843. static const struct hda_verb alc888_6st_dell_verbs[] = {
  1844. {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1845. { }
  1846. };
  1847. static void alc888_3st_hp_setup(struct hda_codec *codec)
  1848. {
  1849. struct alc_spec *spec = codec->spec;
  1850. spec->autocfg.hp_pins[0] = 0x1b;
  1851. spec->autocfg.speaker_pins[0] = 0x14;
  1852. spec->autocfg.speaker_pins[1] = 0x16;
  1853. spec->autocfg.speaker_pins[2] = 0x18;
  1854. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1855. }
  1856. static const struct hda_verb alc888_3st_hp_verbs[] = {
  1857. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
  1858. {0x16, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
  1859. {0x18, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
  1860. {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1861. { } /* end */
  1862. };
  1863. /*
  1864. * 2ch mode
  1865. */
  1866. static const struct hda_verb alc888_3st_hp_2ch_init[] = {
  1867. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  1868. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  1869. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
  1870. { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  1871. { } /* end */
  1872. };
  1873. /*
  1874. * 4ch mode
  1875. */
  1876. static const struct hda_verb alc888_3st_hp_4ch_init[] = {
  1877. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
  1878. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
  1879. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  1880. { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  1881. { 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
  1882. { } /* end */
  1883. };
  1884. /*
  1885. * 6ch mode
  1886. */
  1887. static const struct hda_verb alc888_3st_hp_6ch_init[] = {
  1888. { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  1889. { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  1890. { 0x18, AC_VERB_SET_CONNECT_SEL, 0x02 },
  1891. { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
  1892. { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
  1893. { 0x16, AC_VERB_SET_CONNECT_SEL, 0x01 },
  1894. { } /* end */
  1895. };
  1896. static const struct hda_channel_mode alc888_3st_hp_modes[3] = {
  1897. { 2, alc888_3st_hp_2ch_init },
  1898. { 4, alc888_3st_hp_4ch_init },
  1899. { 6, alc888_3st_hp_6ch_init },
  1900. };
  1901. /* toggle speaker-output according to the hp-jack state */
  1902. #define alc883_targa_init_hook alc882_targa_init_hook
  1903. #define alc883_targa_unsol_event alc882_targa_unsol_event
  1904. static void alc883_clevo_m720_setup(struct hda_codec *codec)
  1905. {
  1906. struct alc_spec *spec = codec->spec;
  1907. spec->autocfg.hp_pins[0] = 0x15;
  1908. spec->autocfg.speaker_pins[0] = 0x14;
  1909. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1910. }
  1911. static void alc883_clevo_m720_init_hook(struct hda_codec *codec)
  1912. {
  1913. alc_hp_automute(codec);
  1914. alc88x_simple_mic_automute(codec);
  1915. }
  1916. static void alc883_clevo_m720_unsol_event(struct hda_codec *codec,
  1917. unsigned int res)
  1918. {
  1919. switch (res >> 26) {
  1920. case ALC_MIC_EVENT:
  1921. alc88x_simple_mic_automute(codec);
  1922. break;
  1923. default:
  1924. alc_sku_unsol_event(codec, res);
  1925. break;
  1926. }
  1927. }
  1928. /* toggle speaker-output according to the hp-jack state */
  1929. static void alc883_acer_aspire_setup(struct hda_codec *codec)
  1930. {
  1931. struct alc_spec *spec = codec->spec;
  1932. spec->autocfg.hp_pins[0] = 0x14;
  1933. spec->autocfg.speaker_pins[0] = 0x15;
  1934. spec->autocfg.speaker_pins[1] = 0x16;
  1935. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1936. }
  1937. static const struct hda_verb alc883_acer_eapd_verbs[] = {
  1938. /* HP Pin: output 0 (0x0c) */
  1939. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  1940. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  1941. {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
  1942. /* Front Pin: output 0 (0x0c) */
  1943. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1944. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
  1945. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  1946. {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
  1947. /* eanable EAPD on medion laptop */
  1948. {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
  1949. {0x20, AC_VERB_SET_PROC_COEF, 0x3050},
  1950. /* enable unsolicited event */
  1951. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1952. { }
  1953. };
  1954. static void alc888_6st_dell_setup(struct hda_codec *codec)
  1955. {
  1956. struct alc_spec *spec = codec->spec;
  1957. spec->autocfg.hp_pins[0] = 0x1b;
  1958. spec->autocfg.speaker_pins[0] = 0x14;
  1959. spec->autocfg.speaker_pins[1] = 0x15;
  1960. spec->autocfg.speaker_pins[2] = 0x16;
  1961. spec->autocfg.speaker_pins[3] = 0x17;
  1962. alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
  1963. }
  1964. static const struct hda_verb alc889A_mb31_verbs[] = {
  1965. /* Init rear pin (used as headphone output) */
  1966. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, /* Apple Headphones */
  1967. {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Connect to front */
  1968. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  1969. /* Init line pin (used as output in 4ch and 6ch mode) */
  1970. {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, /* Connect to CLFE */
  1971. /* Init line 2 pin (used as headphone out by default) */
  1972. {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Use as input */
  1973. {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, /* Mute output */
  1974. { } /* end */
  1975. };
  1976. /* Mute speakers according to the headphone jack state */
  1977. static void alc889A_mb31_automute(struct hda_codec *codec)
  1978. {
  1979. unsigned int present;
  1980. /* Mute only in 2ch or 4ch mode */
  1981. if (snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_CONNECT_SEL, 0)
  1982. == 0x00) {
  1983. present = snd_hda_jack_detect(codec, 0x15);
  1984. snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
  1985. HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
  1986. snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0,
  1987. HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
  1988. }
  1989. }
  1990. static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
  1991. {
  1992. if ((res >> 26) == ALC_HP_EVENT)
  1993. alc889A_mb31_automute(codec);
  1994. }
  1995. static const hda_nid_t alc883_slave_dig_outs[] = {
  1996. ALC1200_DIGOUT_NID, 0,
  1997. };
  1998. static const hda_nid_t alc1200_slave_dig_outs[] = {
  1999. ALC883_DIGOUT_NID, 0,
  2000. };
  2001. /*
  2002. * configuration and preset
  2003. */
  2004. static const char * const alc882_models[ALC882_MODEL_LAST] = {
  2005. [ALC882_3ST_DIG] = "3stack-dig",
  2006. [ALC882_6ST_DIG] = "6stack-dig",
  2007. [ALC882_W2JC] = "w2jc",
  2008. [ALC882_TARGA] = "targa",
  2009. [ALC885_MACPRO] = "macpro",
  2010. [ALC885_MB5] = "mb5",
  2011. [ALC885_MACMINI3] = "macmini3",
  2012. [ALC885_MBA21] = "mba21",
  2013. [ALC885_MBP3] = "mbp3",
  2014. [ALC885_IMAC24] = "imac24",
  2015. [ALC885_IMAC91] = "imac91",
  2016. [ALC883_3ST_2ch_DIG] = "3stack-2ch-dig",
  2017. [ALC883_3ST_6ch_DIG] = "3stack-6ch-dig",
  2018. [ALC883_3ST_6ch] = "3stack-6ch",
  2019. [ALC883_6ST_DIG] = "alc883-6stack-dig",
  2020. [ALC883_TARGA_DIG] = "targa-dig",
  2021. [ALC883_TARGA_2ch_DIG] = "targa-2ch-dig",
  2022. [ALC883_TARGA_8ch_DIG] = "targa-8ch-dig",
  2023. [ALC883_ACER] = "acer",
  2024. [ALC883_ACER_ASPIRE] = "acer-aspire",
  2025. [ALC888_ACER_ASPIRE_4930G] = "acer-aspire-4930g",
  2026. [ALC888_ACER_ASPIRE_6530G] = "acer-aspire-6530g",
  2027. [ALC888_ACER_ASPIRE_8930G] = "acer-aspire-8930g",
  2028. [ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g",
  2029. [ALC888_3ST_HP] = "3stack-hp",
  2030. [ALC888_6ST_DELL] = "6stack-dell",
  2031. [ALC883_CLEVO_M540R] = "clevo-m540r",
  2032. [ALC883_CLEVO_M720] = "clevo-m720",
  2033. [ALC883_3ST_6ch_INTEL] = "3stack-6ch-intel",
  2034. [ALC889A_INTEL] = "intel-alc889a",
  2035. [ALC889_INTEL] = "intel-x58",
  2036. [ALC889A_MB31] = "mb31",
  2037. [ALC882_AUTO] = "auto",
  2038. };
  2039. static const struct snd_pci_quirk alc882_cfg_tbl[] = {
  2040. SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC882_6ST_DIG),
  2041. SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
  2042. SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
  2043. SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_ACER_ASPIRE),
  2044. SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
  2045. SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
  2046. SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
  2047. SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
  2048. ALC888_ACER_ASPIRE_4930G),
  2049. SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
  2050. ALC888_ACER_ASPIRE_4930G),
  2051. SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
  2052. ALC888_ACER_ASPIRE_8930G),
  2053. SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
  2054. ALC888_ACER_ASPIRE_8930G),
  2055. SND_PCI_QUIRK(0x1025, 0x0157, "Acer X3200", ALC882_AUTO),
  2056. SND_PCI_QUIRK(0x1025, 0x0158, "Acer AX1700-U3700A", ALC882_AUTO),
  2057. SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
  2058. ALC888_ACER_ASPIRE_6530G),
  2059. SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
  2060. ALC888_ACER_ASPIRE_6530G),
  2061. SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
  2062. ALC888_ACER_ASPIRE_7730G),
  2063. /* default Acer -- disabled as it causes more problems.
  2064. * model=auto should work fine now
  2065. */
  2066. /* SND_PCI_QUIRK_VENDOR(0x1025, "Acer laptop", ALC883_ACER), */
  2067. SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
  2068. SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavilion", ALC883_6ST_DIG),
  2069. SND_PCI_QUIRK(0x103c, 0x2a4f, "HP Samba", ALC888_3ST_HP),
  2070. SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP),
  2071. SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG),
  2072. SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP),
  2073. SND_PCI_QUIRK(0x103c, 0x2a72, "HP Educ.ar", ALC888_3ST_HP),
  2074. SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_W2JC),
  2075. SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
  2076. SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
  2077. SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
  2078. SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG),
  2079. SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
  2080. SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
  2081. SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
  2082. SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
  2083. SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
  2084. SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
  2085. SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
  2086. SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
  2087. SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
  2088. SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
  2089. SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
  2090. SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
  2091. SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
  2092. SND_PCI_QUIRK(0x1462, 0x3b7f, "MSI", ALC883_TARGA_2ch_DIG),
  2093. SND_PCI_QUIRK(0x1462, 0x3ef9, "MSI", ALC883_TARGA_DIG),
  2094. SND_PCI_QUIRK(0x1462, 0x3fc1, "MSI", ALC883_TARGA_DIG),
  2095. SND_PCI_QUIRK(0x1462, 0x3fc3, "MSI", ALC883_TARGA_DIG),
  2096. SND_PCI_QUIRK(0x1462, 0x3fcc, "MSI", ALC883_TARGA_DIG),
  2097. SND_PCI_QUIRK(0x1462, 0x3fdf, "MSI", ALC883_TARGA_DIG),
  2098. SND_PCI_QUIRK(0x1462, 0x42cd, "MSI", ALC883_TARGA_DIG),
  2099. SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
  2100. SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
  2101. SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
  2102. SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG),
  2103. SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG),
  2104. SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
  2105. SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
  2106. SND_PCI_QUIRK(0x1462, 0x7250, "MSI", ALC883_6ST_DIG),
  2107. SND_PCI_QUIRK(0x1462, 0x7260, "MSI 7260", ALC883_TARGA_DIG),
  2108. SND_PCI_QUIRK(0x1462, 0x7267, "MSI", ALC883_3ST_6ch_DIG),
  2109. SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
  2110. SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
  2111. SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
  2112. SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG),
  2113. SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
  2114. SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
  2115. SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
  2116. SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG),
  2117. SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720),
  2118. SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720),
  2119. SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R),
  2120. SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
  2121. SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
  2122. SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
  2123. SND_PCI_QUIRK(0x8086, 0x0002, "DG33FBC", ALC883_3ST_6ch_INTEL),
  2124. SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL),
  2125. SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL),
  2126. SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL),
  2127. SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG),
  2128. {}
  2129. };
  2130. /* codec SSID table for Intel Mac */
  2131. static const struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
  2132. SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC885_MBP3),
  2133. SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC885_MBP3),
  2134. SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC885_MBP3),
  2135. SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_MACPRO),
  2136. SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
  2137. SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
  2138. SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
  2139. SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
  2140. SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC885_MBP3),
  2141. SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC885_MBA21),
  2142. SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
  2143. SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
  2144. SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
  2145. SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91),
  2146. SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
  2147. SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5),
  2148. /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
  2149. * so apparently no perfect solution yet
  2150. */
  2151. SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
  2152. SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
  2153. SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3),
  2154. {} /* terminator */
  2155. };
  2156. static const struct alc_config_preset alc882_presets[] = {
  2157. [ALC882_3ST_DIG] = {
  2158. .mixers = { alc882_base_mixer },
  2159. .init_verbs = { alc882_base_init_verbs,
  2160. alc882_adc1_init_verbs },
  2161. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2162. .dac_nids = alc882_dac_nids,
  2163. .dig_out_nid = ALC882_DIGOUT_NID,
  2164. .dig_in_nid = ALC882_DIGIN_NID,
  2165. .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
  2166. .channel_mode = alc882_ch_modes,
  2167. .need_dac_fix = 1,
  2168. .input_mux = &alc882_capture_source,
  2169. },
  2170. [ALC882_6ST_DIG] = {
  2171. .mixers = { alc882_base_mixer, alc882_chmode_mixer },
  2172. .init_verbs = { alc882_base_init_verbs,
  2173. alc882_adc1_init_verbs },
  2174. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2175. .dac_nids = alc882_dac_nids,
  2176. .dig_out_nid = ALC882_DIGOUT_NID,
  2177. .dig_in_nid = ALC882_DIGIN_NID,
  2178. .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
  2179. .channel_mode = alc882_sixstack_modes,
  2180. .input_mux = &alc882_capture_source,
  2181. },
  2182. [ALC882_W2JC] = {
  2183. .mixers = { alc882_w2jc_mixer, alc882_chmode_mixer },
  2184. .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
  2185. alc882_eapd_verbs, alc880_gpio1_init_verbs },
  2186. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2187. .dac_nids = alc882_dac_nids,
  2188. .num_channel_mode = ARRAY_SIZE(alc880_threestack_modes),
  2189. .channel_mode = alc880_threestack_modes,
  2190. .need_dac_fix = 1,
  2191. .input_mux = &alc882_capture_source,
  2192. .dig_out_nid = ALC882_DIGOUT_NID,
  2193. },
  2194. [ALC885_MBA21] = {
  2195. .mixers = { alc885_mba21_mixer },
  2196. .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
  2197. .num_dacs = 2,
  2198. .dac_nids = alc882_dac_nids,
  2199. .channel_mode = alc885_mba21_ch_modes,
  2200. .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
  2201. .input_mux = &alc882_capture_source,
  2202. .unsol_event = alc_sku_unsol_event,
  2203. .setup = alc885_mba21_setup,
  2204. .init_hook = alc_hp_automute,
  2205. },
  2206. [ALC885_MBP3] = {
  2207. .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
  2208. .init_verbs = { alc885_mbp3_init_verbs,
  2209. alc880_gpio1_init_verbs },
  2210. .num_dacs = 2,
  2211. .dac_nids = alc882_dac_nids,
  2212. .hp_nid = 0x04,
  2213. .channel_mode = alc885_mbp_4ch_modes,
  2214. .num_channel_mode = ARRAY_SIZE(alc885_mbp_4ch_modes),
  2215. .input_mux = &alc882_capture_source,
  2216. .dig_out_nid = ALC882_DIGOUT_NID,
  2217. .dig_in_nid = ALC882_DIGIN_NID,
  2218. .unsol_event = alc_sku_unsol_event,
  2219. .setup = alc885_mbp3_setup,
  2220. .init_hook = alc_hp_automute,
  2221. },
  2222. [ALC885_MB5] = {
  2223. .mixers = { alc885_mb5_mixer, alc882_chmode_mixer },
  2224. .init_verbs = { alc885_mb5_init_verbs,
  2225. alc880_gpio1_init_verbs },
  2226. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2227. .dac_nids = alc882_dac_nids,
  2228. .channel_mode = alc885_mb5_6ch_modes,
  2229. .num_channel_mode = ARRAY_SIZE(alc885_mb5_6ch_modes),
  2230. .input_mux = &mb5_capture_source,
  2231. .dig_out_nid = ALC882_DIGOUT_NID,
  2232. .dig_in_nid = ALC882_DIGIN_NID,
  2233. .unsol_event = alc_sku_unsol_event,
  2234. .setup = alc885_mb5_setup,
  2235. .init_hook = alc_hp_automute,
  2236. },
  2237. [ALC885_MACMINI3] = {
  2238. .mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
  2239. .init_verbs = { alc885_macmini3_init_verbs,
  2240. alc880_gpio1_init_verbs },
  2241. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2242. .dac_nids = alc882_dac_nids,
  2243. .channel_mode = alc885_macmini3_6ch_modes,
  2244. .num_channel_mode = ARRAY_SIZE(alc885_macmini3_6ch_modes),
  2245. .input_mux = &macmini3_capture_source,
  2246. .dig_out_nid = ALC882_DIGOUT_NID,
  2247. .dig_in_nid = ALC882_DIGIN_NID,
  2248. .unsol_event = alc_sku_unsol_event,
  2249. .setup = alc885_macmini3_setup,
  2250. .init_hook = alc_hp_automute,
  2251. },
  2252. [ALC885_MACPRO] = {
  2253. .mixers = { alc882_macpro_mixer },
  2254. .init_verbs = { alc882_macpro_init_verbs },
  2255. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2256. .dac_nids = alc882_dac_nids,
  2257. .dig_out_nid = ALC882_DIGOUT_NID,
  2258. .dig_in_nid = ALC882_DIGIN_NID,
  2259. .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
  2260. .channel_mode = alc882_ch_modes,
  2261. .input_mux = &alc882_capture_source,
  2262. .init_hook = alc885_macpro_init_hook,
  2263. },
  2264. [ALC885_IMAC24] = {
  2265. .mixers = { alc885_imac24_mixer },
  2266. .init_verbs = { alc885_imac24_init_verbs },
  2267. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2268. .dac_nids = alc882_dac_nids,
  2269. .dig_out_nid = ALC882_DIGOUT_NID,
  2270. .dig_in_nid = ALC882_DIGIN_NID,
  2271. .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
  2272. .channel_mode = alc882_ch_modes,
  2273. .input_mux = &alc882_capture_source,
  2274. .unsol_event = alc_sku_unsol_event,
  2275. .setup = alc885_imac24_setup,
  2276. .init_hook = alc885_imac24_init_hook,
  2277. },
  2278. [ALC885_IMAC91] = {
  2279. .mixers = {alc885_imac91_mixer},
  2280. .init_verbs = { alc885_imac91_init_verbs,
  2281. alc880_gpio1_init_verbs },
  2282. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2283. .dac_nids = alc882_dac_nids,
  2284. .channel_mode = alc885_mba21_ch_modes,
  2285. .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
  2286. .input_mux = &alc889A_imac91_capture_source,
  2287. .dig_out_nid = ALC882_DIGOUT_NID,
  2288. .dig_in_nid = ALC882_DIGIN_NID,
  2289. .unsol_event = alc_sku_unsol_event,
  2290. .setup = alc885_imac91_setup,
  2291. .init_hook = alc_hp_automute,
  2292. },
  2293. [ALC882_TARGA] = {
  2294. .mixers = { alc882_targa_mixer, alc882_chmode_mixer },
  2295. .init_verbs = { alc882_base_init_verbs, alc882_adc1_init_verbs,
  2296. alc880_gpio3_init_verbs, alc882_targa_verbs},
  2297. .num_dacs = ARRAY_SIZE(alc882_dac_nids),
  2298. .dac_nids = alc882_dac_nids,
  2299. .dig_out_nid = ALC882_DIGOUT_NID,
  2300. .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
  2301. .adc_nids = alc882_adc_nids,
  2302. .capsrc_nids = alc882_capsrc_nids,
  2303. .num_channel_mode = ARRAY_SIZE(alc882_3ST_6ch_modes),
  2304. .channel_mode = alc882_3ST_6ch_modes,
  2305. .need_dac_fix = 1,
  2306. .input_mux = &alc882_capture_source,
  2307. .unsol_event = alc_sku_unsol_event,
  2308. .setup = alc882_targa_setup,
  2309. .init_hook = alc882_targa_automute,
  2310. },
  2311. [ALC883_3ST_2ch_DIG] = {
  2312. .mixers = { alc883_3ST_2ch_mixer },
  2313. .init_verbs = { alc883_init_verbs },
  2314. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2315. .dac_nids = alc883_dac_nids,
  2316. .dig_out_nid = ALC883_DIGOUT_NID,
  2317. .dig_in_nid = ALC883_DIGIN_NID,
  2318. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2319. .channel_mode = alc883_3ST_2ch_modes,
  2320. .input_mux = &alc883_capture_source,
  2321. },
  2322. [ALC883_3ST_6ch_DIG] = {
  2323. .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
  2324. .init_verbs = { alc883_init_verbs },
  2325. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2326. .dac_nids = alc883_dac_nids,
  2327. .dig_out_nid = ALC883_DIGOUT_NID,
  2328. .dig_in_nid = ALC883_DIGIN_NID,
  2329. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2330. .channel_mode = alc883_3ST_6ch_modes,
  2331. .need_dac_fix = 1,
  2332. .input_mux = &alc883_capture_source,
  2333. },
  2334. [ALC883_3ST_6ch] = {
  2335. .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
  2336. .init_verbs = { alc883_init_verbs },
  2337. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2338. .dac_nids = alc883_dac_nids,
  2339. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2340. .channel_mode = alc883_3ST_6ch_modes,
  2341. .need_dac_fix = 1,
  2342. .input_mux = &alc883_capture_source,
  2343. },
  2344. [ALC883_3ST_6ch_INTEL] = {
  2345. .mixers = { alc883_3ST_6ch_intel_mixer, alc883_chmode_mixer },
  2346. .init_verbs = { alc883_init_verbs },
  2347. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2348. .dac_nids = alc883_dac_nids,
  2349. .dig_out_nid = ALC883_DIGOUT_NID,
  2350. .dig_in_nid = ALC883_DIGIN_NID,
  2351. .slave_dig_outs = alc883_slave_dig_outs,
  2352. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_intel_modes),
  2353. .channel_mode = alc883_3ST_6ch_intel_modes,
  2354. .need_dac_fix = 1,
  2355. .input_mux = &alc883_3stack_6ch_intel,
  2356. },
  2357. [ALC889A_INTEL] = {
  2358. .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
  2359. .init_verbs = { alc885_init_verbs, alc885_init_input_verbs,
  2360. alc_hp15_unsol_verbs },
  2361. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2362. .dac_nids = alc883_dac_nids,
  2363. .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
  2364. .adc_nids = alc889_adc_nids,
  2365. .dig_out_nid = ALC883_DIGOUT_NID,
  2366. .dig_in_nid = ALC883_DIGIN_NID,
  2367. .slave_dig_outs = alc883_slave_dig_outs,
  2368. .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
  2369. .channel_mode = alc889_8ch_intel_modes,
  2370. .capsrc_nids = alc889_capsrc_nids,
  2371. .input_mux = &alc889_capture_source,
  2372. .setup = alc889_automute_setup,
  2373. .init_hook = alc_hp_automute,
  2374. .unsol_event = alc_sku_unsol_event,
  2375. .need_dac_fix = 1,
  2376. },
  2377. [ALC889_INTEL] = {
  2378. .mixers = { alc885_8ch_intel_mixer, alc883_chmode_mixer },
  2379. .init_verbs = { alc885_init_verbs, alc889_init_input_verbs,
  2380. alc889_eapd_verbs, alc_hp15_unsol_verbs},
  2381. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2382. .dac_nids = alc883_dac_nids,
  2383. .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
  2384. .adc_nids = alc889_adc_nids,
  2385. .dig_out_nid = ALC883_DIGOUT_NID,
  2386. .dig_in_nid = ALC883_DIGIN_NID,
  2387. .slave_dig_outs = alc883_slave_dig_outs,
  2388. .num_channel_mode = ARRAY_SIZE(alc889_8ch_intel_modes),
  2389. .channel_mode = alc889_8ch_intel_modes,
  2390. .capsrc_nids = alc889_capsrc_nids,
  2391. .input_mux = &alc889_capture_source,
  2392. .setup = alc889_automute_setup,
  2393. .init_hook = alc889_intel_init_hook,
  2394. .unsol_event = alc_sku_unsol_event,
  2395. .need_dac_fix = 1,
  2396. },
  2397. [ALC883_6ST_DIG] = {
  2398. .mixers = { alc883_base_mixer, alc883_chmode_mixer },
  2399. .init_verbs = { alc883_init_verbs },
  2400. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2401. .dac_nids = alc883_dac_nids,
  2402. .dig_out_nid = ALC883_DIGOUT_NID,
  2403. .dig_in_nid = ALC883_DIGIN_NID,
  2404. .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
  2405. .channel_mode = alc883_sixstack_modes,
  2406. .input_mux = &alc883_capture_source,
  2407. },
  2408. [ALC883_TARGA_DIG] = {
  2409. .mixers = { alc883_targa_mixer, alc883_chmode_mixer },
  2410. .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
  2411. alc883_targa_verbs},
  2412. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2413. .dac_nids = alc883_dac_nids,
  2414. .dig_out_nid = ALC883_DIGOUT_NID,
  2415. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2416. .channel_mode = alc883_3ST_6ch_modes,
  2417. .need_dac_fix = 1,
  2418. .input_mux = &alc883_capture_source,
  2419. .unsol_event = alc883_targa_unsol_event,
  2420. .setup = alc882_targa_setup,
  2421. .init_hook = alc882_targa_automute,
  2422. },
  2423. [ALC883_TARGA_2ch_DIG] = {
  2424. .mixers = { alc883_targa_2ch_mixer},
  2425. .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
  2426. alc883_targa_verbs},
  2427. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2428. .dac_nids = alc883_dac_nids,
  2429. .adc_nids = alc883_adc_nids_alt,
  2430. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_alt),
  2431. .capsrc_nids = alc883_capsrc_nids,
  2432. .dig_out_nid = ALC883_DIGOUT_NID,
  2433. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2434. .channel_mode = alc883_3ST_2ch_modes,
  2435. .input_mux = &alc883_capture_source,
  2436. .unsol_event = alc883_targa_unsol_event,
  2437. .setup = alc882_targa_setup,
  2438. .init_hook = alc882_targa_automute,
  2439. },
  2440. [ALC883_TARGA_8ch_DIG] = {
  2441. .mixers = { alc883_targa_mixer, alc883_targa_8ch_mixer,
  2442. alc883_chmode_mixer },
  2443. .init_verbs = { alc883_init_verbs, alc880_gpio3_init_verbs,
  2444. alc883_targa_verbs },
  2445. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2446. .dac_nids = alc883_dac_nids,
  2447. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
  2448. .adc_nids = alc883_adc_nids_rev,
  2449. .capsrc_nids = alc883_capsrc_nids_rev,
  2450. .dig_out_nid = ALC883_DIGOUT_NID,
  2451. .dig_in_nid = ALC883_DIGIN_NID,
  2452. .num_channel_mode = ARRAY_SIZE(alc883_4ST_8ch_modes),
  2453. .channel_mode = alc883_4ST_8ch_modes,
  2454. .need_dac_fix = 1,
  2455. .input_mux = &alc883_capture_source,
  2456. .unsol_event = alc883_targa_unsol_event,
  2457. .setup = alc882_targa_setup,
  2458. .init_hook = alc882_targa_automute,
  2459. },
  2460. [ALC883_ACER] = {
  2461. .mixers = { alc883_base_mixer },
  2462. /* On TravelMate laptops, GPIO 0 enables the internal speaker
  2463. * and the headphone jack. Turn this on and rely on the
  2464. * standard mute methods whenever the user wants to turn
  2465. * these outputs off.
  2466. */
  2467. .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs },
  2468. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2469. .dac_nids = alc883_dac_nids,
  2470. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2471. .channel_mode = alc883_3ST_2ch_modes,
  2472. .input_mux = &alc883_capture_source,
  2473. },
  2474. [ALC883_ACER_ASPIRE] = {
  2475. .mixers = { alc883_acer_aspire_mixer },
  2476. .init_verbs = { alc883_init_verbs, alc883_acer_eapd_verbs },
  2477. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2478. .dac_nids = alc883_dac_nids,
  2479. .dig_out_nid = ALC883_DIGOUT_NID,
  2480. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2481. .channel_mode = alc883_3ST_2ch_modes,
  2482. .input_mux = &alc883_capture_source,
  2483. .unsol_event = alc_sku_unsol_event,
  2484. .setup = alc883_acer_aspire_setup,
  2485. .init_hook = alc_hp_automute,
  2486. },
  2487. [ALC888_ACER_ASPIRE_4930G] = {
  2488. .mixers = { alc888_acer_aspire_4930g_mixer,
  2489. alc883_chmode_mixer },
  2490. .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
  2491. alc888_acer_aspire_4930g_verbs },
  2492. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2493. .dac_nids = alc883_dac_nids,
  2494. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
  2495. .adc_nids = alc883_adc_nids_rev,
  2496. .capsrc_nids = alc883_capsrc_nids_rev,
  2497. .dig_out_nid = ALC883_DIGOUT_NID,
  2498. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2499. .channel_mode = alc883_3ST_6ch_modes,
  2500. .need_dac_fix = 1,
  2501. .const_channel_count = 6,
  2502. .num_mux_defs =
  2503. ARRAY_SIZE(alc888_2_capture_sources),
  2504. .input_mux = alc888_2_capture_sources,
  2505. .unsol_event = alc_sku_unsol_event,
  2506. .setup = alc888_acer_aspire_4930g_setup,
  2507. .init_hook = alc_hp_automute,
  2508. },
  2509. [ALC888_ACER_ASPIRE_6530G] = {
  2510. .mixers = { alc888_acer_aspire_6530_mixer },
  2511. .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
  2512. alc888_acer_aspire_6530g_verbs },
  2513. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2514. .dac_nids = alc883_dac_nids,
  2515. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
  2516. .adc_nids = alc883_adc_nids_rev,
  2517. .capsrc_nids = alc883_capsrc_nids_rev,
  2518. .dig_out_nid = ALC883_DIGOUT_NID,
  2519. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2520. .channel_mode = alc883_3ST_2ch_modes,
  2521. .num_mux_defs =
  2522. ARRAY_SIZE(alc888_2_capture_sources),
  2523. .input_mux = alc888_acer_aspire_6530_sources,
  2524. .unsol_event = alc_sku_unsol_event,
  2525. .setup = alc888_acer_aspire_6530g_setup,
  2526. .init_hook = alc_hp_automute,
  2527. },
  2528. [ALC888_ACER_ASPIRE_8930G] = {
  2529. .mixers = { alc889_acer_aspire_8930g_mixer,
  2530. alc883_chmode_mixer },
  2531. .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
  2532. alc889_acer_aspire_8930g_verbs,
  2533. alc889_eapd_verbs},
  2534. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2535. .dac_nids = alc883_dac_nids,
  2536. .num_adc_nids = ARRAY_SIZE(alc889_adc_nids),
  2537. .adc_nids = alc889_adc_nids,
  2538. .capsrc_nids = alc889_capsrc_nids,
  2539. .dig_out_nid = ALC883_DIGOUT_NID,
  2540. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2541. .channel_mode = alc883_3ST_6ch_modes,
  2542. .need_dac_fix = 1,
  2543. .const_channel_count = 6,
  2544. .num_mux_defs =
  2545. ARRAY_SIZE(alc889_capture_sources),
  2546. .input_mux = alc889_capture_sources,
  2547. .unsol_event = alc_sku_unsol_event,
  2548. .setup = alc889_acer_aspire_8930g_setup,
  2549. .init_hook = alc_hp_automute,
  2550. #ifdef CONFIG_SND_HDA_POWER_SAVE
  2551. .power_hook = alc_power_eapd,
  2552. #endif
  2553. },
  2554. [ALC888_ACER_ASPIRE_7730G] = {
  2555. .mixers = { alc883_3ST_6ch_mixer,
  2556. alc883_chmode_mixer },
  2557. .init_verbs = { alc883_init_verbs, alc880_gpio1_init_verbs,
  2558. alc888_acer_aspire_7730G_verbs },
  2559. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2560. .dac_nids = alc883_dac_nids,
  2561. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids_rev),
  2562. .adc_nids = alc883_adc_nids_rev,
  2563. .capsrc_nids = alc883_capsrc_nids_rev,
  2564. .dig_out_nid = ALC883_DIGOUT_NID,
  2565. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes),
  2566. .channel_mode = alc883_3ST_6ch_modes,
  2567. .need_dac_fix = 1,
  2568. .const_channel_count = 6,
  2569. .input_mux = &alc883_capture_source,
  2570. .unsol_event = alc_sku_unsol_event,
  2571. .setup = alc888_acer_aspire_7730g_setup,
  2572. .init_hook = alc_hp_automute,
  2573. },
  2574. [ALC883_CLEVO_M540R] = {
  2575. .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
  2576. .init_verbs = { alc883_init_verbs, alc883_clevo_m540r_verbs },
  2577. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2578. .dac_nids = alc883_dac_nids,
  2579. .dig_out_nid = ALC883_DIGOUT_NID,
  2580. .dig_in_nid = ALC883_DIGIN_NID,
  2581. .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_clevo_modes),
  2582. .channel_mode = alc883_3ST_6ch_clevo_modes,
  2583. .need_dac_fix = 1,
  2584. .input_mux = &alc883_capture_source,
  2585. /* This machine has the hardware HP auto-muting, thus
  2586. * we need no software mute via unsol event
  2587. */
  2588. },
  2589. [ALC883_CLEVO_M720] = {
  2590. .mixers = { alc883_clevo_m720_mixer },
  2591. .init_verbs = { alc883_init_verbs, alc883_clevo_m720_verbs },
  2592. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2593. .dac_nids = alc883_dac_nids,
  2594. .dig_out_nid = ALC883_DIGOUT_NID,
  2595. .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
  2596. .channel_mode = alc883_3ST_2ch_modes,
  2597. .input_mux = &alc883_capture_source,
  2598. .unsol_event = alc883_clevo_m720_unsol_event,
  2599. .setup = alc883_clevo_m720_setup,
  2600. .init_hook = alc883_clevo_m720_init_hook,
  2601. },
  2602. [ALC888_3ST_HP] = {
  2603. .mixers = { alc883_3ST_6ch_mixer, alc883_chmode_mixer },
  2604. .init_verbs = { alc883_init_verbs, alc888_3st_hp_verbs },
  2605. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2606. .dac_nids = alc883_dac_nids,
  2607. .num_channel_mode = ARRAY_SIZE(alc888_3st_hp_modes),
  2608. .channel_mode = alc888_3st_hp_modes,
  2609. .need_dac_fix = 1,
  2610. .input_mux = &alc883_capture_source,
  2611. .unsol_event = alc_sku_unsol_event,
  2612. .setup = alc888_3st_hp_setup,
  2613. .init_hook = alc_hp_automute,
  2614. },
  2615. [ALC888_6ST_DELL] = {
  2616. .mixers = { alc883_base_mixer, alc883_chmode_mixer },
  2617. .init_verbs = { alc883_init_verbs, alc888_6st_dell_verbs },
  2618. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2619. .dac_nids = alc883_dac_nids,
  2620. .dig_out_nid = ALC883_DIGOUT_NID,
  2621. .dig_in_nid = ALC883_DIGIN_NID,
  2622. .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes),
  2623. .channel_mode = alc883_sixstack_modes,
  2624. .input_mux = &alc883_capture_source,
  2625. .unsol_event = alc_sku_unsol_event,
  2626. .setup = alc888_6st_dell_setup,
  2627. .init_hook = alc_hp_automute,
  2628. },
  2629. [ALC889A_MB31] = {
  2630. .mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
  2631. .init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
  2632. alc880_gpio1_init_verbs },
  2633. .adc_nids = alc883_adc_nids,
  2634. .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
  2635. .capsrc_nids = alc883_capsrc_nids,
  2636. .dac_nids = alc883_dac_nids,
  2637. .num_dacs = ARRAY_SIZE(alc883_dac_nids),
  2638. .channel_mode = alc889A_mb31_6ch_modes,
  2639. .num_channel_mode = ARRAY_SIZE(alc889A_mb31_6ch_modes),
  2640. .input_mux = &alc889A_mb31_capture_source,
  2641. .dig_out_nid = ALC883_DIGOUT_NID,
  2642. .unsol_event = alc889A_mb31_unsol_event,
  2643. .init_hook = alc889A_mb31_automute,
  2644. },
  2645. };