aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-08-29 17:23:08 -0400
committerTakashi Iwai <tiwai@suse.de>2009-08-31 02:25:58 -0400
commite9af4f365fee8065c0c1b2389fe10e540dd9d60a (patch)
treececb26a9bb10ad6cf3245d455e3be6ebb9a2def4 /sound/pci/hda/patch_realtek.c
parent96f845de89be6be12112d7b388cdf366dccfe12d (diff)
ALSA: hda - Fix ALC268/ALC269 headphone pin routing
Fix the headphone pin routing of ALC268/ALC269 codecs. Using alc882 routine doesn't work because alc268/alc269 parser assumes the independent DACs for both HP and speaker outputs. Need to assign the DAC depending on the pin. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c46
1 files changed, 41 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d572db619fbd..bc17a96a7945 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -12303,6 +12303,42 @@ static int alc268_auto_create_input_ctls(struct hda_codec *codec,
12303 return alc_auto_create_input_ctls(codec, cfg, 0, 0x23, 0x24); 12303 return alc_auto_create_input_ctls(codec, cfg, 0, 0x23, 0x24);
12304} 12304}
12305 12305
12306static void alc268_auto_set_output_and_unmute(struct hda_codec *codec,
12307 hda_nid_t nid, int pin_type)
12308{
12309 int idx;
12310
12311 alc_set_pin_output(codec, nid, pin_type);
12312 if (nid == 0x14 || nid == 0x16)
12313 idx = 0;
12314 else
12315 idx = 1;
12316 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx);
12317}
12318
12319static void alc268_auto_init_multi_out(struct hda_codec *codec)
12320{
12321 struct alc_spec *spec = codec->spec;
12322 hda_nid_t nid = spec->autocfg.line_out_pins[0];
12323 if (nid) {
12324 int pin_type = get_pin_type(spec->autocfg.line_out_type);
12325 alc268_auto_set_output_and_unmute(codec, nid, pin_type);
12326 }
12327}
12328
12329static void alc268_auto_init_hp_out(struct hda_codec *codec)
12330{
12331 struct alc_spec *spec = codec->spec;
12332 hda_nid_t pin;
12333
12334 pin = spec->autocfg.hp_pins[0];
12335 if (pin)
12336 alc268_auto_set_output_and_unmute(codec, pin, PIN_HP);
12337 pin = spec->autocfg.speaker_pins[0];
12338 if (pin)
12339 alc268_auto_set_output_and_unmute(codec, pin, PIN_OUT);
12340}
12341
12306static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec) 12342static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec)
12307{ 12343{
12308 struct alc_spec *spec = codec->spec; 12344 struct alc_spec *spec = codec->spec;
@@ -12311,9 +12347,10 @@ static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec)
12311 hda_nid_t line_nid = spec->autocfg.line_out_pins[0]; 12347 hda_nid_t line_nid = spec->autocfg.line_out_pins[0];
12312 unsigned int dac_vol1, dac_vol2; 12348 unsigned int dac_vol1, dac_vol2;
12313 12349
12314 if (speaker_nid) { 12350 if (line_nid == 0x1d || speaker_nid == 0x1d) {
12315 snd_hda_codec_write(codec, speaker_nid, 0, 12351 snd_hda_codec_write(codec, speaker_nid, 0,
12316 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 12352 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
12353 /* mute mixer inputs from 0x1d */
12317 snd_hda_codec_write(codec, 0x0f, 0, 12354 snd_hda_codec_write(codec, 0x0f, 0,
12318 AC_VERB_SET_AMP_GAIN_MUTE, 12355 AC_VERB_SET_AMP_GAIN_MUTE,
12319 AMP_IN_UNMUTE(1)); 12356 AMP_IN_UNMUTE(1));
@@ -12321,6 +12358,7 @@ static void alc268_auto_init_mono_speaker_out(struct hda_codec *codec)
12321 AC_VERB_SET_AMP_GAIN_MUTE, 12358 AC_VERB_SET_AMP_GAIN_MUTE,
12322 AMP_IN_UNMUTE(1)); 12359 AMP_IN_UNMUTE(1));
12323 } else { 12360 } else {
12361 /* unmute mixer inputs from 0x1d */
12324 snd_hda_codec_write(codec, 0x0f, 0, 12362 snd_hda_codec_write(codec, 0x0f, 0,
12325 AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)); 12363 AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1));
12326 snd_hda_codec_write(codec, 0x10, 0, 12364 snd_hda_codec_write(codec, 0x10, 0,
@@ -12408,8 +12446,6 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
12408 return 1; 12446 return 1;
12409} 12447}
12410 12448
12411#define alc268_auto_init_multi_out alc882_auto_init_multi_out
12412#define alc268_auto_init_hp_out alc882_auto_init_hp_out
12413#define alc268_auto_init_analog_input alc882_auto_init_analog_input 12449#define alc268_auto_init_analog_input alc882_auto_init_analog_input
12414 12450
12415/* init callback for auto-configuration model -- overriding the default init */ 12451/* init callback for auto-configuration model -- overriding the default init */
@@ -13220,8 +13256,8 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13220 return 1; 13256 return 1;
13221} 13257}
13222 13258
13223#define alc269_auto_init_multi_out alc882_auto_init_multi_out 13259#define alc269_auto_init_multi_out alc268_auto_init_multi_out
13224#define alc269_auto_init_hp_out alc882_auto_init_hp_out 13260#define alc269_auto_init_hp_out alc268_auto_init_hp_out
13225#define alc269_auto_init_analog_input alc882_auto_init_analog_input 13261#define alc269_auto_init_analog_input alc882_auto_init_analog_input
13226 13262
13227 13263