Commit 1aa41272 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Takashi Iwai

ALSA: emu10k1: move code for entering E-MU card FPGA programming mode

... into snd_emu1010_load_firmware_entry(). This makes it clearer that
these steps belong together tightly, as implied by prior commits.
Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Message-ID: <20240428093717.3198716-5-oswald.buddenhagen@gmx.de>
parent 4c0c3686
...@@ -1843,7 +1843,7 @@ void snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 *emu, u32 dst, u32 s ...@@ -1843,7 +1843,7 @@ void snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 *emu, u32 dst, u32 s
u32 snd_emu1010_fpga_link_dst_src_read(struct snd_emu10k1 *emu, u32 dst); u32 snd_emu1010_fpga_link_dst_src_read(struct snd_emu10k1 *emu, u32 dst);
int snd_emu1010_get_raw_rate(struct snd_emu10k1 *emu, u8 src); int snd_emu1010_get_raw_rate(struct snd_emu10k1 *emu, u8 src);
void snd_emu1010_update_clock(struct snd_emu10k1 *emu); void snd_emu1010_update_clock(struct snd_emu10k1 *emu);
void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, const struct firmware *fw_entry); void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, int dock, const struct firmware *fw_entry);
unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc); unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb); void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb); void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
......
...@@ -683,7 +683,7 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu, int dock, ...@@ -683,7 +683,7 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu, int dock,
return err; return err;
} }
snd_emu1010_load_firmware_entry(emu, *fw); snd_emu1010_load_firmware_entry(emu, dock, *fw);
return 0; return 0;
} }
...@@ -699,9 +699,6 @@ static void snd_emu1010_load_dock_firmware(struct snd_emu10k1 *emu) ...@@ -699,9 +699,6 @@ static void snd_emu1010_load_dock_firmware(struct snd_emu10k1 *emu)
msleep(200); msleep(200);
dev_info(emu->card->dev, "emu1010: Loading Audio Dock Firmware\n"); dev_info(emu->card->dev, "emu1010: Loading Audio Dock Firmware\n");
/* Return to Audio Dock programming mode */
snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
EMU_HANA_FPGA_CONFIG_AUDIODOCK);
err = snd_emu1010_load_firmware(emu, 1, &emu->dock_fw); err = snd_emu1010_load_firmware(emu, 1, &emu->dock_fw);
if (err < 0) if (err < 0)
return; return;
...@@ -820,8 +817,6 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) ...@@ -820,8 +817,6 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
snd_emu1010_fpga_lock(emu); snd_emu1010_fpga_lock(emu);
dev_info(emu->card->dev, "emu1010: Loading Hana Firmware\n"); 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); err = snd_emu1010_load_firmware(emu, 0, &emu->firmware);
if (err < 0) { if (err < 0) {
dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n"); dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n");
......
...@@ -422,7 +422,7 @@ void snd_emu1010_update_clock(struct snd_emu10k1 *emu) ...@@ -422,7 +422,7 @@ void snd_emu1010_update_clock(struct snd_emu10k1 *emu)
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, leds); snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, leds);
} }
void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, int dock,
const struct firmware *fw_entry) const struct firmware *fw_entry)
{ {
__always_unused u16 write_post; __always_unused u16 write_post;
...@@ -440,6 +440,11 @@ void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, ...@@ -440,6 +440,11 @@ void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu,
// GPO6 -> FPGA CCLK & FPGA input // GPO6 -> FPGA CCLK & FPGA input
// GPO5 -> FPGA DIN (dual function) // GPO5 -> FPGA DIN (dual function)
// If the FPGA is already programmed, return it to programming mode
snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
dock ? EMU_HANA_FPGA_CONFIG_AUDIODOCK :
EMU_HANA_FPGA_CONFIG_HANA);
// Assert reset line for 100uS // Assert reset line for 100uS
outw(0x00, emu->port + A_GPIO); outw(0x00, emu->port + A_GPIO);
write_post = inw(emu->port + A_GPIO); write_post = inw(emu->port + A_GPIO);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment