ALSA: emu10k1: stop doing weird things with HCFG in snd_emu10k1_emu1010_init()
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Fri, 21 Apr 2023 14:10:03 +0000 (16:10 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 22 Apr 2023 08:42:27 +0000 (10:42 +0200)
This doesn't do anything snd_emu10k1_init() wouldn't do later, and none
of the things it does seem relevant for the function itself (which is
pretty much about setting up the FPGA). It was probably a Windows
driver behavior cargo-culting artifact.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230421141006.1005539-4-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/emu10k1/emu10k1_main.c

index 29b6da6..a4e4f60 100644 (file)
@@ -831,24 +831,10 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
        int err;
 
        dev_info(emu->card->dev, "emu1010: Special config.\n");
-       /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
-        * Lock Sound Memory Cache, Lock Tank Memory Cache,
-        * Mute all codecs.
-        */
-       outl(0x0005a00c, emu->port + HCFG);
-       /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
-        * Lock Tank Memory Cache,
-        * Mute all codecs.
-        */
-       outl(0x0005a004, emu->port + HCFG);
-       /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
-        * Mute all codecs.
-        */
-       outl(0x0005a000, emu->port + HCFG);
-       /* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
-        * Mute all codecs.
-        */
-       outl(0x0005a000, emu->port + HCFG);
+
+       /* Mute, and disable audio and lock cache, just in case.
+        * Proper init follows in snd_emu10k1_init(). */
+       outl(HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK, emu->port + HCFG);
 
        /* Disable 48Volt power to Audio Dock */
        snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
@@ -1075,17 +1061,6 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
 
        snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
 
-       /* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
-        * Lock Sound Memory Cache, Lock Tank Memory Cache,
-        * Mute all codecs.
-        */
-       outl(0x0000a000, emu->port + HCFG);
-       /* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
-        * Lock Sound Memory Cache, Lock Tank Memory Cache,
-        * Un-Mute all codecs.
-        */
-       outl(0x0000a001, emu->port + HCFG);
-
        /* Initial boot complete. Now patches */
 
        snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);