alc882_quirks.c 93 KB

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