aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-07 03:04:26 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-07 03:04:26 -0400
commited208255e700073c34b0ef8d2045ac030ac28971 (patch)
tree1506239155a0841175ad5f3641dc7c0fc5250482 /sound
parenta6bae20559bb0371e89ebc46689e9cf4e7816813 (diff)
ALSA: hda - Add GPIO setup for MacBook pro 5,5 with CS420x
GPIO3 seems corresponding to EAPD that is required for the speaker output. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_cirrus.c49
1 files changed, 36 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index b1fd183d760..12173448009 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -53,6 +53,10 @@ struct cs_spec {
53 53
54 struct hda_bind_ctls *capture_bind[2]; 54 struct hda_bind_ctls *capture_bind[2];
55 55
56 unsigned int gpio_mask;
57 unsigned int gpio_dir;
58 unsigned int gpio_data;
59
56 struct hda_pcm pcm_rec[2]; /* PCM information */ 60 struct hda_pcm pcm_rec[2]; /* PCM information */
57 61
58 unsigned int hp_detect:1; 62 unsigned int hp_detect:1;
@@ -981,6 +985,16 @@ static int cs_init(struct hda_codec *codec)
981 struct cs_spec *spec = codec->spec; 985 struct cs_spec *spec = codec->spec;
982 986
983 snd_hda_sequence_write(codec, cs_coef_init_verbs); 987 snd_hda_sequence_write(codec, cs_coef_init_verbs);
988
989 if (spec->gpio_mask) {
990 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK,
991 spec->gpio_mask);
992 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION,
993 spec->gpio_dir);
994 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
995 spec->gpio_data);
996 }
997
984 init_output(codec); 998 init_output(codec);
985 init_input(codec); 999 init_input(codec);
986 init_digital(codec); 1000 init_digital(codec);
@@ -1043,6 +1057,19 @@ static int cs_parse_auto_config(struct hda_codec *codec)
1043 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); 1057 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL);
1044 if (err < 0) 1058 if (err < 0)
1045 return err; 1059 return err;
1060
1061 err = parse_output(codec);
1062 if (err < 0)
1063 return err;
1064 err = parse_input(codec);
1065 if (err < 0)
1066 return err;
1067 err = parse_digital_output(codec);
1068 if (err < 0)
1069 return err;
1070 err = parse_digital_input(codec);
1071 if (err < 0)
1072 return err;
1046 return 0; 1073 return 0;
1047} 1074}
1048 1075
@@ -1106,20 +1133,16 @@ static int patch_cs420x(struct hda_codec *codec)
1106 if (spec->board_config >= 0) 1133 if (spec->board_config >= 0)
1107 fix_pincfg(codec, spec->board_config); 1134 fix_pincfg(codec, spec->board_config);
1108 1135
1109 err = cs_parse_auto_config(codec); 1136 switch (spec->board_config) {
1110 if (err < 0) 1137 case CS420X_MBP55:
1111 goto error; 1138 /* GPIO3 = EAPD? */
1139 spec->gpio_mask = 0x08;
1140 spec->gpio_dir = 0x08;
1141 spec->gpio_data = 0x08;
1142 break;
1143 }
1112 1144
1113 err = parse_output(codec); 1145 err = cs_parse_auto_config(codec);
1114 if (err < 0)
1115 goto error;
1116 err = parse_input(codec);
1117 if (err < 0)
1118 goto error;
1119 err = parse_digital_output(codec);
1120 if (err < 0)
1121 goto error;
1122 err = parse_digital_input(codec);
1123 if (err < 0) 1146 if (err < 0)
1124 goto error; 1147 goto error;
1125 1148