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