diff options
author | James Courtier-Dutton <James@superbug.co.uk> | 2007-07-14 05:24:49 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-07-20 05:11:59 -0400 |
commit | d9e8a552d486eff3281e58754d126500782dcd74 (patch) | |
tree | 6fcccf936df5a90ff87e25c1c93ab7f12e584b1d /sound/pci | |
parent | 3663d845e557989d09e856c1e9e708e80a976dd4 (diff) |
[ALSA] snd-emu10k1:Enable E-Mu 1616m notebook firmware loading.
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 6135fc99fa5e..404ae1be0a4b 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -53,11 +53,13 @@ | |||
53 | #define DOCK_FILENAME "emu/audio_dock.fw" | 53 | #define DOCK_FILENAME "emu/audio_dock.fw" |
54 | #define EMU1010B_FILENAME "emu/emu1010b.fw" | 54 | #define EMU1010B_FILENAME "emu/emu1010b.fw" |
55 | #define MICRO_DOCK_FILENAME "emu/micro_dock.fw" | 55 | #define MICRO_DOCK_FILENAME "emu/micro_dock.fw" |
56 | #define EMU1010_NOTEBOOK_FILENAME "emu/emu1010_notebook.fw" | ||
56 | 57 | ||
57 | MODULE_FIRMWARE(HANA_FILENAME); | 58 | MODULE_FIRMWARE(HANA_FILENAME); |
58 | MODULE_FIRMWARE(DOCK_FILENAME); | 59 | MODULE_FIRMWARE(DOCK_FILENAME); |
59 | MODULE_FIRMWARE(EMU1010B_FILENAME); | 60 | MODULE_FIRMWARE(EMU1010B_FILENAME); |
60 | MODULE_FIRMWARE(MICRO_DOCK_FILENAME); | 61 | MODULE_FIRMWARE(MICRO_DOCK_FILENAME); |
62 | MODULE_FIRMWARE(EMU1010_NOTEBOOK_FILENAME); | ||
61 | 63 | ||
62 | 64 | ||
63 | /************************************************************************* | 65 | /************************************************************************* |
@@ -764,7 +766,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
764 | /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ | 766 | /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */ |
765 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 767 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
766 | snd_printdd("reg1=0x%x\n",reg); | 768 | snd_printdd("reg1=0x%x\n",reg); |
767 | if ((reg & 0x1f) == 0x15) { | 769 | if ((reg & 0x3f) == 0x15) { |
768 | /* FPGA netlist already present so clear it */ | 770 | /* FPGA netlist already present so clear it */ |
769 | /* Return to programming mode */ | 771 | /* Return to programming mode */ |
770 | 772 | ||
@@ -772,8 +774,9 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
772 | } | 774 | } |
773 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 775 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
774 | snd_printdd("reg2=0x%x\n",reg); | 776 | snd_printdd("reg2=0x%x\n",reg); |
775 | if ((reg & 0x1f) == 0x15) { | 777 | if ((reg & 0x3f) == 0x15) { |
776 | /* FPGA failed to return to programming mode */ | 778 | /* FPGA failed to return to programming mode */ |
779 | snd_printk(KERN_INFO "emu1010: FPGA failed to return to programming mode\n"); | ||
777 | return -ENODEV; | 780 | return -ENODEV; |
778 | } | 781 | } |
779 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); | 782 | snd_printk(KERN_INFO "emu1010: EMU_HANA_ID=0x%x\n",reg); |
@@ -787,11 +790,16 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
787 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010B_FILENAME); | 790 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010B_FILENAME); |
788 | return err; | 791 | return err; |
789 | } | 792 | } |
793 | } else if (emu->card_capabilities->emu1010 == 3) { | ||
794 | if ((err = snd_emu1010_load_firmware(emu, EMU1010_NOTEBOOK_FILENAME)) != 0) { | ||
795 | snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", EMU1010_NOTEBOOK_FILENAME); | ||
796 | return err; | ||
797 | } | ||
790 | } | 798 | } |
791 | 799 | ||
792 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ | 800 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ |
793 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 801 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
794 | if ((reg & 0x1f) != 0x15) { | 802 | if ((reg & 0x3f) != 0x15) { |
795 | /* FPGA failed to be programmed */ | 803 | /* FPGA failed to be programmed */ |
796 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg); | 804 | snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg); |
797 | return -ENODEV; | 805 | return -ENODEV; |
@@ -1016,6 +1024,10 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
1016 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | 1024 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { |
1017 | return err; | 1025 | return err; |
1018 | } | 1026 | } |
1027 | } else if (emu->card_capabilities->emu1010 == 3) { | ||
1028 | if ((err = snd_emu1010_load_firmware(emu, MICRO_DOCK_FILENAME)) != 0) { | ||
1029 | return err; | ||
1030 | } | ||
1019 | } | 1031 | } |
1020 | 1032 | ||
1021 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); | 1033 | snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); |
@@ -1024,7 +1036,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
1024 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ | 1036 | /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ |
1025 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); | 1037 | snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® ); |
1026 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg); | 1038 | snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg); |
1027 | if ((reg & 0x1f) != 0x15) { | 1039 | if ((reg & 0x3f) != 0x15) { |
1028 | /* FPGA failed to be programmed */ | 1040 | /* FPGA failed to be programmed */ |
1029 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); | 1041 | snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware file failed, reg=0x%x\n", reg); |
1030 | return 0; | 1042 | return 0; |
@@ -1299,9 +1311,8 @@ static struct snd_emu_chip_details emu_chip_details[] = { | |||
1299 | .emu10k2_chip = 1, | 1311 | .emu10k2_chip = 1, |
1300 | .ca0108_chip = 1, | 1312 | .ca0108_chip = 1, |
1301 | .ca_cardbus_chip = 1, | 1313 | .ca_cardbus_chip = 1, |
1302 | .spi_dac = 1, | 1314 | .spk71 = 1 , |
1303 | .i2c_adc = 1, | 1315 | .emu1010 = 3} , |
1304 | .spk71 = 1} , | ||
1305 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, | 1316 | {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102, |
1306 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", | 1317 | .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]", |
1307 | .id = "EMU1010", | 1318 | .id = "EMU1010", |
@@ -1742,12 +1753,13 @@ int __devinit snd_emu10k1_create(struct snd_card *card, | |||
1742 | emu->fx8010.extout_mask = extout_mask; | 1753 | emu->fx8010.extout_mask = extout_mask; |
1743 | emu->enable_ir = enable_ir; | 1754 | emu->enable_ir = enable_ir; |
1744 | 1755 | ||
1756 | if (emu->card_capabilities->ca_cardbus_chip) { | ||
1757 | if ((err = snd_emu10k1_cardbus_init(emu)) < 0) | ||
1758 | goto error; | ||
1759 | } | ||
1745 | if (emu->card_capabilities->ecard) { | 1760 | if (emu->card_capabilities->ecard) { |
1746 | if ((err = snd_emu10k1_ecard_init(emu)) < 0) | 1761 | if ((err = snd_emu10k1_ecard_init(emu)) < 0) |
1747 | goto error; | 1762 | goto error; |
1748 | } else if (emu->card_capabilities->ca_cardbus_chip) { | ||
1749 | if ((err = snd_emu10k1_cardbus_init(emu)) < 0) | ||
1750 | goto error; | ||
1751 | } else if (emu->card_capabilities->emu1010) { | 1763 | } else if (emu->card_capabilities->emu1010) { |
1752 | if ((err = snd_emu10k1_emu1010_init(emu)) < 0) { | 1764 | if ((err = snd_emu10k1_emu1010_init(emu)) < 0) { |
1753 | snd_emu10k1_free(emu); | 1765 | snd_emu10k1_free(emu); |
@@ -1893,10 +1905,10 @@ void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu) | |||
1893 | 1905 | ||
1894 | void snd_emu10k1_resume_init(struct snd_emu10k1 *emu) | 1906 | void snd_emu10k1_resume_init(struct snd_emu10k1 *emu) |
1895 | { | 1907 | { |
1908 | if (emu->card_capabilities->ca_cardbus_chip) | ||
1909 | snd_emu10k1_cardbus_init(emu); | ||
1896 | if (emu->card_capabilities->ecard) | 1910 | if (emu->card_capabilities->ecard) |
1897 | snd_emu10k1_ecard_init(emu); | 1911 | snd_emu10k1_ecard_init(emu); |
1898 | else if (emu->card_capabilities->ca_cardbus_chip) | ||
1899 | snd_emu10k1_cardbus_init(emu); | ||
1900 | else if (emu->card_capabilities->emu1010) | 1912 | else if (emu->card_capabilities->emu1010) |
1901 | snd_emu10k1_emu1010_init(emu); | 1913 | snd_emu10k1_emu1010_init(emu); |
1902 | else | 1914 | else |