]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: hda - Add model=vaio for STAC9872
authorTakashi Iwai <tiwai@suse.de>
Thu, 12 Mar 2009 17:17:58 +0000 (18:17 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 12 Mar 2009 17:17:58 +0000 (18:17 +0100)
Add the default pin config for model=vaio (in case of broken BIOS).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/alsa/HD-Audio-Models.txt
sound/pci/hda/patch_sigmatel.c

index f9253ea3c19f05fa9eae27a9a95bc62819201856..8eec05bc079ebfcc0af9e030ceee652e0a9bf024 100644 (file)
@@ -368,4 +368,5 @@ STAC92HD83*
 
 STAC9872
 ========
-  N/A
+  vaio         VAIO laptop without SPDIF
+  auto         BIOS setup (default)
index 72c87aa20bd9185b0f13c13ddf5292fbc1706f7e..e06fc7decd31d2bbe41cc2b62a96f3667a1b4ed4 100644 (file)
@@ -155,6 +155,12 @@ enum {
        STAC_927X_MODELS
 };
 
+enum {
+       STAC_9872_AUTO,
+       STAC_9872_VAIO,
+       STAC_9872_MODELS
+};
+
 struct sigmatel_event {
        hda_nid_t nid;
        unsigned char type;
@@ -5588,6 +5594,25 @@ static hda_nid_t stac9872_mux_nids[] = {
        0x15
 };
 
+static unsigned int stac9872_vaio_pin_configs[9] = {
+       0x03211020, 0x411111f0, 0x411111f0, 0x03a15030,
+       0x411111f0, 0x90170110, 0x411111f0, 0x411111f0,
+       0x90a7013e
+};
+
+static const char *stac9872_models[STAC_9872_MODELS] = {
+       [STAC_9872_AUTO] = "auto",
+       [STAC_9872_VAIO] = "vaio",
+};
+
+static unsigned int *stac9872_brd_tbl[STAC_9872_MODELS] = {
+       [STAC_9872_VAIO] = stac9872_vaio_pin_configs,
+};
+
+static struct snd_pci_quirk stac9872_cfg_tbl[] = {
+       {} /* terminator */
+};
+
 static int patch_stac9872(struct hda_codec *codec)
 {
        struct sigmatel_spec *spec;
@@ -5598,11 +5623,15 @@ static int patch_stac9872(struct hda_codec *codec)
                return -ENOMEM;
        codec->spec = spec;
 
-#if 0 /* no model right now */
        spec->board_config = snd_hda_check_board_config(codec, STAC_9872_MODELS,
                                                        stac9872_models,
                                                        stac9872_cfg_tbl);
-#endif
+       if (spec->board_config < 0)
+               snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC9872, "
+                           "using BIOS defaults\n");
+       else
+               stac92xx_set_config_regs(codec,
+                                        stac9872_brd_tbl[spec->board_config]);
 
        spec->num_pins = ARRAY_SIZE(stac9872_pin_nids);
        spec->pin_nids = stac9872_pin_nids;