aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ymfpci/ymfpci_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index fd12674d0394..ea861bceaddf 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -1998,9 +1998,7 @@ static void snd_ymfpci_disable_dsp(struct snd_ymfpci *chip)
1998 } 1998 }
1999} 1999}
2000 2000
2001#define FIRMWARE_IN_THE_KERNEL 2001#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
2002
2003#ifdef FIRMWARE_IN_THE_KERNEL
2004 2002
2005#include "ymfpci_image.h" 2003#include "ymfpci_image.h"
2006 2004
@@ -2018,6 +2016,24 @@ static struct firmware snd_ymfpci_controller_1e_microcode = {
2018}; 2016};
2019#endif 2017#endif
2020 2018
2019#ifdef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
2020static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
2021{
2022 chip->dsp_microcode = &snd_ymfpci_dsp_microcode;
2023 if (chip->device_id == PCI_DEVICE_ID_YAMAHA_724F ||
2024 chip->device_id == PCI_DEVICE_ID_YAMAHA_740C ||
2025 chip->device_id == PCI_DEVICE_ID_YAMAHA_744 ||
2026 chip->device_id == PCI_DEVICE_ID_YAMAHA_754)
2027 chip->controller_microcode =
2028 &snd_ymfpci_controller_1e_microcode;
2029 else
2030 chip->controller_microcode =
2031 &snd_ymfpci_controller_microcode;
2032 return 0;
2033}
2034
2035#else /* use fw_loader */
2036
2021#ifdef __LITTLE_ENDIAN 2037#ifdef __LITTLE_ENDIAN
2022static inline void snd_ymfpci_convert_from_le(const struct firmware *fw) { } 2038static inline void snd_ymfpci_convert_from_le(const struct firmware *fw) { }
2023#else 2039#else
@@ -2046,13 +2062,8 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
2046 err = -EINVAL; 2062 err = -EINVAL;
2047 } 2063 }
2048 } 2064 }
2049 if (err < 0) { 2065 if (err < 0)
2050#ifdef FIRMWARE_IN_THE_KERNEL
2051 chip->dsp_microcode = &snd_ymfpci_dsp_microcode;
2052#else
2053 return err; 2066 return err;
2054#endif
2055 }
2056 is_1e = chip->device_id == PCI_DEVICE_ID_YAMAHA_724F || 2067 is_1e = chip->device_id == PCI_DEVICE_ID_YAMAHA_724F ||
2057 chip->device_id == PCI_DEVICE_ID_YAMAHA_740C || 2068 chip->device_id == PCI_DEVICE_ID_YAMAHA_740C ||
2058 chip->device_id == PCI_DEVICE_ID_YAMAHA_744 || 2069 chip->device_id == PCI_DEVICE_ID_YAMAHA_744 ||
@@ -2069,18 +2080,17 @@ static int snd_ymfpci_request_firmware(struct snd_ymfpci *chip)
2069 err = -EINVAL; 2080 err = -EINVAL;
2070 } 2081 }
2071 } 2082 }
2072 if (err < 0) { 2083 if (err < 0)
2073#ifdef FIRMWARE_IN_THE_KERNEL
2074 chip->controller_microcode =
2075 is_1e ? &snd_ymfpci_controller_1e_microcode
2076 : &snd_ymfpci_controller_microcode;
2077#else
2078 return err; 2084 return err;
2079#endif
2080 }
2081 return 0; 2085 return 0;
2082} 2086}
2083 2087
2088MODULE_FIRMWARE("yamaha/ds1_dsp.fw");
2089MODULE_FIRMWARE("yamaha/ds1_ctrl.fw");
2090MODULE_FIRMWARE("yamaha/ds1e_ctrl.fw");
2091
2092#endif
2093
2084static void snd_ymfpci_download_image(struct snd_ymfpci *chip) 2094static void snd_ymfpci_download_image(struct snd_ymfpci *chip)
2085{ 2095{
2086 int i; 2096 int i;
@@ -2259,15 +2269,10 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
2259 pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl); 2269 pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
2260 2270
2261 pci_disable_device(chip->pci); 2271 pci_disable_device(chip->pci);
2262#ifdef FIRMWARE_IN_THE_KERNEL 2272#ifndef CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL
2263 if (chip->dsp_microcode != &snd_ymfpci_dsp_microcode) 2273 release_firmware(chip->dsp_microcode);
2264#endif 2274 release_firmware(chip->controller_microcode);
2265 release_firmware(chip->dsp_microcode);
2266#ifdef FIRMWARE_IN_THE_KERNEL
2267 if (chip->controller_microcode != &snd_ymfpci_controller_microcode &&
2268 chip->controller_microcode != &snd_ymfpci_controller_1e_microcode)
2269#endif 2275#endif
2270 release_firmware(chip->controller_microcode);
2271 kfree(chip); 2276 kfree(chip);
2272 return 0; 2277 return 0;
2273} 2278}