aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-07-29 10:54:36 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-29 10:54:36 -0400
commitda96fb5b0185d27faab0746f872d22b0cee7b026 (patch)
tree17b9487ff08146e9fba2339e1465dffe65ec5e42 /sound/pci
parenteefb8be4a4fb4aa9005fc092a88d66fe7cf1adc2 (diff)
ALSA: hda - Fix invalid multi-io creation on VAIO-Z laptops
VAIO-Z laptops need to use the specific DAC for the speaker output by some unknown reason although the codec itself supports the flexible connection. So we implemented a workaround by a new flag, no_primary_hp, for assigning the speaker pin first. This worked until 3.8 kernel, but it got broken because the driver learned for a better multi-io pin mapping, and not it can assign two mic pins for multi-io. Since the multi-io requires to be the primary output, the hp and two mic pins are assigned in prior to the speaker in the end. Although the machine has two mic pins, one of them is used as a noise- canceling headphone, thus it's no real retaskable mic jack. Thus, at best, we can disable the multi-io assignment and make the parser behavior back to the state before the multi-io. This patch adds again a new flag, no_multi_io, to indicate that the device has no multi-io capability, and set it in the fixup for VAIO-Z. The no_multi_io flag itself can be used generically, added via a helper line, too. Reported-by: Tormen <my.nl.abos@gmail.com> Reported-by: Adam Williamson <awilliam@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_generic.c14
-rw-r--r--sound/pci/hda/hda_generic.h1
-rw-r--r--sound/pci/hda/patch_realtek.c4
3 files changed, 14 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index f5c2d1ff1a09..f6c0344258ac 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -142,6 +142,9 @@ static void parse_user_hints(struct hda_codec *codec)
142 val = snd_hda_get_bool_hint(codec, "primary_hp"); 142 val = snd_hda_get_bool_hint(codec, "primary_hp");
143 if (val >= 0) 143 if (val >= 0)
144 spec->no_primary_hp = !val; 144 spec->no_primary_hp = !val;
145 val = snd_hda_get_bool_hint(codec, "multi_io");
146 if (val >= 0)
147 spec->no_multi_io = !val;
145 val = snd_hda_get_bool_hint(codec, "multi_cap_vol"); 148 val = snd_hda_get_bool_hint(codec, "multi_cap_vol");
146 if (val >= 0) 149 if (val >= 0)
147 spec->multi_cap_vol = !!val; 150 spec->multi_cap_vol = !!val;
@@ -1541,7 +1544,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
1541 cfg->speaker_pins, 1544 cfg->speaker_pins,
1542 spec->multiout.extra_out_nid, 1545 spec->multiout.extra_out_nid,
1543 spec->speaker_paths); 1546 spec->speaker_paths);
1544 if (fill_mio_first && cfg->line_outs == 1 && 1547 if (!spec->no_multi_io &&
1548 fill_mio_first && cfg->line_outs == 1 &&
1545 cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { 1549 cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1546 err = fill_multi_ios(codec, cfg->line_out_pins[0], true); 1550 err = fill_multi_ios(codec, cfg->line_out_pins[0], true);
1547 if (!err) 1551 if (!err)
@@ -1554,7 +1558,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
1554 spec->private_dac_nids, spec->out_paths, 1558 spec->private_dac_nids, spec->out_paths,
1555 spec->main_out_badness); 1559 spec->main_out_badness);
1556 1560
1557 if (fill_mio_first && 1561 if (!spec->no_multi_io && fill_mio_first &&
1558 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { 1562 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1559 /* try to fill multi-io first */ 1563 /* try to fill multi-io first */
1560 err = fill_multi_ios(codec, cfg->line_out_pins[0], false); 1564 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
@@ -1582,7 +1586,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
1582 return err; 1586 return err;
1583 badness += err; 1587 badness += err;
1584 } 1588 }
1585 if (cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { 1589 if (!spec->no_multi_io &&
1590 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1586 err = fill_multi_ios(codec, cfg->line_out_pins[0], false); 1591 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
1587 if (err < 0) 1592 if (err < 0)
1588 return err; 1593 return err;
@@ -1600,7 +1605,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
1600 check_aamix_out_path(codec, spec->speaker_paths[0]); 1605 check_aamix_out_path(codec, spec->speaker_paths[0]);
1601 } 1606 }
1602 1607
1603 if (cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) 1608 if (!spec->no_multi_io &&
1609 cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
1604 if (count_multiio_pins(codec, cfg->hp_pins[0]) >= 2) 1610 if (count_multiio_pins(codec, cfg->hp_pins[0]) >= 2)
1605 spec->multi_ios = 1; /* give badness */ 1611 spec->multi_ios = 1; /* give badness */
1606 1612
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index e199a852388b..48d44026705b 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -220,6 +220,7 @@ struct hda_gen_spec {
220 unsigned int hp_mic:1; /* Allow HP as a mic-in */ 220 unsigned int hp_mic:1; /* Allow HP as a mic-in */
221 unsigned int suppress_hp_mic_detect:1; /* Don't detect HP/mic */ 221 unsigned int suppress_hp_mic_detect:1; /* Don't detect HP/mic */
222 unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins */ 222 unsigned int no_primary_hp:1; /* Don't prefer HP pins to speaker pins */
223 unsigned int no_multi_io:1; /* Don't try multi I/O config */
223 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ 224 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */
224 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ 225 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */
225 unsigned int own_eapd_ctl:1; /* set EAPD by own function */ 226 unsigned int own_eapd_ctl:1; /* set EAPD by own function */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 04a69e3fca47..ad7a0985edfe 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1845,8 +1845,10 @@ static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1845 const struct hda_fixup *fix, int action) 1845 const struct hda_fixup *fix, int action)
1846{ 1846{
1847 struct alc_spec *spec = codec->spec; 1847 struct alc_spec *spec = codec->spec;
1848 if (action == HDA_FIXUP_ACT_PRE_PROBE) 1848 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1849 spec->gen.no_primary_hp = 1; 1849 spec->gen.no_primary_hp = 1;
1850 spec->gen.no_multi_io = 1;
1851 }
1850} 1852}
1851 1853
1852static const struct hda_fixup alc882_fixups[] = { 1854static const struct hda_fixup alc882_fixups[] = {