summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_cirrus.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-06 15:15:22 +0200
committerTakashi Iwai <tiwai@suse.de>2009-07-06 15:18:46 +0200
commita6bae20559bb0371e89ebc46689e9cf4e7816813 (patch)
treecc878ae405742c2d26610d33366d1ab41f800bc4 /sound/pci/hda/patch_cirrus.c
parent60e53882ace216cf58fc847a94d839f32b8eb7bf (diff)
downloadlinux-3.10-a6bae20559bb0371e89ebc46689e9cf4e7816813.tar.gz
linux-3.10-a6bae20559bb0371e89ebc46689e9cf4e7816813.tar.bz2
linux-3.10-a6bae20559bb0371e89ebc46689e9cf4e7816813.zip
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/pci/hda/patch_cirrus.c')
-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 404c120991b..b1fd183d760 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -30,6 +30,7 @@
*/
struct cs_spec {
+ int board_config;
struct auto_pin_cfg autocfg;
struct hda_multi_out multiout;
struct snd_kcontrol *vmaster_sw;
@@ -58,6 +59,13 @@ struct cs_spec {
unsigned int mic_detect:1;
};
+/* available models */
+enum {
+ CS420X_MBP55,
+ CS420X_AUTO,
+ CS420X_MODELS
+};
+
/* Vendor-specific processing widget */
#define CS420X_VENDOR_NID 0x11
#define CS_DIG_OUT1_PIN_NID 0x10
@@ -1038,6 +1046,49 @@ static int cs_parse_auto_config(struct hda_codec *codec)
return 0;
}
+static const char *cs420x_models[CS420X_MODELS] = {
+ [CS420X_MBP55] = "mbp55",
+ [CS420X_AUTO] = "auto",
+};
+
+
+static struct snd_pci_quirk cs420x_cfg_tbl[] = {
+ SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
+ {} /* terminator */
+};
+
+struct cs_pincfg {
+ hda_nid_t nid;
+ u32 val;
+};
+
+static struct cs_pincfg mbp55_pincfgs[] = {
+ { 0x09, 0x012b4030 },
+ { 0x0a, 0x90100121 },
+ { 0x0b, 0x90100120 },
+ { 0x0c, 0x400000f0 },
+ { 0x0d, 0x90a00110 },
+ { 0x0e, 0x400000f0 },
+ { 0x0f, 0x400000f0 },
+ { 0x10, 0x014be040 },
+ { 0x12, 0x400000f0 },
+ { 0x15, 0x400000f0 },
+ {} /* terminator */
+};
+
+static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
+ [CS420X_MBP55] = mbp55_pincfgs,
+};
+
+static void fix_pincfg(struct hda_codec *codec, int model)
+{
+ const struct cs_pincfg *cfg = cs_pincfgs[model];
+ if (!cfg)
+ return;
+ for (; cfg->nid; cfg++)
+ snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
+}
+
static int patch_cs420x(struct hda_codec *codec)
{
@@ -1049,6 +1100,12 @@ static int patch_cs420x(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ spec->board_config =
+ snd_hda_check_board_config(codec, CS420X_MODELS,
+ cs420x_models, cs420x_cfg_tbl);
+ if (spec->board_config >= 0)
+ fix_pincfg(codec, spec->board_config);
+
err = cs_parse_auto_config(codec);
if (err < 0)
goto error;