Commit 18ee6dfa authored by David Woodhouse's avatar David Woodhouse Committed by David Woodhouse

firmware: convert ymfpci driver to use firmware loader exclusively

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent a292f404
...@@ -23,6 +23,8 @@ fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE)) ...@@ -23,6 +23,8 @@ fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE))
fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp
fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \ fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \
ess/maestro3_assp_minisrc.fw ess/maestro3_assp_minisrc.fw
fw-shipped-$(CONFIG_SND_YMFPCI) += yamaha/ds1_ctrl.fw yamaha/ds1_dsp.fw \
yamaha/ds1e_ctrl.fw
fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-) fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)
......
...@@ -31,3 +31,16 @@ drops binary dsp code images on our heads, but we don't get to see ...@@ -31,3 +31,16 @@ drops binary dsp code images on our heads, but we don't get to see
specs on the dsp." specs on the dsp."
-------------------------------------------------------------------------- --------------------------------------------------------------------------
Driver: ymfpci -- Yamaha YMF724/740/744/754 audio devices
File: yamaha/ds1_ctrl.fw
File: yamaha/ds1_dsp.fw
File: yamaha/ds1e_ctrl.fw
Licence: Unknown
Found alsa-firmware package in hex form, with the following comment:
Copyright (c) 1997-1999 Yamaha Corporation. All Rights Reserved.
--------------------------------------------------------------------------
This diff is collapsed.
:1000000081000000A40100000A0000002F00000091
:1000100053020800170380017B4000003F8400006A
:100020003C4801003C9401003CD805003C1C000009
:100030007BC000003F0C05003C5021010000000087
:1000400000000000000000000000000000000000B0
:1000500000000000000000000000000000000000A0
:100060000000000000000000000000000000000090
:100070000000000000000000000000000000000080
:00000001FF
This diff is collapsed.
...@@ -914,7 +914,6 @@ config SND_VX222 ...@@ -914,7 +914,6 @@ config SND_VX222
config SND_YMFPCI config SND_YMFPCI
tristate "Yamaha YMF724/740/744/754" tristate "Yamaha YMF724/740/744/754"
depends on SND depends on SND
select FW_LOADER if !SND_YMFPCI_FIRMWARE_IN_KERNEL
select SND_OPL3_LIB select SND_OPL3_LIB
select SND_MPU401_UART select SND_MPU401_UART
select SND_AC97_CODEC select SND_AC97_CODEC
...@@ -925,15 +924,6 @@ config SND_YMFPCI ...@@ -925,15 +924,6 @@ config SND_YMFPCI
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called snd-ymfpci. will be called snd-ymfpci.
config SND_YMFPCI_FIRMWARE_IN_KERNEL
bool "In-kernel firmware for YMFPCI driver"
depends on SND_YMFPCI
default y
help
Say Y here to include the static firmware built in the kernel
for the YMFPCI driver. If you choose N here, you need to
install the firmware files from the alsa-firmware package.
config SND_AC97_POWER_SAVE config SND_AC97_POWER_SAVE
bool "AC97 Power-Saving Mode" bool "AC97 Power-Saving Mode"
depends on SND_AC97_CODEC && EXPERIMENTAL depends on SND_AC97_CODEC && EXPERIMENTAL
......
This diff is collapsed.
...@@ -1994,65 +1994,6 @@ static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip) ...@@ -1994,65 +1994,6 @@ static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip)
} }
} }
#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
#include "ymfpci_image.h"
static struct firmware snd_ymfpci_dsp_microcode = {
.size = YDSXG_DSPLENGTH,
.data = (u8 *)DspInst,
};
static struct firmware snd_ymfpci_controller_microcode = {
.size = YDSXG_CTRLLENGTH,
.data = (u8 *)CntrlInst,
};
static struct firmware snd_ymfpci_controller_1e_microcode = {
.size = YDSXG_CTRLLENGTH,
.data = (u8 *)CntrlInst1E,
};
#ifdef __BIG_ENDIAN
static int microcode_swapped;
static DEFINE_MUTEX(microcode_swap);
static void snd_ymfpci_convert_to_le(const struct firmware *fw)
{
int i;
u32 *data = (u32 *)fw->data;
for (i = 0; i < fw->size / 4; ++i)
cpu_to_le32s(&data[i]);
}
#endif
static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
{
#ifdef __BIG_ENDIAN
mutex_lock(&microcode_swap);
if (!microcode_swapped) {
snd_ymfpci_convert_to_le(&snd_ymfpci_dsp_microcode);
snd_ymfpci_convert_to_le(&snd_ymfpci_controller_1e_microcode);
snd_ymfpci_convert_to_le(&snd_ymfpci_controller_microcode);
microcode_swapped = 1;
}
mutex_unlock(&microcode_swap);
#endif
chip->dsp_microcode = &snd_ymfpci_dsp_microcode;
if (chip->device_id == PCI_DEVICE_ID_YAMAHA_724F ||
chip->device_id == PCI_DEVICE_ID_YAMAHA_740C ||
chip->device_id == PCI_DEVICE_ID_YAMAHA_744 ||
chip->device_id == PCI_DEVICE_ID_YAMAHA_754)
chip->controller_microcode =
&snd_ymfpci_controller_1e_microcode;
else
chip->controller_microcode =
&snd_ymfpci_controller_microcode;
return 0;
}
#else /* use fw_loader */
static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
{ {
int err, is_1e; int err, is_1e;
...@@ -2091,8 +2032,6 @@ MODULE_FIRMWARE("yamaha/ds1_dsp.fw"); ...@@ -2091,8 +2032,6 @@ MODULE_FIRMWARE("yamaha/ds1_dsp.fw");
MODULE_FIRMWARE("yamaha/ds1_ctrl.fw"); MODULE_FIRMWARE("yamaha/ds1_ctrl.fw");
MODULE_FIRMWARE("yamaha/ds1e_ctrl.fw"); MODULE_FIRMWARE("yamaha/ds1e_ctrl.fw");
#endif
static void snd_ymfpci_download_image(struct snd_ymfpci *chip) static void snd_ymfpci_download_image(struct snd_ymfpci *chip)
{ {
int i; int i;
...@@ -2273,10 +2212,8 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip) ...@@ -2273,10 +2212,8 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
pci_disable_device(chip->pci); pci_disable_device(chip->pci);
#ifndef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
release_firmware(chip->dsp_microcode); release_firmware(chip->dsp_microcode);
release_firmware(chip->controller_microcode); release_firmware(chip->controller_microcode);
#endif
kfree(chip); kfree(chip);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment