aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/echoaudio.c
diff options
context:
space:
mode:
authorGiuliano Pochini <pochini@shiny.it>2010-02-14 12:15:34 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-15 04:36:51 -0500
commit19b50063780953563e3c3a2867c39aad7b9e64cf (patch)
tree0b26395a9d785f1684e2a7f489735ce577a8c1ac /sound/pci/echoaudio/echoaudio.c
parenta540e13386e90f8c833c5cd0d16d877b8a277af1 (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.c')
-rw-r--r--sound/pci/echoaudio/echoaudio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 1305f7ca02c3..78fc2637bfa6 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -36,11 +36,15 @@ MODULE_PARM_DESC(enable, "Enable " ECHOCARD_NAME " soundcard.");
36static unsigned int channels_list[10] = {1, 2, 4, 6, 8, 10, 12, 14, 16, 999999}; 36static unsigned int channels_list[10] = {1, 2, 4, 6, 8, 10, 12, 14, 16, 999999};
37static const DECLARE_TLV_DB_SCALE(db_scale_output_gain, -12800, 100, 1); 37static const DECLARE_TLV_DB_SCALE(db_scale_output_gain, -12800, 100, 1);
38 38
39
40
39static int get_firmware(const struct firmware **fw_entry, 41static int get_firmware(const struct firmware **fw_entry,
40 const struct firmware *frm, struct echoaudio *chip) 42 struct echoaudio *chip, const short fw_index)
41{ 43{
42 int err; 44 int err;
43 char name[30]; 45 char name[30];
46 const struct firmware *frm = &card_fw[fw_index];
47
44 DE_ACT(("firmware requested: %s\n", frm->data)); 48 DE_ACT(("firmware requested: %s\n", frm->data));
45 snprintf(name, sizeof(name), "ea/%s", frm->data); 49 snprintf(name, sizeof(name), "ea/%s", frm->data);
46 if ((err = request_firmware(fw_entry, name, pci_device(chip))) < 0) 50 if ((err = request_firmware(fw_entry, name, pci_device(chip))) < 0)
@@ -48,6 +52,8 @@ static int get_firmware(const struct firmware **fw_entry,
48 return err; 52 return err;
49} 53}
50 54
55
56
51static void free_firmware(const struct firmware *fw_entry) 57static void free_firmware(const struct firmware *fw_entry)
52{ 58{
53 release_firmware(fw_entry); 59 release_firmware(fw_entry);