aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cirrus.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-23 02:38:23 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-23 02:38:23 -0500
commit524027916e5763a0c9a7da80aa8dd013a14a0440 (patch)
treeed576766b050122065f5c548adb22f9ce277a2a0 /sound/pci/hda/patch_cirrus.c
parent75d1aeb9d6899b10420d10284e8ea894b2794224 (diff)
parent9dc8398bab52931435fce403ce2eaf5822f28e58 (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci/hda/patch_cirrus.c')
-rw-r--r--sound/pci/hda/patch_cirrus.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index eeb91f6a06c..093cfbb55e9 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -66,6 +66,7 @@ struct cs_spec {
66/* available models */ 66/* available models */
67enum { 67enum {
68 CS420X_MBP55, 68 CS420X_MBP55,
69 CS420X_IMAC27,
69 CS420X_AUTO, 70 CS420X_AUTO,
70 CS420X_MODELS 71 CS420X_MODELS
71}; 72};
@@ -833,7 +834,8 @@ static void cs_automute(struct hda_codec *codec)
833 AC_VERB_SET_PIN_WIDGET_CONTROL, 834 AC_VERB_SET_PIN_WIDGET_CONTROL,
834 hp_present ? 0 : PIN_OUT); 835 hp_present ? 0 : PIN_OUT);
835 } 836 }
836 if (spec->board_config == CS420X_MBP55) { 837 if (spec->board_config == CS420X_MBP55 ||
838 spec->board_config == CS420X_IMAC27) {
837 unsigned int gpio = hp_present ? 0x02 : 0x08; 839 unsigned int gpio = hp_present ? 0x02 : 0x08;
838 snd_hda_codec_write(codec, 0x01, 0, 840 snd_hda_codec_write(codec, 0x01, 0,
839 AC_VERB_SET_GPIO_DATA, gpio); 841 AC_VERB_SET_GPIO_DATA, gpio);
@@ -1075,12 +1077,14 @@ static int cs_parse_auto_config(struct hda_codec *codec)
1075 1077
1076static const char *cs420x_models[CS420X_MODELS] = { 1078static const char *cs420x_models[CS420X_MODELS] = {
1077 [CS420X_MBP55] = "mbp55", 1079 [CS420X_MBP55] = "mbp55",
1080 [CS420X_IMAC27] = "imac27",
1078 [CS420X_AUTO] = "auto", 1081 [CS420X_AUTO] = "auto",
1079}; 1082};
1080 1083
1081 1084
1082static struct snd_pci_quirk cs420x_cfg_tbl[] = { 1085static struct snd_pci_quirk cs420x_cfg_tbl[] = {
1083 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), 1086 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
1087 SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
1084 {} /* terminator */ 1088 {} /* terminator */
1085}; 1089};
1086 1090
@@ -1103,8 +1107,23 @@ static struct cs_pincfg mbp55_pincfgs[] = {
1103 {} /* terminator */ 1107 {} /* terminator */
1104}; 1108};
1105 1109
1110static struct cs_pincfg imac27_pincfgs[] = {
1111 { 0x09, 0x012b4050 },
1112 { 0x0a, 0x90100140 },
1113 { 0x0b, 0x90100142 },
1114 { 0x0c, 0x018b3020 },
1115 { 0x0d, 0x90a00110 },
1116 { 0x0e, 0x400000f0 },
1117 { 0x0f, 0x01cbe030 },
1118 { 0x10, 0x014be060 },
1119 { 0x12, 0x01ab9070 },
1120 { 0x15, 0x400000f0 },
1121 {} /* terminator */
1122};
1123
1106static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = { 1124static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
1107 [CS420X_MBP55] = mbp55_pincfgs, 1125 [CS420X_MBP55] = mbp55_pincfgs,
1126 [CS420X_IMAC27] = imac27_pincfgs,
1108}; 1127};
1109 1128
1110static void fix_pincfg(struct hda_codec *codec, int model) 1129static void fix_pincfg(struct hda_codec *codec, int model)
@@ -1134,6 +1153,7 @@ static int patch_cs420x(struct hda_codec *codec)
1134 fix_pincfg(codec, spec->board_config); 1153 fix_pincfg(codec, spec->board_config);
1135 1154
1136 switch (spec->board_config) { 1155 switch (spec->board_config) {
1156 case CS420X_IMAC27:
1137 case CS420X_MBP55: 1157 case CS420X_MBP55:
1138 /* GPIO1 = headphones */ 1158 /* GPIO1 = headphones */
1139 /* GPIO3 = speakers */ 1159 /* GPIO3 = speakers */