Update of /cvsroot/alsa/alsa-kernel/pci/ac97
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31782

Modified Files:
        ac97_codec.c ac97_patch.c ac97_patch.h 
Log Message:
Clemens Ladisch <[EMAIL PROTECTED]>:
added AD1888 support.


Index: ac97_codec.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- ac97_codec.c        9 Feb 2004 12:01:07 -0000       1.120
+++ ac97_codec.c        11 Feb 2004 12:14:40 -0000      1.121
@@ -100,6 +100,7 @@
 { 0x41445361, 0xffffffff, "AD1886",            patch_ad1886,   NULL },
 { 0x41445362, 0xffffffff, "AD1887",            patch_ad1881,   NULL },
 { 0x41445363, 0xffffffff, "AD1886A",           patch_ad1881,   NULL },
+{ 0x41445368, 0xffffffff, "AD1888",            patch_ad1888,   NULL },
 { 0x41445370, 0xffffffff, "AD1980",            patch_ad1980,   NULL },
 { 0x41445372, 0xffffffff, "AD1981A",           patch_ad1981a,  NULL },
 { 0x41445374, 0xffffffff, "AD1981B",           patch_ad1981b,  NULL },

Index: ac97_patch.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- ac97_patch.c        11 Feb 2004 12:09:07 -0000      1.35
+++ ac97_patch.c        11 Feb 2004 12:14:40 -0000      1.36
@@ -802,7 +802,7 @@
        return 0;
 }
 
-static int snd_ac97_ad1980_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t 
*uinfo)
+static int snd_ac97_ad1888_lohpsel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t 
*uinfo)
 {
        uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
        uinfo->count = 1;
@@ -811,7 +811,7 @@
        return 0;
 }
 
-static int snd_ac97_ad1980_lohpsel_get(snd_kcontrol_t *kcontrol, 
snd_ctl_elem_value_t* ucontrol)
+static int snd_ac97_ad1888_lohpsel_get(snd_kcontrol_t *kcontrol, 
snd_ctl_elem_value_t* ucontrol)
 {
        ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
        unsigned short val;
@@ -821,7 +821,7 @@
        return 0;
 }
 
-static int snd_ac97_ad1980_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t 
*ucontrol)
+static int snd_ac97_ad1888_lohpsel_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t 
*ucontrol)
 {
        ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
        unsigned short val;
@@ -832,7 +832,7 @@
                                    AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val);
 }
 
-static int snd_ac97_ad1980_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t 
*uinfo)
+static int snd_ac97_ad1888_downmix_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t 
*uinfo)
 {
        static char *texts[3] = {"Off", "6 -> 4", "6 -> 2"};
 
@@ -845,7 +845,7 @@
        return 0;
 }
 
-static int snd_ac97_ad1980_downmix_get(snd_kcontrol_t *kcontrol, 
snd_ctl_elem_value_t* ucontrol)
+static int snd_ac97_ad1888_downmix_get(snd_kcontrol_t *kcontrol, 
snd_ctl_elem_value_t* ucontrol)
 {
        ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
        unsigned short val;
@@ -858,7 +858,7 @@
        return 0;
 }
 
-static int snd_ac97_ad1980_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t 
*ucontrol)
+static int snd_ac97_ad1888_downmix_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t 
*ucontrol)
 {
        ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
        unsigned short val;
@@ -874,51 +874,47 @@
                                    AC97_AD198X_DMIX0 | AC97_AD198X_DMIX1, val);
 }
 
