summaryrefslogtreecommitdiff
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 4526904e3f86..8a5ff1cb5362 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -59,6 +59,10 @@ MODULE_SUPPORTED_DEVICE("{{ESS,Maestro3 PCI},"
"{ESS,Allegro PCI},"
"{ESS,Allegro-1 PCI},"
"{ESS,Canyon3D-2/LE PCI}}");
+#ifndef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+MODULE_FIRMWARE("ess/maestro3_assp_kernel.fw");
+MODULE_FIRMWARE("ess/maestro3_assp_minisrc.fw");
+#endif
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -2101,9 +2105,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
}
-#define FIRMWARE_IN_THE_KERNEL
-
-#ifdef FIRMWARE_IN_THE_KERNEL
+#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
/*
* DSP Code images
@@ -2242,7 +2244,7 @@ static const struct firmware assp_minisrc = {
.size = sizeof assp_minisrc_image
};
-#endif /* FIRMWARE_IN_THE_KERNEL */
+#else /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
#ifdef __LITTLE_ENDIAN
static inline void snd_m3_convert_from_le(const struct firmware *fw) { }
@@ -2257,6 +2259,8 @@ static void snd_m3_convert_from_le(const struct firmware *fw)
}
#endif
+#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
+
/*
* initialize ASSP
@@ -2550,14 +2554,10 @@ static int snd_m3_free(struct snd_m3 *chip)
if (chip->iobase)
pci_release_regions(chip->pci);
-#ifdef FIRMWARE_IN_THE_KERNEL
- if (chip->assp_kernel_image != &assp_kernel)
+#ifndef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ release_firmware(chip->assp_kernel_image);
+ release_firmware(chip->assp_minisrc_image);
#endif
- release_firmware(chip->assp_kernel_image);
-#ifdef FIRMWARE_IN_THE_KERNEL
- if (chip->assp_minisrc_image != &assp_minisrc)
-#endif
- release_firmware(chip->assp_minisrc_image);
pci_disable_device(chip->pci);
kfree(chip);
@@ -2747,29 +2747,29 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
return -ENOMEM;
}
+#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ chip->assp_kernel_image = &assp_kernel;
+#else
err = request_firmware(&chip->assp_kernel_image,
"ess/maestro3_assp_kernel.fw", &pci->dev);
if (err < 0) {
-#ifdef FIRMWARE_IN_THE_KERNEL
- chip->assp_kernel_image = &assp_kernel;
-#else
snd_m3_free(chip);
return err;
-#endif
} else
snd_m3_convert_from_le(chip->assp_kernel_image);
+#endif
+#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ chip->assp_minisrc_image = &assp_minisrc;
+#else
err = request_firmware(&chip->assp_minisrc_image,
"ess/maestro3_assp_minisrc.fw", &pci->dev);
if (err < 0) {
-#ifdef FIRMWARE_IN_THE_KERNEL
- chip->assp_minisrc_image = &assp_minisrc;
-#else
snd_m3_free(chip);
return err;
-#endif
} else
snd_m3_convert_from_le(chip->assp_minisrc_image);
+#endif
if ((err = pci_request_regions(pci, card->driver)) < 0) {
snd_m3_free(chip);