Commit 1a5ba2e9fc7999b8de2a71c7e7b9f58d752c05e4
Committed by
Takashi Iwai
1 parent
d8d881dd2c
Exists in
master
and in
4 other branches
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>
Showing 2 changed files with 22 additions and 1 deletions Side-by-side Diff
Documentation/sound/alsa/HD-Audio-Models.txt
sound/pci/hda/patch_cirrus.c
... | ... | @@ -66,6 +66,7 @@ |
66 | 66 | /* available models */ |
67 | 67 | enum { |
68 | 68 | CS420X_MBP55, |
69 | + CS420X_IMAC27, | |
69 | 70 | CS420X_AUTO, |
70 | 71 | CS420X_MODELS |
71 | 72 | }; |
... | ... | @@ -827,7 +828,8 @@ |
827 | 828 | AC_VERB_SET_PIN_WIDGET_CONTROL, |
828 | 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 | 833 | unsigned int gpio = hp_present ? 0x02 : 0x08; |
832 | 834 | snd_hda_codec_write(codec, 0x01, 0, |
833 | 835 | AC_VERB_SET_GPIO_DATA, gpio); |
834 | 836 | |
... | ... | @@ -1069,12 +1071,14 @@ |
1069 | 1071 | |
1070 | 1072 | static const char *cs420x_models[CS420X_MODELS] = { |
1071 | 1073 | [CS420X_MBP55] = "mbp55", |
1074 | + [CS420X_IMAC27] = "imac27", | |
1072 | 1075 | [CS420X_AUTO] = "auto", |
1073 | 1076 | }; |
1074 | 1077 | |
1075 | 1078 | |
1076 | 1079 | static struct snd_pci_quirk cs420x_cfg_tbl[] = { |
1077 | 1080 | SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), |
1081 | + SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27), | |
1078 | 1082 | {} /* terminator */ |
1079 | 1083 | }; |
1080 | 1084 | |
1081 | 1085 | |
... | ... | @@ -1097,8 +1101,23 @@ |
1097 | 1101 | {} /* terminator */ |
1098 | 1102 | }; |
1099 | 1103 | |
1104 | +static 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 | + | |
1100 | 1118 | static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = { |
1101 | 1119 | [CS420X_MBP55] = mbp55_pincfgs, |
1120 | + [CS420X_IMAC27] = imac27_pincfgs, | |
1102 | 1121 | }; |
1103 | 1122 | |
1104 | 1123 | static void fix_pincfg(struct hda_codec *codec, int model) |
... | ... | @@ -1128,6 +1147,7 @@ |
1128 | 1147 | fix_pincfg(codec, spec->board_config); |
1129 | 1148 | |
1130 | 1149 | switch (spec->board_config) { |
1150 | + case CS420X_IMAC27: | |
1131 | 1151 | case CS420X_MBP55: |
1132 | 1152 | /* GPIO1 = headphones */ |
1133 | 1153 | /* GPIO3 = speakers */ |