alc882_quirks.c 107 KB

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