alc882_quirks.c 130 KB

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