Skip to content

Commit

Permalink
[ALSA] Enable Kconfig options for external firmwares
Browse files Browse the repository at this point in the history
Some drivers are already ifdefs for enabling external firmwares
but not defined in Kconfig.  Now they appear as the kernel configs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed May 11, 2007
1 parent 8f7ba05 commit 8ad2da1
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 34 deletions.
22 changes: 20 additions & 2 deletions sound/isa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,21 @@ config SND_SBAWE
config SND_SB16_CSP
bool "Sound Blaster 16/AWE CSP support"
depends on (SND_SB16 || SND_SBAWE) && (BROKEN || !PPC)
select FW_LOADER
help
Say Y here to include support for the CSP core. This special
coprocessor can do variable tasks like various compression and
decompression algorithms.

config SND_SB16_CSP_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for SB16 CSP"
depends on SND_SB16_CSP
select FW_LOADER
default y
help
Say Y here to include the static firmware built in the kernel
for SB16 CSP controller. If you choose N here, the external
firmware files from alsa-plugins pacakge are necessary.

config SND_SGALAXY
tristate "Aztech Sound Galaxy"
depends on SND
Expand Down Expand Up @@ -391,7 +400,6 @@ config SND_SSCAPE
config SND_WAVEFRONT
tristate "Turtle Beach Maui,Tropez,Tropez+ (Wavefront)"
depends on SND
select FW_LOADER
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_CS4231_LIB
Expand All @@ -402,4 +410,14 @@ config SND_WAVEFRONT
To compile this driver as a module, choose M here: the module
will be called snd-wavefront.

config SND_WAVEFRONT_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for Wavefront"
depends on SND_WAVEFRONT
select FW_LOADER
default y
help
Say Y here to include the static firmware built in the kernel
for Wavefront driver. If you choose N here, the external
firmware files from alsa-plugins pacakge are necessary.

endmenu
6 changes: 2 additions & 4 deletions sound/isa/sb/sb16_csp.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,7 @@ static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __use
return err;
}

#define FIRMWARE_IN_THE_KERNEL

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL
#include "sb16_csp_codecs.h"

