summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2024-04-28 11:37:14 +0200
committerTakashi Iwai <tiwai@suse.de>2024-04-28 12:00:36 +0200
commit7868e4c1794d336d40578e861bb3824d1ccdaaa3 (patch)
tree7826ddc5129982e4607c22c71ab25fc827cb9e72
parent15c7e87aa88f0ab2d51c2e2123b127a6d693ca21 (diff)
downloadlinux-stable-7868e4c1794d336d40578e861bb3824d1ccdaaa3.tar.gz
linux-stable-7868e4c1794d336d40578e861bb3824d1ccdaaa3.tar.bz2
linux-stable-7868e4c1794d336d40578e861bb3824d1ccdaaa3.zip
ALSA: emu10k1: simplify E-MU card FPGA reset sequence
Firstly, it is pointless to explicitly disable the power to the dock prior to resetting the FPGA, as the latter will do the former anyway. Secondly, it doesn't make much sense to check whether the FPGA is already programmed. It's much simpler to just presume it is, and issue the self-reset command. If it isn't, the effect isn't worse than the checks themselves. As a side effect, we lose the info if the reset fails, but there is no plausible way how that could happen unless the card burns out while operating, and in that case we'll detect a firmware upload failure a bit later anyway. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <20240428093717.3198716-2-oswald.buddenhagen@gmx.de>
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 8ccc0178360c..353dd3b61c61 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -864,28 +864,9 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
snd_emu1010_fpga_lock(emu);
- /* Disable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
-
- /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
- dev_dbg(emu->card->dev, "reg1 = 0x%x\n", reg);
- if ((reg & 0x3f) == 0x15) {
- /* FPGA netlist already present so clear it */
- /* Return to programming mode */
-
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_HANA);
- }
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
- dev_dbg(emu->card->dev, "reg2 = 0x%x\n", reg);
- if ((reg & 0x3f) == 0x15) {
- /* FPGA failed to return to programming mode */
- dev_info(emu->card->dev,
- "emu1010: FPGA failed to return to programming mode\n");
- return -ENODEV;
- }
- dev_info(emu->card->dev, "emu1010: EMU_HANA_ID = 0x%x\n", reg);
-
+ dev_info(emu->card->dev, "emu1010: Loading Hana Firmware\n");
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
+ EMU_HANA_FPGA_CONFIG_HANA);
err = snd_emu1010_load_firmware(emu, 0, &emu->firmware);
if (err < 0) {
dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n");