aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-06 09:15:22 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-06 09:18:46 -0400
commita6bae20559bb0371e89ebc46689e9cf4e7816813 (patch)
treecc878ae405742c2d26610d33366d1ab41f800bc4 /sound
parent60e53882ace216cf58fc847a94d839f32b8eb7bf (diff)
ALSA: hda - Add quirk for MacBook Pro 5,5 with CS4206
Add the default pin configs for MBP55. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_cirrus.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 404c120991bf..b1fd183d7604 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -30,6 +30,7 @@
30 */ 30 */
31 31
32struct cs_spec { 32struct cs_spec {
33 int board_config;
33 struct auto_pin_cfg autocfg; 34 struct auto_pin_cfg autocfg;
34 struct hda_multi_out multiout; 35 struct hda_multi_out multiout;
35 struct snd_kcontrol *vmaster_sw; 36 struct snd_kcontrol *vmaster_sw;
@@ -58,6 +59,13 @@ struct cs_spec {
58 unsigned int mic_detect:1; 59 unsigned int mic_detect:1;
59}; 60};
60 61
62/* available models */
63enum {
64 CS420X_MBP55,
65 CS420X_AUTO,
66 CS420X_MODELS
67};
68
61/* Vendor-specific processing widget */ 69/* Vendor-specific processing widget */
62#define CS420X_VENDOR_NID 0x11 70#define CS420X_VENDOR_NID 0x11
63#define CS_DIG_OUT1_PIN_NID 0x10 71#define CS_DIG_OUT1_PIN_NID 0x10
@@ -1038,6 +1046,49 @@ static int cs_parse_auto_config(struct hda_codec *codec)
1038 return 0; 1046 return 0;
1039} 1047}
1040 1048
1049static const char *cs420x_models[CS420X_MODELS] = {
1050 [CS420X_MBP55] = "mbp55",
1051 [CS420X_AUTO] = "auto",
1052};
1053
1054
1055static struct snd_pci_quirk cs420x_cfg_tbl[] = {
1056 SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
1057 {} /* terminator */
1058};
1059
1060struct cs_pincfg {
1061 hda_nid_t nid;
1062 u32 val;
1063};
1064
1065static struct cs_pincfg mbp55_pincfgs[] = {
1066 { 0x09, 0x012b4030 },
1067 { 0x0a, 0x90100121 },
1068 { 0x0b, 0x90100120 },
1069 { 0x0c, 0x400000f0 },
1070 { 0x0d, 0x90a00110 },
1071 { 0x0e, 0x400000f0 },
1072 { 0x0f, 0x400000f0 },
1073 { 0x10, 0x014be040 },
1074 { 0x12, 0x400000f0 },
1075 { 0x15, 0x400000f0 },
1076 {} /* terminator */
1077};
1078
1079static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
1080 [CS420X_MBP55] = mbp55_pincfgs,
1081};
1082
1083static void fix_pincfg(struct hda_codec *codec, int model)
1084{
1085 const struct cs_pincfg *cfg = cs_pincfgs[model];
1086 if (!cfg)
1087 return;
1088 for (; cfg->nid; cfg++)
1089 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
1090}
1091
1041 1092
1042static int patch_cs420x(struct hda_codec *codec) 1093static int patch_cs420x(struct hda_codec *codec)
1043{ 1094{
@@ -1049,6 +1100,12 @@ static int patch_cs420x(struct hda_codec *codec)
1049 return -ENOMEM; 1100 return -ENOMEM;
1050 codec->spec = spec; 1101 codec->spec = spec;
1051 1102
1103 spec->board_config =
1104 snd_hda_check_board_config(codec, CS420X_MODELS,
1105 cs420x_models, cs420x_cfg_tbl);
1106 if (spec->board_config >= 0)
1107 fix_pincfg(codec, spec->board_config);
1108
1052 err = cs_parse_auto_config(codec); 1109 err = cs_parse_auto_config(codec);
1053 if (err < 0) 1110 if (err < 0)
1054 goto error; 1111 goto error;