From: Jiang Zhe Date: Thu, 17 Jan 2008 10:18:41 +0000 (+0100) Subject: [ALSA] hda-codec - New model for conexant 5045 codec to support benq r55e X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5218c892652c1e8f89964a7fd4cf8b71cc863094;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index bbe4b7c4239..66390d7b63f 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt @@ -947,6 +947,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. Conexant 5045 laptop Laptop config fujitsu Fujitsu Si1520 laptop + benq Benq R55E test for testing/debugging purpose, almost all controls can be adjusted. Appearing only when compiled with $CONFIG_SND_DEBUG=y diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 8b8de96df13..23a3be5509d 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 = { } }; +static struct hda_input_mux cxt5045_capture_source_benq = { + .num_items = 3, + .items = { + { "IntMic", 0x1 }, + { "ExtMic", 0x2 }, + { "LineIn", 0x3 }, + } +}; + /* turn on/off EAPD (+ mute HP) as a master switch */ static int cxt5045_hp_master_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -576,6 +585,15 @@ static struct snd_kcontrol_new cxt5045_mixers[] = { {} }; +static struct snd_kcontrol_new cxt5045_benq_mixers[] = { + HDA_CODEC_VOLUME("Line In Capture Volume", 0x1a, 0x03, HDA_INPUT), + HDA_CODEC_MUTE("Line In Capture Switch", 0x1a, 0x03, HDA_INPUT), + HDA_CODEC_VOLUME("Line In Playback Volume", 0x17, 0x3, HDA_INPUT), + HDA_CODEC_MUTE("Line In Playback Switch", 0x17, 0x3, HDA_INPUT), + + {} +}; + static struct hda_verb cxt5045_init_verbs[] = { /* Line in, Mic */ {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, @@ -601,6 +619,30 @@ static struct hda_verb cxt5045_init_verbs[] = { { } /* end */ }; +static struct hda_verb cxt5045_benq_init_verbs[] = { + /* Int Mic, Mic */ + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_80 }, + /* Line In,HP, Amp */ + {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x10, AC_VERB_SET_CONNECT_SEL, 0x1}, + {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, + {0x11, AC_VERB_SET_CONNECT_SEL, 0x1}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, + /* Record selector: Int mic */ + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x1}, + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, + AC_AMP_SET_INPUT|AC_AMP_SET_RIGHT|AC_AMP_SET_LEFT|0x17}, + /* SPDIF route: PCM */ + {0x13, AC_VERB_SET_CONNECT_SEL, 0x0}, + /* EAPD */ + {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ + { } /* end */ +}; static struct hda_verb cxt5045_hp_sense_init_verbs[] = { /* pin sensing on HP jack */ @@ -741,6 +783,7 @@ static int cxt5045_init(struct hda_codec *codec) enum { CXT5045_LAPTOP, /* Laptops w/ EAPD support */ CXT5045_FUJITSU, /* Laptops w/ EAPD support */ + CXT5045_BENQ, #ifdef CONFIG_SND_DEBUG CXT5045_TEST, #endif @@ -750,6 +793,7 @@ enum { static const char *cxt5045_models[CXT5045_MODELS] = { [CXT5045_LAPTOP] = "laptop", [CXT5045_FUJITSU] = "fujitsu", + [CXT5045_BENQ] = "benq", #ifdef CONFIG_SND_DEBUG [CXT5045_TEST] = "test", #endif @@ -763,6 +807,7 @@ static struct snd_pci_quirk cxt5045_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x30cd, "HP DV Series", CXT5045_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT5045_LAPTOP), SND_PCI_QUIRK(0x103c, 0x30d9, "HP Spartan", CXT5045_LAPTOP), + SND_PCI_QUIRK(0x152d, 0x0753, "Benq R55E", CXT5045_BENQ), SND_PCI_QUIRK(0x1734, 0x10ad, "Fujitsu Si1520", CXT5045_FUJITSU), SND_PCI_QUIRK(0x1734, 0x10cb, "Fujitsu Si3515", CXT5045_LAPTOP), SND_PCI_QUIRK(0x1734, 0x110e, "Fujitsu V5505", CXT5045_LAPTOP), @@ -819,6 +864,16 @@ static int patch_cxt5045(struct hda_codec *codec) spec->mixers[0] = cxt5045_mixers; codec->patch_ops.init = cxt5045_init; break; + case CXT5045_BENQ: + codec->patch_ops.unsol_event = cxt5045_hp_unsol_event; + spec->input_mux = &cxt5045_capture_source_benq; + spec->num_init_verbs = 1; + spec->init_verbs[0] = cxt5045_benq_init_verbs; + spec->mixers[0] = cxt5045_mixers; + spec->mixers[1] = cxt5045_benq_mixers; + spec->num_mixers = 2; + codec->patch_ops.init = cxt5045_init; + break; #ifdef CONFIG_SND_DEBUG case CXT5045_TEST: spec->input_mux = &cxt5045_test_capture_source;