-static const snd_kcontrol_new_t snd_ac97_ad1980_controls[] = {
+static const snd_kcontrol_new_t snd_ac97_ad1888_controls[] = {
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                .name = "Exchange Front/Surround",
-               .info = snd_ac97_ad1980_lohpsel_info,
-               .get = snd_ac97_ad1980_lohpsel_get,
-               .put = snd_ac97_ad1980_lohpsel_put
+               .info = snd_ac97_ad1888_lohpsel_info,
+               .get = snd_ac97_ad1888_lohpsel_get,
+               .put = snd_ac97_ad1888_lohpsel_put
        },
        AC97_SINGLE("Spread Front to Surround and Center/LFE", AC97_AD_MISC, 7, 1, 0),
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                .name = "Downmix",
-               .info = snd_ac97_ad1980_downmix_info,
-               .get = snd_ac97_ad1980_downmix_get,
-               .put = snd_ac97_ad1980_downmix_put
+               .info = snd_ac97_ad1888_downmix_info,
+               .get = snd_ac97_ad1888_downmix_get,
+               .put = snd_ac97_ad1888_downmix_put
        },
        AC97_SINGLE("Surround Jack as Input", AC97_AD_MISC, 12, 1, 0),
        AC97_SINGLE("Center/LFE Jack as Input", AC97_AD_MISC, 11, 1, 0),
 };
 
-static int patch_ad1980_specific(ac97_t *ac97)
+static int patch_ad1888_specific(ac97_t *ac97)
 {
-       int err;
-
        /* rename 0x04 as "Master" and 0x02 as "Master Surround" */
        snd_ac97_rename_ctl(ac97, "Master Playback Switch", "Master Surround Playback 
Switch");
        snd_ac97_rename_ctl(ac97, "Master Playback Volume", "Master Surround Playback 
Volume");
        snd_ac97_rename_ctl(ac97, "Headphone Playback Switch", "Master Playback 
Switch");
        snd_ac97_rename_ctl(ac97, "Headphone Playback Volume", "Master Playback 
Volume");
-       if ((err = patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1)) < 0)
-               return err;
-       return patch_build_controls(ac97, snd_ac97_ad1980_controls, 
ARRAY_SIZE(snd_ac97_ad1980_controls));
+       return patch_build_controls(ac97, snd_ac97_ad1888_controls, 
ARRAY_SIZE(snd_ac97_ad1888_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1980_build_ops = {
+static struct snd_ac97_build_ops patch_ad1888_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
-       .build_specific = patch_ad1980_specific
+       .build_specific = patch_ad1888_specific
 };
 
-int patch_ad1980(ac97_t * ac97)
+int patch_ad1888(ac97_t * ac97)
 {
        unsigned short misc;
        
        patch_ad1881(ac97);
-       ac97->build_ops = &patch_ad1980_build_ops;
+       ac97->build_ops = &patch_ad1888_build_ops;
        /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */
        /* it seems that most vendors connect line-out connector to headphone out of 
AC'97 */
        /* AD-compatible mode */
@@ -933,6 +929,27 @@
        return 0;
 }
 
+static int patch_ad1980_specific(ac97_t *ac97)
+{
+       int err;
+
+       if ((err = patch_ad1888_specific(ac97)) < 0)
+               return err;
+       return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
+}
+
+static struct snd_ac97_build_ops patch_ad1980_build_ops = {
+       .build_post_spdif = patch_ad198x_post_spdif,
+       .build_specific = patch_ad1980_specific
+};
+
+int patch_ad1980(ac97_t * ac97)
+{
+       patch_ad1888(ac97);
+       ac97->build_ops = &patch_ad1980_build_ops;
+       return 0;
+}
+
 static const snd_kcontrol_new_t snd_ac97_ad1985_controls[] = {
        AC97_SINGLE("Center/LFE Jack as Mic", AC97_AD_SERIAL_CFG, 9, 1, 0),
        AC97_SINGLE("Exchange Center/LFE", AC97_AD_SERIAL_CFG, 3, 1, 0)

Index: ac97_patch.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ac97_patch.h        12 Jan 2004 14:38:06 -0000      1.13
+++ ac97_patch.h        11 Feb 2004 12:14:40 -0000      1.14
@@ -41,6 +41,7 @@
 int patch_ad1881(ac97_t * ac97);
 int patch_ad1885(ac97_t * ac97);
 int patch_ad1886(ac97_t * ac97);
+int patch_ad1888(ac97_t * ac97);
 int patch_ad1980(ac97_t * ac97);
 int patch_ad1981a(ac97_t * ac97);
 int patch_ad1981b(ac97_t * ac97);



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to