aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-02-03 06:32:51 -0500
committerTakashi Iwai <tiwai@suse.de>2016-02-03 06:32:51 -0500
commit2154cc0e2d4ae15132d005d17e473327c70c9a06 (patch)
treee50fb37e4b044613d46af798432a8eb213a8ff94
parent4cc9b9d627af2c443cf98e651e3738d84f991cec (diff)
ALSA: hda - Add fixup for Mac Mini 7,1 model
Mac Mini 7,1 model with CS4208 codec reports the headphone jack detection wrongly in an inverted way. Moreover, the advertised pins for the audio input and SPDIF output have actually no jack detection. This patch addresses these issues. The inv_jack_detect flag is set for fixing the headphone jack detection, and the pin configs for audio input and SPDIF output are marked as non-detectable. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105161 Report-and-tested-by: moosotc@gmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_cirrus.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index a12ae8ac0914..c1c855a6c0af 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -614,6 +614,7 @@ enum {
614 CS4208_MAC_AUTO, 614 CS4208_MAC_AUTO,
615 CS4208_MBA6, 615 CS4208_MBA6,
616 CS4208_MBP11, 616 CS4208_MBP11,
617 CS4208_MACMINI,
617 CS4208_GPIO0, 618 CS4208_GPIO0,
618}; 619};
619 620
@@ -621,6 +622,7 @@ static const struct hda_model_fixup cs4208_models[] = {
621 { .id = CS4208_GPIO0, .name = "gpio0" }, 622 { .id = CS4208_GPIO0, .name = "gpio0" },
622 { .id = CS4208_MBA6, .name = "mba6" }, 623 { .id = CS4208_MBA6, .name = "mba6" },
623 { .id = CS4208_MBP11, .name = "mbp11" }, 624 { .id = CS4208_MBP11, .name = "mbp11" },
625 { .id = CS4208_MACMINI, .name = "macmini" },
624 {} 626 {}
625}; 627};
626 628
@@ -632,6 +634,7 @@ static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
632/* codec SSID matching */ 634/* codec SSID matching */
633static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = { 635static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
634 SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11), 636 SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
637 SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI),
635 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), 638 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
636 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), 639 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
637 SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11), 640 SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11),
@@ -666,6 +669,24 @@ static void cs4208_fixup_mac(struct hda_codec *codec,
666 snd_hda_apply_fixup(codec, action); 669 snd_hda_apply_fixup(codec, action);
667} 670}
668 671
672/* MacMini 7,1 has the inverted jack detection */
673static void cs4208_fixup_macmini(struct hda_codec *codec,
674 const struct hda_fixup *fix, int action)
675{
676 static const struct hda_pintbl pincfgs[] = {
677 { 0x18, 0x00ab9150 }, /* mic (audio-in) jack: disable detect */
678 { 0x21, 0x004be140 }, /* SPDIF: disable detect */
679 { }
680 };
681
682 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
683 /* HP pin (0x10) has an inverted detection */
684 codec->inv_jack_detect = 1;
685 /* disable the bogus Mic and SPDIF jack detections */
686 snd_hda_apply_pincfgs(codec, pincfgs);
687 }
688}
689
669static int cs4208_spdif_sw_put(struct snd_kcontrol *kcontrol, 690static int cs4208_spdif_sw_put(struct snd_kcontrol *kcontrol,
670 struct snd_ctl_elem_value *ucontrol) 691 struct snd_ctl_elem_value *ucontrol)
671{ 692{
@@ -709,6 +730,12 @@ static const struct hda_fixup cs4208_fixups[] = {
709 .chained = true, 730 .chained = true,
710 .chain_id = CS4208_GPIO0, 731 .chain_id = CS4208_GPIO0,
711 }, 732 },
733 [CS4208_MACMINI] = {
734 .type = HDA_FIXUP_FUNC,
735 .v.func = cs4208_fixup_macmini,
736 .chained = true,
737 .chain_id = CS4208_GPIO0,
738 },
712 [CS4208_GPIO0] = { 739 [CS4208_GPIO0] = {
713 .type = HDA_FIXUP_FUNC, 740 .type = HDA_FIXUP_FUNC,
714 .v.func = cs4208_fixup_gpio0, 741 .v.func = cs4208_fixup_gpio0,