alc268_quirks.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * ALC267/ALC268 quirk models
  3. * included by patch_realtek.c
  4. */
  5. /* ALC268 models */
  6. enum {
  7. ALC268_AUTO,
  8. ALC267_QUANTA_IL1,
  9. ALC268_3ST,
  10. ALC268_TOSHIBA,
  11. ALC268_ACER,
  12. ALC268_ACER_DMIC,
  13. ALC268_ACER_ASPIRE_ONE,
  14. ALC268_DELL,
  15. ALC268_ZEPTO,
  16. #ifdef CONFIG_SND_DEBUG
  17. ALC268_TEST,
  18. #endif
  19. ALC268_MODEL_LAST /* last tag */
  20. };
  21. /*
  22. * ALC268 channel source setting (2 channel)
  23. */
  24. #define ALC268_DIGOUT_NID ALC880_DIGOUT_NID
  25. #define alc268_modes alc260_modes
  26. static const hda_nid_t alc268_dac_nids[2] = {
  27. /* front, hp */
  28. 0x02, 0x03
  29. };
  30. static const hda_nid_t alc268_adc_nids[2] = {
  31. /* ADC0-1 */
  32. 0x08, 0x07
  33. };
  34. static const hda_nid_t alc268_adc_nids_alt[1] = {
  35. /* ADC0 */
  36. 0x08
  37. };
  38. static const hda_nid_t alc268_capsrc_nids[2] = { 0x23, 0x24 };
  39. static const struct snd_kcontrol_new alc268_base_mixer[] = {
  40. /* output mixer control */
  41. HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
  42. HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  43. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
  44. HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
  45. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  46. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  47. HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT),
  48. { }
  49. };
  50. static const struct snd_kcontrol_new alc268_toshiba_mixer[] = {
  51. /* output mixer control */
  52. HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
  53. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
  54. ALC262_HIPPO_MASTER_SWITCH,
  55. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  56. HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x19, 0, HDA_INPUT),
  57. HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT),
  58. { }
  59. };
  60. static const struct hda_verb alc268_eapd_verbs[] = {
  61. {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
  62. {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
  63. { }
  64. };
  65. /* Toshiba specific */
  66. static const struct hda_verb alc268_toshiba_verbs[] = {
  67. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  68. { } /* end */
  69. };
  70. /* Acer specific */
  71. /* bind volumes of both NID 0x02 and 0x03 */
  72. static const struct hda_bind_ctls alc268_acer_bind_master_vol = {
  73. .ops = &snd_hda_bind_vol,
  74. .values = {
  75. HDA_COMPOSE_AMP_VAL(0x02, 3, 0, HDA_OUTPUT),
  76. HDA_COMPOSE_AMP_VAL(0x03, 3, 0, HDA_OUTPUT),
  77. 0
  78. },
  79. };
  80. static void alc268_acer_setup(struct hda_codec *codec)
  81. {
  82. struct alc_spec *spec = codec->spec;
  83. spec->autocfg.hp_pins[0] = 0x14;
  84. spec->autocfg.speaker_pins[0] = 0x15;
  85. spec->automute = 1;
  86. spec->automute_mode = ALC_AUTOMUTE_AMP;
  87. }
  88. #define alc268_acer_master_sw_get alc262_hp_master_sw_get
  89. #define alc268_acer_master_sw_put alc262_hp_master_sw_put
  90. static const struct snd_kcontrol_new alc268_acer_aspire_one_mixer[] = {
  91. /* output mixer control */
  92. HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
  93. {
  94. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  95. .name = "Master Playback Switch",
  96. .subdevice = HDA_SUBDEV_NID_FLAG | 0x15,
  97. .info = snd_ctl_boolean_mono_info,
  98. .get = alc268_acer_master_sw_get,
  99. .put = alc268_acer_master_sw_put,
  100. },
  101. HDA_CODEC_VOLUME("Mic Boost Capture Volume", 0x18, 0, HDA_INPUT),
  102. { }
  103. };
  104. static const struct snd_kcontrol_new alc268_acer_mixer[] = {
  105. /* output mixer control */
  106. HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
  107. {
  108. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  109. .name = "Master Playback Switch",
  110. .subdevice = HDA_SUBDEV_NID_FLAG | 0x14,
  111. .info = snd_ctl_boolean_mono_info,
  112. .get = alc268_acer_master_sw_get,
  113. .put = alc268_acer_master_sw_put,
  114. },
  115. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  116. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  117. HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT),
  118. { }
  119. };
  120. static const struct snd_kcontrol_new alc268_acer_dmic_mixer[] = {
  121. /* output mixer control */
  122. HDA_BIND_VOL("Master Playback Volume", &alc268_acer_bind_master_vol),
  123. {
  124. .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
  125. .name = "Master Playback Switch",
  126. .subdevice = HDA_SUBDEV_NID_FLAG | 0x14,
  127. .info = snd_ctl_boolean_mono_info,
  128. .get = alc268_acer_master_sw_get,
  129. .put = alc268_acer_master_sw_put,
  130. },
  131. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  132. HDA_CODEC_VOLUME("Line In Boost Volume", 0x1a, 0, HDA_INPUT),
  133. { }
  134. };
  135. static const struct hda_verb alc268_acer_aspire_one_verbs[] = {
  136. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  137. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  138. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  139. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_MIC_EVENT},
  140. {0x23, AC_VERB_SET_CONNECT_SEL, 0x06},
  141. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, 0xa017},
  142. { }
  143. };
  144. static const struct hda_verb alc268_acer_verbs[] = {
  145. {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* internal dmic? */
  146. {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
  147. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  148. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
  149. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  150. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
  151. {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  152. { }
  153. };
  154. /* unsolicited event for HP jack sensing */
  155. #define alc268_toshiba_setup alc262_hippo_setup
  156. static void alc268_acer_lc_setup(struct hda_codec *codec)
  157. {
  158. struct alc_spec *spec = codec->spec;
  159. spec->autocfg.hp_pins[0] = 0x15;
  160. spec->autocfg.speaker_pins[0] = 0x14;
  161. spec->automute = 1;
  162. spec->automute_mode = ALC_AUTOMUTE_AMP;
  163. spec->ext_mic_pin = 0x18;
  164. spec->int_mic_pin = 0x12;
  165. spec->auto_mic = 1;
  166. }
  167. static const struct snd_kcontrol_new alc268_dell_mixer[] = {
  168. /* output mixer control */
  169. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
  170. HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  171. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  172. HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
  173. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  174. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  175. { }
  176. };
  177. static const struct hda_verb alc268_dell_verbs[] = {
  178. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  179. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
  180. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  181. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
  182. { }
  183. };
  184. /* mute/unmute internal speaker according to the hp jack and mute state */
  185. static void alc268_dell_setup(struct hda_codec *codec)
  186. {
  187. struct alc_spec *spec = codec->spec;
  188. spec->autocfg.hp_pins[0] = 0x15;
  189. spec->autocfg.speaker_pins[0] = 0x14;
  190. spec->ext_mic_pin = 0x18;
  191. spec->int_mic_pin = 0x19;
  192. spec->auto_mic = 1;
  193. spec->automute = 1;
  194. spec->automute_mode = ALC_AUTOMUTE_PIN;
  195. }
  196. static const struct snd_kcontrol_new alc267_quanta_il1_mixer[] = {
  197. HDA_CODEC_VOLUME("Speaker Playback Volume", 0x2, 0x0, HDA_OUTPUT),
  198. HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
  199. HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT),
  200. HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
  201. HDA_CODEC_VOLUME("Mic Capture Volume", 0x23, 0x0, HDA_OUTPUT),
  202. HDA_BIND_MUTE("Mic Capture Switch", 0x23, 2, HDA_OUTPUT),
  203. HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT),
  204. HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT),
  205. { }
  206. };
  207. static const struct hda_verb alc267_quanta_il1_verbs[] = {
  208. {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
  209. {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_MIC_EVENT | AC_USRSP_EN},
  210. { }
  211. };
  212. static void alc267_quanta_il1_setup(struct hda_codec *codec)
  213. {
  214. struct alc_spec *spec = codec->spec;
  215. spec->autocfg.hp_pins[0] = 0x15;
  216. spec->autocfg.speaker_pins[0] = 0x14;
  217. spec->ext_mic_pin = 0x18;
  218. spec->int_mic_pin = 0x19;
  219. spec->auto_mic = 1;
  220. spec->automute = 1;
  221. spec->automute_mode = ALC_AUTOMUTE_PIN;
  222. }
  223. /*
  224. * generic initialization of ADC, input mixers and output mixers
  225. */
  226. static const struct hda_verb alc268_base_init_verbs[] = {
  227. /* Unmute DAC0-1 and set vol = 0 */
  228. {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  229. {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  230. /*
  231. * Set up output mixers (0x0c - 0x0e)
  232. */
  233. /* set vol=0 to output mixers */
  234. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  235. {0x0e, AC_VERB_SET_CONNECT_SEL, 0x00},
  236. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  237. {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  238. {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
  239. {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
  240. {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
  241. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
  242. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
  243. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  244. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  245. {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  246. {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  247. {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  248. {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  249. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  250. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  251. /* set PCBEEP vol = 0, mute connections */
  252. {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  253. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  254. {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
  255. /* Unmute Selector 23h,24h and set the default input to mic-in */
  256. {0x23, AC_VERB_SET_CONNECT_SEL, 0x00},
  257. {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  258. {0x24, AC_VERB_SET_CONNECT_SEL, 0x00},
  259. {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
  260. { }
  261. };
  262. /* only for model=test */
  263. #ifdef CONFIG_SND_DEBUG
  264. /*
  265. * generic initialization of ADC, input mixers and output mixers
  266. */
  267. static const struct hda_verb alc268_volume_init_verbs[] = {
  268. /* set output DAC */
  269. {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  270. {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
  271. {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
  272. {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
  273. {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  274. {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  275. {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
  276. {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  277. {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  278. {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
  279. {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  280. {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
  281. { }
  282. };
  283. #endif /* CONFIG_SND_DEBUG */
  284. static const struct snd_kcontrol_new alc268_capture_nosrc_mixer[] = {
  285. HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
  286. HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
  287. { } /* end */
  288. };
  289. static const struct snd_kcontrol_new alc268_capture_alt_mixer[] = {
  290. HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
  291. HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
  292. _DEFINE_CAPSRC(1),
  293. { } /* end */
  294. };
  295. static const struct snd_kcontrol_new alc268_capture_mixer[] = {
  296. HDA_CODEC_VOLUME("Capture Volume", 0x23, 0x0, HDA_OUTPUT),
  297. HDA_CODEC_MUTE("Capture Switch", 0x23, 0x0, HDA_OUTPUT),
  298. HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x24, 0x0, HDA_OUTPUT),
  299. HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x24, 0x0, HDA_OUTPUT),
  300. _DEFINE_CAPSRC(2),
  301. { } /* end */
  302. };
  303. static const struct hda_input_mux alc268_capture_source = {
  304. .num_items = 4,
  305. .items = {
  306. { "Mic", 0x0 },
  307. { "Front Mic", 0x1 },
  308. { "Line", 0x2 },
  309. { "CD", 0x3 },
  310. },
  311. };
  312. static const struct hda_input_mux alc268_acer_capture_source = {
  313. .num_items = 3,
  314. .items = {
  315. { "Mic", 0x0 },
  316. { "Internal Mic", 0x1 },
  317. { "Line", 0x2 },
  318. },
  319. };
  320. static const struct hda_input_mux alc268_acer_dmic_capture_source = {
  321. .num_items = 3,
  322. .items = {
  323. { "Mic", 0x0 },
  324. { "Internal Mic", 0x6 },
  325. { "Line", 0x2 },
  326. },
  327. };
  328. #ifdef CONFIG_SND_DEBUG
  329. static const struct snd_kcontrol_new alc268_test_mixer[] = {
  330. /* Volume widgets */
  331. HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT),
  332. HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT),
  333. HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT),
  334. HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT),
  335. HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT),
  336. HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT),
  337. HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT),
  338. HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT),
  339. HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT),
  340. HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT),
  341. HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT),
  342. HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT),
  343. HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT),
  344. /* The below appears problematic on some hardwares */
  345. /*HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT),*/
  346. HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT),
  347. HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT),
  348. HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT),
  349. HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT),
  350. /* Modes for retasking pin widgets */
  351. ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT),
  352. ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT),
  353. ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT),
  354. ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT),
  355. /* Controls for GPIO pins, assuming they are configured as outputs */
  356. ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01),
  357. ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02),
  358. ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04),
  359. ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08),
  360. /* Switches to allow the digital SPDIF output pin to be enabled.
  361. * The ALC268 does not have an SPDIF input.
  362. */
  363. ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01),
  364. /* A switch allowing EAPD to be enabled. Some laptops seem to use
  365. * this output to turn on an external amplifier.
  366. */
  367. ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02),
  368. ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02),
  369. { } /* end */
  370. };
  371. #endif
  372. /*
  373. * configuration and preset
  374. */
  375. static const char * const alc268_models[ALC268_MODEL_LAST] = {
  376. [ALC267_QUANTA_IL1] = "quanta-il1",
  377. [ALC268_3ST] = "3stack",
  378. [ALC268_TOSHIBA] = "toshiba",
  379. [ALC268_ACER] = "acer",
  380. [ALC268_ACER_DMIC] = "acer-dmic",
  381. [ALC268_ACER_ASPIRE_ONE] = "acer-aspire",
  382. [ALC268_DELL] = "dell",
  383. [ALC268_ZEPTO] = "zepto",
  384. #ifdef CONFIG_SND_DEBUG
  385. [ALC268_TEST] = "test",
  386. #endif
  387. [ALC268_AUTO] = "auto",
  388. };
  389. static const struct snd_pci_quirk alc268_cfg_tbl[] = {
  390. SND_PCI_QUIRK(0x1025, 0x011e, "Acer Aspire 5720z", ALC268_ACER),
  391. SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER),
  392. SND_PCI_QUIRK(0x1025, 0x012e, "Acer Aspire 5310", ALC268_ACER),
  393. SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER),
  394. SND_PCI_QUIRK(0x1025, 0x0136, "Acer Aspire 5315", ALC268_ACER),
  395. SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
  396. ALC268_ACER_ASPIRE_ONE),
  397. SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
  398. SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO),
  399. SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
  400. "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
  401. /* almost compatible with toshiba but with optional digital outs;
  402. * auto-probing seems working fine
  403. */
  404. SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x3000, "HP TX25xx series",
  405. ALC268_AUTO),
  406. SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
  407. SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
  408. SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
  409. SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
  410. {}
  411. };
  412. /* Toshiba laptops have no unique PCI SSID but only codec SSID */
  413. static const struct snd_pci_quirk alc268_ssid_cfg_tbl[] = {
  414. SND_PCI_QUIRK(0x1179, 0xff0a, "TOSHIBA X-200", ALC268_AUTO),
  415. SND_PCI_QUIRK(0x1179, 0xff0e, "TOSHIBA X-200 HDMI", ALC268_AUTO),
  416. SND_PCI_QUIRK_MASK(0x1179, 0xff00, 0xff00, "TOSHIBA A/Lx05",
  417. ALC268_TOSHIBA),
  418. {}
  419. };
  420. static const struct alc_config_preset alc268_presets[] = {
  421. [ALC267_QUANTA_IL1] = {
  422. .mixers = { alc267_quanta_il1_mixer, alc268_beep_mixer,
  423. alc268_capture_nosrc_mixer },
  424. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  425. alc267_quanta_il1_verbs },
  426. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  427. .dac_nids = alc268_dac_nids,
  428. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  429. .adc_nids = alc268_adc_nids_alt,
  430. .hp_nid = 0x03,
  431. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  432. .channel_mode = alc268_modes,
  433. .unsol_event = alc_sku_unsol_event,
  434. .setup = alc267_quanta_il1_setup,
  435. .init_hook = alc_inithook,
  436. },
  437. [ALC268_3ST] = {
  438. .mixers = { alc268_base_mixer, alc268_capture_alt_mixer,
  439. alc268_beep_mixer },
  440. .init_verbs = { alc268_base_init_verbs },
  441. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  442. .dac_nids = alc268_dac_nids,
  443. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  444. .adc_nids = alc268_adc_nids_alt,
  445. .capsrc_nids = alc268_capsrc_nids,
  446. .hp_nid = 0x03,
  447. .dig_out_nid = ALC268_DIGOUT_NID,
  448. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  449. .channel_mode = alc268_modes,
  450. .input_mux = &alc268_capture_source,
  451. },
  452. [ALC268_TOSHIBA] = {
  453. .mixers = { alc268_toshiba_mixer, alc268_capture_alt_mixer,
  454. alc268_beep_mixer },
  455. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  456. alc268_toshiba_verbs },
  457. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  458. .dac_nids = alc268_dac_nids,
  459. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  460. .adc_nids = alc268_adc_nids_alt,
  461. .capsrc_nids = alc268_capsrc_nids,
  462. .hp_nid = 0x03,
  463. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  464. .channel_mode = alc268_modes,
  465. .input_mux = &alc268_capture_source,
  466. .unsol_event = alc_sku_unsol_event,
  467. .setup = alc268_toshiba_setup,
  468. .init_hook = alc_inithook,
  469. },
  470. [ALC268_ACER] = {
  471. .mixers = { alc268_acer_mixer, alc268_capture_alt_mixer,
  472. alc268_beep_mixer },
  473. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  474. alc268_acer_verbs },
  475. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  476. .dac_nids = alc268_dac_nids,
  477. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  478. .adc_nids = alc268_adc_nids_alt,
  479. .capsrc_nids = alc268_capsrc_nids,
  480. .hp_nid = 0x02,
  481. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  482. .channel_mode = alc268_modes,
  483. .input_mux = &alc268_acer_capture_source,
  484. .unsol_event = alc_sku_unsol_event,
  485. .setup = alc268_acer_setup,
  486. .init_hook = alc_inithook,
  487. },
  488. [ALC268_ACER_DMIC] = {
  489. .mixers = { alc268_acer_dmic_mixer, alc268_capture_alt_mixer,
  490. alc268_beep_mixer },
  491. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  492. alc268_acer_verbs },
  493. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  494. .dac_nids = alc268_dac_nids,
  495. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  496. .adc_nids = alc268_adc_nids_alt,
  497. .capsrc_nids = alc268_capsrc_nids,
  498. .hp_nid = 0x02,
  499. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  500. .channel_mode = alc268_modes,
  501. .input_mux = &alc268_acer_dmic_capture_source,
  502. .unsol_event = alc_sku_unsol_event,
  503. .setup = alc268_acer_setup,
  504. .init_hook = alc_inithook,
  505. },
  506. [ALC268_ACER_ASPIRE_ONE] = {
  507. .mixers = { alc268_acer_aspire_one_mixer,
  508. alc268_beep_mixer,
  509. alc268_capture_nosrc_mixer },
  510. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  511. alc268_acer_aspire_one_verbs },
  512. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  513. .dac_nids = alc268_dac_nids,
  514. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  515. .adc_nids = alc268_adc_nids_alt,
  516. .capsrc_nids = alc268_capsrc_nids,
  517. .hp_nid = 0x03,
  518. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  519. .channel_mode = alc268_modes,
  520. .unsol_event = alc_sku_unsol_event,
  521. .setup = alc268_acer_lc_setup,
  522. .init_hook = alc_inithook,
  523. },
  524. [ALC268_DELL] = {
  525. .mixers = { alc268_dell_mixer, alc268_beep_mixer,
  526. alc268_capture_nosrc_mixer },
  527. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  528. alc268_dell_verbs },
  529. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  530. .dac_nids = alc268_dac_nids,
  531. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  532. .adc_nids = alc268_adc_nids_alt,
  533. .capsrc_nids = alc268_capsrc_nids,
  534. .hp_nid = 0x02,
  535. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  536. .channel_mode = alc268_modes,
  537. .unsol_event = alc_sku_unsol_event,
  538. .setup = alc268_dell_setup,
  539. .init_hook = alc_inithook,
  540. },
  541. [ALC268_ZEPTO] = {
  542. .mixers = { alc268_base_mixer, alc268_capture_alt_mixer,
  543. alc268_beep_mixer },
  544. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  545. alc268_toshiba_verbs },
  546. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  547. .dac_nids = alc268_dac_nids,
  548. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  549. .adc_nids = alc268_adc_nids_alt,
  550. .capsrc_nids = alc268_capsrc_nids,
  551. .hp_nid = 0x03,
  552. .dig_out_nid = ALC268_DIGOUT_NID,
  553. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  554. .channel_mode = alc268_modes,
  555. .input_mux = &alc268_capture_source,
  556. .unsol_event = alc_sku_unsol_event,
  557. .setup = alc268_toshiba_setup,
  558. .init_hook = alc_inithook,
  559. },
  560. #ifdef CONFIG_SND_DEBUG
  561. [ALC268_TEST] = {
  562. .mixers = { alc268_test_mixer, alc268_capture_mixer },
  563. .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
  564. alc268_volume_init_verbs,
  565. alc268_beep_init_verbs },
  566. .num_dacs = ARRAY_SIZE(alc268_dac_nids),
  567. .dac_nids = alc268_dac_nids,
  568. .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
  569. .adc_nids = alc268_adc_nids_alt,
  570. .capsrc_nids = alc268_capsrc_nids,
  571. .hp_nid = 0x03,
  572. .dig_out_nid = ALC268_DIGOUT_NID,
  573. .num_channel_mode = ARRAY_SIZE(alc268_modes),
  574. .channel_mode = alc268_modes,
  575. .input_mux = &alc268_capture_source,
  576. },
  577. #endif
  578. };