alc882_quirks.c 98 KB

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