alc882_quirks.c 112 KB

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