alc882_quirks.c 95 KB

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