]> err.no Git - linux-2.6/commitdiff
[ALSA] ac97 - Fix confliction of DRA and surround slots
authorTakashi Iwai <tiwai@suse.de>
Thu, 27 Oct 2005 18:56:35 +0000 (20:56 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 4 Nov 2005 12:20:34 +0000 (13:20 +0100)
Modules: AC97 Codec

Fixed the confliction of DRA and surround slots 7/8.

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

index 3b589104510b1e0aa4115a1e5576b5024280a529..9bde76c4c6a2d332ddfeef34edf449e95e44734e 100644 (file)
@@ -2046,6 +2046,8 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
                snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, AC97_GP_DRSS_MASK, AC97_GP_DRSS_78);
                if ((snd_ac97_read(ac97, AC97_GENERAL_PURPOSE) & AC97_GP_DRSS_MASK) == AC97_GP_DRSS_78)
                        ac97->flags |= AC97_DOUBLE_RATE;
+               /* restore to slots 10/11 to avoid the confliction with surrounds */
+               snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, AC97_GP_DRSS_MASK, 0);
        }
        if (ac97->ext_id & AC97_EI_VRA) {       /* VRA support */
                snd_ac97_determine_rates(ac97, AC97_PCM_FRONT_DAC_RATE, 0, &ac97->rates[AC97_RATES_FRONT_DAC]);
index dd289b9512e13b55c2f088464572380a4aad00dc..ded13165d635e24113e2c8f935f08399dafaadaf 100644 (file)
@@ -303,6 +303,15 @@ int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate)
                                     AC97_EA_DRA, dbl ? AC97_EA_DRA : 0);
        snd_ac97_update(ac97, reg, tmp & 0xffff);
        snd_ac97_read(ac97, reg);
+       if ((ac97->ext_id & AC97_EI_DRA) && reg == AC97_PCM_FRONT_DAC_RATE) {
+               /* Intel controllers require double rate data to be put in
+                * slots 7+8
+                */
+               snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE,
+                                    AC97_GP_DRSS_MASK,
+                                    dbl ? AC97_GP_DRSS_78 : 0);
+               snd_ac97_read(ac97, AC97_GENERAL_PURPOSE);
+       }
        return 0;
 }