Skip to content

Commit

Permalink
ALSA: hda - Fix pin configurations for MacBook Air 4,2
Browse files Browse the repository at this point in the history
MacBook Air 4,2 requires the whole default pin configuration table to
be overridden by the driver, as usual, as Apple's machines don't set
up properly after boot.  Otherwise mic won't work, and other ill
effect may happen.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59381
Reported-and-tested-by: Peter John Hartman <peterjohnhartman@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 17, 2013
1 parent 342cda2 commit 6ab982e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum {
CS420X_GPIO_23,
CS420X_MBP101,
CS420X_MBP81,
CS420X_MBA42,
CS420X_AUTO,
/* aliases */
CS420X_IMAC27_122 = CS420X_GPIO_23,
Expand Down Expand Up @@ -346,6 +347,7 @@ static const struct hda_model_fixup cs420x_models[] = {
{ .id = CS420X_APPLE, .name = "apple" },
{ .id = CS420X_MBP101, .name = "mbp101" },
{ .id = CS420X_MBP81, .name = "mbp81" },
{ .id = CS420X_MBA42, .name = "mba42" },
{}
};

Expand All @@ -361,6 +363,7 @@ static const struct snd_pci_quirk cs420x_fixup_tbl[] = {
SND_PCI_QUIRK(0x106b, 0x1c00, "MacBookPro 8,1", CS420X_MBP81),
SND_PCI_QUIRK(0x106b, 0x2000, "iMac 12,2", CS420X_IMAC27_122),
SND_PCI_QUIRK(0x106b, 0x2800, "MacBookPro 10,1", CS420X_MBP101),
SND_PCI_QUIRK(0x106b, 0x5b00, "MacBookAir 4,2", CS420X_MBA42),
SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
{} /* terminator */
};
Expand Down Expand Up @@ -414,6 +417,20 @@ static const struct hda_pintbl mbp101_pincfgs[] = {
{} /* terminator */
};

static const struct hda_pintbl mba42_pincfgs[] = {
{ 0x09, 0x012b4030 }, /* HP */
{ 0x0a, 0x400000f0 },
{ 0x0b, 0x90100120 }, /* speaker */
{ 0x0c, 0x400000f0 },
{ 0x0d, 0x90a00110 }, /* mic */
{ 0x0e, 0x400000f0 },
{ 0x0f, 0x400000f0 },
{ 0x10, 0x400000f0 },
{ 0x12, 0x400000f0 },
{ 0x15, 0x400000f0 },
{} /* terminator */
};

static void cs420x_fixup_gpio_13(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
Expand Down Expand Up @@ -482,6 +499,12 @@ static const struct hda_fixup cs420x_fixups[] = {
.chained = true,
.chain_id = CS420X_GPIO_13,
},
[CS420X_MBA42] = {
.type = HDA_FIXUP_PINS,
.v.pins = mba42_pincfgs,
.chained = true,
.chain_id = CS420X_GPIO_13,
},
};

static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid)
Expand Down

0 comments on commit 6ab982e

Please sign in to comment.