aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1_main.c
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2006-10-09 18:08:00 -0400
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:00:38 -0500
commit9148cc502752b12051760e6c5ba5daaea3367360 (patch)
treede02a490f42d253f2baf5c690bb4a92406d04e9e /sound/pci/emu10k1/emu10k1_main.c
parent6add0f4242fc52a97a92fca99a39f35298c2b50b (diff)
[ALSA] snd_emu10k1: Added support for 14dB Attenuation PADS on DACs and ADCs.
Signed-off-by: James Courtier-Dutton <James@superbug.co.uk> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/emu10k1/emu10k1_main.c')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 09c4db8495b2..341a2775d286 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -725,25 +725,27 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
725 snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp ); 725 snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp );
726 /* ADAT input. */ 726 /* ADAT input. */
727 snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x01 ); 727 snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x01 );
728 snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_PADS, &tmp ); 728 snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp );
729 /* Set no attenuation on Audio Dock pads. */ 729 /* Set no attenuation on Audio Dock pads. */
730 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PADS, 0x00 ); 730 snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00 );
731 emu->emu1010.adc_pads = 0x00;
731 snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp ); 732 snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
732 /* Unmute Audio dock DACs, Headphone source DAC-4. */ 733 /* Unmute Audio dock DACs, Headphone source DAC-4. */
733 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 ); 734 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
734 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 ); 735 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
735 snd_emu1010_fpga_read(emu, EMU_HANA_UNKNOWN13, &tmp ); 736 snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp );
736 /* Unknown. */ 737 /* DAC PADs. */
737 snd_emu1010_fpga_write(emu, EMU_HANA_UNKNOWN13, 0x0f ); 738 snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f );
739 emu->emu1010.dac_pads = 0x0f;
738 snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp ); 740 snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
739 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 ); 741 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
740 snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp ); 742 snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
741 /* SPDIF Format. Set Consumer mode, 24bit, copy enable */ 743 /* SPDIF Format. Set Consumer mode, 24bit, copy enable */
742 snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); 744 snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 );
743 /* MIDI routing */ 745 /* MIDI routing */
744 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI, 0x19 ); 746 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 );
745 /* Unknown. */ 747 /* Unknown. */
746 snd_emu1010_fpga_write(emu, EMU_HANA_UNKNOWN12, 0x0c ); 748 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c );
747 /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */ 749 /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */
748 /* IRQ Enable: All off */ 750 /* IRQ Enable: All off */
749 snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00 ); 751 snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00 );
@@ -880,10 +882,10 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
880 /* Initial boot complete. Now patches */ 882 /* Initial boot complete. Now patches */
881 883
882 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp ); 884 snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
883 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI, 0x19 ); /* MIDI Route */ 885 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
884 snd_emu1010_fpga_write(emu, EMU_HANA_UNKNOWN12, 0x0c ); /* Unknown */ 886 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
885 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI, 0x19 ); /* MIDI Route */ 887 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
886 snd_emu1010_fpga_write(emu, EMU_HANA_UNKNOWN12, 0x0c ); /* Unknown */ 888 snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
887 snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp ); 889 snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
888 snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */ 890 snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
889 891
@@ -902,7 +904,6 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
902 if ((err = snd_emu1010_load_firmware(emu, dock_filename)) != 0) { 904 if ((err = snd_emu1010_load_firmware(emu, dock_filename)) != 0) {
903 return err; 905 return err;
904 } 906 }
905 snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
906 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 ); 907 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 );
907 snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg ); 908 snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &reg );
908 snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg); 909 snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg);
@@ -915,6 +916,10 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
915 return 0; 916 return 0;
916 return -ENODEV; 917 return -ENODEV;
917 } 918 }
919 snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
920 snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp );
921 snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2 );
922 snd_printk("Audio Dock ver:%d.%d\n",tmp ,tmp2);
918 } 923 }
919#if 0 924#if 0
920 snd_emu1010_fpga_link_dst_src_write(emu, 925 snd_emu1010_fpga_link_dst_src_write(emu,