Skip to content

Commit 2154cc0

Browse files
committed
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: [email protected] Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 4cc9b9d commit 2154cc0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

sound/pci/hda/patch_cirrus.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,15 @@ enum {
614614
CS4208_MAC_AUTO,
615615
CS4208_MBA6,
616616
CS4208_MBP11,
617+
CS4208_MACMINI,
617618
CS4208_GPIO0,
618619
};
619620

620621
static const struct hda_model_fixup cs4208_models[] = {
621622
{ .id = CS4208_GPIO0, .name = "gpio0" },
622623
{ .id = CS4208_MBA6, .name = "mba6" },
623624
{ .id = CS4208_MBP11, .name = "mbp11" },
625+
{ .id = CS4208_MACMINI, .name = "macmini" },
624626
{}
625627
};
626628

@@ -632,6 +634,7 @@ static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
632634
/* codec SSID matching */
633635
static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
634636
SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
637+
SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI),
635638
SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
636639
SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
637640
SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11),
@@ -666,6 +669,24 @@ static void cs4208_fixup_mac(struct hda_codec *codec,
666669
snd_hda_apply_fixup(codec, action);
667670
}
668671

672+
/* MacMini 7,1 has the inverted jack detection */
673+
static 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+
669690
static int cs4208_spdif_sw_put(struct snd_kcontrol *kcontrol,
670691
struct snd_ctl_elem_value *ucontrol)
671692
{
@@ -709,6 +730,12 @@ static const struct hda_fixup cs4208_fixups[] = {
709730
.chained = true,
710731
.chain_id = CS4208_GPIO0,
711732
},
733+
[CS4208_MACMINI] = {
734+
.type = HDA_FIXUP_FUNC,
735+
.v.func = cs4208_fixup_macmini,
736+
.chained = true,
737+
.chain_id = CS4208_GPIO0,
738+
},
712739
[CS4208_GPIO0] = {
713740
.type = HDA_FIXUP_FUNC,
714741
.v.func = cs4208_fixup_gpio0,

0 commit comments

Comments
 (0)