diff options
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 6298b29c66bb..2164e34e46b7 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -1994,65 +1994,6 @@ static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip) | |||
1994 | } | 1994 | } |
1995 | } | 1995 | } |
1996 | 1996 | ||
1997 | #ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL | ||
1998 | |||
1999 | #include "ymfpci_image.h" | ||
2000 | |||
2001 | static struct firmware snd_ymfpci_dsp_microcode = { | ||
2002 | .size = YDSXG_DSPLENGTH, | ||
2003 | .data = (u8 *)DspInst, | ||
2004 | }; | ||
2005 | static struct firmware snd_ymfpci_controller_microcode = { | ||
2006 | .size = YDSXG_CTRLLENGTH, | ||
2007 | .data = (u8 *)CntrlInst, | ||
2008 | }; | ||
2009 | static struct firmware snd_ymfpci_controller_1e_microcode = { | ||
2010 | .size = YDSXG_CTRLLENGTH, | ||
2011 | .data = (u8 *)CntrlInst1E, | ||
2012 | }; | ||
2013 | |||
2014 | #ifdef __BIG_ENDIAN | ||
2015 | static int microcode_swapped; | ||
2016 | static DEFINE_MUTEX(microcode_swap); | ||
2017 | |||
2018 | static void snd_ymfpci_convert_to_le(const struct firmware *fw) | ||
2019 | { | ||
2020 | int i; | ||
2021 | u32 *data = (u32 *)fw->data; | ||
2022 | |||
2023 | for (i = 0; i < fw->size / 4; ++i) | ||
2024 | cpu_to_le32s(&data[i]); | ||
2025 | } | ||
2026 | #endif | ||
2027 | |||
2028 | static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) | ||
2029 | { | ||
2030 | #ifdef __BIG_ENDIAN | ||
2031 | mutex_lock(µcode_swap); | ||
2032 | if (!microcode_swapped) { | ||
2033 | snd_ymfpci_convert_to_le(&snd_ymfpci_dsp_microcode); | ||
2034 | snd_ymfpci_convert_to_le(&snd_ymfpci_controller_1e_microcode); | ||
2035 | snd_ymfpci_convert_to_le(&snd_ymfpci_controller_microcode); | ||
2036 | microcode_swapped = 1; | ||
2037 | } | ||
2038 | mutex_unlock(µcode_swap); | ||
2039 | #endif | ||
2040 | |||
2041 | chip->dsp_microcode = &snd_ymfpci_dsp_microcode; | ||
2042 | if (chip->device_id == PCI_DEVICE_ID_YAMAHA_724F || | ||
2043 | chip->device_id == PCI_DEVICE_ID_YAMAHA_740C || | ||
2044 | chip->device_id == PCI_DEVICE_ID_YAMAHA_744 || | ||
2045 | chip->device_id == PCI_DEVICE_ID_YAMAHA_754) | ||
2046 | chip->controller_microcode = | ||
2047 | &snd_ymfpci_controller_1e_microcode; | ||
2048 | else | ||
2049 | chip->controller_microcode = | ||
2050 | &snd_ymfpci_controller_microcode; | ||
2051 | return 0; | ||
2052 | } | ||
2053 | |||
2054 | #else /* use fw_loader */ | ||
2055 | |||
2056 | static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) | 1997 | static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip) |
2057 | { | 1998 | { |
2058 | int err, is_1e; | 1999 | int err, is_1e; |
@@ -2091,8 +2032,6 @@ MODULE_FIRMWARE("yamaha/ds1_dsp.fw"); | |||
2091 | MODULE_FIRMWARE("yamaha/ds1_ctrl.fw"); | 2032 | MODULE_FIRMWARE("yamaha/ds1_ctrl.fw"); |
2092 | MODULE_FIRMWARE("yamaha/ds1e_ctrl.fw"); | 2033 | MODULE_FIRMWARE("yamaha/ds1e_ctrl.fw"); |
2093 | 2034 | ||
2094 | #endif | ||
2095 | |||
2096 | static void snd_ymfpci_download_image(struct snd_ymfpci *chip) | 2035 | static void snd_ymfpci_download_image(struct snd_ymfpci *chip) |
2097 | { | 2036 | { |
2098 | int i; | 2037 | int i; |
@@ -2273,10 +2212,8 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip) | |||
2273 | pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); | 2212 | pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); |
2274 | 2213 | ||
2275 | pci_disable_device(chip->pci); | 2214 | pci_disable_device(chip->pci); |
2276 | #ifndef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL | ||
2277 | release_firmware(chip->dsp_microcode); | 2215 | release_firmware(chip->dsp_microcode); |
2278 | release_firmware(chip->controller_microcode); | 2216 | release_firmware(chip->controller_microcode); |
2279 | #endif | ||
2280 | kfree(chip); | 2217 | kfree(chip); |
2281 | return 0; | 2218 | return 0; |
2282 | } | 2219 | } |