aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorJiang Zhe <zhe.jiang@intel.com>2008-01-17 05:18:41 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:04 -0500
commit5218c892652c1e8f89964a7fd4cf8b71cc863094 (patch)
treec45f4a3d784b65225a5b3d0246bd775eebc81ec6 /sound/pci/hda/patch_conexant.c
parent178532348c215d23d8d64548c6ff0e38b50fca6c (diff)
[ALSA] hda-codec - New model for conexant 5045 codec to support benq r55e
The benq r55e laptop have 3 jacks on the front panel. One for HP, one for Line In and one for Mic In. This patch implemented a new model to support it. Signed-off-by: Jiang Zhe <zhe.jiang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 8b8de96df138..23a3be5509de 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -457,6 +457,15 @@ static struct hda_input_mux cxt5045_capture_source = {
457 } 457 }
458}; 458};
459 459
460static struct hda_input_mux cxt5045_capture_source_benq = {
461 .num_items = 3,
462 .items = {
463 { "IntMic", 0x1 },
464 { "ExtMic", 0x2 },
465 { "LineIn", 0x3 },
466 }
467};
468
460/* turn on/off EAPD (+ mute HP) as a master switch */ 469/* turn on/off EAPD (+ mute HP) as a master switch */
461static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol, 470static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol,
462 struct snd_ctl_elem_value *ucontrol) 471 struct snd_ctl_elem_value *ucontrol)
@@ -576,6 +585,15 @@ static struct snd_kcontrol_new cxt5045_mixers[] = {
576 {} 585 {}
577}; 586};
578 587
588static struct snd_kcontrol_new cxt5045_benq_mixers[] = {
589 HDA_CODEC_VOLUME("Line In Capture Volume", 0x1a, 0x03, HDA_INPUT),
590 HDA_CODEC_MUTE("Line In Capture Switch", 0x1a, 0x03, HDA_INPUT),
591 HDA_CODEC_VOLUME("Line In Playback Volume", 0x17, 0x3, HDA_INPUT),
592 HDA_CODEC_MUTE("Line In Playback Switch", 0x17, 0x3, HDA_INPUT),
593
594 {}
595};
596
579static struct hda_verb cxt5045_init_verbs[] = { 597static struct hda_verb cxt5045_init_verbs[] = {
580 /* Line in, Mic */ 598 /* Line in, Mic */
581 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, 599 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
@@ -601,6 +619,30 @@ static struct hda_verb cxt5045_init_verbs[] = {
601 { } /* end */ 619 { } /* end */
602}; 620};
603 621
622static struct hda_verb cxt5045_benq_init_verbs[] = {
623 /* Int Mic, Mic */
624 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 },
625 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 },
626 /* Line In,HP, Amp */
627 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
628 {0x10, AC_VERB_SET_CONNECT_SEL, 0x1},
629 {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
630 {0x11, AC_VERB_SET_CONNECT_SEL, 0x1},
631 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
632 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
633 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
634 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
635 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
636 /* Record selector: Int mic */
637 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x1},
638 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE,
639 AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17},
640 /* SPDIF route: PCM */
641 {0x13, AC_VERB_SET_CONNECT_SEL, 0x0},
642 /* EAPD */
643 {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
644 { } /* end */
645};
604 646
605static struct hda_verb cxt5045_hp_sense_init_verbs[] = { 647static struct hda_verb cxt5045_hp_sense_init_verbs[] = {
606 /* pin sensing on HP jack */ 648 /* pin sensing on HP jack */
@@ -741,6 +783,7 @@ static int cxt5045_init(struct hda_codec *codec)
741enum { 783enum {
742 CXT5045_LAPTOP, /* Laptops w/ EAPD support */ 784 CXT5045_LAPTOP, /* Laptops w/ EAPD support */
743 CXT5045_FUJITSU, /* Laptops w/ EAPD support */ 785 CXT5045_FUJITSU, /* Laptops w/ EAPD support */
786 CXT5045_BENQ,
744#ifdef CONFIG_SND_DEBUG 787#ifdef CONFIG_SND_DEBUG
745 CXT5045_TEST, 788 CXT5045_TEST,
746#endif 789#endif
@@ -750,6 +793,7 @@ enum {
750static const char *cxt5045_models[CXT5045_MODELS] = { 793static const char *cxt5045_models[CXT5045_MODELS] = {
751 [CXT5045_LAPTOP] = "laptop", 794 [CXT5045_LAPTOP] = "laptop",
752 [CXT5045_FUJITSU] = "fujitsu", 795 [CXT5045_FUJITSU] = "fujitsu",
796 [CXT5045_BENQ] = "benq",
753#ifdef CONFIG_SND_DEBUG 797#ifdef CONFIG_SND_DEBUG
754 [CXT5045_TEST] = "test", 798 [CXT5045_TEST] = "test",
755#endif 799#endif
@@ -763,6 +807,7 @@ static struct snd_pci_quirk cxt5045_cfg_tbl[] = {
763 SND_PCI_QUIRK(0x103c, 0x30cd, "HP DV Series", CXT5045_LAPTOP), 807 SND_PCI_QUIRK(0x103c, 0x30cd, "HP DV Series", CXT5045_LAPTOP),
764 SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT5045_LAPTOP), 808 SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT5045_LAPTOP),
765 SND_PCI_QUIRK(0x103c, 0x30d9, "HP Spartan", CXT5045_LAPTOP), 809 SND_PCI_QUIRK(0x103c, 0x30d9, "HP Spartan", CXT5045_LAPTOP),
810 SND_PCI_QUIRK(0x152d, 0x0753, "Benq R55E", CXT5045_BENQ),
766 SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_FUJITSU), 811 SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_FUJITSU),
767 SND_PCI_QUIRK(0x1734, 0x10cb, "Fujitsu Si3515", CXT5045_LAPTOP), 812 SND_PCI_QUIRK(0x1734, 0x10cb, "Fujitsu Si3515", CXT5045_LAPTOP),
768 SND_PCI_QUIRK(0x1734, 0x110e, "Fujitsu V5505", CXT5045_LAPTOP), 813 SND_PCI_QUIRK(0x1734, 0x110e, "Fujitsu V5505", CXT5045_LAPTOP),
@@ -819,6 +864,16 @@ static int patch_cxt5045(struct hda_codec *codec)
819 spec->mixers[0] = cxt5045_mixers; 864 spec->mixers[0] = cxt5045_mixers;
820 codec->patch_ops.init = cxt5045_init; 865 codec->patch_ops.init = cxt5045_init;
821 break; 866 break;
867 case CXT5045_BENQ:
868 codec->patch_ops.unsol_event = cxt5045_hp_unsol_event;
869 spec->input_mux = &cxt5045_capture_source_benq;
870 spec->num_init_verbs = 1;
871 spec->init_verbs[0] = cxt5045_benq_init_verbs;
872 spec->mixers[0] = cxt5045_mixers;
873 spec->mixers[1] = cxt5045_benq_mixers;
874 spec->num_mixers = 2;
875 codec->patch_ops.init = cxt5045_init;
876 break;
822#ifdef CONFIG_SND_DEBUG 877#ifdef CONFIG_SND_DEBUG
823 case CXT5045_TEST: 878 case CXT5045_TEST:
824 spec->input_mux = &cxt5045_test_capture_source; 879 spec->input_mux = &cxt5045_test_capture_source;