alc882_quirks.c 133 KB

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