diff options
author | Einar Rünkaru <einarry@smail.ee> | 2009-12-16 15:16:13 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-17 06:30:03 -0500 |
commit | 254bba6a7e28c77d8b32d9eaeba02d4943ee844e (patch) | |
tree | ac776c8b0e7731e47aa9c7a500e8529d3e2e5ea3 /sound/pci | |
parent | ebb83eeb6469bedda83b4dc6f23ddf93eb32b347 (diff) |
ALSA: hda - Fixed internal mic initialization for Dell Vostro 1015
Fixed initialization of internal mic and added internal mic boost control
Renamed analog mic boost control to ext mic boost contol.
Name pair analog/digital seems too confusing for a normal user.
Signed-off-by: Einar Rünkaru <einarry@smail.ee>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index a09c03c3f62b..ca9ad9fddbf2 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -111,6 +111,7 @@ struct conexant_spec { | |||
111 | unsigned int dell_automute; | 111 | unsigned int dell_automute; |
112 | unsigned int port_d_mode; | 112 | unsigned int port_d_mode; |
113 | unsigned char ext_mic_bias; | 113 | unsigned char ext_mic_bias; |
114 | unsigned int dell_vostro; | ||
114 | }; | 115 | }; |
115 | 116 | ||
116 | static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, | 117 | static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, |
@@ -2109,9 +2110,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol, | |||
2109 | { | 2110 | { |
2110 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2111 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2111 | int val; | 2112 | int val; |
2113 | hda_nid_t nid = kcontrol->private_value & 0xff; | ||
2114 | int inout = (kcontrol->private_value & 0x100) ? | ||
2115 | AC_AMP_GET_INPUT : AC_AMP_GET_OUTPUT; | ||
2112 | 2116 | ||
2113 | val = snd_hda_codec_read(codec, 0x17, 0, | 2117 | val = snd_hda_codec_read(codec, nid, 0, |
2114 | AC_VERB_GET_AMP_GAIN_MUTE, AC_AMP_GET_OUTPUT); | 2118 | AC_VERB_GET_AMP_GAIN_MUTE, inout); |
2115 | 2119 | ||
2116 | ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN; | 2120 | ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN; |
2117 | return 0; | 2121 | return 0; |
@@ -2123,6 +2127,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
2123 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 2127 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2124 | const struct hda_input_mux *imux = &cxt5066_analog_mic_boost; | 2128 | const struct hda_input_mux *imux = &cxt5066_analog_mic_boost; |
2125 | unsigned int idx; | 2129 | unsigned int idx; |
2130 | hda_nid_t nid = kcontrol->private_value & 0xff; | ||
2131 | int inout = (kcontrol->private_value & 0x100) ? | ||
2132 | AC_AMP_SET_INPUT : AC_AMP_SET_OUTPUT; | ||
2126 | 2133 | ||
2127 | if (!imux->num_items) | 2134 | if (!imux->num_items) |
2128 | return 0; | 2135 | return 0; |
@@ -2130,9 +2137,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol, | |||
2130 | if (idx >= imux->num_items) | 2137 | if (idx >= imux->num_items) |
2131 | idx = imux->num_items - 1; | 2138 | idx = imux->num_items - 1; |
2132 | 2139 | ||
2133 | snd_hda_codec_write_cache(codec, 0x17, 0, | 2140 | snd_hda_codec_write_cache(codec, nid, 0, |
2134 | AC_VERB_SET_AMP_GAIN_MUTE, | 2141 | AC_VERB_SET_AMP_GAIN_MUTE, |
2135 | AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | | 2142 | AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | inout | |
2136 | imux->items[idx].index); | 2143 | imux->items[idx].index); |
2137 | 2144 | ||
2138 | return 1; | 2145 | return 1; |
@@ -2201,10 +2208,11 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { | |||
2201 | 2208 | ||
2202 | { | 2209 | { |
2203 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 2210 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
2204 | .name = "Analog Mic Boost Capture Enum", | 2211 | .name = "Ext Mic Boost Capture Enum", |
2205 | .info = cxt5066_mic_boost_mux_enum_info, | 2212 | .info = cxt5066_mic_boost_mux_enum_info, |
2206 | .get = cxt5066_mic_boost_mux_enum_get, | 2213 | .get = cxt5066_mic_boost_mux_enum_get, |
2207 | .put = cxt5066_mic_boost_mux_enum_put, | 2214 | .put = cxt5066_mic_boost_mux_enum_put, |
2215 | .private_value = 0x17, | ||
2208 | }, | 2216 | }, |
2209 | 2217 | ||
2210 | HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others), | 2218 | HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others), |
@@ -2212,6 +2220,18 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { | |||
2212 | {} | 2220 | {} |
2213 | }; | 2221 | }; |
2214 | 2222 | ||
2223 | static struct snd_kcontrol_new cxt5066_vostro_mixers[] = { | ||
2224 | { | ||
2225 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2226 | .name = "Int Mic Boost Capture Enum", | ||
2227 | .info = cxt5066_mic_boost_mux_enum_info, | ||
2228 | .get = cxt5066_mic_boost_mux_enum_get, | ||
2229 | .put = cxt5066_mic_boost_mux_enum_put, | ||
2230 | .private_value = 0x23 | 0x100, | ||
2231 | }, | ||
2232 | {} | ||
2233 | }; | ||
2234 | |||
2215 | static struct hda_verb cxt5066_init_verbs[] = { | 2235 | static struct hda_verb cxt5066_init_verbs[] = { |
2216 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */ | 2236 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */ |
2217 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */ | 2237 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */ |
@@ -2397,11 +2417,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = { | |||
2397 | /* initialize jack-sensing, too */ | 2417 | /* initialize jack-sensing, too */ |
2398 | static int cxt5066_init(struct hda_codec *codec) | 2418 | static int cxt5066_init(struct hda_codec *codec) |
2399 | { | 2419 | { |
2420 | struct conexant_spec *spec = codec->spec; | ||
2421 | |||
2400 | snd_printdd("CXT5066: init\n"); | 2422 | snd_printdd("CXT5066: init\n"); |
2401 | conexant_init(codec); | 2423 | conexant_init(codec); |
2402 | if (codec->patch_ops.unsol_event) { | 2424 | if (codec->patch_ops.unsol_event) { |
2403 | cxt5066_hp_automute(codec); | 2425 | cxt5066_hp_automute(codec); |
2404 | cxt5066_automic(codec); | 2426 | if (spec->dell_vostro) |
2427 | cxt5066_vostro_automic(codec); | ||
2428 | else | ||
2429 | cxt5066_automic(codec); | ||
2405 | } | 2430 | } |
2406 | return 0; | 2431 | return 0; |
2407 | } | 2432 | } |
@@ -2500,7 +2525,9 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
2500 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; | 2525 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; |
2501 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; | 2526 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; |
2502 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 2527 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
2528 | spec->mixers[spec->num_mixers++] = cxt5066_vostro_mixers; | ||
2503 | spec->port_d_mode = 0; | 2529 | spec->port_d_mode = 0; |
2530 | spec->dell_vostro = 1; | ||
2504 | 2531 | ||
2505 | /* no S/PDIF out */ | 2532 | /* no S/PDIF out */ |
2506 | spec->multiout.dig_out_nid = 0; | 2533 | spec->multiout.dig_out_nid = 0; |