Commit 4e7d7c60 authored by Vince Weaver's avatar Vince Weaver Committed by Takashi Iwai

ALSA: hda - MacBookPro 5,3 line-in support

I've found the following patch is necessary to enable line-in on
my MacBookPro 5,3 machine.  With the patch applied I've successfully
recorded audio from the line-in jack.  This is based on the existing
5,5 support.
Signed-off-by: default avatarVince Weaver <vweaver1@eecs.utk.edu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent abdd8f51
...@@ -65,6 +65,7 @@ struct cs_spec { ...@@ -65,6 +65,7 @@ struct cs_spec {
/* available models */ /* available models */
enum { enum {
CS420X_MBP53,
CS420X_MBP55, CS420X_MBP55,
CS420X_IMAC27, CS420X_IMAC27,
CS420X_AUTO, CS420X_AUTO,
...@@ -839,7 +840,8 @@ static void cs_automute(struct hda_codec *codec) ...@@ -839,7 +840,8 @@ static void cs_automute(struct hda_codec *codec)
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL,
hp_present ? 0 : PIN_OUT); hp_present ? 0 : PIN_OUT);
} }
if (spec->board_config == CS420X_MBP55 || if (spec->board_config == CS420X_MBP53 ||
spec->board_config == CS420X_MBP55 ||
spec->board_config == CS420X_IMAC27) { spec->board_config == CS420X_IMAC27) {
unsigned int gpio = hp_present ? 0x02 : 0x08; unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0, snd_hda_codec_write(codec, 0x01, 0,
...@@ -1128,6 +1130,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) ...@@ -1128,6 +1130,7 @@ static int cs_parse_auto_config(struct hda_codec *codec)
} }
static const char *cs420x_models[CS420X_MODELS] = { static const char *cs420x_models[CS420X_MODELS] = {
[CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55", [CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27", [CS420X_IMAC27] = "imac27",
[CS420X_AUTO] = "auto", [CS420X_AUTO] = "auto",
...@@ -1135,6 +1138,7 @@ static const char *cs420x_models[CS420X_MODELS] = { ...@@ -1135,6 +1138,7 @@ static const char *cs420x_models[CS420X_MODELS] = {
static struct snd_pci_quirk cs420x_cfg_tbl[] = { static struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27), SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
{} /* terminator */ {} /* terminator */
...@@ -1145,6 +1149,20 @@ struct cs_pincfg { ...@@ -1145,6 +1149,20 @@ struct cs_pincfg {
u32 val; u32 val;
}; };
static struct cs_pincfg mbp53_pincfgs[] = {
{ 0x09, 0x012b4050 },
{ 0x0a, 0x90100141 },
{ 0x0b, 0x90100140 },
{ 0x0c, 0x018b3020 },
{ 0x0d, 0x90a00110 },
{ 0x0e, 0x400000f0 },
{ 0x0f, 0x01cbe030 },
{ 0x10, 0x014be060 },
{ 0x12, 0x400000f0 },
{ 0x15, 0x400000f0 },
{} /* terminator */
};
static struct cs_pincfg mbp55_pincfgs[] = { static struct cs_pincfg mbp55_pincfgs[] = {
{ 0x09, 0x012b4030 }, { 0x09, 0x012b4030 },
{ 0x0a, 0x90100121 }, { 0x0a, 0x90100121 },
...@@ -1174,6 +1192,7 @@ static struct cs_pincfg imac27_pincfgs[] = { ...@@ -1174,6 +1192,7 @@ static struct cs_pincfg imac27_pincfgs[] = {
}; };
static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = { static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
[CS420X_MBP53] = mbp53_pincfgs,
[CS420X_MBP55] = mbp55_pincfgs, [CS420X_MBP55] = mbp55_pincfgs,
[CS420X_IMAC27] = imac27_pincfgs, [CS420X_IMAC27] = imac27_pincfgs,
}; };
...@@ -1206,6 +1225,7 @@ static int patch_cs420x(struct hda_codec *codec) ...@@ -1206,6 +1225,7 @@ static int patch_cs420x(struct hda_codec *codec)
switch (spec->board_config) { switch (spec->board_config) {
case CS420X_IMAC27: case CS420X_IMAC27:
case CS420X_MBP53:
case CS420X_MBP55: case CS420X_MBP55:
/* GPIO1 = headphones */ /* GPIO1 = headphones */
/* GPIO3 = speakers */ /* GPIO3 = speakers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment