alc882_quirks.c 125 KB

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