aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront_fx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/wavefront/wavefront_fx.c')
-rw-r--r--sound/isa/wavefront/wavefront_fx.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 15331ed8819..fc95a870f69 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -35,9 +35,7 @@
35 35
36#define WAIT_IDLE 0xff 36#define WAIT_IDLE 0xff
37 37
38#define FIRMWARE_IN_THE_KERNEL 38#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
39
40#ifdef FIRMWARE_IN_THE_KERNEL
41#include "yss225.c" 39#include "yss225.c"
42static const struct firmware yss225_registers_firmware = { 40static const struct firmware yss225_registers_firmware = {
43 .data = (u8 *)yss225_registers, 41 .data = (u8 *)yss225_registers,
@@ -258,21 +256,21 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
258{ 256{
259 unsigned int i; 257 unsigned int i;
260 int err; 258 int err;
261 const struct firmware *firmware; 259 const struct firmware *firmware = NULL;
262 260
263 if (dev->fx_initialized) 261 if (dev->fx_initialized)
264 return 0; 262 return 0;
265 263
264#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
265 firmware = &yss225_registers_firmware;
266#else
266 err = request_firmware(&firmware, "yamaha/yss225_registers.bin", 267 err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
267 dev->card->dev); 268 dev->card->dev);
268 if (err < 0) { 269 if (err < 0) {
269#ifdef FIRMWARE_IN_THE_KERNEL
270 firmware = &yss225_registers_firmware;
271#else
272 err = -1; 270 err = -1;
273 goto out; 271 goto out;
274#endif
275 } 272 }
273#endif
276 274
277 for (i = 0; i + 1 < firmware->size; i += 2) { 275 for (i = 0; i + 1 < firmware->size; i += 2) {
278 if (firmware->data[i] >= 8 && firmware->data[i] < 16) { 276 if (firmware->data[i] >= 8 && firmware->data[i] < 16) {
@@ -295,9 +293,12 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
295 err = 0; 293 err = 0;
296 294
297out: 295out:
298#ifdef FIRMWARE_IN_THE_KERNEL 296#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
299 if (firmware != &yss225_registers_firmware) 297 release_firmware(firmware);
300#endif 298#endif
301 release_firmware(firmware);
302 return err; 299 return err;
303} 300}
301
302#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
303MODULE_FIRMWARE("yamaha/yss225_registers.bin");
304#endif