aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-08 06:50:31 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-08 07:50:56 -0500
commit885845d78551be7bf8570f6283df8b7a7797c4d1 (patch)
tree0065525685ddb145e92816a4b6ef990c299a3e56 /sound/pci/hda
parent380702192f616df5b2ba704b85cc479a3da92c91 (diff)
ALSA: hda - Apply MacBook fixups for CS4208 correctly
The commit [8fe7b65ab465: ALSA: hda - Apply GPIO setup for MacBooks with CS4208] added a fixup entry matching with the vendor id 0x106b. This broke the fixups for previous MBA6,1 and 6,2, since the PCI SSID vendor id matches before evaluating the codec SSIDs. We had a similar issue on Mac with Sigmatel codecs, and solve this problem again similarly, by introducing a skeleton entry matching with the all MacBooks, then remap to the right one. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401 Fixes: 8fe7b65ab465 ('ALSA: hda - Apply GPIO setup for MacBooks with CS4208') Cc: <stable@vger.kernel.org> [v3.12+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_cirrus.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 1ce1f4067b15..072755c8289c 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -597,6 +597,7 @@ static int patch_cs420x(struct hda_codec *codec)
597 * Its layout is no longer compatible with CS4206/CS4207 597 * Its layout is no longer compatible with CS4206/CS4207
598 */ 598 */
599enum { 599enum {
600 CS4208_MAC_AUTO,
600 CS4208_MBA6, 601 CS4208_MBA6,
601 CS4208_GPIO0, 602 CS4208_GPIO0,
602}; 603};
@@ -608,10 +609,14 @@ static const struct hda_model_fixup cs4208_models[] = {
608}; 609};
609 610
610static const struct snd_pci_quirk cs4208_fixup_tbl[] = { 611static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
611 /* codec SSID */ 612 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_MAC_AUTO),
613 {} /* terminator */
614};
615
616/* codec SSID matching */
617static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
612 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), 618 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
613 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), 619 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
614 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_GPIO0),
615 {} /* terminator */ 620 {} /* terminator */
616}; 621};
617 622
@@ -627,6 +632,20 @@ static void cs4208_fixup_gpio0(struct hda_codec *codec,
627 } 632 }
628} 633}
629 634
635static const struct hda_fixup cs4208_fixups[];
636
637/* remap the fixup from codec SSID and apply it */
638static void cs4208_fixup_mac(struct hda_codec *codec,
639 const struct hda_fixup *fix, int action)
640{
641 if (action != HDA_FIXUP_ACT_PRE_PROBE)
642 return;
643 snd_hda_pick_fixup(codec, NULL, cs4208_mac_fixup_tbl, cs4208_fixups);
644 if (codec->fixup_id < 0 || codec->fixup_id == CS4208_MAC_AUTO)
645 codec->fixup_id = CS4208_GPIO0; /* default fixup */
646 snd_hda_apply_fixup(codec, action);
647}
648
630static const struct hda_fixup cs4208_fixups[] = { 649static const struct hda_fixup cs4208_fixups[] = {
631 [CS4208_MBA6] = { 650 [CS4208_MBA6] = {
632 .type = HDA_FIXUP_PINS, 651 .type = HDA_FIXUP_PINS,
@@ -638,6 +657,10 @@ static const struct hda_fixup cs4208_fixups[] = {
638 .type = HDA_FIXUP_FUNC, 657 .type = HDA_FIXUP_FUNC,
639 .v.func = cs4208_fixup_gpio0, 658 .v.func = cs4208_fixup_gpio0,
640 }, 659 },
660 [CS4208_MAC_AUTO] = {
661 .type = HDA_FIXUP_FUNC,
662 .v.func = cs4208_fixup_mac,
663 },
641}; 664};
642 665
643/* correct the 0dB offset of input pins */ 666/* correct the 0dB offset of input pins */