aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorRafael Avila de Espindola <rafael.espindola@gmail.com>2009-12-22 01:59:37 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-22 02:01:07 -0500
commit1a5ba2e9fc7999b8de2a71c7e7b9f58d752c05e4 (patch)
tree6fe82bf1ca8fe6348b029713693f09bd3a8f9edf /sound
parentd8d881dd2c814e1500558889d800cf78d11cf898 (diff)
ALSA: hda - Add support for the new 27 inch IMacs
With the attached patch I am able to use the sound on a new IMac 27. What works: *) Internal speakers *) Internal microphone *) Headphone I don't have an external mic or a SPDIF device to test the rest. Signed-off-by: Rafael Avila de Espindola <rafael.espindola@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-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 4b200da1bd18..fe0423c39598 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};
@@ -827,7 +828,8 @@ static void cs_automute(struct hda_codec *codec)
827 AC_VERB_SET_PIN_WIDGET_CONTROL, 828 AC_VERB_SET_PIN_WIDGET_CONTROL,
828 hp_present ? 0 : PIN_OUT); 829 hp_present ? 0 : PIN_OUT);
829 } 830 }
830 if (spec->board_config == CS420X_MBP55) { 831 if (spec->board_config == CS420X_MBP55 ||
832 spec->board_config == CS420X_IMAC27) {
831 unsigned int gpio = hp_present ? 0x02 : 0x08; 833 unsigned int gpio = hp_present ? 0x02 : 0x08;
832 snd_hda_codec_write(codec, 0x01, 0, 834 snd_hda_codec_write(codec, 0x01, 0,
833 AC_VERB_SET_GPIO_DATA, gpio); 835 AC_VERB_SET_GPIO_DATA, gpio);
@@ -1069,12 +1071,14 @@ static int cs_parse_auto_config(struct hda_codec *codec)
1069 1071
1070static const char *cs420x_models[CS420X_MODELS] = { 1072static const char *cs420x_models[CS420X_MODELS] = {
1071 [CS420X_MBP55] = "mbp55", 1073 [CS420X_MBP55] = "mbp55",
1074 [CS420X_IMAC27] = "imac27",
1072 [CS420X_AUTO] = "auto", 1075 [CS420X_AUTO] = "auto",
1073}; 1076};
1074 1077
1075 1078
1076static struct snd_pci_quirk cs420x_cfg_tbl[] = { 1079static struct snd_pci_quirk cs420x_cfg_tbl[] = {
1077 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), 1080 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
1081 SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
1078 {} /* terminator */ 1082 {} /* terminator */
1079}; 1083};
1080 1084
@@ -1097,8 +1101,23 @@ static struct cs_pincfg mbp55_pincfgs[] = {
1097 {} /* terminator */ 1101 {} /* terminator */
1098}; 1102};
1099 1103
1104static struct cs_pincfg imac27_pincfgs[] = {
1105 { 0x09, 0x012b4050 },
1106 { 0x0a, 0x90100140 },
1107 { 0x0b, 0x90100142 },
1108 { 0x0c, 0x018b3020 },
1109 { 0x0d, 0x90a00110 },
1110 { 0x0e, 0x400000f0 },
1111 { 0x0f, 0x01cbe030 },
1112 { 0x10, 0x014be060 },
1113 { 0x12, 0x01ab9070 },
1114 { 0x15, 0x400000f0 },
1115 {} /* terminator */
1116};
1117
1100static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = { 1118static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
1101 [CS420X_MBP55] = mbp55_pincfgs, 1119 [CS420X_MBP55] = mbp55_pincfgs,
1120 [CS420X_IMAC27] = imac27_pincfgs,
1102}; 1121};
1103 1122
1104static void fix_pincfg(struct hda_codec *codec, int model) 1123static void fix_pincfg(struct hda_codec *codec, int model)
@@ -1128,6 +1147,7 @@ static int patch_cs420x(struct hda_codec *codec)
1128 fix_pincfg(codec, spec->board_config); 1147 fix_pincfg(codec, spec->board_config);
1129 1148
1130 switch (spec->board_config) { 1149 switch (spec->board_config) {
1150 case CS420X_IMAC27:
1131 case CS420X_MBP55: 1151 case CS420X_MBP55:
1132 /* GPIO1 = headphones */ 1152 /* GPIO1 = headphones */
1133 /* GPIO3 = speakers */ 1153 /* GPIO3 = speakers */