alc882_quirks.c 119 KB

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