aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart/mixart_hwdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/mixart/mixart_hwdep.c')
-rw-r--r--sound/pci/mixart/mixart_hwdep.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index e0f4d87555a0..ece1f831c16a 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -546,14 +546,6 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
546} 546}
547 547
548 548
549#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
550#if !defined(CONFIG_USE_MIXARTLOADER) && !defined(CONFIG_SND_MIXART) /* built-in kernel */
551#define SND_MIXART_FW_LOADER /* use the standard firmware loader */
552#endif
553#endif
554
555#ifdef SND_MIXART_FW_LOADER
556
557int snd_mixart_setup_firmware(struct mixart_mgr *mgr) 549int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
558{ 550{
559 static char *fw_files[3] = { 551 static char *fw_files[3] = {
@@ -583,71 +575,3 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
583MODULE_FIRMWARE("mixart/miXart8.xlx"); 575MODULE_FIRMWARE("mixart/miXart8.xlx");
584MODULE_FIRMWARE("mixart/miXart8.elf"); 576MODULE_FIRMWARE("mixart/miXart8.elf");
585MODULE_FIRMWARE("mixart/miXart8AES.xlx"); 577MODULE_FIRMWARE("mixart/miXart8AES.xlx");
586
587#else /* old style firmware loading */
588
589/* miXart hwdep interface id string */
590#define SND_MIXART_HWDEP_ID "miXart Loader"
591
592static int mixart_hwdep_dsp_status(struct snd_hwdep *hw,
593 struct snd_hwdep_dsp_status *info)
594{
595 struct mixart_mgr *mgr = hw->private_data;
596
597 strcpy(info->id, "miXart");
598 info->num_dsps = MIXART_HARDW_FILES_MAX_INDEX;
599
600 if (mgr->dsp_loaded & (1 << MIXART_MOTHERBOARD_ELF_INDEX))
601 info->chip_ready = 1;
602
603 info->version = MIXART_DRIVER_VERSION;
604 return 0;
605}
606
607static int mixart_hwdep_dsp_load(struct snd_hwdep *hw,
608 struct snd_hwdep_dsp_image *dsp)
609{
610 struct mixart_mgr* mgr = hw->private_data;
611 struct firmware fw;
612 int err;
613
614 fw.size = dsp->length;
615 fw.data = vmalloc(dsp->length);
616 if (! fw.data) {
617 snd_printk(KERN_ERR "miXart: cannot allocate image size %d\n",
618 (int)dsp->length);
619 return -ENOMEM;
620 }
621 if (copy_from_user((void *) fw.data, dsp->image, dsp->length)) {
622 vfree(fw.data);
623 return -EFAULT;
624 }
625 err = mixart_dsp_load(mgr, dsp->index, &fw);
626 vfree(fw.data);
627 if (err < 0)
628 return err;
629 mgr->dsp_loaded |= 1 << dsp->index;
630 return err;
631}
632
633int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
634{
635 int err;
636 struct snd_hwdep *hw;
637
638 /* only create hwdep interface for first cardX (see "index" module parameter)*/
639 if ((err = snd_hwdep_new(mgr->chip[0]->card, SND_MIXART_HWDEP_ID, 0, &hw)) < 0)
640 return err;
641
642 hw->iface = SNDRV_HWDEP_IFACE_MIXART;
643 hw->private_data = mgr;
644 hw->ops.dsp_status = mixart_hwdep_dsp_status;
645 hw->ops.dsp_load = mixart_hwdep_dsp_load;
646 hw->exclusive = 1;
647 sprintf(hw->name, SND_MIXART_HWDEP_ID);
648 mgr->dsp_loaded = 0;
649
650 return snd_card_register(mgr->chip[0]->card);
651}
652
653#endif /* SND_MIXART_FW_LOADER */