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/gina24_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/gina24_dsp.c')
-rw-r--r-- | sound/pci/echoaudio/gina24_dsp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/pci/echoaudio/gina24_dsp.c b/sound/pci/echoaudio/gina24_dsp.c index 2fef37a2a5b9..093dd7ba0e81 100644 --- a/sound/pci/echoaudio/gina24_dsp.c +++ b/sound/pci/echoaudio/gina24_dsp.c | |||
@@ -33,8 +33,7 @@ static int write_control_reg(struct echoaudio *chip, u32 value, char force); | |||
33 | static int set_input_clock(struct echoaudio *chip, u16 clock); | 33 | static int set_input_clock(struct echoaudio *chip, u16 clock); |
34 | static int set_professional_spdif(struct echoaudio *chip, char prof); | 34 | static int set_professional_spdif(struct echoaudio *chip, char prof); |
35 | static int set_digital_mode(struct echoaudio *chip, u8 mode); | 35 | static int set_digital_mode(struct echoaudio *chip, u8 mode); |
36 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, | 36 | static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic); |
37 | const struct firmware *asic); | ||
38 | static int check_asic_status(struct echoaudio *chip); | 37 | static int check_asic_status(struct echoaudio *chip); |
39 | 38 | ||
40 | 39 | ||
@@ -64,13 +63,13 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) | |||
64 | 63 | ||
65 | /* Gina24 comes in both '301 and '361 flavors */ | 64 | /* Gina24 comes in both '301 and '361 flavors */ |
66 | if (chip->device_id == DEVICE_ID_56361) { | 65 | if (chip->device_id == DEVICE_ID_56361) { |
67 | chip->dsp_code_to_load = &card_fw[FW_GINA24_361_DSP]; | 66 | chip->dsp_code_to_load = FW_GINA24_361_DSP; |
68 | chip->digital_modes = | 67 | chip->digital_modes = |
69 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | | 68 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | |
70 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | | 69 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | |
71 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; | 70 | ECHOCAPS_HAS_DIGITAL_MODE_ADAT; |
72 | } else { | 71 | } else { |
73 | chip->dsp_code_to_load = &card_fw[FW_GINA24_301_DSP]; | 72 | chip->dsp_code_to_load = FW_GINA24_301_DSP; |
74 | chip->digital_modes = | 73 | chip->digital_modes = |
75 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | | 74 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA | |
76 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | | 75 | ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL | |
@@ -125,7 +124,7 @@ static int load_asic(struct echoaudio *chip) | |||
125 | { | 124 | { |
126 | u32 control_reg; | 125 | u32 control_reg; |
127 | int err; | 126 | int err; |
128 | const struct firmware *fw; | 127 | short asic; |
129 | 128 | ||
130 | if (chip->asic_loaded) | 129 | if (chip->asic_loaded) |
131 | return 1; | 130 | return 1; |
@@ -135,14 +134,15 @@ static int load_asic(struct echoaudio *chip) | |||
135 | 134 | ||
136 | /* Pick the correct ASIC for '301 or '361 Gina24 */ | 135 | /* Pick the correct ASIC for '301 or '361 Gina24 */ |
137 | if (chip->device_id == DEVICE_ID_56361) | 136 | if (chip->device_id == DEVICE_ID_56361) |
138 | fw = &card_fw[FW_GINA24_361_ASIC]; | 137 | asic = FW_GINA24_361_ASIC; |
139 | else | 138 | else |
140 | fw = &card_fw[FW_GINA24_301_ASIC]; | 139 | asic = FW_GINA24_301_ASIC; |
141 | 140 | ||
142 | if ((err = load_asic_generic(chip, DSP_FNC_LOAD_GINA24_ASIC, fw)) < 0) | 141 | err = load_asic_generic(chip, DSP_FNC_LOAD_GINA24_ASIC, asic); |
142 | if (err < 0) | ||
143 | return err; | 143 | return err; |
144 | 144 | ||
145 | chip->asic_code = fw; | 145 | chip->asic_code = asic; |
146 | 146 | ||
147 | /* Now give the new ASIC a little time to set up */ | 147 | /* Now give the new ASIC a little time to set up */ |
148 | mdelay(10); | 148 | mdelay(10); |