diff options
author | Jonathan Woithe <jwoithe@physics.adelaide.edu.au> | 2008-01-08 06:33:19 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:46 -0500 |
commit | 86c53bd26b431767438c65f89863471be177f0f7 (patch) | |
tree | 437337aabef40372bb6a142fbf0ee1f735d94eca /sound/pci/hda/patch_realtek.c | |
parent | f8225f6d1f68c3d0a0fe844dc40a11cd432a853b (diff) |
[ALSA] hda-codec - Add test model for ALC268
This implements a test model for the ALC268. It depends on the feature
added by alc260-test-eapd-0.2.diff. This patch also adds a mention of
the ALC260 test model to ALSA-Configuration.txt since this seems to have
been missed.
Signed-off-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0a64d24e7fda..1b2ad52bc908 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -106,6 +106,9 @@ enum { | |||
106 | ALC268_3ST, | 106 | ALC268_3ST, |
107 | ALC268_TOSHIBA, | 107 | ALC268_TOSHIBA, |
108 | ALC268_ACER, | 108 | ALC268_ACER, |
109 | #ifdef CONFIG_SND_DEBUG | ||
110 | ALC268_TEST, | ||
111 | #endif | ||
109 | ALC268_AUTO, | 112 | ALC268_AUTO, |
110 | ALC268_MODEL_LAST /* last tag */ | 113 | ALC268_MODEL_LAST /* last tag */ |
111 | }; | 114 | }; |
@@ -9366,6 +9369,60 @@ static struct hda_input_mux alc268_capture_source = { | |||
9366 | }, | 9369 | }, |
9367 | }; | 9370 | }; |
9368 | 9371 | ||
9372 | #ifdef CONFIG_SND_DEBUG | ||
9373 | static struct snd_kcontrol_new alc268_test_mixer[] = { | ||
9374 | HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT), | ||
9375 | HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
9376 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x3, 0x0, HDA_OUTPUT), | ||
9377 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
9378 | |||
9379 | /* Volume widgets */ | ||
9380 | HDA_CODEC_VOLUME("LOUT1 Playback Volume", 0x02, 0x0, HDA_OUTPUT), | ||
9381 | HDA_CODEC_VOLUME("LOUT2 Playback Volume", 0x03, 0x0, HDA_OUTPUT), | ||
9382 | HDA_BIND_MUTE_MONO("Mono sum Playback Switch", 0x0e, 1, 2, HDA_INPUT), | ||
9383 | HDA_BIND_MUTE("LINE-OUT sum Playback Switch", 0x0f, 2, HDA_INPUT), | ||
9384 | HDA_BIND_MUTE("HP-OUT sum Playback Switch", 0x10, 2, HDA_INPUT), | ||
9385 | HDA_BIND_MUTE("LINE-OUT Playback Switch", 0x14, 2, HDA_OUTPUT), | ||
9386 | HDA_BIND_MUTE("HP-OUT Playback Switch", 0x15, 2, HDA_OUTPUT), | ||
9387 | HDA_BIND_MUTE("Mono Playback Switch", 0x16, 2, HDA_OUTPUT), | ||
9388 | HDA_CODEC_VOLUME("MIC1 Capture Volume", 0x18, 0x0, HDA_INPUT), | ||
9389 | HDA_BIND_MUTE("MIC1 Capture Switch", 0x18, 2, HDA_OUTPUT), | ||
9390 | HDA_CODEC_VOLUME("MIC2 Capture Volume", 0x19, 0x0, HDA_INPUT), | ||
9391 | HDA_CODEC_VOLUME("LINE1 Capture Volume", 0x1a, 0x0, HDA_INPUT), | ||
9392 | HDA_BIND_MUTE("LINE1 Capture Switch", 0x1a, 2, HDA_OUTPUT), | ||
9393 | HDA_CODEC_VOLUME("PCBEEP Playback Volume", 0x1d, 0x0, HDA_INPUT), | ||
9394 | HDA_CODEC_VOLUME("PCM-IN1 Capture Volume", 0x23, 0x0, HDA_OUTPUT), | ||
9395 | HDA_BIND_MUTE("PCM-IN1 Capture Switch", 0x23, 2, HDA_OUTPUT), | ||
9396 | HDA_CODEC_VOLUME("PCM-IN2 Capture Volume", 0x24, 0x0, HDA_OUTPUT), | ||
9397 | HDA_BIND_MUTE("PCM-IN2 Capture Switch", 0x24, 2, HDA_OUTPUT), | ||
9398 | |||
9399 | /* Modes for retasking pin widgets */ | ||
9400 | ALC_PIN_MODE("LINE-OUT pin mode", 0x14, ALC_PIN_DIR_INOUT), | ||
9401 | ALC_PIN_MODE("HP-OUT pin mode", 0x15, ALC_PIN_DIR_INOUT), | ||
9402 | ALC_PIN_MODE("MIC1 pin mode", 0x18, ALC_PIN_DIR_INOUT), | ||
9403 | ALC_PIN_MODE("LINE1 pin mode", 0x1a, ALC_PIN_DIR_INOUT), | ||
9404 | |||
9405 | /* Controls for GPIO pins, assuming they are configured as outputs */ | ||
9406 | ALC_GPIO_DATA_SWITCH("GPIO pin 0", 0x01, 0x01), | ||
9407 | ALC_GPIO_DATA_SWITCH("GPIO pin 1", 0x01, 0x02), | ||
9408 | ALC_GPIO_DATA_SWITCH("GPIO pin 2", 0x01, 0x04), | ||
9409 | ALC_GPIO_DATA_SWITCH("GPIO pin 3", 0x01, 0x08), | ||
9410 | |||
9411 | /* Switches to allow the digital SPDIF output pin to be enabled. | ||
9412 | * The ALC268 does not have an SPDIF input. | ||
9413 | */ | ||
9414 | ALC_SPDIF_CTRL_SWITCH("SPDIF Playback Switch", 0x06, 0x01), | ||
9415 | |||
9416 | /* A switch allowing EAPD to be enabled. Some laptops seem to use | ||
9417 | * this output to turn on an external amplifier. | ||
9418 | */ | ||
9419 | ALC_EAPD_CTRL_SWITCH("LINE-OUT EAPD Enable Switch", 0x0f, 0x02), | ||
9420 | ALC_EAPD_CTRL_SWITCH("HP-OUT EAPD Enable Switch", 0x10, 0x02), | ||
9421 | |||
9422 | { } /* end */ | ||
9423 | }; | ||
9424 | #endif | ||
9425 | |||
9369 | /* create input playback/capture controls for the given pin */ | 9426 | /* create input playback/capture controls for the given pin */ |
9370 | static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid, | 9427 | static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid, |
9371 | const char *ctlname, int idx) | 9428 | const char *ctlname, int idx) |
@@ -9578,6 +9635,9 @@ static const char *alc268_models[ALC268_MODEL_LAST] = { | |||
9578 | [ALC268_3ST] = "3stack", | 9635 | [ALC268_3ST] = "3stack", |
9579 | [ALC268_TOSHIBA] = "toshiba", | 9636 | [ALC268_TOSHIBA] = "toshiba", |
9580 | [ALC268_ACER] = "acer", | 9637 | [ALC268_ACER] = "acer", |
9638 | #ifdef CONFIG_SND_DEBUG | ||
9639 | [ALC268_TEST] = "test", | ||
9640 | #endif | ||
9581 | [ALC268_AUTO] = "auto", | 9641 | [ALC268_AUTO] = "auto", |
9582 | }; | 9642 | }; |
9583 | 9643 | ||
@@ -9636,6 +9696,22 @@ static struct alc_config_preset alc268_presets[] = { | |||
9636 | .unsol_event = alc268_acer_unsol_event, | 9696 | .unsol_event = alc268_acer_unsol_event, |
9637 | .init_hook = alc268_acer_init_hook, | 9697 | .init_hook = alc268_acer_init_hook, |
9638 | }, | 9698 | }, |
9699 | #ifdef CONFIG_SND_DEBUG | ||
9700 | [ALC268_TEST] = { | ||
9701 | .mixers = { alc268_test_mixer, alc268_capture_mixer }, | ||
9702 | .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs, | ||
9703 | alc268_volume_init_verbs }, | ||
9704 | .num_dacs = ARRAY_SIZE(alc268_dac_nids), | ||
9705 | .dac_nids = alc268_dac_nids, | ||
9706 | .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt), | ||
9707 | .adc_nids = alc268_adc_nids_alt, | ||
9708 | .hp_nid = 0x03, | ||
9709 | .dig_out_nid = ALC268_DIGOUT_NID, | ||
9710 | .num_channel_mode = ARRAY_SIZE(alc268_modes), | ||
9711 | .channel_mode = alc268_modes, | ||
9712 | .input_mux = &alc268_capture_source, | ||
9713 | }, | ||
9714 | #endif | ||
9639 | }; | 9715 | }; |
9640 | 9716 | ||
9641 | static int patch_alc268(struct hda_codec *codec) | 9717 | static int patch_alc268(struct hda_codec *codec) |