static const struct firmware snd_sb_csp_static_programs[] = {
Expand Down Expand Up @@ -724,7 +722,7 @@ static int snd_sb_csp_firmware_load(struct snd_sb_csp *p, int index, int flags)
if (err >= 0)
p->csp_programs[index] = program;
else {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_SB16_CSP_FIRMWARE_IN_KERNEL
program = &snd_sb_csp_static_programs[index];
#else
return err;
Expand Down
8 changes: 3 additions & 5 deletions sound/isa/wavefront/wavefront_fx.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@

#define WAIT_IDLE 0xff

#define FIRMWARE_IN_THE_KERNEL

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
#include "yss225.c"
static const struct firmware yss225_registers_firmware = {
.data = (u8 *)yss225_registers,
Expand Down Expand Up @@ -266,7 +264,7 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
dev->card->dev);
if (err < 0) {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
firmware = &yss225_registers_firmware;
#else
err = -1;
Expand Down Expand Up @@ -295,7 +293,7 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
err = 0;

out:
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
if (firmware != &yss225_registers_firmware)
#endif
release_firmware(firmware);
Expand Down
32 changes: 30 additions & 2 deletions sound/pci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -576,14 +576,23 @@ config SND_INTEL8X0M
config SND_KORG1212
tristate "Korg 1212 IO"
depends on SND
select FW_LOADER
select SND_PCM
help
Say Y here to include support for Korg 1212IO soundcards.

To compile this driver as a module, choose M here: the module
will be called snd-korg1212.

config SND_KORG1212_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for Korg1212 driver"
depends on SND_KORG1212
select FW_LOADER
default y
help
Say Y here to include the static firmware built in the kernel
for Korg1212 driver. If you choose N here, the external
firmware files from alsa-plugins pacakge are necessary.

config SND_MAESTRO3
tristate "ESS Allegro/Maestro3"
depends on SND
Expand All @@ -596,6 +605,16 @@ config SND_MAESTRO3
To compile this driver as a module, choose M here: the module
will be called snd-maestro3.

config SND_MAESTRO3_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for Maestro3 driver"
depends on SND_MAESTRO3
select FW_LOADER
default y
help
Say Y here to include the static firmware built in the kernel
for Maestro3 driver. If you choose N here, the external
firmware files from alsa-plugins pacakge are necessary.

config SND_MIXART
tristate "Digigram miXart"
depends on SND
Expand Down Expand Up @@ -737,7 +756,6 @@ config SND_VX222
config SND_YMFPCI
tristate "Yamaha YMF724/740/744/754"
depends on SND
select FW_LOADER
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_AC97_CODEC
Expand All @@ -748,6 +766,16 @@ config SND_YMFPCI
To compile this driver as a module, choose M here: the module
will be called snd-ymfpci.

config SND_YMFPCI_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for YMFPCI driver"
depends on SND_YMFPCI
select FW_LOADER
default y
help
Say Y here to include the static firmware built in the kernel
for YMFPCI driver. If you choose N here, the external
firmware files from alsa-plugins pacakge are necessary.

config SND_AC97_POWER_SAVE
bool "AC97 Power-Saving Mode"
depends on SND_AC97_CODEC && EXPERIMENTAL
Expand Down
10 changes: 4 additions & 6 deletions sound/pci/korg1212/korg1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ enum MonitorModeSelector {
#define COMMAND_ACK_DELAY 13 // number of RTC ticks to wait for an acknowledgement
// from the card after sending a command.

#define FIRMWARE_IN_THE_KERNEL

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
#include "korg1212-firmware.h"
static const struct firmware static_dsp_code = {
.data = (u8 *)dspCode,
Expand Down Expand Up @@ -2345,7 +2343,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev);
if (err < 0) {
release_firmware(dsp_code);
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
dsp_code = &static_dsp_code;
#else
snd_printk(KERN_ERR "firmware not available\n");
Expand All @@ -2358,7 +2356,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
dsp_code->size, &korg1212->dma_dsp) < 0) {
snd_printk(KERN_ERR "korg1212: cannot allocate dsp code memory (%zd bytes)\n", dsp_code->size);
snd_korg1212_free(korg1212);
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
if (dsp_code != &static_dsp_code)
#endif
release_firmware(dsp_code);
Expand All @@ -2371,7 +2369,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *

memcpy(korg1212->dma_dsp.area, dsp_code->data, dsp_code->size);

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL
if (dsp_code != &static_dsp_code)
#endif
release_firmware(dsp_code);
Expand Down
14 changes: 6 additions & 8 deletions sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,9 +2101,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
Expand Down Expand Up @@ -2242,7 +2240,7 @@ static const struct firmware assp_minisrc = {
.size = sizeof assp_minisrc_image
};

#endif /* FIRMWARE_IN_THE_KERNEL */
#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */

#ifdef __LITTLE_ENDIAN
static inline void snd_m3_convert_from_le(const struct firmware *fw) { }
Expand Down Expand Up @@ -2550,11 +2548,11 @@ static int snd_m3_free(struct snd_m3 *chip)
if (chip->iobase)
pci_release_regions(chip->pci);

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
if (chip->assp_kernel_image != &assp_kernel)
#endif
release_firmware(chip->assp_kernel_image);
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
if (chip->assp_minisrc_image != &assp_minisrc)
#endif
release_firmware(chip->assp_minisrc_image);
Expand Down Expand Up @@ -2750,7 +2748,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
err = request_firmware(&chip->assp_kernel_image,
"ess/maestro3_assp_kernel.fw", &pci->dev);
if (err < 0) {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
chip->assp_kernel_image = &assp_kernel;
#else
snd_m3_free(chip);
Expand All @@ -2762,7 +2760,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
err = request_firmware(&chip->assp_minisrc_image,
"ess/maestro3_assp_minisrc.fw", &pci->dev);
if (err < 0) {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
chip->assp_minisrc_image = &assp_minisrc;
#else
snd_m3_free(chip);
Expand Down
12 changes: 5 additions & 7 deletions sound/pci/ymfpci/ymfpci_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,9 +1998,7 @@ static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip)
}
}

#define FIRMWARE_IN_THE_KERNEL

#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL

#include "ymfpci_image.h"

Expand Down Expand Up @@ -2047,7 +2045,7 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
}
}
if (err < 0) {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
chip->dsp_microcode = &snd_ymfpci_dsp_microcode;
#else
return err;
Expand All @@ -2070,7 +2068,7 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
}
}
if (err < 0) {
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
chip->controller_microcode =
is_1e ? &snd_ymfpci_controller_1e_microcode
: &snd_ymfpci_controller_microcode;
Expand Down Expand Up @@ -2259,11 +2257,11 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);

pci_disable_device(chip->pci);
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
if (chip->dsp_microcode != &snd_ymfpci_dsp_microcode)
#endif
release_firmware(chip->dsp_microcode);
#ifdef FIRMWARE_IN_THE_KERNEL
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
if (chip->controller_microcode != &snd_ymfpci_controller_microcode &&
chip->controller_microcode != &snd_ymfpci_controller_1e_microcode)
#endif
Expand Down

0 comments on commit 8ad2da1

Please sign in to comment.