aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_analog.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-11-20 20:25:48 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-20 20:25:48 -0500
commit1725b82a6e2721612a3572d0336f51f1f1c3cf54 (patch)
treecd24cc1fe3272c588f12f7f6ab86efa84af42acc /sound/pci/hda/patch_analog.c
parent5b2d1ecac2a79b9438aed731557b8912564cedfd (diff)
ALSA: hda - make laptop-eapd model back for AD1986A
The changes specific for Samsung laptops seem unapplicable to other hardware models like ASUS. The mic inputs are lost on such hardware by the change 5d5d5f43f1b835c375de9bd270cce030d16e2871. This patch adds back the old laptop-eapd model, and create a new model "samsung" for the new one specific to Samsung laptops with automatic mic selection feature. Reference: kernel bugzilla #12070 http://bugzilla.kernel.org/show_bug.cgi?id=12070 Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r--sound/pci/hda/patch_analog.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 032cbb4bd985..0cc6be12b8b7 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -642,6 +642,36 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
642 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw), 642 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
643 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT), 643 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
644 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT), 644 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
645 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
646 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
647 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
648 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
649 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
650 HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
651 HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
652 {
653 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
654 .name = "Capture Source",
655 .info = ad198x_mux_enum_info,
656 .get = ad198x_mux_enum_get,
657 .put = ad198x_mux_enum_put,
658 },
659 {
660 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
661 .name = "External Amplifier",
662 .info = ad198x_eapd_info,
663 .get = ad198x_eapd_get,
664 .put = ad198x_eapd_put,
665 .private_value = 0x1b | (1 << 8), /* port-D, inversed */
666 },
667 { } /* end */
668};
669
670static struct snd_kcontrol_new ad1986a_samsung_mixers[] = {
671 HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
672 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
673 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
674 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
645 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT), 675 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
646 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT), 676 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
647 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT), 677 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
@@ -930,6 +960,7 @@ enum {
930 AD1986A_LAPTOP_EAPD, 960 AD1986A_LAPTOP_EAPD,
931 AD1986A_LAPTOP_AUTOMUTE, 961 AD1986A_LAPTOP_AUTOMUTE,
932 AD1986A_ULTRA, 962 AD1986A_ULTRA,
963 AD1986A_SAMSUNG,
933 AD1986A_MODELS 964 AD1986A_MODELS
934}; 965};
935 966
@@ -940,6 +971,7 @@ static const char *ad1986a_models[AD1986A_MODELS] = {
940 [AD1986A_LAPTOP_EAPD] = "laptop-eapd", 971 [AD1986A_LAPTOP_EAPD] = "laptop-eapd",
941 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute", 972 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
942 [AD1986A_ULTRA] = "ultra", 973 [AD1986A_ULTRA] = "ultra",
974 [AD1986A_SAMSUNG] = "samsung",
943}; 975};
944 976
945static struct snd_pci_quirk ad1986a_cfg_tbl[] = { 977static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
@@ -962,9 +994,9 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
962 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), 994 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
963 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 995 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
964 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 996 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
965 SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD), 997 SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_SAMSUNG),
966 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD), 998 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_SAMSUNG),
967 SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD), 999 SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_SAMSUNG),
968 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), 1000 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
969 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), 1001 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
970 SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP), 1002 SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP),
@@ -1046,6 +1078,17 @@ static int patch_ad1986a(struct hda_codec *codec)
1046 break; 1078 break;
1047 case AD1986A_LAPTOP_EAPD: 1079 case AD1986A_LAPTOP_EAPD:
1048 spec->mixers[0] = ad1986a_laptop_eapd_mixers; 1080 spec->mixers[0] = ad1986a_laptop_eapd_mixers;
1081 spec->num_init_verbs = 2;
1082 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1083 spec->multiout.max_channels = 2;
1084 spec->multiout.num_dacs = 1;
1085 spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1086 if (!is_jack_available(codec, 0x25))
1087 spec->multiout.dig_out_nid = 0;
1088 spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1089 break;
1090 case AD1986A_SAMSUNG:
1091 spec->mixers[0] = ad1986a_samsung_mixers;
1049 spec->num_init_verbs = 3; 1092 spec->num_init_verbs = 3;
1050 spec->init_verbs[1] = ad1986a_eapd_init_verbs; 1093 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1051 spec->init_verbs[2] = ad1986a_automic_verbs; 1094 spec->init_verbs[2] = ad1986a_automic_verbs;