aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_ca0132.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-08-10 10:53:32 -0400
committerTakashi Iwai <tiwai@suse.de>2015-08-10 10:53:32 -0400
commitfe14f39e88c8ac16d0a051f8444a2294f8cb358c (patch)
treedec89bbb784529a05584c06dad1899ed4c11bb77 /sound/pci/hda/patch_ca0132.c
parent3f6175ece947358e988af149ecca0d31100ee6c4 (diff)
ALSA: hda - Fix pin config and mapping on Alienware 15
Alienware 15 has CA0132 codec for its onboard sound, but the pin config and mapping seem quite different from other Creative boards. This patch corrects them, at least, for providing the right headphone and mic jack notification, as well as removing the non-existing SPDIF pins. Even with this fix, not all stuff works perfectly yet, mainly because of the badly written ca0132 driver code -- it has too many implicit assumptions of pin configs and maps. Nevertheless, this is a small good step forward. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101981 Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_ca0132.c')
-rw-r--r--sound/pci/hda/patch_ca0132.c87
1 files changed, 59 insertions, 28 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 0f039abe9673..186792fe226e 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -763,6 +763,20 @@ enum {
763 QUIRK_ALIENWARE, 763 QUIRK_ALIENWARE,
764}; 764};
765 765
766static const struct hda_pintbl alienware_pincfgs[] = {
767 { 0x0b, 0x90170110 }, /* Builtin Speaker */
768 { 0x0c, 0x411111f0 }, /* N/A */
769 { 0x0d, 0x411111f0 }, /* N/A */
770 { 0x0e, 0x411111f0 }, /* N/A */
771 { 0x0f, 0x0321101f }, /* HP */
772 { 0x10, 0x411111f0 }, /* Headset? disabled for now */
773 { 0x11, 0x03a11021 }, /* Mic */
774 { 0x12, 0xd5a30140 }, /* Builtin Mic */
775 { 0x13, 0x411111f0 }, /* N/A */
776 { 0x18, 0x411111f0 }, /* N/A */
777 {}
778};
779
766static const struct snd_pci_quirk ca0132_quirks[] = { 780static const struct snd_pci_quirk ca0132_quirks[] = {
767 SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15", QUIRK_ALIENWARE), 781 SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15", QUIRK_ALIENWARE),
768 {} 782 {}
@@ -3147,7 +3161,7 @@ static int ca0132_select_out(struct hda_codec *codec)
3147 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID]; 3161 auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID];
3148 3162
3149 if (auto_jack) 3163 if (auto_jack)
3150 jack_present = snd_hda_jack_detect(codec, spec->out_pins[1]); 3164 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_hp);
3151 else 3165 else
3152 jack_present = 3166 jack_present =
3153 spec->vnode_lswitch[VNID_HP_SEL - VNODE_START_NID]; 3167 spec->vnode_lswitch[VNID_HP_SEL - VNODE_START_NID];
@@ -3309,7 +3323,7 @@ static int ca0132_select_mic(struct hda_codec *codec)
3309 auto_jack = spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID]; 3323 auto_jack = spec->vnode_lswitch[VNID_AMIC1_ASEL - VNODE_START_NID];
3310 3324
3311 if (auto_jack) 3325 if (auto_jack)
3312 jack_present = snd_hda_jack_detect(codec, spec->input_pins[0]); 3326 jack_present = snd_hda_jack_detect(codec, spec->unsol_tag_amic1);
3313 else 3327 else
3314 jack_present = 3328 jack_present =
3315 spec->vnode_lswitch[VNID_AMIC1_SEL - VNODE_START_NID]; 3329 spec->vnode_lswitch[VNID_AMIC1_SEL - VNODE_START_NID];
@@ -4617,37 +4631,54 @@ static void ca0132_config(struct hda_codec *codec)
4617 spec->multiout.num_dacs = 3; 4631 spec->multiout.num_dacs = 3;
4618 spec->multiout.max_channels = 2; 4632 spec->multiout.max_channels = 2;
4619 4633
4620 spec->num_outputs = 2;
4621 spec->out_pins[0] = 0x0b; /* speaker out */
4622 if (spec->quirk == QUIRK_ALIENWARE) { 4634 if (spec->quirk == QUIRK_ALIENWARE) {
4623 codec_dbg(codec, "ca0132_config: QUIRK_ALIENWARE applied.\n"); 4635 codec_dbg(codec, "ca0132_config: QUIRK_ALIENWARE applied.\n");
4636 snd_hda_apply_pincfgs(codec, alienware_pincfgs);
4637
4638 spec->num_outputs = 2;
4639 spec->out_pins[0] = 0x0b; /* speaker out */
4624 spec->out_pins[1] = 0x0f; 4640 spec->out_pins[1] = 0x0f;
4625 } else{ 4641 spec->shared_out_nid = 0x2;
4642 spec->unsol_tag_hp = 0x0f;
4643
4644 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */
4645 spec->adcs[1] = 0x8; /* analog mic2 */
4646 spec->adcs[2] = 0xa; /* what u hear */
4647
4648 spec->num_inputs = 3;
4649 spec->input_pins[0] = 0x12;
4650 spec->input_pins[1] = 0x11;
4651 spec->input_pins[2] = 0x13;
4652 spec->shared_mic_nid = 0x7;
4653 spec->unsol_tag_amic1 = 0x11;
4654 } else {
4655 spec->num_outputs = 2;
4656 spec->out_pins[0] = 0x0b; /* speaker out */
4626 spec->out_pins[1] = 0x10; /* headphone out */ 4657 spec->out_pins[1] = 0x10; /* headphone out */
4658 spec->shared_out_nid = 0x2;
4659 spec->unsol_tag_hp = spec->out_pins[1];
4660
4661 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */
4662 spec->adcs[1] = 0x8; /* analog mic2 */
4663 spec->adcs[2] = 0xa; /* what u hear */
4664
4665 spec->num_inputs = 3;
4666 spec->input_pins[0] = 0x12;
4667 spec->input_pins[1] = 0x11;
4668 spec->input_pins[2] = 0x13;
4669 spec->shared_mic_nid = 0x7;
4670 spec->unsol_tag_amic1 = spec->input_pins[0];
4671
4672 /* SPDIF I/O */
4673 spec->dig_out = 0x05;
4674 spec->multiout.dig_out_nid = spec->dig_out;
4675 cfg->dig_out_pins[0] = 0x0c;
4676 cfg->dig_outs = 1;
4677 cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
4678 spec->dig_in = 0x09;
4679 cfg->dig_in_pin = 0x0e;
4680 cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
4627 } 4681 }
4628 spec->shared_out_nid = 0x2;
4629 spec->unsol_tag_hp = spec->out_pins[1];
4630
4631 spec->adcs[0] = 0x7; /* digital mic / analog mic1 */
4632 spec->adcs[1] = 0x8; /* analog mic2 */
4633 spec->adcs[2] = 0xa; /* what u hear */
4634
4635 spec->num_inputs = 3;
4636 spec->input_pins[0] = 0x12;
4637 spec->input_pins[1] = 0x11;
4638 spec->input_pins[2] = 0x13;
4639 spec->shared_mic_nid = 0x7;
4640 spec->unsol_tag_amic1 = spec->input_pins[0];
4641
4642 /* SPDIF I/O */
4643 spec->dig_out = 0x05;
4644 spec->multiout.dig_out_nid = spec->dig_out;
4645 cfg->dig_out_pins[0] = 0x0c;
4646 cfg->dig_outs = 1;
4647 cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
4648 spec->dig_in = 0x09;
4649 cfg->dig_in_pin = 0x0e;
4650 cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
4651} 4682}
4652 4683
4653static int ca0132_prepare_verbs(struct hda_codec *codec) 4684static int ca0132_prepare_verbs(struct hda_codec *codec)