diff options
author | Giuliano Pochini <pochini@shiny.it> | 2010-02-14 12:15:34 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-02-15 04:36:51 -0500 |
commit | 19b50063780953563e3c3a2867c39aad7b9e64cf (patch) | |
tree | 0b26395a9d785f1684e2a7f489735ce577a8c1ac /sound/pci/echoaudio/echoaudio_dsp.c | |
parent | a540e13386e90f8c833c5cd0d16d877b8a277af1 (diff) |
ALSA: Echoaudio - Add firmware cache #1
Changes the way the firmware is passed through functions.
When CONFIG_PM is enabled the firmware cannot be released because the
driver will need it again to resume the card.
With this patch the firmware is passed as an index of the struct
firmware card_fw[] in place of a pointer. That same index is then used
to locate the firmware in the firmware cache.
Signed-off-by: Giuliano Pochini <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/echoaudio/echoaudio_dsp.c')
-rw-r--r-- | sound/pci/echoaudio/echoaudio_dsp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c index 4df51ef5e095..031ef7e9da91 100644 --- a/sound/pci/echoaudio/echoaudio_dsp.c +++ b/sound/pci/echoaudio/echoaudio_dsp.c | |||
@@ -175,15 +175,15 @@ static inline int check_asic_status(struct echoaudio *chip) | |||
175 | #ifdef ECHOCARD_HAS_ASIC | 175 | #ifdef ECHOCARD_HAS_ASIC |
176 | 176 | ||
177 | /* Load ASIC code - done after the DSP is loaded */ | 177 | /* Load ASIC code - done after the DSP is loaded */ |
178 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, | 178 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic) |
179 | const struct firmware *asic) | ||
180 | { | 179 | { |
181 | const struct firmware *fw; | 180 | const struct firmware *fw; |
182 | int err; | 181 | int err; |
183 | u32 i, size; | 182 | u32 i, size; |
184 | u8 *code; | 183 | u8 *code; |
185 | 184 | ||
186 | if ((err = get_firmware(&fw, asic, chip)) < 0) { | 185 | err = get_firmware(&fw, chip, asic); |
186 | if (err < 0) { | ||
187 | snd_printk(KERN_WARNING "Firmware not found !\n"); | 187 | snd_printk(KERN_WARNING "Firmware not found !\n"); |
188 | return err; | 188 | return err; |
189 | } | 189 | } |
@@ -245,7 +245,8 @@ static int install_resident_loader(struct echoaudio *chip) | |||
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
247 | 247 | ||
248 | if ((i = get_firmware(&fw, &card_fw[FW_361_LOADER], chip)) < 0) { | 248 | i = get_firmware(&fw, chip, FW_361_LOADER); |
249 | if (i < 0) { | ||
249 | snd_printk(KERN_WARNING "Firmware not found !\n"); | 250 | snd_printk(KERN_WARNING "Firmware not found !\n"); |
250 | return i; | 251 | return i; |
251 | } | 252 | } |
@@ -485,7 +486,8 @@ static int load_firmware(struct echoaudio *chip) | |||
485 | chip->dsp_code = NULL; | 486 | chip->dsp_code = NULL; |
486 | } | 487 | } |
487 | 488 | ||
488 | if ((err = get_firmware(&fw, chip->dsp_code_to_load, chip)) < 0) | 489 | err = get_firmware(&fw, chip, chip->dsp_code_to_load); |
490 | if (err < 0) | ||
489 | return err; | 491 | return err; |
490 | err = load_dsp(chip, (u16 *)fw->data); | 492 | err = load_dsp(chip, (u16 *)fw->data); |
491 | free_firmware(fw); | 493 | free_firmware(fw); |