aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-26 08:13:44 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:56:11 -0400
commitb7dd2b349a9fa9e4347780c2bbb41e51484b5bb5 (patch)
treef5b896fd062a410e46bc35963fe15cdaed38f654 /sound/isa
parentf223a9fc3d5707c354588570e2cf1f3abf6b1f84 (diff)
[ALSA] Don't use request_firmware if internal firmwares are defined
Don't use request_firmware() if the internal firmwares are defined via Kconfig. Otherwise it results in a significant delay at loading time (minutes). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/sb/sb16_csp.c17
-rw-r--r--sound/isa/wavefront/wavefront_fx.c15
2 files changed, 16 insertions, 16 deletions
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index ef71e50744e9..92e2bc413178 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -161,13 +161,17 @@ int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep)
161 */ 161 */
162static void snd_sb_csp_free(struct snd_hwdep *hwdep) 162static void snd_sb_csp_free(struct snd_hwdep *hwdep)
163{ 163{
164#ifndef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL
164 int i; 165 int i;
166#endif
165 struct snd_sb_csp *p = hwdep->private_data; 167 struct snd_sb_csp *p = hwdep->private_data;
166 if (p) { 168 if (p) {
167 if (p->running & SNDRV_SB_CSP_ST_RUNNING) 169 if (p->running & SNDRV_SB_CSP_ST_RUNNING)
168 snd_sb_csp_stop(p); 170 snd_sb_csp_stop(p);
171#ifndef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL
169 for (i = 0; i < ARRAY_SIZE(p->csp_programs); ++i) 172 for (i = 0; i < ARRAY_SIZE(p->csp_programs); ++i)
170 release_firmware(p->csp_programs[i]); 173 release_firmware(p->csp_programs[i]);
174#endif
171 kfree(p); 175 kfree(p);
172 } 176 }
173} 177}
@@ -712,22 +716,19 @@ static int snd_sb_csp_firmware_load(struct snd_sb_csp *p, int index, int flags)
712 "sb16/ima_adpcm_capture.csp", 716 "sb16/ima_adpcm_capture.csp",
713 }; 717 };
714 const struct firmware *program; 718 const struct firmware *program;
715 int err;
716 719
717 BUILD_BUG_ON(ARRAY_SIZE(names) != CSP_PROGRAM_COUNT); 720 BUILD_BUG_ON(ARRAY_SIZE(names) != CSP_PROGRAM_COUNT);
718 program = p->csp_programs[index]; 721 program = p->csp_programs[index];
719 if (!program) { 722 if (!program) {
720 err = request_firmware(&program, names[index],
721 p->chip->card->dev);
722 if (err >= 0)
723 p->csp_programs[index] = program;
724 else {
725#ifdef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL 723#ifdef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL
726 program = &snd_sb_csp_static_programs[index]; 724 program = &snd_sb_csp_static_programs[index];
727#else 725#else
726 int err = request_firmware(&program, names[index],
727 p->chip->card->dev);
728 if (err < 0)
728 return err; 729 return err;
729#endif 730#endif
730 } 731 p->csp_programs[index] = program;
731 } 732 }
732 return snd_sb_csp_load(p, program->data, program->size, flags); 733 return snd_sb_csp_load(p, program->data, program->size, flags);
733} 734}
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 3a8c0565d676..0e948a9a7205 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -256,21 +256,21 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
256{ 256{
257 unsigned int i; 257 unsigned int i;
258 int err; 258 int err;
259 const struct firmware *firmware; 259 const struct firmware *firmware = NULL;
260 260
261 if (dev->fx_initialized) 261 if (dev->fx_initialized)
262 return 0; 262 return 0;
263 263
264#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
265 firmware = &yss225_registers_firmware;
266#else
264 err = request_firmware(&firmware, "yamaha/yss225_registers.bin", 267 err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
265 dev->card->dev); 268 dev->card->dev);
266 if (err < 0) { 269 if (err < 0) {
267#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
268 firmware = &yss225_registers_firmware;
269#else
270 err = -1; 270 err = -1;
271 goto out; 271 goto out;
272#endif
273 } 272 }
273#endif
274 274
275 for (i = 0; i + 1 < firmware->size; i += 2) { 275 for (i = 0; i + 1 < firmware->size; i += 2) {
276 if (firmware->data[i] >= 8 && firmware->data[i] < 16) { 276 if (firmware->data[i] >= 8 && firmware->data[i] < 16) {
@@ -293,9 +293,8 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
293 err = 0; 293 err = 0;
294 294
295out: 295out:
296#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL 296#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
297 if (firmware != &yss225_registers_firmware) 297 release_firmware(firmware);
298#endif 298#endif
299 release_firmware(firmware);
300 return err; 299 return err;
301} 300}