[ALSA] Add VT1617A codec support
authorPhilip Prindeville <philipp_subx@redfish-solutions.com>
Fri, 12 Aug 2005 14:46:17 +0000 (16:46 +0200)
committerJaroslav Kysela <perex@suse.cz>
Tue, 30 Aug 2005 06:45:22 +0000 (08:45 +0200)
AC97 Codec
Added (minimal) support of VT1617A codec with SPDIF.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_patch.c
sound/pci/ac97/ac97_patch.h

index 33dba10f03e86a64cad7261f09817716a498b6a7..600e053dfd357392393f4d2704a0d7ca184faf2a 100644 (file)
@@ -157,6 +157,7 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
 { 0x54524123, 0xffffffff, "TR28602",           NULL,           NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)]
 { 0x54584e20, 0xffffffff, "TLC320AD9xC",       NULL,           NULL },
 { 0x56494161, 0xffffffff, "VIA1612A",          NULL,           NULL }, // modified ICE1232 with S/PDIF
+{ 0x56494170, 0xffffffff, "VIA1617A",          patch_vt1617a,  NULL }, // modified VT1616 with S/PDIF
 { 0x57454301, 0xffffffff, "W83971D",           NULL,           NULL },
 { 0x574d4c00, 0xffffffff, "WM9701A",           NULL,           NULL },
 { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
@@ -2580,8 +2581,6 @@ int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *o
 {
        int result;
 
-       snd_assert(quirk, return -EINVAL);
-
        /* quirk overriden? */
        if (override && strcmp(override, "-1") && strcmp(override, "default")) {
                result = apply_quirk_str(ac97, override);
@@ -2590,6 +2589,9 @@ int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *o
                return result;
        }
 
+       if (! quirk)
+               return -EINVAL;
+
        for (; quirk->subvendor; quirk++) {
                if (quirk->subvendor != ac97->subsystem_vendor)
                        continue;
index b0b31f4015aaf9473b75babf9459b7c76d3941f0..a0d51553617798ec3214b159a7e5693545d7587d 100644 (file)
@@ -375,7 +375,7 @@ AC97_DOUBLE("Front Playback Volume", AC97_WM97XX_FMIXER_VOL, 8, 0, 31, 1),
 AC97_SINGLE("Front Playback Switch", AC97_WM97XX_FMIXER_VOL, 15, 1, 1),
 };
 
-static int patch_wolfson_wm9703_specific(ac97_t * ac97)
+int patch_wolfson_wm9703_specific(ac97_t * ac97)
 {
        /* This is known to work for the ViewSonic ViewPad 1000
         * Randolph Bentson <bentson@holmsjoen.com>
@@ -410,7 +410,7 @@ AC97_DOUBLE("Rear DAC Volume", AC97_WM9704_RPCM_VOL, 8, 0, 31, 1),
 AC97_DOUBLE("Surround Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
 };
 
-static int patch_wolfson_wm9704_specific(ac97_t * ac97)
+int patch_wolfson_wm9704_specific(ac97_t * ac97)
 {
        int err, i;
        for (i = 0; i < ARRAY_SIZE(wm9704_snd_ac97_controls); i++) {
@@ -433,7 +433,7 @@ int patch_wolfson04(ac97_t * ac97)
        return 0;
 }
 
-static int patch_wolfson_wm9705_specific(ac97_t * ac97)
+int patch_wolfson_wm9705_specific(ac97_t * ac97)
 {
        int err, i;
        for (i = 0; i < ARRAY_SIZE(wm97xx_snd_ac97_controls); i++) {
@@ -558,7 +558,7 @@ AC97_SINGLE("Headphone ZC Switch", AC97_HEADPHONE, 7, 1, 0),
 AC97_SINGLE("Mono ZC Switch", AC97_MASTER_MONO, 7, 1, 0),
 };
 
-static int patch_wolfson_wm9711_specific(ac97_t * ac97)
+int patch_wolfson_wm9711_specific(ac97_t * ac97)
 {
        int err, i;
        
@@ -2665,6 +2665,16 @@ int patch_vt1616(ac97_t * ac97)
        return 0;
 }
 
+/*
+ * VT1617A codec
+ */
+int patch_vt1617a(ac97_t * ac97)
+{
+       ac97->ext_id |= AC97_EI_SPDIF;  /* force the detection of spdif */
+       ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
+       return 0;
+}
+
 /*
  */
 static void it2646_update_jacks(ac97_t *ac97)
index 7b7377d0f2ae4d3926e3cd7e379be16d488d3027..ec181132010660e2d3015124b98b6b7923132c3b 100644 (file)
@@ -56,5 +56,6 @@ int patch_cm9739(ac97_t * ac97);
 int patch_cm9761(ac97_t * ac97);
 int patch_cm9780(ac97_t * ac97);
 int patch_vt1616(ac97_t * ac97);
+int patch_vt1617a(ac97_t * ac97);
 int patch_it2646(ac97_t * ac97);
 int mpatch_si3036(ac97_t * ac97);