diff options
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 3fbbc8c01e70..905859d4f4df 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -110,6 +110,7 @@ struct conexant_spec { | |||
110 | 110 | ||
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 | }; | 114 | }; |
114 | 115 | ||
115 | static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, | 116 | static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, |
@@ -1927,6 +1928,11 @@ static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; | |||
1927 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; | 1928 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; |
1928 | #define CXT5066_SPDIF_OUT 0x21 | 1929 | #define CXT5066_SPDIF_OUT 0x21 |
1929 | 1930 | ||
1931 | /* OLPC's microphone port is DC coupled for use with external sensors, | ||
1932 | * therefore we use a 50% mic bias in order to center the input signal with | ||
1933 | * the DC input range of the codec. */ | ||
1934 | #define CXT5066_OLPC_EXT_MIC_BIAS PIN_VREF50 | ||
1935 | |||
1930 | static struct hda_channel_mode cxt5066_modes[1] = { | 1936 | static struct hda_channel_mode cxt5066_modes[1] = { |
1931 | { 2, NULL }, | 1937 | { 2, NULL }, |
1932 | }; | 1938 | }; |
@@ -1980,9 +1986,10 @@ static int cxt5066_hp_master_sw_put(struct snd_kcontrol *kcontrol, | |||
1980 | /* toggle input of built-in and mic jack appropriately */ | 1986 | /* toggle input of built-in and mic jack appropriately */ |
1981 | static void cxt5066_automic(struct hda_codec *codec) | 1987 | static void cxt5066_automic(struct hda_codec *codec) |
1982 | { | 1988 | { |
1983 | static struct hda_verb ext_mic_present[] = { | 1989 | struct conexant_spec *spec = codec->spec; |
1990 | struct hda_verb ext_mic_present[] = { | ||
1984 | /* enable external mic, port B */ | 1991 | /* enable external mic, port B */ |
1985 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 1992 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, spec->ext_mic_bias}, |
1986 | 1993 | ||
1987 | /* switch to external mic input */ | 1994 | /* switch to external mic input */ |
1988 | {0x17, AC_VERB_SET_CONNECT_SEL, 0}, | 1995 | {0x17, AC_VERB_SET_CONNECT_SEL, 0}, |
@@ -2235,7 +2242,7 @@ static struct hda_verb cxt5066_init_verbs_olpc[] = { | |||
2235 | {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ | 2242 | {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ |
2236 | 2243 | ||
2237 | /* Port B: external microphone */ | 2244 | /* Port B: external microphone */ |
2238 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 2245 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, CXT5066_OLPC_EXT_MIC_BIAS}, |
2239 | 2246 | ||
2240 | /* Port C: internal microphone */ | 2247 | /* Port C: internal microphone */ |
2241 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 2248 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
@@ -2325,6 +2332,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
2325 | CXT5066_LAPTOP), | 2332 | CXT5066_LAPTOP), |
2326 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", | 2333 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", |
2327 | CXT5066_DELL_LAPTOP), | 2334 | CXT5066_DELL_LAPTOP), |
2335 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | ||
2328 | {} | 2336 | {} |
2329 | }; | 2337 | }; |
2330 | 2338 | ||
@@ -2352,6 +2360,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
2352 | spec->input_mux = &cxt5066_capture_source; | 2360 | spec->input_mux = &cxt5066_capture_source; |
2353 | 2361 | ||
2354 | spec->port_d_mode = PIN_HP; | 2362 | spec->port_d_mode = PIN_HP; |
2363 | spec->ext_mic_bias = PIN_VREF80; | ||
2355 | 2364 | ||
2356 | spec->num_init_verbs = 1; | 2365 | spec->num_init_verbs = 1; |
2357 | spec->init_verbs[0] = cxt5066_init_verbs; | 2366 | spec->init_verbs[0] = cxt5066_init_verbs; |
@@ -2383,6 +2392,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
2383 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; | 2392 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; |
2384 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 2393 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
2385 | spec->port_d_mode = 0; | 2394 | spec->port_d_mode = 0; |
2395 | spec->ext_mic_bias = CXT5066_OLPC_EXT_MIC_BIAS; | ||
2386 | 2396 | ||
2387 | /* no S/PDIF out */ | 2397 | /* no S/PDIF out */ |
2388 | spec->multiout.dig_out_nid = 0; | 2398 | spec->multiout.dig_out_nid = 0; |