Changeset 210
- Timestamp:
- Jul 13, 2007, 4:47:31 PM (18 years ago)
- Location:
- GPL/branches/alsa-resync1/alsa-kernel
- Files:
-
- 12 deleted
- 86 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/core/control.c
r206 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 23 #include <linux/threads.h> 24 24 #include <linux/interrupt.h> 25 25 #include <linux/slab.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/device.c
r92 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/slab.h> 25 24 #include <linux/time.h> 25 #include <linux/errno.h> 26 26 #include <sound/core.h> 27 27 -
GPL/branches/alsa-resync1/alsa-kernel/core/info.c
r207 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/init.h> … … 535 534 { 536 535 #ifndef LINUX_2_2 537 owner:THIS_MODULE,538 #endif 539 llseek:snd_info_entry_llseek,540 read:snd_info_entry_read,541 write:snd_info_entry_write,542 poll:snd_info_entry_poll,543 ioctl:snd_info_entry_ioctl,544 mmap:snd_info_entry_mmap,545 open:snd_info_entry_open,546 release:snd_info_entry_release,536 .owner = THIS_MODULE, 537 #endif 538 .llseek = snd_info_entry_llseek, 539 .read = snd_info_entry_read, 540 .write = snd_info_entry_write, 541 .poll = snd_info_entry_poll, 542 .ioctl = snd_info_entry_ioctl, 543 .mmap = snd_info_entry_mmap, 544 .open = snd_info_entry_open, 545 .release = snd_info_entry_release, 547 546 }; 548 547 … … 606 605 { 607 606 #ifdef LINUX_2_2 608 default_file_ops:&snd_info_card_link_operations,609 #endif 610 readlink:snd_info_card_readlink,611 follow_link:snd_info_card_followlink,607 .default_file_ops = &snd_info_card_link_operations, 608 #endif 609 .readlink = snd_info_card_readlink, 610 .follow_link = snd_info_card_followlink, 612 611 }; 613 612 #endif //TARGET_OS2 -
GPL/branches/alsa-resync1/alsa-kernel/core/init.c
r207 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/init.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/isadma.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ … … 28 28 29 29 #include <sound/driver.h> 30 #include <sound/core.h> 31 #include <asm/dma.h> 30 32 31 #ifdef CONFIG_ SND_ISA33 #ifdef CONFIG_ISA 32 34 33 35 /* … … 36 38 37 39 void snd_dma_program(unsigned long dma, 38 const void *buf, unsigned int size,40 unsigned long addr, unsigned int size, 39 41 unsigned short mode) 40 42 { … … 45 47 clear_dma_ff(dma); 46 48 set_dma_mode(dma, mode); 47 set_dma_addr(dma, virt_to_bus((void *) buf));49 set_dma_addr(dma, addr); 48 50 set_dma_count(dma, size); 49 51 if (!(mode & DMA_MODE_NO_ENABLE)) … … 78 80 } 79 81 80 #endif /* CONFIG_ SND_ISA */82 #endif /* CONFIG_ISA */ -
GPL/branches/alsa-resync1/alsa-kernel/core/memory.c
r207 r210 21 21 */ 22 22 23 #define __NO_VERSION__24 23 #include <sound/driver.h> 25 24 #include <asm/io.h> … … 31 30 #include <sound/core.h> 32 31 #include <sound/info.h> 32 #ifdef CONFIG_SBUS 33 #include <asm/sbus.h> 34 #endif 33 35 #include <sound/memalloc.h> 34 36 -
GPL/branches/alsa-resync1/alsa-kernel/core/misc.c
r206 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/init.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_lib.c
r105 r210 21 21 */ 22 22 23 #define __NO_VERSION__24 23 #include <sound/driver.h> 25 24 #include <linux/slab.h> … … 2694 2693 EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); 2695 2694 #endif 2695 #ifdef CONFIG_SBUS 2696 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages); 2697 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages_for_all); 2698 #endif -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_memory.c
r105 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <asm/io.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_native.c
r109 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/mm.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_timer.c
r105 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/time.h> -
GPL/branches/alsa-resync1/alsa-kernel/core/rtctimer.c
r207 r210 24 24 #include <linux/init.h> 25 25 #include <linux/time.h> 26 #include <linux/threads.h> 26 27 #include <linux/interrupt.h> 27 28 #include <sound/core.h> … … 52 53 */ 53 54 static struct _snd_timer_hardware rtc_hw = { 54 flags:SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO,55 ticks:100000000L, /* FIXME: XXX */56 open:rtctimer_open,57 close:rtctimer_close,58 start:rtctimer_start,59 stop:rtctimer_stop,55 .flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO, 56 .ticks = 100000000L, /* FIXME: XXX */ 57 .open = rtctimer_open, 58 .close = rtctimer_close, 59 .start = rtctimer_start, 60 .stop = rtctimer_stop, 60 61 }; 61 62 -
GPL/branches/alsa-resync1/alsa-kernel/core/seq/seq_virmidi.c
r34 r210 556 556 557 557 EXPORT_SYMBOL(snd_virmidi_new); 558 EXPORT_SYMBOL(snd_virmidi_receive); -
GPL/branches/alsa-resync1/alsa-kernel/core/sound.c
r112 r210 173 173 { 174 174 #ifndef LINUX_2_2 175 owner:THIS_MODULE,176 #endif 177 open:snd_open175 .owner = THIS_MODULE, 176 #endif 177 .open = snd_open 178 178 }; 179 179 #endif -
GPL/branches/alsa-resync1/alsa-kernel/core/timer.c
r207 r210 1787 1787 1788 1788 remove_wait_queue(&tu->qchange_sleep, &wait); 1789 set_current_state(TASK_RUNNING); 1789 1790 1790 1791 if (signal_pending(current)) { -
GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c
r207 r210 123 123 #define SNDRV_SERIAL_MS124W_SA 2 /* Midiator MS-124W in S/A mode */ 124 124 #define SNDRV_SERIAL_MS124W_MB 3 /* Midiator MS-124W in M/B mode */ 125 #define SNDRV_SERIAL_MAX_ADAPTOR SNDRV_SERIAL_MS124W_MB 125 #define SNDRV_SERIAL_GENERIC 4 /* Generic Interface */ 126 #define SNDRV_SERIAL_MAX_ADAPTOR SNDRV_SERIAL_GENERIC 126 127 static char *adaptor_names[] = { 127 128 "Soundcanvas", 128 129 "MS-124T", 129 130 "MS-124W S/A", 130 "MS-124W M/B" 131 "MS-124W M/B", 132 "Generic" 131 133 }; 132 134 … … 140 142 static int snd_base[SNDRV_CARDS] = {REPEAT_SNDRV(115200)}; /* baud base */ 141 143 static int snd_outs[SNDRV_CARDS] = {REPEAT_SNDRV(1)}; /* 1 to 16 */ 144 static int snd_ins[SNDRV_CARDS] = {REPEAT_SNDRV(1)}; /* 1 to 16 */ 142 145 static int snd_adaptor[SNDRV_CARDS] = {REPEAT_SNDRV(SNDRV_SERIAL_SOUNDCANVAS)}; 143 146 #else 144 147 static int snd_speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */ 145 148 static int snd_base[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 115200}; /* baud base */ 146 static int snd_outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ 149 static int snd_outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ 150 static int snd_ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; /* 1 to 16 */ 147 151 static int snd_adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS}; 148 152 #endif … … 171 175 MODULE_PARM(snd_outs, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 172 176 MODULE_PARM_DESC(snd_outs, "Number of MIDI outputs."); 177 MODULE_PARM(snd_ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 178 MODULE_PARM_DESC(snd_ins, "Number of MIDI inputs."); 179 173 180 MODULE_PARM_SYNTAX(snd_outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list"); 181 MODULE_PARM_SYNTAX(snd_ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list"); 174 182 MODULE_PARM(snd_adaptor, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 175 183 MODULE_PARM_DESC(snd_adaptor, "Type of adaptor."); 176 MODULE_PARM_SYNTAX(snd_adaptor, SNDRV_ENABLED ",allows:{{0=Soundcanvas,1=MS-124T,2=MS-124W S/A,3=MS-124W M/B }},dialog:list");184 MODULE_PARM_SYNTAX(snd_adaptor, SNDRV_ENABLED ",allows:{{0=Soundcanvas,1=MS-124T,2=MS-124W S/A,3=MS-124W M/B,4=Generic}},dialog:list"); 177 185 178 186 /*#define SNDRV_SERIAL_MS124W_MB_NOCOMBO 1*/ /* Address outs as 0-3 instead of bitmap */ 179 187 180 188 #define SNDRV_SERIAL_MAX_OUTS 16 /* max 64, min 16 */ 181 182 #define TX_BUFF_SIZE (1<<9) /* Must be 2^n */ 189 #define SNDRV_SERIAL_MAX_INS 16 /* max 64, min 16 */ 190 191 #define TX_BUFF_SIZE (1<<15) /* Must be 2^n */ 183 192 #define TX_BUFF_MASK (TX_BUFF_SIZE - 1) 184 193 … … 193 202 snd_rawmidi_t *rmidi; 194 203 snd_rawmidi_substream_t *midi_output[SNDRV_SERIAL_MAX_OUTS]; 195 snd_rawmidi_substream_t *midi_input;204 snd_rawmidi_substream_t *midi_input[SNDRV_SERIAL_MAX_INS]; 196 205 197 206 int filemode; //open status of file … … 218 227 // type of adaptor 219 228 int adaptor; 229 230 // inputs 231 int prev_in; 232 unsigned char rstatus; 220 233 221 234 // outputs … … 274 287 { 275 288 unsigned char c, status; 289 int substream; 290 291 /* recall previous stream */ 292 substream = uart->prev_in; 276 293 277 294 /* Read Loop */ … … 279 296 /* while receive data ready */ 280 297 c = inb(uart->base + UART_RX); 281 if (uart->filemode & SERIAL_MODE_INPUT_OPEN) { 282 snd_rawmidi_receive(uart->midi_input, &c, 1); 283 } 298 299 /* keep track of last status byte */ 300 if (c & 0x80) { 301 uart->rstatus = c; 302 } 303 304 /* handle stream switch */ 305 if (uart->adaptor == SNDRV_SERIAL_GENERIC) { 306 if (uart->rstatus == 0xf5) { 307 if (c <= SNDRV_SERIAL_MAX_INS && c > 0) 308 substream = c - 1; 309 if (c != 0xf5) 310 uart->rstatus = 0; /* prevent future bytes from being interpreted as streams */ 311 } 312 else if ((uart->filemode & SERIAL_MODE_INPUT_OPEN) && (uart->midi_input[substream] != NULL)) { 313 snd_rawmidi_receive(uart->midi_input[substream], &c, 1); 314 } 315 } else if ((uart->filemode & SERIAL_MODE_INPUT_OPEN) && (uart->midi_input[substream] != NULL)) { 316 snd_rawmidi_receive(uart->midi_input[substream], &c, 1); 317 } 318 284 319 if (status & UART_LSR_OE) 285 320 snd_printk("%s: Overrun on device at 0x%lx\n", 286 321 uart->rmidi->name, uart->base); 287 322 } 323 324 /* remember the last stream */ 325 uart->prev_in = substream; 288 326 289 327 /* no need of check SERIAL_MODE_OUTPUT_OPEN because if not, … … 293 331 uart->fifo_count = 0; 294 332 } 295 if (uart->adaptor == SNDRV_SERIAL_MS124W_SA) { 333 if (uart->adaptor == SNDRV_SERIAL_MS124W_SA 334 || uart->adaptor == SNDRV_SERIAL_GENERIC) { 296 335 /* Can't use FIFO, must send only when CTS is true */ 297 336 status = inb(uart->base + UART_MSR); … … 474 513 | UART_IER_MSI /* Enable Modem status interrupt */ 475 514 ; 515 } else if (uart->adaptor == SNDRV_SERIAL_GENERIC) { 516 byte = UART_IER_RDI /* Enable Receiver data interrupt */ 517 | UART_IER_MSI /* Enable Modem status interrupt */ 518 | UART_IER_THRI /* Enable Transmitter holding register empty interupt */ 519 ; 476 520 } else { 477 521 byte = UART_IER_RDI /* Enable Receiver data interupt */ … … 546 590 snd_uart16550_do_open(uart); 547 591 uart->filemode |= SERIAL_MODE_INPUT_OPEN; 548 uart->midi_input= substream;592 uart->midi_input[substream->number] = substream; 549 593 spin_unlock_irqrestore(&uart->open_lock, flags); 550 594 return 0; … … 558 602 spin_lock_irqsave(&uart->open_lock, flags); 559 603 uart->filemode &= ~SERIAL_MODE_INPUT_OPEN; 560 uart->midi_input= NULL;604 uart->midi_input[substream->number] = NULL; 561 605 if (uart->filemode == SERIAL_MODE_NOT_OPENED) 562 606 snd_uart16550_do_close(uart); … … 622 666 { 623 667 if (uart->buff_in_count == 0 /* Buffer empty? */ 624 && (uart->adaptor != SNDRV_SERIAL_MS124W_SA || 668 && ((uart->adaptor != SNDRV_SERIAL_MS124W_SA && 669 uart->adaptor != SNDRV_SERIAL_GENERIC) || 625 670 (uart->fifo_count == 0 /* FIFO empty? */ 626 671 && (inb(uart->base + UART_MSR) & UART_MSR_CTS)))) { /* CTS? */ … … 656 701 snd_uart16550_t *uart = substream->rmidi->private_data; 657 702 char first; 703 static unsigned long lasttime=0; 658 704 659 705 /* Interupts are disabled during the updating of the tx_buff, … … 691 737 first = 0; 692 738 while (1) { 693 /* buffer full? */694 if (uart->buff_in_count >= TX_BUFF_SIZE)695 break;696 739 if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1) 697 740 break; 698 if (first == 0 && uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS && 699 uart->prev_out != substream->number) { 741 /* Also send F5 after 3 seconds with no data to handle device disconnect */ 742 if (first == 0 && (uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS || 743 uart->adaptor == SNDRV_SERIAL_GENERIC) && 744 (uart->prev_out != substream->number || jiffies-lasttime > 3*HZ)) { 745 746 /* We will need three bytes of data here (worst case). */ 747 if (uart->buff_in_count >= TX_BUFF_SIZE - 3) 748 break; 749 700 750 /* Roland Soundcanvas part selection */ 701 751 /* If this substream of the data is different previous … … 707 757 snd_uart16550_output_byte(uart, substream, uart->prev_out + 1); 708 758 /* If midi_byte is a data byte, send the previous status byte */ 709 if (midi_byte < 0x80)759 if ((midi_byte < 0x80) && (uart->adaptor == SNDRV_SERIAL_SOUNDCANVAS)) 710 760 snd_uart16550_output_byte(uart, substream, uart->prev_status[uart->prev_out]); 711 761 } 762 763 /* buffer full? */ 764 if (uart->buff_in_count >= TX_BUFF_SIZE) 765 break; 766 712 767 /* send midi byte */ 713 768 snd_uart16550_output_byte(uart, substream, midi_byte); … … 716 771 first = 1; 717 772 } 773 lasttime = jiffies; 718 774 } 719 775 spin_unlock_irqrestore(&uart->open_lock, flags); … … 753 809 static snd_rawmidi_ops_t snd_uart16550_output = 754 810 { 755 open:snd_uart16550_output_open,756 close:snd_uart16550_output_close,757 trigger:snd_uart16550_output_trigger,811 .open = snd_uart16550_output_open, 812 .close = snd_uart16550_output_close, 813 .trigger = snd_uart16550_output_trigger, 758 814 }; 759 815 760 816 static snd_rawmidi_ops_t snd_uart16550_input = 761 817 { 762 open:snd_uart16550_input_open,763 close:snd_uart16550_input_close,764 trigger:snd_uart16550_input_trigger,818 .open = snd_uart16550_input_open, 819 .close = snd_uart16550_input_close, 820 .trigger = snd_uart16550_input_trigger, 765 821 }; 766 822 #endif … … 829 885 uart->speed_base = base; 830 886 uart->prev_out = -1; 887 uart->prev_in = 0; 888 uart->rstatus = 0; 831 889 memset(uart->prev_status, 0x80, sizeof(unsigned char) * SNDRV_SERIAL_MAX_OUTS); 832 890 uart->buffer_timer.function = snd_uart16550_buffer_timer; … … 862 920 } 863 921 864 static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, snd_rawmidi_t **rmidi)922 static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, snd_rawmidi_t **rmidi) 865 923 { 866 924 snd_rawmidi_t *rrawmidi; 867 925 int err; 868 926 869 if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, 1, &rrawmidi)) < 0)927 if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, ins, &rrawmidi)) < 0) 870 928 return err; 871 929 snd_rawmidi_set_ops(rrawmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_uart16550_input); … … 892 950 switch (snd_adaptor[dev]) { 893 951 case SNDRV_SERIAL_SOUNDCANVAS: 952 snd_ins[dev] = 1; 894 953 break; 895 954 case SNDRV_SERIAL_MS124T: 896 955 case SNDRV_SERIAL_MS124W_SA: 897 956 snd_outs[dev] = 1; 957 snd_ins[dev] = 1; 898 958 break; 899 959 case SNDRV_SERIAL_MS124W_MB: 900 960 snd_outs[dev] = 16; 961 snd_ins[dev] = 1; 962 break; 963 case SNDRV_SERIAL_GENERIC: 901 964 break; 902 965 default: … … 909 972 snd_printk("Count of outputs is out of range 1-%d (%d)\n", 910 973 SNDRV_SERIAL_MAX_OUTS, snd_outs[dev]); 974 return -ENODEV; 975 } 976 977 if (snd_ins[dev] < 1 || snd_ins[dev] > SNDRV_SERIAL_MAX_INS) { 978 snd_printk("Count of inputs is out of range 1-%d (%d)\n", 979 SNDRV_SERIAL_MAX_INS, snd_ins[dev]); 911 980 return -ENODEV; 912 981 } … … 936 1005 } 937 1006 938 if ((err = snd_uart16550_rmidi(uart, 0, snd_outs[dev], &uart->rmidi)) < 0) {1007 if ((err = snd_uart16550_rmidi(uart, 0, snd_outs[dev], snd_ins[dev], &uart->rmidi)) < 0) { 939 1008 snd_card_free(card); 940 1009 return err; 941 1010 } 942 1011 943 sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d adaptor %s",1012 sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s", 944 1013 card->shortname, 945 1014 uart->base, … … 948 1017 (int)uart->divisor, 949 1018 snd_outs[dev], 1019 snd_ins[dev], 950 1020 adaptor_names[uart->adaptor]); 951 1021 … … 993 1063 994 1064 /* format is: snd-serial=snd_enable,snd_index,snd_id, 995 snd_port,snd_irq,snd_speed,snd_base,snd_outs */ 1065 snd_port,snd_irq,snd_speed,snd_base,snd_outs, 1066 snd_ins,snd_adaptor */ 996 1067 997 1068 static int __init alsa_card_serial_setup(char *str) … … 1009 1080 get_option(&str,&snd_base[nr_dev]) == 2 && 1010 1081 get_option(&str,&snd_outs[nr_dev]) == 2 && 1082 get_option(&str,&snd_ins[nr_dev]) == 2 && 1011 1083 get_option(&str,&snd_adaptor[nr_dev]) == 2); 1012 1084 nr_dev++; -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/ad1848.h
r96 r210 167 167 void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs); 168 168 169 #ifdef TARGET_OS2170 169 #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ 171 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 172 0, 0, snd_ad1848_info_single, \ 173 snd_ad1848_get_single, snd_ad1848_put_single, \ 174 reg | (shift << 8) | (mask << 16) | (invert << 24) } 175 #else 176 #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ 177 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 178 info: snd_ad1848_info_single, \ 179 get: snd_ad1848_get_single, put: snd_ad1848_put_single, \ 180 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 181 #endif 170 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 171 .info = snd_ad1848_info_single, \ 172 .get = snd_ad1848_get_single, .put = snd_ad1848_put_single, \ 173 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 182 174 183 175 int snd_ad1848_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); … … 185 177 int snd_ad1848_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 186 178 187 #ifdef TARGET_OS2188 179 #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 189 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 190 0, 0, snd_ad1848_info_double, \ 191 snd_ad1848_get_double, snd_ad1848_put_double, \ 192 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 193 #else 194 #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 195 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 196 info: snd_ad1848_info_double, \ 197 get: snd_ad1848_get_double, put: snd_ad1848_put_double, \ 198 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 199 #endif 180 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 181 .info = snd_ad1848_info_double, \ 182 .get = snd_ad1848_get_double, .put = snd_ad1848_put_double, \ 183 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 200 184 201 185 int snd_ad1848_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/core.h
r206 r210 373 373 374 374 #ifdef CONFIG_SND_VERBOSE_PRINTK 375 #define snd_printk(f ormat, args...) \376 snd_verbose_printk(__FILE__, __LINE__, f ormat,##args)377 #else 378 #define snd_printk(f ormat, args...) \379 printk(f ormat,##args)375 #define snd_printk(fmt, args...) \ 376 snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) 377 #else 378 #define snd_printk(fmt, args...) \ 379 printk(fmt ,##args) 380 380 #endif 381 381 … … 385 385 386 386 #ifdef CONFIG_SND_VERBOSE_PRINTK 387 #define snd_printd(f ormat, args...) \388 snd_verbose_printd(__FILE__, __LINE__, f ormat,##args)387 #define snd_printd(fmt, args...) \ 388 snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) 389 389 #endif 390 390 #define snd_assert(expr, args...) do {\ … … 403 403 #else /* !CONFIG_SND_DEBUG */ 404 404 405 #define snd_printd(f ormat, args...) /* nothing */406 #define snd_assert(expr, args...) /* nothing */405 #define snd_printd(fmt, args...) /* nothing */ 406 #define snd_assert(expr, args...) (void)(expr) 407 407 #define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0) 408 408 -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/cs4231.h
r96 r210 297 297 */ 298 298 299 #ifdef TARGET_OS2300 299 #define CS4231_SINGLE(xname, xindex, reg, shift, mask, invert) \ 301 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 302 0, 0, snd_cs4231_info_single, \ 303 snd_cs4231_get_single, snd_cs4231_put_single, \ 304 reg | (shift << 8) | (mask << 16) | (invert << 24) } 305 #else 306 #define CS4231_SINGLE(xname, xindex, reg, shift, mask, invert) \ 307 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 308 info: snd_cs4231_info_single, \ 309 get: snd_cs4231_get_single, put: snd_cs4231_put_single, \ 310 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 311 #endif 300 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 301 .info = snd_cs4231_info_single, \ 302 .get = snd_cs4231_get_single, .put = snd_cs4231_put_single, \ 303 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 312 304 313 305 int snd_cs4231_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); … … 315 307 int snd_cs4231_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 316 308 317 #ifdef TARGET_OS2318 309 #define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 319 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 320 0, 0, snd_cs4231_info_double, \ 321 snd_cs4231_get_double, snd_cs4231_put_double, \ 322 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 323 #else 324 #define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 325 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 326 info: snd_cs4231_info_double, \ 327 get: snd_cs4231_get_double, put: snd_cs4231_put_double, \ 328 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 329 #endif 310 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 311 .info = snd_cs4231_info_double, \ 312 .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \ 313 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 330 314 331 315 int snd_cs4231_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/driver.h
r112 r210 58 58 59 59 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) 60 #if defined(__i386__) || defined(__ppc__) 60 #if defined(__i386__) || defined(__ppc__) || defined(__x86_64__) 61 61 /* 62 * Here a dirty hack for 2.4 kernels.. See kernel/memory.c.62 * Here a dirty hack for 2.4 kernels.. See sound/core/memory.c. 63 63 */ 64 64 #define HACK_PCI_ALLOC_CONSISTENT -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/initval.h
r92 r210 179 179 #if defined(SNDRV_GET_ID) && !defined(MODULE) 180 180 #include <linux/ctype.h> 181 #include <linux/init.h> 181 182 static int __init get_id(char **str, char **dst) 182 183 { -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/mixer_oss.h
r96 r210 23 23 */ 24 24 25 #if def CONFIG_SND_OSSEMUL25 #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 26 26 27 27 typedef struct _snd_oss_mixer_slot snd_mixer_oss_slot_t; … … 67 67 }; 68 68 69 #endif /* CONFIG_SND_ OSSEMUL*/69 #endif /* CONFIG_SND_MIXER_OSS */ 70 70 71 71 #endif /* __SOUND_MIXER_OSS_H */ -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm_params.h
r112 r210 37 37 38 38 #define INLINE static inline 39 #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */40 #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32)41 #define MASK_OFS(i) ((i) >> 5)42 #define MASK_BIT(i) (1U << ((i) & 31))43 44 39 #define assert(a) 40 41 #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ 42 #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) 43 #define MASK_OFS(i) ((i) >> 5) 44 #define MASK_BIT(i) (1U << ((i) & 31)) 45 45 46 46 INLINE unsigned int ld2(u_int32_t v) -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a_lib.c
r112 r210 333 333 } 334 334 335 #ifdef TARGET_OS2 335 336 336 static snd_pcm_hardware_t snd_ad1816a_playback = { 337 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |337 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 338 338 SNDRV_PCM_INFO_MMAP_VALID), 339 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |339 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | 340 340 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 341 341 SNDRV_PCM_FMTBIT_S16_BE), 342 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,343 /* rate_min: */4000,344 /* rate_max: */55200,345 /* channels_min: */1,346 /* channels_max: */2,347 /* buffer_bytes_max: */(128*1024),348 /* period_bytes_min: */64,349 /* period_bytes_max: */(128*1024),350 /* periods_min: */1,351 /* periods_max: */1024,352 /* fifo_size: */0,342 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 343 .rate_min = 4000, 344 .rate_max = 55200, 345 .channels_min = 1, 346 .channels_max = 2, 347 .buffer_bytes_max = (128*1024), 348 .period_bytes_min = 64, 349 .period_bytes_max = (128*1024), 350 .periods_min = 1, 351 .periods_max = 1024, 352 .fifo_size = 0, 353 353 }; 354 354 355 355 static snd_pcm_hardware_t snd_ad1816a_capture = { 356 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |356 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 357 357 SNDRV_PCM_INFO_MMAP_VALID), 358 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |358 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | 359 359 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 360 360 SNDRV_PCM_FMTBIT_S16_BE), 361 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,362 /* rate_min: */4000,363 /* rate_max: */55200,364 /* channels_min: */1,365 /* channels_max: */2,366 /* buffer_bytes_max: */(128*1024),367 /* period_bytes_min: */64,368 /* period_bytes_max: */(128*1024),369 /* periods_min: */1,370 /* periods_max: */1024,371 /* fifo_size: */0,361 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 362 .rate_min = 4000, 363 .rate_max = 55200, 364 .channels_min = 1, 365 .channels_max = 2, 366 .buffer_bytes_max = (128*1024), 367 .period_bytes_min = 64, 368 .period_bytes_max = (128*1024), 369 .periods_min = 1, 370 .periods_max = 1024, 371 .fifo_size = 0, 372 372 }; 373 #else374 static snd_pcm_hardware_t snd_ad1816a_playback = {375 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |376 SNDRV_PCM_INFO_MMAP_VALID),377 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |378 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |379 SNDRV_PCM_FMTBIT_S16_BE),380 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,381 rate_min: 4000,382 rate_max: 55200,383 channels_min: 1,384 channels_max: 2,385 buffer_bytes_max: (128*1024),386 period_bytes_min: 64,387 period_bytes_max: (128*1024),388 periods_min: 1,389 periods_max: 1024,390 fifo_size: 0,391 };392 393 static snd_pcm_hardware_t snd_ad1816a_capture = {394 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |395 SNDRV_PCM_INFO_MMAP_VALID),396 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |397 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |398 SNDRV_PCM_FMTBIT_S16_BE),399 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,400 rate_min: 4000,401 rate_max: 55200,402 channels_min: 1,403 channels_max: 2,404 buffer_bytes_max: (128*1024),405 period_bytes_min: 64,406 period_bytes_max: (128*1024),407 periods_min: 1,408 periods_max: 1024,409 fifo_size: 0,410 };411 #endif412 373 413 374 static int snd_ad1816a_timer_close(snd_timer_t *timer) … … 464 425 } 465 426 466 #ifdef TARGET_OS2467 427 static struct _snd_timer_hardware snd_ad1816a_timer_table = { 468 SNDRV_TIMER_HW_AUTO,469 10000,470 65535,471 snd_ad1816a_timer_open,472 snd_ad1816a_timer_close,473 snd_ad1816a_timer_resolution,474 snd_ad1816a_timer_start,475 snd_ad1816a_timer_stop,428 .flags = SNDRV_TIMER_HW_AUTO, 429 .resolution = 10000, 430 .ticks = 65535, 431 .open = snd_ad1816a_timer_open, 432 .close = snd_ad1816a_timer_close, 433 .c_resolution = snd_ad1816a_timer_resolution, 434 .start = snd_ad1816a_timer_start, 435 .stop = snd_ad1816a_timer_stop, 476 436 }; 477 #else 478 static struct _snd_timer_hardware snd_ad1816a_timer_table = { 479 flags: SNDRV_TIMER_HW_AUTO, 480 resolution: 10000, 481 ticks: 65535, 482 open: snd_ad1816a_timer_open, 483 close: snd_ad1816a_timer_close, 484 c_resolution: snd_ad1816a_timer_resolution, 485 start: snd_ad1816a_timer_start, 486 stop: snd_ad1816a_timer_stop, 487 }; 488 #endif 437 489 438 490 439 static int snd_ad1816a_playback_open(snd_pcm_substream_t *substream) … … 626 575 ad1816a_t **rchip) 627 576 { 628 #ifdef TARGET_OS2629 577 static snd_device_ops_t ops = { 630 snd_ad1816a_dev_free,0,0578 .dev_free = snd_ad1816a_dev_free, 631 579 }; 632 #else633 static snd_device_ops_t ops = {634 dev_free: snd_ad1816a_dev_free,635 };636 #endif637 580 int error; 638 581 ad1816a_t *chip; … … 688 631 } 689 632 690 #ifdef TARGET_OS2691 633 static snd_pcm_ops_t snd_ad1816a_playback_ops = { 692 snd_ad1816a_playback_open,693 snd_ad1816a_playback_close,694 snd_pcm_lib_ioctl,695 snd_ad1816a_hw_params,696 snd_ad1816a_hw_free,697 snd_ad1816a_playback_prepare,698 snd_ad1816a_playback_trigger,699 snd_ad1816a_playback_pointer,0,0634 .open = snd_ad1816a_playback_open, 635 .close = snd_ad1816a_playback_close, 636 .ioctl = snd_pcm_lib_ioctl, 637 .hw_params = snd_ad1816a_hw_params, 638 .hw_free = snd_ad1816a_hw_free, 639 .prepare = snd_ad1816a_playback_prepare, 640 .trigger = snd_ad1816a_playback_trigger, 641 .pointer = snd_ad1816a_playback_pointer, 700 642 }; 701 643 702 644 static snd_pcm_ops_t snd_ad1816a_capture_ops = { 703 snd_ad1816a_capture_open,704 snd_ad1816a_capture_close,705 snd_pcm_lib_ioctl,706 snd_ad1816a_hw_params,707 snd_ad1816a_hw_free,708 snd_ad1816a_capture_prepare,709 snd_ad1816a_capture_trigger,710 snd_ad1816a_capture_pointer,0,0645 .open = snd_ad1816a_capture_open, 646 .close = snd_ad1816a_capture_close, 647 .ioctl = snd_pcm_lib_ioctl, 648 .hw_params = snd_ad1816a_hw_params, 649 .hw_free = snd_ad1816a_hw_free, 650 .prepare = snd_ad1816a_capture_prepare, 651 .trigger = snd_ad1816a_capture_trigger, 652 .pointer = snd_ad1816a_capture_pointer, 711 653 }; 712 #else713 static snd_pcm_ops_t snd_ad1816a_playback_ops = {714 open: snd_ad1816a_playback_open,715 close: snd_ad1816a_playback_close,716 ioctl: snd_pcm_lib_ioctl,717 hw_params: snd_ad1816a_hw_params,718 hw_free: snd_ad1816a_hw_free,719 prepare: snd_ad1816a_playback_prepare,720 trigger: snd_ad1816a_playback_trigger,721 pointer: snd_ad1816a_playback_pointer,722 };723 724 static snd_pcm_ops_t snd_ad1816a_capture_ops = {725 open: snd_ad1816a_capture_open,726 close: snd_ad1816a_capture_close,727 ioctl: snd_pcm_lib_ioctl,728 hw_params: snd_ad1816a_hw_params,729 hw_free: snd_ad1816a_hw_free,730 prepare: snd_ad1816a_capture_prepare,731 trigger: snd_ad1816a_capture_trigger,732 pointer: snd_ad1816a_capture_pointer,733 };734 #endif735 654 736 655 static void snd_ad1816a_pcm_free(snd_pcm_t *pcm) … … 849 768 } 850 769 851 #ifdef TARGET_OS2852 770 #define AD1816A_SINGLE(xname, reg, shift, mask, invert) \ 853 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, 0, 0, 0, snd_ad1816a_info_single, \ 854 snd_ad1816a_get_single, snd_ad1816a_put_single, \ 855 reg | (shift << 8) | (mask << 16) | (invert << 24) } 856 #else 857 #define AD1816A_SINGLE(xname, reg, shift, mask, invert) \ 858 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, info: snd_ad1816a_info_single, \ 859 get: snd_ad1816a_get_single, put: snd_ad1816a_put_single, \ 860 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 861 #endif 771 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ad1816a_info_single, \ 772 .get = snd_ad1816a_get_single, .put = snd_ad1816a_put_single, \ 773 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 862 774 863 775 static int snd_ad1816a_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 913 825 } 914 826 915 #ifdef TARGET_OS2916 827 #define AD1816A_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \ 917 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, 0, 0, snd_ad1816a_info_double, \ 918 snd_ad1816a_get_double, snd_ad1816a_put_double, \ 919 reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } 920 #else 921 #define AD1816A_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \ 922 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, info: snd_ad1816a_info_double, \ 923 get: snd_ad1816a_get_double, put: snd_ad1816a_put_double, \ 924 private_value: reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } 925 #endif 828 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_ad1816a_info_double, \ 829 .get = snd_ad1816a_get_double, .put = snd_ad1816a_put_double, \ 830 .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } 926 831 927 832 static int snd_ad1816a_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1004 909 AD1816A_DOUBLE("FM Playback Volume", AD1816A_FM_ATT, 8, 0, 63, 1), 1005 910 AD1816A_SINGLE("Mic Playback Switch", AD1816A_MIC_GAIN_ATT, 15, 1, 1), 1006 AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 63, 1),911 AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 31, 1), 1007 912 AD1816A_SINGLE("Mic Boost", AD1816A_MIC_GAIN_ATT, 14, 1, 0), 1008 913 AD1816A_DOUBLE("Video Playback Switch", AD1816A_VID_GAIN_ATT, 15, 7, 1, 1), … … 1013 918 AD1816A_SINGLE("Phone Playback Volume", AD1816A_PHONE_OUT_ATT, 0, 31, 1), 1014 919 { 1015 #ifdef TARGET_OS2 1016 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1017 "Capture Source",0,0, 0, 1018 snd_ad1816a_info_mux, 1019 snd_ad1816a_get_mux, 1020 snd_ad1816a_put_mux,0 1021 #else 1022 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1023 name: "Capture Source", 1024 info: snd_ad1816a_info_mux, 1025 get: snd_ad1816a_get_mux, 1026 put: snd_ad1816a_put_mux, 1027 #endif 920 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 921 .name = "Capture Source", 922 .info = snd_ad1816a_info_mux, 923 .get = snd_ad1816a_get_mux, 924 .put = snd_ad1816a_put_mux, 1028 925 }, 1029 926 AD1816A_DOUBLE("Capture Switch", AD1816A_ADC_PGA, 15, 7, 1, 1), … … 1066 963 module_init(alsa_ad1816a_init) 1067 964 module_exit(alsa_ad1816a_exit) 1068 -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848_lib.c
r112 r210 25 25 #include <asm/dma.h> 26 26 #include <linux/delay.h> 27 #include <linux/init.h> 27 28 #include <linux/slab.h> 28 29 #include <linux/ioport.h> 29 30 #include <sound/core.h> 30 31 #include <sound/ad1848.h> 32 #include <sound/pcm_params.h> 31 33 32 34 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); … … 66 68 }; 67 69 68 #ifdef TARGET_OS269 70 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 70 14,71 rates,72 0,71 .count = 14, 72 .list = rates, 73 .mask = 0, 73 74 }; 74 #else75 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {76 count: 14,77 list: rates,78 mask: 0,79 };80 #endif81 75 82 76 static unsigned char snd_ad1848_original_image[16] = … … 706 700 */ 707 701 708 #ifdef TARGET_OS2709 702 static snd_pcm_hardware_t snd_ad1848_playback = 710 703 { 711 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |704 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 712 705 SNDRV_PCM_INFO_MMAP_VALID), 713 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |706 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | 714 707 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE), 715 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,716 /* rate_min: */5510,717 /* rate_max: */48000,718 /* channels_min: */1,719 /* channels_max: */2,720 /* buffer_bytes_max: */(128*1024),721 /* period_bytes_min: */64,722 /* period_bytes_max: */(128*1024),723 /* periods_min: */1,724 /* periods_max: */1024,725 /* fifo_size: */0,708 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000, 709 .rate_min = 5510, 710 .rate_max = 48000, 711 .channels_min = 1, 712 .channels_max = 2, 713 .buffer_bytes_max = (128*1024), 714 .period_bytes_min = 64, 715 .period_bytes_max = (128*1024), 716 .periods_min = 1, 717 .periods_max = 1024, 718 .fifo_size = 0, 726 719 }; 727 720 728 721 static snd_pcm_hardware_t snd_ad1848_capture = 729 722 { 730 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |723 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 731 724 SNDRV_PCM_INFO_MMAP_VALID), 732 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |725 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | 733 726 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE), 734 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,735 /* rate_min: */5510,736 /* rate_max: */48000,737 /* channels_min: */1,738 /* channels_max: */2,739 /* buffer_bytes_max: */(128*1024),740 /* period_bytes_min: */64,741 /* period_bytes_max: */(128*1024),742 /* periods_min: */1,743 /* periods_max: */1024,744 /* fifo_size: */0,727 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000, 728 .rate_min = 5510, 729 .rate_max = 48000, 730 .channels_min = 1, 731 .channels_max = 2, 732 .buffer_bytes_max = (128*1024), 733 .period_bytes_min = 64, 734 .period_bytes_max = (128*1024), 735 .periods_min = 1, 736 .periods_max = 1024, 737 .fifo_size = 0, 745 738 }; 746 #else747 static snd_pcm_hardware_t snd_ad1848_playback =748 {749 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |750 SNDRV_PCM_INFO_MMAP_VALID),751 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |752 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE),753 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,754 rate_min: 5510,755 rate_max: 48000,756 channels_min: 1,757 channels_max: 2,758 buffer_bytes_max: (128*1024),759 period_bytes_min: 64,760 period_bytes_max: (128*1024),761 periods_min: 1,762 periods_max: 1024,763 fifo_size: 0,764 };765 766 static snd_pcm_hardware_t snd_ad1848_capture =767 {768 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |769 SNDRV_PCM_INFO_MMAP_VALID),770 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW |771 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE),772 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,773 rate_min: 5510,774 rate_max: 48000,775 channels_min: 1,776 channels_max: 2,777 buffer_bytes_max: (128*1024),778 period_bytes_min: 64,779 period_bytes_max: (128*1024),780 periods_min: 1,781 periods_max: 1024,782 fifo_size: 0,783 };784 #endif785 739 786 740 /* … … 879 833 ad1848_t ** rchip) 880 834 { 881 #ifdef TARGET_OS2882 835 static snd_device_ops_t ops = { 883 snd_ad1848_dev_free,0,0836 .dev_free = snd_ad1848_dev_free, 884 837 }; 885 #else886 static snd_device_ops_t ops = {887 dev_free: snd_ad1848_dev_free,888 };889 #endif890 838 ad1848_t *chip; 891 839 int err; … … 934 882 } 935 883 936 #ifdef TARGET_OS2937 884 static snd_pcm_ops_t snd_ad1848_playback_ops = { 938 snd_ad1848_playback_open,939 snd_ad1848_playback_close,940 snd_ad1848_ioctl,941 snd_ad1848_playback_hw_params,942 snd_ad1848_playback_hw_free,943 snd_ad1848_playback_prepare,944 snd_ad1848_playback_trigger,945 snd_ad1848_playback_pointer,0,0885 .open = snd_ad1848_playback_open, 886 .close = snd_ad1848_playback_close, 887 .ioctl = snd_ad1848_ioctl, 888 .hw_params = snd_ad1848_playback_hw_params, 889 .hw_free = snd_ad1848_playback_hw_free, 890 .prepare = snd_ad1848_playback_prepare, 891 .trigger = snd_ad1848_playback_trigger, 892 .pointer = snd_ad1848_playback_pointer, 946 893 }; 947 894 948 895 static snd_pcm_ops_t snd_ad1848_capture_ops = { 949 snd_ad1848_capture_open,950 snd_ad1848_capture_close,951 snd_ad1848_ioctl,952 snd_ad1848_capture_hw_params,953 snd_ad1848_capture_hw_free,954 snd_ad1848_capture_prepare,955 snd_ad1848_capture_trigger,956 snd_ad1848_capture_pointer,0,0896 .open = snd_ad1848_capture_open, 897 .close = snd_ad1848_capture_close, 898 .ioctl = snd_ad1848_ioctl, 899 .hw_params = snd_ad1848_capture_hw_params, 900 .hw_free = snd_ad1848_capture_hw_free, 901 .prepare = snd_ad1848_capture_prepare, 902 .trigger = snd_ad1848_capture_trigger, 903 .pointer = snd_ad1848_capture_pointer, 957 904 }; 958 #else959 static snd_pcm_ops_t snd_ad1848_playback_ops = {960 open: snd_ad1848_playback_open,961 close: snd_ad1848_playback_close,962 ioctl: snd_ad1848_ioctl,963 hw_params: snd_ad1848_playback_hw_params,964 hw_free: snd_ad1848_playback_hw_free,965 prepare: snd_ad1848_playback_prepare,966 trigger: snd_ad1848_playback_trigger,967 pointer: snd_ad1848_playback_pointer,968 };969 970 static snd_pcm_ops_t snd_ad1848_capture_ops = {971 open: snd_ad1848_capture_open,972 close: snd_ad1848_capture_close,973 ioctl: snd_ad1848_ioctl,974 hw_params: snd_ad1848_capture_hw_params,975 hw_free: snd_ad1848_capture_hw_free,976 prepare: snd_ad1848_capture_prepare,977 trigger: snd_ad1848_capture_trigger,978 pointer: snd_ad1848_capture_pointer,979 };980 #endif981 905 982 906 static void snd_ad1848_pcm_free(snd_pcm_t *pcm) … … 1197 1121 AD1848_DOUBLE("Capture Volume", 0, AD1848_LEFT_INPUT, AD1848_RIGHT_INPUT, 0, 0, 15, 0), 1198 1122 { 1199 #ifdef TARGET_OS2 1200 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1201 "Capture Source",0,0, 0, 1202 snd_ad1848_info_mux, 1203 snd_ad1848_get_mux, 1204 snd_ad1848_put_mux,0 1205 #else 1206 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1207 name: "Capture Source", 1208 info: snd_ad1848_info_mux, 1209 get: snd_ad1848_get_mux, 1210 put: snd_ad1848_put_mux, 1211 #endif 1123 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1124 .name = "Capture Source", 1125 .info = snd_ad1848_info_mux, 1126 .get = snd_ad1848_get_mux, 1127 .put = snd_ad1848_put_mux, 1212 1128 }, 1213 1129 AD1848_SINGLE("Loopback Capture Switch", 0, AD1848_LOOPBACK, 0, 1, 0), -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c
r112 r210 36 36 #include <sound/core.h> 37 37 #include <sound/cs4231.h> 38 #include <sound/pcm_params.h> 38 39 39 40 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); … … 73 74 }; 74 75 75 #ifdef TARGET_OS276 76 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 77 14,78 rates,79 0,77 .count = 14, 78 .list = rates, 79 .mask = 0, 80 80 }; 81 #else82 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {83 count: 14,84 list: rates,85 mask: 0,86 };87 #endif88 81 89 82 static int snd_cs4231_xrate(snd_pcm_runtime_t *runtime) … … 801 794 } 802 795 803 #ifdef TARGET_OS2804 796 static struct _snd_timer_hardware snd_cs4231_timer_table = 805 797 { 806 SNDRV_TIMER_HW_AUTO,807 9945,808 65535,809 snd_cs4231_timer_open,810 snd_cs4231_timer_close,811 snd_cs4231_timer_resolution,812 snd_cs4231_timer_start,813 snd_cs4231_timer_stop,798 .flags = SNDRV_TIMER_HW_AUTO, 799 .resolution = 9945, 800 .ticks = 65535, 801 .open = snd_cs4231_timer_open, 802 .close = snd_cs4231_timer_close, 803 .c_resolution = snd_cs4231_timer_resolution, 804 .start = snd_cs4231_timer_start, 805 .stop = snd_cs4231_timer_stop, 814 806 }; 815 #else816 static struct _snd_timer_hardware snd_cs4231_timer_table =817 {818 flags: SNDRV_TIMER_HW_AUTO,819 resolution: 9945,820 ticks: 65535,821 open: snd_cs4231_timer_open,822 close: snd_cs4231_timer_close,823 c_resolution: snd_cs4231_timer_resolution,824 start: snd_cs4231_timer_start,825 stop: snd_cs4231_timer_stop,826 };827 #endif828 807 829 808 /* … … 1147 1126 */ 1148 1127 1149 #ifdef TARGET_OS21150 1128 static snd_pcm_hardware_t snd_cs4231_playback = 1151 1129 { 1152 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1130 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1153 1131 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), 1154 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1132 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | 1155 1133 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), 1156 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1157 /* rate_min: */5510,1158 /* rate_max: */48000,1159 /* channels_min: */1,1160 /* channels_max: */2,1161 /* buffer_bytes_max: */(128*1024),1162 /* period_bytes_min: */64,1163 /* period_bytes_max: */(128*1024),1164 /* periods_min: */1,1165 /* periods_max: */1024,1166 /* fifo_size: */0,1134 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000, 1135 .rate_min = 5510, 1136 .rate_max = 48000, 1137 .channels_min = 1, 1138 .channels_max = 2, 1139 .buffer_bytes_max = (128*1024), 1140 .period_bytes_min = 64, 1141 .period_bytes_max = (128*1024), 1142 .periods_min = 1, 1143 .periods_max = 1024, 1144 .fifo_size = 0, 1167 1145 }; 1168 1146 1169 1147 static snd_pcm_hardware_t snd_cs4231_capture = 1170 1148 { 1171 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1149 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1172 1150 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), 1173 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1151 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | 1174 1152 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), 1175 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1176 /* rate_min: */5510,1177 /* rate_max: */48000,1178 /* channels_min: */1,1179 /* channels_max: */2,1180 /* buffer_bytes_max: */(128*1024),1181 /* period_bytes_min: */64,1182 /* period_bytes_max: */(128*1024),1183 /* periods_min: */1,1184 /* periods_max: */1024,1185 /* fifo_size: */0,1153 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000, 1154 .rate_min = 5510, 1155 .rate_max = 48000, 1156 .channels_min = 1, 1157 .channels_max = 2, 1158 .buffer_bytes_max = (128*1024), 1159 .period_bytes_min = 64, 1160 .period_bytes_max = (128*1024), 1161 .periods_min = 1, 1162 .periods_max = 1024, 1163 .fifo_size = 0, 1186 1164 }; 1187 #else1188 static snd_pcm_hardware_t snd_cs4231_playback =1189 {1190 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1191 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),1192 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1193 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),1194 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1195 rate_min: 5510,1196 rate_max: 48000,1197 channels_min: 1,1198 channels_max: 2,1199 buffer_bytes_max: (128*1024),1200 period_bytes_min: 64,1201 period_bytes_max: (128*1024),1202 periods_min: 1,1203 periods_max: 1024,1204 fifo_size: 0,1205 };1206 1207 static snd_pcm_hardware_t snd_cs4231_capture =1208 {1209 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1210 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),1211 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1212 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),1213 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1214 rate_min: 5510,1215 rate_max: 48000,1216 channels_min: 1,1217 channels_max: 2,1218 buffer_bytes_max: (128*1024),1219 period_bytes_min: 64,1220 period_bytes_max: (128*1024),1221 periods_min: 1,1222 periods_max: 1024,1223 fifo_size: 0,1224 };1225 #endif1226 1165 1227 1166 /* … … 1456 1395 cs4231_t ** rchip) 1457 1396 { 1458 #ifdef TARGET_OS21459 1397 static snd_device_ops_t ops = { 1460 snd_cs4231_dev_free,0,0 1461 }; 1462 #else 1463 static snd_device_ops_t ops = { 1464 dev_free: snd_cs4231_dev_free, 1465 }; 1466 #endif 1398 .dev_free = snd_cs4231_dev_free, 1399 }; 1467 1400 cs4231_t *chip; 1468 1401 int err; … … 1548 1481 } 1549 1482 1550 #ifdef TARGET_OS21551 1483 static snd_pcm_ops_t snd_cs4231_playback_ops = { 1552 snd_cs4231_playback_open,1553 snd_cs4231_playback_close,1554 snd_pcm_lib_ioctl,1555 snd_cs4231_playback_hw_params,1556 snd_cs4231_playback_hw_free,1557 snd_cs4231_playback_prepare,1558 snd_cs4231_trigger,1559 snd_cs4231_playback_pointer,0,01484 .open = snd_cs4231_playback_open, 1485 .close = snd_cs4231_playback_close, 1486 .ioctl = snd_pcm_lib_ioctl, 1487 .hw_params = snd_cs4231_playback_hw_params, 1488 .hw_free = snd_cs4231_playback_hw_free, 1489 .prepare = snd_cs4231_playback_prepare, 1490 .trigger = snd_cs4231_trigger, 1491 .pointer = snd_cs4231_playback_pointer, 1560 1492 }; 1561 1493 1562 1494 static snd_pcm_ops_t snd_cs4231_capture_ops = { 1563 snd_cs4231_capture_open,1564 snd_cs4231_capture_close,1565 snd_pcm_lib_ioctl,1566 snd_cs4231_capture_hw_params,1567 snd_cs4231_capture_hw_free,1568 snd_cs4231_capture_prepare,1569 snd_cs4231_trigger,1570 snd_cs4231_capture_pointer,0,01495 .open = snd_cs4231_capture_open, 1496 .close = snd_cs4231_capture_close, 1497 .ioctl = snd_pcm_lib_ioctl, 1498 .hw_params = snd_cs4231_capture_hw_params, 1499 .hw_free = snd_cs4231_capture_hw_free, 1500 .prepare = snd_cs4231_capture_prepare, 1501 .trigger = snd_cs4231_trigger, 1502 .pointer = snd_cs4231_capture_pointer, 1571 1503 }; 1572 #else1573 static snd_pcm_ops_t snd_cs4231_playback_ops = {1574 open: snd_cs4231_playback_open,1575 close: snd_cs4231_playback_close,1576 ioctl: snd_pcm_lib_ioctl,1577 hw_params: snd_cs4231_playback_hw_params,1578 hw_free: snd_cs4231_playback_hw_free,1579 prepare: snd_cs4231_playback_prepare,1580 trigger: snd_cs4231_trigger,1581 pointer: snd_cs4231_playback_pointer,1582 };1583 1584 static snd_pcm_ops_t snd_cs4231_capture_ops = {1585 open: snd_cs4231_capture_open,1586 close: snd_cs4231_capture_close,1587 ioctl: snd_pcm_lib_ioctl,1588 hw_params: snd_cs4231_capture_hw_params,1589 hw_free: snd_cs4231_capture_hw_free,1590 prepare: snd_cs4231_capture_prepare,1591 trigger: snd_cs4231_trigger,1592 pointer: snd_cs4231_capture_pointer,1593 };1594 #endif1595 1504 1596 1505 static void snd_cs4231_pcm_free(snd_pcm_t *pcm) … … 1865 1774 CS4231_DOUBLE("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 0, 0, 15, 0), 1866 1775 { 1867 #ifdef TARGET_OS2 1868 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1869 "Capture Source",0,0, 0, 1870 snd_cs4231_info_mux, 1871 snd_cs4231_get_mux, 1872 snd_cs4231_put_mux,0 1873 #else 1874 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1875 name: "Capture Source", 1876 info: snd_cs4231_info_mux, 1877 get: snd_cs4231_get_mux, 1878 put: snd_cs4231_put_mux, 1879 #endif 1776 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1777 .name = "Capture Source", 1778 .info = snd_cs4231_info_mux, 1779 .get = snd_cs4231_get_mux, 1780 .put = snd_cs4231_put_mux, 1880 1781 }, 1881 1782 CS4231_DOUBLE("Mic Boost", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0), -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236.c
r207 r210 255 255 /* Typhoon Soundsystem PnP - CS4236B */ 256 256 ISAPNP_CS4232('C','S','C',0x4536,0x0000,0x0010,0x0003), 257 /* Crystal CX4235-XQ3 EP - CS4235 */ 258 ISAPNP_CS4232('C','S','C',0x4625,0x0100,0x0110,0x0103), 257 259 /* TerraTec AudioSystem EWS64XL - CS4236B */ 258 260 ISAPNP_CS4232('C','S','C',0xa836,0xa800,0xa810,0xa803), -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236_lib.c
r32 r210 21 21 * You should have received a copy of the GNU General Public License 22 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 24 * 25 25 */ … … 80 80 */ 81 81 82 #define SNDRV_MAIN_OBJECT_FILE83 82 #include <sound/driver.h> 83 #include <asm/io.h> 84 #include <linux/delay.h> 85 #include <linux/init.h> 86 #include <linux/time.h> 87 #include <linux/wait.h> 88 #include <sound/core.h> 84 89 #include <sound/cs4231.h> 90 #include <sound/asoundef.h> 91 92 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); 93 MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips"); 94 MODULE_LICENSE("GPL"); 85 95 86 96 #define chip_t cs4231_t … … 133 143 #define CLOCKS 8 134 144 135 #ifdef TARGET_OS2136 145 static ratnum_t clocks[CLOCKS] = { 137 { 16934400, 353, 353,1 },138 { 16934400, 529, 529,1 },139 { 16934400, 617, 617,1 },140 { 16934400, 1058, 1058,1 },141 { 16934400, 1764, 1764,1 },142 { 16934400, 2117, 2117,1 },143 { 16934400, 2558, 2558,1 },144 { 16934400/16, 21, 192,1 }146 { .num = 16934400, .den_min = 353, .den_max = 353, .den_step = 1 }, 147 { .num = 16934400, .den_min = 529, .den_max = 529, .den_step = 1 }, 148 { .num = 16934400, .den_min = 617, .den_max = 617, .den_step = 1 }, 149 { .num = 16934400, .den_min = 1058, .den_max = 1058, .den_step = 1 }, 150 { .num = 16934400, .den_min = 1764, .den_max = 1764, .den_step = 1 }, 151 { .num = 16934400, .den_min = 2117, .den_max = 2117, .den_step = 1 }, 152 { .num = 16934400, .den_min = 2558, .den_max = 2558, .den_step = 1 }, 153 { .num = 16934400/16, .den_min = 21, .den_max = 192, .den_step = 1 } 145 154 }; 146 155 147 156 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = { 148 CLOCKS,149 clocks,157 .nrats = CLOCKS, 158 .rats = clocks, 150 159 }; 151 #else152 static ratnum_t clocks[CLOCKS] = {153 { num: 16934400, den_min: 353, den_max: 353, den_step: 1 },154 { num: 16934400, den_min: 529, den_max: 529, den_step: 1 },155 { num: 16934400, den_min: 617, den_max: 617, den_step: 1 },156 { num: 16934400, den_min: 1058, den_max: 1058, den_step: 1 },157 { num: 16934400, den_min: 1764, den_max: 1764, den_step: 1 },158 { num: 16934400, den_min: 2117, den_max: 2117, den_step: 1 },159 { num: 16934400, den_min: 2558, den_max: 2558, den_step: 1 },160 { num: 16934400/16, den_min: 21, den_max: 192, den_step: 1 }161 };162 163 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = {164 nrats: CLOCKS,165 rats: clocks,166 };167 #endif168 160 169 161 static int snd_cs4236_xrate(snd_pcm_runtime_t *runtime) … … 305 297 ver1 = snd_cs4236_ctrl_in(chip, 1); 306 298 ver2 = snd_cs4236_ext_in(chip, CS4236_VERSION); 307 snd_printdd("CS4236: [0x% x] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2);299 snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2); 308 300 if (ver1 != ver2) { 309 301 snd_printk("CS4236+ chip detected, but control port 0x%lx is not valid\n", cport); … … 314 306 snd_cs4236_ctrl_out(chip, 2, 0xff); 315 307 snd_cs4236_ctrl_out(chip, 3, 0x00); 316 snd_cs4236_ctrl_out(chip, 4, 0x 00);317 snd_cs4236_ctrl_out(chip, 5, 0x00);318 snd_cs4236_ctrl_out(chip, 6, 0x00);308 snd_cs4236_ctrl_out(chip, 4, 0x80); 309 snd_cs4236_ctrl_out(chip, 5, ((IEC958_AES1_CON_PCM_CODER & 3) << 6) | IEC958_AES0_CON_EMPHASIS_NONE); 310 snd_cs4236_ctrl_out(chip, 6, IEC958_AES1_CON_PCM_CODER >> 2); 319 311 snd_cs4236_ctrl_out(chip, 7, 0x00); 320 /* 0x 07for C8 is valid for Turtle Beach Malibu - the IEC-958 output */312 /* 0x8c for C8 is valid for Turtle Beach Malibu - the IEC-958 output */ 321 313 /* is working with this setup, other hardware should have */ 322 314 /* different signal paths and this value should be selectable */ 323 315 /* in the future */ 324 snd_cs4236_ctrl_out(chip, 8, 0x 07);316 snd_cs4236_ctrl_out(chip, 8, 0x8c); 325 317 chip->rate_constraint = snd_cs4236_xrate; 326 318 chip->set_playback_format = snd_cs4236_playback_format; … … 374 366 */ 375 367 376 #ifdef TARGET_OS2377 368 #define CS4236_SINGLE(xname, xindex, reg, shift, mask, invert) \ 378 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 379 0, 0, snd_cs4236_info_single, \ 380 snd_cs4236_get_single, snd_cs4236_put_single, \ 381 reg | (shift << 8) | (mask << 16) | (invert << 24) } 382 #else 383 #define CS4236_SINGLE(xname, xindex, reg, shift, mask, invert) \ 384 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 385 info: snd_cs4236_info_single, \ 386 get: snd_cs4236_get_single, put: snd_cs4236_put_single, \ 387 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 388 #endif 369 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 370 .info = snd_cs4236_info_single, \ 371 .get = snd_cs4236_get_single, .put = snd_cs4236_put_single, \ 372 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 389 373 390 374 static int snd_cs4236_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 439 423 } 440 424 441 #ifdef TARGET_OS2442 425 #define CS4236_SINGLEC(xname, xindex, reg, shift, mask, invert) \ 443 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 444 0, 0, snd_cs4236_info_single, \ 445 snd_cs4236_get_singlec, snd_cs4236_put_singlec, \ 446 reg | (shift << 8) | (mask << 16) | (invert << 24) } 447 #else 448 #define CS4236_SINGLEC(xname, xindex, reg, shift, mask, invert) \ 449 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 450 info: snd_cs4236_info_single, \ 451 get: snd_cs4236_get_singlec, put: snd_cs4236_put_singlec, \ 452 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 453 #endif 426 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 427 .info = snd_cs4236_info_single, \ 428 .get = snd_cs4236_get_singlec, .put = snd_cs4236_put_singlec, \ 429 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 454 430 455 431 static int snd_cs4236_get_singlec(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) … … 493 469 } 494 470 495 #ifdef TARGET_OS2496 471 #define CS4236_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 497 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 498 0, 0, snd_cs4236_info_double, \ 499 snd_cs4236_get_double, snd_cs4236_put_double, \ 500 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 501 #else 502 #define CS4236_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 503 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 504 info: snd_cs4236_info_double, \ 505 get: snd_cs4236_get_double, put: snd_cs4236_put_double, \ 506 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 507 #endif 472 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 473 .info = snd_cs4236_info_double, \ 474 .get = snd_cs4236_get_double, .put = snd_cs4236_put_double, \ 475 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 508 476 509 477 static int snd_cs4236_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 577 545 } 578 546 579 #ifdef TARGET_OS2580 547 #define CS4236_DOUBLE1(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 581 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 582 0, 0, snd_cs4236_info_double, \ 583 snd_cs4236_get_double1, snd_cs4236_put_double1, \ 584 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 585 #else 586 #define CS4236_DOUBLE1(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 587 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 588 info: snd_cs4236_info_double, \ 589 get: snd_cs4236_get_double1, put: snd_cs4236_put_double1, \ 590 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 591 #endif 548 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 549 .info = snd_cs4236_info_double, \ 550 .get = snd_cs4236_get_double1, .put = snd_cs4236_put_double1, \ 551 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 592 552 593 553 static int snd_cs4236_get_double1(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) … … 644 604 } 645 605 646 #ifdef TARGET_OS2647 606 #define CS4236_MASTER_DIGITAL(xname, xindex) \ 648 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 649 0, 0, snd_cs4236_info_double, \ 650 snd_cs4236_get_master_digital, snd_cs4236_put_master_digital, \ 651 71 << 24 } 652 #else 653 #define CS4236_MASTER_DIGITAL(xname, xindex) \ 654 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 655 info: snd_cs4236_info_double, \ 656 get: snd_cs4236_get_master_digital, put: snd_cs4236_put_master_digital, \ 657 private_value: 71 << 24 } 658 #endif 607 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 608 .info = snd_cs4236_info_double, \ 609 .get = snd_cs4236_get_master_digital, .put = snd_cs4236_put_master_digital, \ 610 .private_value = 71 << 24 } 659 611 660 612 static inline int snd_cs4236_mixer_master_digital_invert_volume(int vol) … … 694 646 } 695 647 696 #ifdef TARGET_OS2697 648 #define CS4235_OUTPUT_ACCU(xname, xindex) \ 698 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 699 0, 0, snd_cs4236_info_double, \ 700 snd_cs4235_get_output_accu, snd_cs4235_put_output_accu, \ 701 3 << 24 } 702 #else 703 #define CS4235_OUTPUT_ACCU(xname, xindex) \ 704 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 705 info: snd_cs4236_info_double, \ 706 get: snd_cs4235_get_output_accu, put: snd_cs4235_put_output_accu, \ 707 private_value: 3 << 24 } 708 #endif 649 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 650 .info = snd_cs4236_info_double, \ 651 .get = snd_cs4235_get_output_accu, .put = snd_cs4235_put_output_accu, \ 652 .private_value = 3 << 24 } 709 653 710 654 static inline int snd_cs4235_mixer_output_accu_get_volume(int vol) … … 863 807 }; 864 808 865 #ifdef TARGET_OS2866 809 #define CS4236_IEC958_ENABLE(xname, xindex) \ 867 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 868 0, 0, snd_cs4236_info_single, \ 869 snd_cs4236_get_iec958_switch, snd_cs4236_put_iec958_switch, \ 870 1 << 16 } 871 #else 872 #define CS4236_IEC958_ENABLE(xname, xindex) \ 873 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 874 info: snd_cs4236_info_single, \ 875 get: snd_cs4236_get_iec958_switch, put: snd_cs4236_put_iec958_switch, \ 876 private_value: 1 << 16 } 810 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 811 .info = snd_cs4236_info_single, \ 812 .get = snd_cs4236_get_iec958_switch, .put = snd_cs4236_put_iec958_switch, \ 813 .private_value = 1 << 16 } 814 815 static int snd_cs4236_get_iec958_switch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 816 { 817 cs4231_t *chip = snd_kcontrol_chip(kcontrol); 818 unsigned long flags; 819 820 spin_lock_irqsave(&chip->reg_lock, flags); 821 ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0; 822 #if 0 823 printk("get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", 824 snd_cs4231_in(chip, CS4231_ALT_FEATURE_1), 825 snd_cs4236_ctrl_in(chip, 3), 826 snd_cs4236_ctrl_in(chip, 4), 827 snd_cs4236_ctrl_in(chip, 5), 828 snd_cs4236_ctrl_in(chip, 6), 829 snd_cs4236_ctrl_in(chip, 8)); 877 830 #endif 878 879 static int snd_cs4236_get_iec958_switch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)880 {881 cs4231_t *chip = snd_kcontrol_chip(kcontrol);882 unsigned long flags;883 884 spin_lock_irqsave(&chip->reg_lock, flags);885 ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0;886 831 spin_unlock_irqrestore(&chip->reg_lock, flags); 887 832 return 0; … … 900 845 snd_cs4231_mce_up(chip); 901 846 spin_lock_irqsave(&chip->reg_lock, flags); 902 val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0 2) | (enable << 1);847 val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1); 903 848 change = val != chip->image[CS4231_ALT_FEATURE_1]; 904 849 snd_cs4231_out(chip, CS4231_ALT_FEATURE_1, val); 905 val = (snd_cs4236_ctrl_in(chip, 4) & ~0x80) | (enable << 7); 906 change |= snd_cs4236_ctrl_in(chip, 4) != val; 850 val = snd_cs4236_ctrl_in(chip, 4) | 0xc0; 851 snd_cs4236_ctrl_out(chip, 4, val); 852 udelay(100); 853 val &= ~0x40; 907 854 snd_cs4236_ctrl_out(chip, 4, val); 908 855 spin_unlock_irqrestore(&chip->reg_lock, flags); … … 925 872 926 873 static snd_kcontrol_new_t snd_cs4236_iec958_controls[] = { 927 CS4236_IEC958_ENABLE("S/PDIF Output Enable", 0), 928 CS4236_SINGLEC("S/PDIF Output Validity", 0, 4, 4, 1, 0), 929 CS4236_SINGLEC("S/PDIF Output User", 0, 4, 5, 1, 0), 930 CS4236_SINGLEC("S/PDIF Output CSBR", 0, 4, 6, 1, 0), 931 CS4236_SINGLEC("S/PDIF Output 3D", 0, 3, 5, 1, 0), 932 CS4236_SINGLEC("S/PDIF Output Channel Status Low", 0, 5, 1, 127, 0), 933 CS4236_SINGLEC("S/PDIF Output Channel Status High", 0, 6, 0, 255, 0) 874 CS4236_IEC958_ENABLE("IEC958 Output Enable", 0), 875 CS4236_SINGLEC("IEC958 Output Validity", 0, 4, 4, 1, 0), 876 CS4236_SINGLEC("IEC958 Output User", 0, 4, 5, 1, 0), 877 CS4236_SINGLEC("IEC958 Output CSBR", 0, 4, 6, 1, 0), 878 CS4236_SINGLEC("IEC958 Output Channel Status Low", 0, 5, 1, 127, 0), 879 CS4236_SINGLEC("IEC958 Output Channel Status High", 0, 6, 0, 255, 0) 934 880 }; 935 881 … … 948 894 CS4236_SINGLEC("3D Control - Center", 0, 2, 0, 15, 1), 949 895 CS4236_SINGLEC("3D Control - Mono", 0, 3, 6, 1, 0), 950 CS4236_SINGLEC("3D Control - S/PDIF", 0, 3, 5, 1, 0)896 CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0) 951 897 }; 952 898 … … 957 903 CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1), 958 904 CS4236_SINGLEC("3D Control - Volume", 0, 2, 0, 15, 1), 959 CS4236_SINGLEC("3D Control - S/PDIF", 0, 3, 5, 1, 0)905 CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0) 960 906 }; 961 907 -
GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c
r209 r210 1 1 2 2 /* 3 card-dt0197h.c - driver for Diamond Technologies DT-0197H based soundcards. 4 Copyright (C) 1999 by Massimo Piccioni <dafastidio@libero.it> 3 dt019x.c - driver for Diamond Technologies DT-0197H based soundcards. 4 Copyright (C) 1999, 2002 by Massimo Piccioni <dafastidio@libero.it> 5 6 Generalised for soundcards based on DT-0196 and ALS-007 chips 7 by Jonathan Woithe <jwoithe@physics.adelaide.edu.au>: June 2002. 5 8 6 9 This program is free software; you can redistribute it and/or modify … … 23 26 #include <linux/sched.h> 24 27 #include <linux/wait.h> 28 #ifndef LINUX_ISAPNP_H 29 #include <linux/isapnp.h> 30 #define isapnp_card pci_bus 31 #define isapnp_dev pci_dev 32 #endif 25 33 #include <sound/core.h> 26 34 #define SNDRV_GET_ID … … 32 40 #define chip_t sb_t 33 41 34 #define PFX "dt019 7h: "42 #define PFX "dt019x: " 35 43 36 44 MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); 37 MODULE_DESCRIPTION("Diamond Technologies DT-019 7H");45 MODULE_DESCRIPTION("Diamond Technologies DT-019X / Avance Logic ALS-007"); 38 46 MODULE_LICENSE("GPL"); 39 47 MODULE_CLASSES("{sound}"); 40 MODULE_DEVICES("{{Diamond Technologies,DT-0197H}}"); 48 MODULE_DEVICES("{{Diamond Technologies DT-019X}," 49 "{Avance Logic ALS-007}}"); 41 50 42 51 static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ … … 51 60 52 61 MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 53 MODULE_PARM_DESC(snd_index, "Index value for dt0197hbased soundcard.");62 MODULE_PARM_DESC(snd_index, "Index value for DT-019X based soundcard."); 54 63 MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC); 55 64 MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s"); 56 MODULE_PARM_DESC(snd_id, "ID string for dt0197hbased soundcard.");65 MODULE_PARM_DESC(snd_id, "ID string for DT-019X based soundcard."); 57 66 MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC); 58 67 MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 59 MODULE_PARM_DESC(snd_enable, "Enable dt0197hbased soundcard.");68 MODULE_PARM_DESC(snd_enable, "Enable DT-019X based soundcard."); 60 69 MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC); 61 70 MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 62 MODULE_PARM_DESC(snd_port, "Port # for dt019 7hdriver.");71 MODULE_PARM_DESC(snd_port, "Port # for dt019x driver."); 63 72 MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC); 64 73 MODULE_PARM(snd_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 65 MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for dt019 7hdriver.");74 MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for dt019x driver."); 66 75 MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_PORT12_DESC); 67 76 MODULE_PARM(snd_fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 68 MODULE_PARM_DESC(snd_fm_port, "FM port # for dt019 7hdriver.");77 MODULE_PARM_DESC(snd_fm_port, "FM port # for dt019x driver."); 69 78 MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_PORT12_DESC); 70 79 MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 71 MODULE_PARM_DESC(snd_irq, "IRQ # for dt019 7hdriver.");80 MODULE_PARM_DESC(snd_irq, "IRQ # for dt019x driver."); 72 81 MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC); 73 82 MODULE_PARM(snd_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 74 MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for dt019 7hdriver.");83 MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for dt019x driver."); 75 84 MODULE_PARM_SYNTAX(snd_mpu_irq, SNDRV_IRQ_DESC); 76 85 MODULE_PARM(snd_dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 77 MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for dt019 7hdriver.");86 MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for dt019x driver."); 78 87 MODULE_PARM_SYNTAX(snd_dma8, SNDRV_DMA8_DESC); 79 88 80 struct snd_card_dt019 7h{89 struct snd_card_dt019x { 81 90 #ifdef __ISAPNP__ 82 91 struct isapnp_dev *dev; … … 86 95 }; 87 96 88 static snd_card_t *snd_dt019 7h_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;89 90 #ifdef __ISAPNP__ 91 static struct isapnp_card *snd_dt019 7h_isapnp_cards[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;92 static const struct isapnp_card_id *snd_dt019 7h_isapnp_id[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;93 94 static struct isapnp_card_id snd_dt019 7h_pnpids[] __devinitdata = {97 static snd_card_t *snd_dt019x_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 98 99 #ifdef __ISAPNP__ 100 static struct isapnp_card *snd_dt019x_isapnp_cards[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR; 101 static const struct isapnp_card_id *snd_dt019x_isapnp_id[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR; 102 103 static struct isapnp_card_id snd_dt019x_pnpids[] __devinitdata = { 95 104 /* DT197A30 */ 96 105 { … … 102 111 #else 103 112 ISAPNP_CARD_ID('R','W','B',0x1688), 104 devs: { ISAPNP_DEVICE_ID('@','@','@',0x1688), 113 .devs = { ISAPNP_DEVICE_ID('@','@','@',0x0001), 114 ISAPNP_DEVICE_ID('@','X','@',0x0001), 115 ISAPNP_DEVICE_ID('@','H','@',0x0001) } 116 }, 117 /* DT0196 / ALS-007 */ 118 { 119 ISAPNP_CARD_ID('A','L','S',0x0007), 120 devs: { ISAPNP_DEVICE_ID('@','@','@',0x0001), 105 121 ISAPNP_DEVICE_ID('@','X','@',0x0001), 106 122 ISAPNP_DEVICE_ID('@','H','@',0x0001) } … … 110 126 }; 111 127 112 ISAPNP_CARD_TABLE(snd_dt019 7h_pnpids);128 ISAPNP_CARD_TABLE(snd_dt019x_pnpids); 113 129 114 130 #endif /* __ISAPNP__ */ 115 131 116 #define DRIVER_NAME "snd-card-dt019 7h"117 118 119 #ifdef __ISAPNP__ 120 static int __init snd_card_dt019 7h_isapnp(int dev, struct snd_card_dt0197h*acard)121 { 122 const struct isapnp_card_id *id = snd_dt019 7h_isapnp_id[dev];123 struct isapnp_card *card = snd_dt019 7h_isapnp_cards[dev];132 #define DRIVER_NAME "snd-card-dt019x" 133 134 135 #ifdef __ISAPNP__ 136 static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard) 137 { 138 const struct isapnp_card_id *id = snd_dt019x_isapnp_id[dev]; 139 struct isapnp_card *card = snd_dt019x_isapnp_cards[dev]; 124 140 struct isapnp_dev *pdev; 125 141 … … 141 157 142 158 pdev = acard->dev; 143 if ( pdev->prepare(pdev)<0)159 if (!pdev || pdev->prepare(pdev)<0) 144 160 return -EAGAIN; 145 161 … … 153 169 154 170 if (pdev->activate(pdev)<0) { 155 printk(KERN_ERR PFX " AUDIO isapnp configure failure\n");171 printk(KERN_ERR PFX "DT-019X AUDIO isapnp configure failure\n"); 156 172 return -EBUSY; 157 173 } 158 159 174 snd_port[dev] = pdev->resource[0].start; 160 175 snd_dma8[dev] = pdev->dma_resource[0].start; 161 176 snd_irq[dev] = pdev->irq_resource[0].start; 177 snd_printdd("dt019x: found audio interface: port=0x%lx, irq=0x%lx, dma=0x%lx\n", 178 snd_port[dev],snd_irq[dev],snd_dma8[dev]); 162 179 163 180 pdev = acard->devmpu; 164 if ( pdev || pdev->prepare(pdev)<0)181 if (!pdev || pdev->prepare(pdev)<0) 165 182 return 0; 166 183 … … 173 190 174 191 if (pdev->activate(pdev)<0) { 175 printk(KERN_ERR PFX " MPU-401 isapnp configure failure\n");192 printk(KERN_ERR PFX "DT-019X MPU-401 isapnp configure failure\n"); 176 193 snd_mpu_port[dev] = -1; 177 194 acard->devmpu = NULL; … … 179 196 snd_mpu_port[dev] = pdev->resource[0].start; 180 197 snd_mpu_irq[dev] = pdev->irq_resource[0].start; 198 snd_printdd("dt019x: found MPU-401: port=0x%lx, irq=0x%lx\n", 199 snd_mpu_port[dev],snd_mpu_irq[dev]); 181 200 } 182 201 183 202 pdev = acard->devopl; 184 if ( pdev == NULL|| pdev->prepare(pdev)<0)203 if (!pdev || pdev->prepare(pdev)<0) 185 204 return 0; 186 205 … … 189 208 190 209 if (pdev->activate(pdev)<0) { 191 printk(KERN_ERR PFX " OPLisapnp configure failure\n");210 printk(KERN_ERR PFX "DT-019X OPL3 isapnp configure failure\n"); 192 211 snd_fm_port[dev] = -1; 193 212 acard->devopl = NULL; 194 213 } else { 195 214 snd_fm_port[dev] = pdev->resource[0].start; 215 snd_printdd("dt019x: found OPL3 synth: port=0x%lx\n",snd_fm_port[dev]); 196 216 } 197 217 … … 199 219 } 200 220 201 static void snd_card_dt019 7h_deactivate(struct snd_card_dt0197h*acard)221 static void snd_card_dt019x_deactivate(struct snd_card_dt019x *acard) 202 222 { 203 223 if (acard->dev) { … … 216 236 #endif /* __ISAPNP__ */ 217 237 218 static void snd_card_dt019 7h_free(snd_card_t *card)219 { 220 struct snd_card_dt019 7h *acard = (struct snd_card_dt0197h*)card->private_data;238 static void snd_card_dt019x_free(snd_card_t *card) 239 { 240 struct snd_card_dt019x *acard = (struct snd_card_dt019x *)card->private_data; 221 241 222 242 if (acard != NULL) { 223 243 #ifdef __ISAPNP__ 224 snd_card_dt019 7h_deactivate(acard);244 snd_card_dt019x_deactivate(acard); 225 245 #endif /* __ISAPNP__ */ 226 246 } 227 247 } 228 248 229 static int __init snd_card_dt019 7h_probe(int dev)249 static int __init snd_card_dt019x_probe(int dev) 230 250 { 231 251 int error; 232 252 sb_t *chip; 233 253 snd_card_t *card; 234 struct snd_card_dt019 7h*acard;254 struct snd_card_dt019x *acard; 235 255 opl3_t *opl3; 236 256 237 257 if ((card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE, 238 sizeof(struct snd_card_dt019 7h))) == NULL)258 sizeof(struct snd_card_dt019x))) == NULL) 239 259 return -ENOMEM; 240 acard = (struct snd_card_dt019 7h*)card->private_data;241 card->private_free = snd_card_dt019 7h_free;242 243 #ifdef __ISAPNP__ 244 if ((error = snd_card_dt019 7h_isapnp(dev, acard))) {260 acard = (struct snd_card_dt019x *)card->private_data; 261 card->private_free = snd_card_dt019x_free; 262 263 #ifdef __ISAPNP__ 264 if ((error = snd_card_dt019x_isapnp(dev, acard))) { 245 265 snd_card_free(card); 246 266 return error; … … 257 277 snd_dma8[dev], 258 278 -1, 259 SB_HW_ AUTO,279 SB_HW_DT019X, 260 280 &chip)) < 0) { 261 281 snd_card_free(card); … … 274 294 if (snd_mpu_port[dev] > 0) { 275 295 if (snd_mpu401_uart_new(card, 0, 296 /* MPU401_HW_SB,*/ 276 297 MPU401_HW_MPU401, 277 298 snd_mpu_port[dev], 0, … … 302 323 } 303 324 304 strcpy(card->driver, "DT-019 7H");305 strcpy(card->shortname, "Diamond Tech. DT-019 7H");325 strcpy(card->driver, "DT-019X"); 326 strcpy(card->shortname, "Diamond Tech. DT-019X"); 306 327 sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d", 307 328 card->shortname, chip->name, chip->port, … … 311 332 return error; 312 333 } 313 snd_dt019 7h_cards[dev] = card;334 snd_dt019x_cards[dev] = card; 314 335 return 0; 315 336 } 316 337 317 338 #ifdef __ISAPNP__ 318 static int __init snd_dt019 7h_isapnp_detect(struct isapnp_card *card,339 static int __init snd_dt019x_isapnp_detect(struct isapnp_card *card, 319 340 const struct isapnp_card_id *id) 320 341 { … … 325 346 if (!snd_enable[dev]) 326 347 continue; 327 snd_dt019 7h_isapnp_cards[dev] = card;328 snd_dt019 7h_isapnp_id[dev] = id;329 res = snd_card_dt019 7h_probe(dev);348 snd_dt019x_isapnp_cards[dev] = card; 349 snd_dt019x_isapnp_id[dev] = id; 350 res = snd_card_dt019x_probe(dev); 330 351 if (res < 0) 331 352 return res; … … 337 358 #endif /* __ISAPNP__ */ 338 359 339 static int __init alsa_card_dt019 7h_init(void)360 static int __init alsa_card_dt019x_init(void) 340 361 { 341 362 int cards = 0; 342 363 343 364 #ifdef __ISAPNP__ 344 cards += isapnp_probe_cards(snd_dt019 7h_pnpids, snd_dt0197h_isapnp_detect);365 cards += isapnp_probe_cards(snd_dt019x_pnpids, snd_dt019x_isapnp_detect); 345 366 #else 346 367 printk(KERN_ERR PFX "you have to enable ISA PnP support.\n"); … … 348 369 #ifdef MODULE 349 370 if (!cards) 350 printk(KERN_ERR "no DT-019 7Hbased soundcards found\n");371 printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); 351 372 #endif 352 373 return cards ? 0 : -ENODEV; 353 374 } 354 375 355 static void __exit alsa_card_dt019 7h_exit(void)376 static void __exit alsa_card_dt019x_exit(void) 356 377 { 357 378 int dev; 358 379 359 380 for (dev = 0; dev < SNDRV_CARDS; dev++) 360 snd_card_free(snd_dt019 7h_cards[dev]);361 } 362 363 module_init(alsa_card_dt019 7h_init)364 module_exit(alsa_card_dt019 7h_exit)381 snd_card_free(snd_dt019x_cards[dev]); 382 } 383 384 module_init(alsa_card_dt019x_init) 385 module_exit(alsa_card_dt019x_exit) 365 386 366 387 #ifndef MODULE 367 388 368 /* format is: snd-dt019 7h=snd_enable,snd_index,snd_id,snd_isapnp,369 370 371 372 static int __init alsa_card_dt019 7h_setup(char *str)389 /* format is: snd-dt019x=snd_enable,snd_index,snd_id,snd_isapnp, 390 snd_port,snd_mpu_port,snd_fm_port, 391 snd_irq,snd_mpu_irq,snd_dma8,snd_dma8_size */ 392 393 static int __init alsa_card_dt019x_setup(char *str) 373 394 { 374 395 static unsigned __initdata nr_dev = 0; … … 389 410 } 390 411 391 __setup("snd-dt019 7h=", alsa_card_dt0197h_setup);412 __setup("snd-dt019x=", alsa_card_dt019x_setup); 392 413 393 414 #endif /* ifndef MODULE */ -
GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688_lib.c
r112 r210 285 285 */ 286 286 287 #ifdef TARGET_OS2288 287 static ratnum_t clocks[2] = { 289 288 { 290 795444,291 1,292 128,293 1,289 .num = 795444, 290 .den_min = 1, 291 .den_max = 128, 292 .den_step = 1, 294 293 }, 295 294 { 296 397722,297 1,298 128,299 1,295 .num = 397722, 296 .den_min = 1, 297 .den_max = 128, 298 .den_step = 1, 300 299 } 301 300 }; 302 301 303 302 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = { 304 2,305 clocks,303 .nrats = 2, 304 .rats = clocks, 306 305 }; 307 #else308 static ratnum_t clocks[2] = {309 {310 num: 795444,311 den_min: 1,312 den_max: 128,313 den_step: 1,314 },315 {316 num: 397722,317 den_min: 1,318 den_max: 128,319 den_step: 1,320 }321 };322 323 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = {324 nrats: 2,325 rats: clocks,326 };327 #endif328 306 329 307 static void snd_es1688_set_rate(es1688_t *chip, snd_pcm_substream_t *substream) … … 541 519 */ 542 520 543 #ifdef TARGET_OS2544 521 static snd_pcm_hardware_t snd_es1688_playback = 545 522 { 546 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |523 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 547 524 SNDRV_PCM_INFO_MMAP_VALID), 548 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,549 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,550 /* rate_min: */4000,551 /* rate_max: */48000,552 /* channels_min: */1,553 /* channels_max: */2,554 /* buffer_bytes_max: */65536,555 /* period_bytes_min: */64,556 /* period_bytes_max: */65536,557 /* periods_min: */1,558 /* periods_max: */1024,559 /* fifo_size: */0,525 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 526 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 527 .rate_min = 4000, 528 .rate_max = 48000, 529 .channels_min = 1, 530 .channels_max = 2, 531 .buffer_bytes_max = 65536, 532 .period_bytes_min = 64, 533 .period_bytes_max = 65536, 534 .periods_min = 1, 535 .periods_max = 1024, 536 .fifo_size = 0, 560 537 }; 561 538 562 539 static snd_pcm_hardware_t snd_es1688_capture = 563 540 { 564 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |541 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 565 542 SNDRV_PCM_INFO_MMAP_VALID), 566 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,567 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,568 /* rate_min: */4000,569 /* rate_max: */48000,570 /* channels_min: */1,571 /* channels_max: */2,572 /* buffer_bytes_max: */65536,573 /* period_bytes_min: */64,574 /* period_bytes_max: */65536,575 /* periods_min: */1,576 /* periods_max: */1024,577 /* fifo_size: */0,543 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 544 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 545 .rate_min = 4000, 546 .rate_max = 48000, 547 .channels_min = 1, 548 .channels_max = 2, 549 .buffer_bytes_max = 65536, 550 .period_bytes_min = 64, 551 .period_bytes_max = 65536, 552 .periods_min = 1, 553 .periods_max = 1024, 554 .fifo_size = 0, 578 555 }; 579 #else580 static snd_pcm_hardware_t snd_es1688_playback =581 {582 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |583 SNDRV_PCM_INFO_MMAP_VALID),584 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,585 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,586 rate_min: 4000,587 rate_max: 48000,588 channels_min: 1,589 channels_max: 2,590 buffer_bytes_max: 65536,591 period_bytes_min: 64,592 period_bytes_max: 65536,593 periods_min: 1,594 periods_max: 1024,595 fifo_size: 0,596 };597 598 static snd_pcm_hardware_t snd_es1688_capture =599 {600 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |601 SNDRV_PCM_INFO_MMAP_VALID),602 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,603 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,604 rate_min: 4000,605 rate_max: 48000,606 channels_min: 1,607 channels_max: 2,608 buffer_bytes_max: 65536,609 period_bytes_min: 64,610 period_bytes_max: 65536,611 periods_min: 1,612 periods_max: 1024,613 fifo_size: 0,614 };615 #endif616 556 617 557 /* … … 702 642 es1688_t **rchip) 703 643 { 704 #ifdef TARGET_OS2705 644 static snd_device_ops_t ops = { 706 snd_es1688_dev_free,0,0645 .dev_free = snd_es1688_dev_free, 707 646 }; 708 #else 709 static snd_device_ops_t ops = { 710 dev_free: snd_es1688_dev_free, 711 }; 712 #endif 647 713 648 es1688_t *chip; 714 649 int err; … … 766 701 } 767 702 768 #ifdef TARGET_OS2769 703 static snd_pcm_ops_t snd_es1688_playback_ops = { 770 snd_es1688_playback_open,771 snd_es1688_playback_close,772 snd_es1688_ioctl,773 snd_es1688_hw_params,774 snd_es1688_hw_free,775 snd_es1688_playback_prepare,776 snd_es1688_playback_trigger,777 snd_es1688_playback_pointer,0,0704 .open = snd_es1688_playback_open, 705 .close = snd_es1688_playback_close, 706 .ioctl = snd_es1688_ioctl, 707 .hw_params = snd_es1688_hw_params, 708 .hw_free = snd_es1688_hw_free, 709 .prepare = snd_es1688_playback_prepare, 710 .trigger = snd_es1688_playback_trigger, 711 .pointer = snd_es1688_playback_pointer, 778 712 }; 779 713 780 714 static snd_pcm_ops_t snd_es1688_capture_ops = { 781 snd_es1688_capture_open,782 snd_es1688_capture_close,783 snd_es1688_ioctl,784 snd_es1688_hw_params,785 snd_es1688_hw_free,786 snd_es1688_capture_prepare,787 snd_es1688_capture_trigger,788 snd_es1688_capture_pointer,715 .open = snd_es1688_capture_open, 716 .close = snd_es1688_capture_close, 717 .ioctl = snd_es1688_ioctl, 718 .hw_params = snd_es1688_hw_params, 719 .hw_free = snd_es1688_hw_free, 720 .prepare = snd_es1688_capture_prepare, 721 .trigger = snd_es1688_capture_trigger, 722 .pointer = snd_es1688_capture_pointer, 789 723 }; 790 #else791 static snd_pcm_ops_t snd_es1688_playback_ops = {792 open: snd_es1688_playback_open,793 close: snd_es1688_playback_close,794 ioctl: snd_es1688_ioctl,795 hw_params: snd_es1688_hw_params,796 hw_free: snd_es1688_hw_free,797 prepare: snd_es1688_playback_prepare,798 trigger: snd_es1688_playback_trigger,799 pointer: snd_es1688_playback_pointer,800 };801 802 static snd_pcm_ops_t snd_es1688_capture_ops = {803 open: snd_es1688_capture_open,804 close: snd_es1688_capture_close,805 ioctl: snd_es1688_ioctl,806 hw_params: snd_es1688_hw_params,807 hw_free: snd_es1688_hw_free,808 prepare: snd_es1688_capture_prepare,809 trigger: snd_es1688_capture_trigger,810 pointer: snd_es1688_capture_pointer,811 };812 #endif813 724 814 725 static void snd_es1688_pcm_free(snd_pcm_t *pcm) … … 889 800 } 890 801 891 #ifdef TARGET_OS2892 802 #define ES1688_SINGLE(xname, xindex, reg, shift, mask, invert) \ 893 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 894 0, 0, snd_es1688_info_single, \ 895 snd_es1688_get_single, snd_es1688_put_single, \ 896 reg | (shift << 8) | (mask << 16) | (invert << 24) } 897 #else 898 #define ES1688_SINGLE(xname, xindex, reg, shift, mask, invert) \ 899 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 900 info: snd_es1688_info_single, \ 901 get: snd_es1688_get_single, put: snd_es1688_put_single, \ 902 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 903 #endif 803 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 804 .info = snd_es1688_info_single, \ 805 .get = snd_es1688_get_single, .put = snd_es1688_put_single, \ 806 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 904 807 905 808 static int snd_es1688_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 956 859 } 957 860 958 #ifdef TARGET_OS2959 861 #define ES1688_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 960 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,xname, xindex, \ 961 0, 0, snd_es1688_info_double, \ 962 snd_es1688_get_double, snd_es1688_put_double, \ 963 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 964 #else 965 #define ES1688_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 966 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 967 info: snd_es1688_info_double, \ 968 get: snd_es1688_get_double, put: snd_es1688_put_double, \ 969 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 970 #endif 862 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 863 .info = snd_es1688_info_double, \ 864 .get = snd_es1688_get_double, .put = snd_es1688_put_double, \ 865 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 971 866 972 867 static int snd_es1688_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1092 987 ES1688_SINGLE("Capture Switch", 0, ES1688_REC_DEV, 4, 1, 1), 1093 988 { 1094 #ifdef TARGET_OS2 1095 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1096 "Capture Source",0,0, 0, 1097 snd_es1688_info_mux, 1098 snd_es1688_get_mux, 1099 snd_es1688_put_mux,0 1100 #else 1101 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1102 name: "Capture Source", 1103 info: snd_es1688_info_mux, 1104 get: snd_es1688_get_mux, 1105 put: snd_es1688_put_mux, 1106 #endif 989 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 990 .name = "Capture Source", 991 .info = snd_es1688_info_mux, 992 .get = snd_es1688_get_mux, 993 .put = snd_es1688_put_mux, 1107 994 }, 1108 995 }; -
GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c
r207 r210 79 79 #include <sound/control.h> 80 80 #include <sound/pcm.h> 81 #include <sound/pcm_params.h> 81 82 #include <sound/mpu401.h> 82 83 #include <sound/opl3.h> … … 404 405 static ratnum_t new_clocks[2] = { 405 406 { 406 num:793800,407 den_min:1,408 den_max:128,409 den_step:1,407 .num = 793800, 408 .den_min = 1, 409 .den_max = 128, 410 .den_step = 1, 410 411 }, 411 412 { 412 num:768000,413 den_min:1,414 den_max:128,415 den_step:1,413 .num = 768000, 414 .den_min = 1, 415 .den_max = 128, 416 .den_step = 1, 416 417 } 417 418 }; 418 419 419 420 static snd_pcm_hw_constraint_ratnums_t new_hw_constraints_clocks = { 420 nrats:2,421 rats:new_clocks,421 .nrats = 2, 422 .rats = new_clocks, 422 423 }; 423 424 424 425 static ratnum_t old_clocks[2] = { 425 426 { 426 num:795444,427 den_min:1,428 den_max:128,429 den_step:1,427 .num = 795444, 428 .den_min = 1, 429 .den_max = 128, 430 .den_step = 1, 430 431 }, 431 432 { 432 num:397722,433 den_min:1,434 den_max:128,435 den_step:1,433 .num = 397722, 434 .den_min = 1, 435 .den_max = 128, 436 .den_step = 1, 436 437 } 437 438 }; 438 439 439 440 static snd_pcm_hw_constraint_ratnums_t old_hw_constraints_clocks = { 440 nrats:2,441 rats:old_clocks,441 .nrats = 2, 442 .rats = old_clocks, 442 443 }; 443 444 #endif … … 906 907 static snd_pcm_hardware_t snd_es18xx_playback = 907 908 { 908 info:(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |909 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 909 910 SNDRV_PCM_INFO_MMAP_VALID), 910 formats:(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |911 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | 911 912 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE), 912 rates:SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,913 rate_min:4000,914 rate_max:48000,915 channels_min:1,916 channels_max:2,917 buffer_bytes_max:65536,918 period_bytes_min:64,919 period_bytes_max:65536,920 periods_min:1,921 periods_max:1024,922 fifo_size:0,913 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 914 .rate_min = 4000, 915 .rate_max = 48000, 916 .channels_min = 1, 917 .channels_max = 2, 918 .buffer_bytes_max = 65536, 919 .period_bytes_min = 64, 920 .period_bytes_max = 65536, 921 .periods_min = 1, 922 .periods_max = 1024, 923 .fifo_size = 0, 923 924 }; 924 925 925 926 static snd_pcm_hardware_t snd_es18xx_capture = 926 927 { 927 info:(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |928 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 928 929 SNDRV_PCM_INFO_MMAP_VALID), 929 formats:(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |930 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | 930 931 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE), 931 rates:SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,932 rate_min:4000,933 rate_max:48000,934 channels_min:1,935 channels_max:2,936 buffer_bytes_max:65536,937 period_bytes_min:64,938 period_bytes_max:65536,939 periods_min:1,940 periods_max:1024,941 fifo_size:0,932 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 933 .rate_min = 4000, 934 .rate_max = 48000, 935 .channels_min = 1, 936 .channels_max = 2, 937 .buffer_bytes_max = 65536, 938 .period_bytes_min = 64, 939 .period_bytes_max = 65536, 940 .periods_min = 1, 941 .periods_max = 1024, 942 .fifo_size = 0, 942 943 }; 943 944 #endif … … 1155 1156 #else 1156 1157 #define ES18XX_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1157 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index:xindex, \1158 info:snd_es18xx_info_single, \1159 get: snd_es18xx_get_single, put:snd_es18xx_put_single, \1160 private_value:reg | (shift << 8) | (mask << 16) | (invert << 24) }1158 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1159 .info = snd_es18xx_info_single, \ 1160 .get = snd_es18xx_get_single, .put = snd_es18xx_put_single, \ 1161 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 1161 1162 #endif 1162 1163 … … 1213 1214 #else 1214 1215 #define ES18XX_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1215 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index:xindex, \1216 info:snd_es18xx_info_double, \1217 get: snd_es18xx_get_double, put:snd_es18xx_put_double, \1218 private_value:left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }1216 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1217 .info = snd_es18xx_info_double, \ 1218 .get = snd_es18xx_get_double, .put = snd_es18xx_put_double, \ 1219 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1219 1220 #endif 1220 1221 … … 1312 1313 snd_es18xx_put_mux, 0 1313 1314 #else 1314 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1315 name:"Capture Source",1316 info:snd_es18xx_info_mux,1317 get:snd_es18xx_get_mux,1318 put:snd_es18xx_put_mux,1315 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1316 .name = "Capture Source", 1317 .info = snd_es18xx_info_mux, 1318 .get = snd_es18xx_get_mux, 1319 .put = snd_es18xx_put_mux, 1319 1320 #endif 1320 1321 } … … 1354 1355 snd_es18xx_put_spatializer_enable, 1355 1356 #else 1356 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1357 name:"3D Control - Switch",1358 info:snd_es18xx_info_spatializer_enable,1359 get:snd_es18xx_get_spatializer_enable,1360 put:snd_es18xx_put_spatializer_enable,1357 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1358 .name = "3D Control - Switch", 1359 .info = snd_es18xx_info_spatializer_enable, 1360 .get = snd_es18xx_get_spatializer_enable, 1361 .put = snd_es18xx_put_spatializer_enable, 1361 1362 #endif 1362 1363 } … … 1387 1388 #else 1388 1389 { 1389 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1390 name:"Hardware Master Playback Volume",1391 access:SNDRV_CTL_ELEM_ACCESS_READ,1392 info:snd_es18xx_info_hw_volume,1393 get:snd_es18xx_get_hw_volume,1390 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1391 .name = "Hardware Master Playback Volume", 1392 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1393 .info = snd_es18xx_info_hw_volume, 1394 .get = snd_es18xx_get_hw_volume, 1394 1395 }, 1395 1396 { 1396 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1397 name:"Hardware Master Playback Switch",1398 access:SNDRV_CTL_ELEM_ACCESS_READ,1399 info:snd_es18xx_info_hw_switch,1400 get:snd_es18xx_get_hw_switch,1397 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1398 .name = "Hardware Master Playback Switch", 1399 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1400 .info = snd_es18xx_info_hw_switch, 1401 .get = snd_es18xx_get_hw_switch, 1401 1402 }, 1402 1403 #endif … … 1705 1706 #else 1706 1707 static snd_pcm_ops_t snd_es18xx_playback_ops = { 1707 open:snd_es18xx_playback_open,1708 close:snd_es18xx_playback_close,1709 ioctl:snd_pcm_lib_ioctl,1710 hw_params:snd_es18xx_playback_hw_params,1711 prepare:snd_es18xx_playback_prepare,1712 trigger:snd_es18xx_playback_trigger,1713 pointer:snd_es18xx_playback_pointer,1708 .open = snd_es18xx_playback_open, 1709 .close = snd_es18xx_playback_close, 1710 .ioctl = snd_pcm_lib_ioctl, 1711 .hw_params = snd_es18xx_playback_hw_params, 1712 .prepare = snd_es18xx_playback_prepare, 1713 .trigger = snd_es18xx_playback_trigger, 1714 .pointer = snd_es18xx_playback_pointer, 1714 1715 }; 1715 1716 1716 1717 static snd_pcm_ops_t snd_es18xx_capture_ops = { 1717 open:snd_es18xx_capture_open,1718 close:snd_es18xx_capture_close,1719 ioctl:snd_pcm_lib_ioctl,1720 hw_params:snd_es18xx_capture_hw_params,1721 prepare:snd_es18xx_capture_prepare,1722 trigger:snd_es18xx_capture_trigger,1723 pointer:snd_es18xx_capture_pointer,1718 .open = snd_es18xx_capture_open, 1719 .close = snd_es18xx_capture_close, 1720 .ioctl = snd_pcm_lib_ioctl, 1721 .hw_params = snd_es18xx_capture_hw_params, 1722 .prepare = snd_es18xx_capture_prepare, 1723 .trigger = snd_es18xx_capture_trigger, 1724 .pointer = snd_es18xx_capture_pointer, 1724 1725 }; 1725 1726 #endif … … 1895 1896 #else 1896 1897 static snd_device_ops_t ops = { 1897 dev_free:snd_es18xx_dev_free,1898 .dev_free = snd_es18xx_dev_free, 1898 1899 }; 1899 1900 #endif -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_dma.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <asm/dma.h> 24 #include <linux/slab.h> 25 #include <sound/core.h> 23 26 #include <sound/gus.h> 24 27 … … 35 38 void snd_gf1_dma_program(snd_gus_card_t * gus, 36 39 unsigned int addr, 37 const void *buf,40 unsigned long buf_addr, 38 41 unsigned int count, 39 42 unsigned int cmd) … … 74 77 } 75 78 snd_gf1_dma_ack(gus); 76 snd_dma_program(gus->gf1.dma1, buf , count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);79 snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE); 77 80 #if 0 78 81 snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd); … … 138 141 block = snd_gf1_dma_next_block(gus); 139 142 spin_unlock(&gus->dma_lock); 140 snd_gf1_dma_program(gus, block->addr, block->buf fer, block->count, (unsigned short) block->cmd);143 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); 141 144 kfree(block); 142 145 #if 0 … … 233 236 if (block == NULL) 234 237 return 0; 235 snd_gf1_dma_program(gus, block->addr, block->buf fer, block->count, (unsigned short) block->cmd);238 snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd); 236 239 kfree(block); 237 240 return 0; -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_dram.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/time.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 #include <sound/info.h> -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_instr.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/time.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_io.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/delay.h> 24 #include <linux/time.h> 25 #include <sound/core.h> 23 26 #include <sound/gus.h> 24 27 -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_irq.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <sound/core.h> 23 24 #include <sound/info.h> 24 25 #include <sound/gus.h> -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_lfo.c
r32 r210 17 17 * You should have received a copy of the GNU General Public License 18 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 * 21 21 */ 22 22 23 23 #include <sound/driver.h> 24 #include <sound/core.h> 24 25 #include <sound/gus.h> 25 26 -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_main.c
r112 r210 93 93 } 94 94 95 #ifdef TARGET_OS296 95 static snd_kcontrol_new_t snd_gus_joystick_control = { 97 SNDRV_CTL_ELEM_IFACE_CARD,0,0,98 "Joystick Speed",0,0, 0,99 snd_gus_joystick_info,100 snd_gus_joystick_get,101 snd_gus_joystick_put,096 .iface = SNDRV_CTL_ELEM_IFACE_CARD, 97 .name = "Joystick Speed", 98 .info = snd_gus_joystick_info, 99 .get = snd_gus_joystick_get, 100 .put = snd_gus_joystick_put 102 101 }; 103 #else104 static snd_kcontrol_new_t snd_gus_joystick_control = {105 iface: SNDRV_CTL_ELEM_IFACE_CARD,106 name: "Joystick Speed",107 info: snd_gus_joystick_info,108 get: snd_gus_joystick_get,109 put: snd_gus_joystick_put110 };111 #endif112 102 113 103 static void snd_gus_init_control(snd_gus_card_t *gus) … … 173 163 snd_gus_card_t *gus; 174 164 int err; 175 #ifdef TARGET_OS2176 165 static snd_device_ops_t ops = { 177 snd_gus_dev_free,0,0166 .dev_free = snd_gus_dev_free, 178 167 }; 179 #else180 static snd_device_ops_t ops = {181 dev_free: snd_gus_dev_free,182 };183 #endif184 168 185 169 *rgus = NULL; -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mem.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/slab.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 #include <sound/info.h> -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mem_proc.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/slab.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 #include <sound/info.h> … … 74 76 file->f_pos += offset; 75 77 break; 76 case 2: /* SEEK_END */77 file->f_pos = priv->size -offset;78 case 2: /* SEEK_END, offset is negative */ 79 file->f_pos = priv->size + offset; 78 80 break; 79 81 default: … … 91 93 } 92 94 93 #ifdef TARGET_OS294 95 static struct snd_info_entry_ops snd_gf1_mem_proc_ops = { 95 0,0, 96 snd_gf1_mem_proc_dump,0, 97 snd_gf1_mem_proc_llseek,0,0,0 96 .read = snd_gf1_mem_proc_dump, 97 .llseek = snd_gf1_mem_proc_llseek, 98 98 }; 99 #else100 static struct snd_info_entry_ops snd_gf1_mem_proc_ops = {101 read: snd_gf1_mem_proc_dump,102 llseek: snd_gf1_mem_proc_llseek,103 };104 #endif105 99 106 100 int snd_gf1_mem_proc_init(snd_gus_card_t * gus) -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mixer.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/time.h> 24 #include <linux/wait.h> 25 #include <sound/core.h> 23 26 #include <sound/control.h> 24 27 #include <sound/gus.h> … … 30 33 */ 31 34 32 #ifdef TARGET_OS233 35 #define GF1_SINGLE(xname, xindex, shift, invert) \ 34 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 35 0, 0, snd_gf1_info_single, \ 36 snd_gf1_get_single, snd_gf1_put_single, \ 37 shift | (invert << 8) } 38 #else 39 #define GF1_SINGLE(xname, xindex, shift, invert) \ 40 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 41 info: snd_gf1_info_single, \ 42 get: snd_gf1_get_single, put: snd_gf1_put_single, \ 43 private_value: shift | (invert << 8) } 44 #endif 36 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 37 .info = snd_gf1_info_single, \ 38 .get = snd_gf1_get_single, .put = snd_gf1_put_single, \ 39 .private_value = shift | (invert << 8) } 45 40 46 41 static int snd_gf1_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 88 83 } 89 84 90 #ifdef TARGET_OS291 85 #define ICS_DOUBLE(xname, xindex, addr) \ 92 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ 93 0, 0, snd_ics_info_double, \ 94 snd_ics_get_double, snd_ics_put_double, \ 95 addr } 96 #else 97 #define ICS_DOUBLE(xname, xindex, addr) \ 98 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 99 info: snd_ics_info_double, \ 100 get: snd_ics_get_double, put: snd_ics_put_double, \ 101 private_value: addr } 102 #endif 86 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 87 .info = snd_ics_info_double, \ 88 .get = snd_ics_get_double, .put = snd_ics_put_double, \ 89 .private_value = addr } 103 90 104 91 static int snd_ics_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_pcm.c
r207 r210 26 26 */ 27 27 28 #define __NO_VERSION__29 28 #include <sound/driver.h> 30 29 #include <asm/dma.h> … … 33 32 #include <sound/control.h> 34 33 #include <sound/gus.h> 34 #include <sound/pcm_params.h> 35 35 #include "gus_tables.h" 36 36 … … 530 530 } 531 531 532 #ifdef TARGET_OS2533 532 static ratnum_t clock = { 534 9878400/16,535 2,536 257,537 1,533 .num = 9878400/16, 534 .den_min = 2, 535 .den_max = 257, 536 .den_step = 1, 538 537 }; 539 538 540 539 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = { 541 1,542 &clock,540 .nrats = 1, 541 .rats = &clock, 543 542 }; 544 #else545 static ratnum_t clock = {546 num: 9878400/16,547 den_min: 2,548 den_max: 257,549 den_step: 1,550 };551 552 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = {553 nrats: 1,554 rats: &clock,555 };556 #endif557 543 558 544 static int snd_gf1_pcm_capture_hw_params(snd_pcm_substream_t * substream, … … 632 618 } 633 619 634 #ifdef TARGET_OS2635 620 static snd_pcm_hardware_t snd_gf1_pcm_playback = 636 621 { 637 /* info: */SNDRV_PCM_INFO_NONINTERLEAVED,638 /* formats: */(SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |622 .info = SNDRV_PCM_INFO_NONINTERLEAVED, 623 formats: (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | 639 624 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE), 640 /* rates: */ SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,641 /* rate_min: */5510,642 /* rate_max: */48000,643 /* channels_min: */1,644 /* channels_max: */2,645 /* buffer_bytes_max: */(128*1024),646 /* period_bytes_min: */64,647 /* period_bytes_max: */(128*1024),648 /* periods_min: */1,649 /* periods_max: */1024,650 /* fifo_size: */0,625 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 626 .rate_min = 5510, 627 .rate_max = 48000, 628 .channels_min = 1, 629 .channels_max = 2, 630 .buffer_bytes_max = (128*1024), 631 .period_bytes_min = 64, 632 .period_bytes_max = (128*1024), 633 .periods_min = 1, 634 .periods_max = 1024, 635 .fifo_size = 0, 651 636 }; 652 637 653 638 static snd_pcm_hardware_t snd_gf1_pcm_capture = 654 639 { 655 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |640 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 656 641 SNDRV_PCM_INFO_MMAP_VALID), 657 /* formats: */SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8,658 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,659 /* rate_min: */5510,660 /* rate_max: */44100,661 /* channels_min: */1,662 /* channels_max: */2,663 /* buffer_bytes_max: */(128*1024),664 /* period_bytes_min: */64,665 /* period_bytes_max: */(128*1024),666 /* periods_min: */1,667 /* periods_max: */1024,668 /* fifo_size: */0,642 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8, 643 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100, 644 .rate_min = 5510, 645 .rate_max = 44100, 646 .channels_min = 1, 647 .channels_max = 2, 648 .buffer_bytes_max = (128*1024), 649 .period_bytes_min = 64, 650 .period_bytes_max = (128*1024), 651 .periods_min = 1, 652 .periods_max = 1024, 653 .fifo_size = 0, 669 654 }; 670 #else671 static snd_pcm_hardware_t snd_gf1_pcm_playback =672 {673 info: SNDRV_PCM_INFO_NONINTERLEAVED,674 formats: (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |675 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE),676 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,677 rate_min: 5510,678 rate_max: 48000,679 channels_min: 1,680 channels_max: 2,681 buffer_bytes_max: (128*1024),682 period_bytes_min: 64,683 period_bytes_max: (128*1024),684 periods_min: 1,685 periods_max: 1024,686 fifo_size: 0,687 };688 689 static snd_pcm_hardware_t snd_gf1_pcm_capture =690 {691 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |692 SNDRV_PCM_INFO_MMAP_VALID),693 formats: SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8,694 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,695 rate_min: 5510,696 rate_max: 44100,697 channels_min: 1,698 channels_max: 2,699 buffer_bytes_max: (128*1024),700 period_bytes_min: 64,701 period_bytes_max: (128*1024),702 periods_min: 1,703 periods_max: 1024,704 fifo_size: 0,705 };706 #endif707 655 708 656 static void snd_gf1_pcm_playback_free(snd_pcm_runtime_t *runtime) … … 856 804 } 857 805 858 #ifdef TARGET_OS2859 806 static snd_kcontrol_new_t snd_gf1_pcm_volume_control = 860 807 { 861 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,862 "PCM Playback Volume",0,0, 0,863 snd_gf1_pcm_volume_info,864 snd_gf1_pcm_volume_get,865 snd_gf1_pcm_volume_put,0808 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 809 .name = "PCM Playback Volume", 810 .info = snd_gf1_pcm_volume_info, 811 .get = snd_gf1_pcm_volume_get, 812 .put = snd_gf1_pcm_volume_put 866 813 }; 867 814 868 815 static snd_pcm_ops_t snd_gf1_pcm_playback_ops = { 869 snd_gf1_pcm_playback_open,870 snd_gf1_pcm_playback_close,871 snd_pcm_lib_ioctl,872 snd_gf1_pcm_playback_hw_params,873 snd_gf1_pcm_playback_hw_free,874 snd_gf1_pcm_playback_prepare,875 snd_gf1_pcm_playback_trigger,876 snd_gf1_pcm_playback_pointer,877 snd_gf1_pcm_playback_copy,878 snd_gf1_pcm_playback_silence816 .open = snd_gf1_pcm_playback_open, 817 .close = snd_gf1_pcm_playback_close, 818 .ioctl = snd_pcm_lib_ioctl, 819 .hw_params = snd_gf1_pcm_playback_hw_params, 820 .hw_free = snd_gf1_pcm_playback_hw_free, 821 .prepare = snd_gf1_pcm_playback_prepare, 822 .trigger = snd_gf1_pcm_playback_trigger, 823 .pointer = snd_gf1_pcm_playback_pointer, 824 .copy = snd_gf1_pcm_playback_copy, 825 .silence = snd_gf1_pcm_playback_silence, 879 826 }; 880 827 881 828 static snd_pcm_ops_t snd_gf1_pcm_capture_ops = { 882 snd_gf1_pcm_capture_open,883 snd_gf1_pcm_capture_close,884 snd_pcm_lib_ioctl,885 snd_gf1_pcm_capture_hw_params,886 snd_gf1_pcm_capture_hw_free,887 snd_gf1_pcm_capture_prepare,888 snd_gf1_pcm_capture_trigger,889 snd_gf1_pcm_capture_pointer,0,0829 .open = snd_gf1_pcm_capture_open, 830 .close = snd_gf1_pcm_capture_close, 831 .ioctl = snd_pcm_lib_ioctl, 832 .hw_params = snd_gf1_pcm_capture_hw_params, 833 .hw_free = snd_gf1_pcm_capture_hw_free, 834 .prepare = snd_gf1_pcm_capture_prepare, 835 .trigger = snd_gf1_pcm_capture_trigger, 836 .pointer = snd_gf1_pcm_capture_pointer, 890 837 }; 891 #else892 static snd_kcontrol_new_t snd_gf1_pcm_volume_control =893 {894 iface: SNDRV_CTL_ELEM_IFACE_MIXER,895 name: "PCM Playback Volume",896 info: snd_gf1_pcm_volume_info,897 get: snd_gf1_pcm_volume_get,898 put: snd_gf1_pcm_volume_put899 };900 901 static snd_pcm_ops_t snd_gf1_pcm_playback_ops = {902 open: snd_gf1_pcm_playback_open,903 close: snd_gf1_pcm_playback_close,904 ioctl: snd_pcm_lib_ioctl,905 hw_params: snd_gf1_pcm_playback_hw_params,906 hw_free: snd_gf1_pcm_playback_hw_free,907 prepare: snd_gf1_pcm_playback_prepare,908 trigger: snd_gf1_pcm_playback_trigger,909 pointer: snd_gf1_pcm_playback_pointer,910 copy: snd_gf1_pcm_playback_copy,911 silence: snd_gf1_pcm_playback_silence,912 };913 914 static snd_pcm_ops_t snd_gf1_pcm_capture_ops = {915 open: snd_gf1_pcm_capture_open,916 close: snd_gf1_pcm_capture_close,917 ioctl: snd_pcm_lib_ioctl,918 hw_params: snd_gf1_pcm_capture_hw_params,919 hw_free: snd_gf1_pcm_capture_hw_free,920 prepare: snd_gf1_pcm_capture_prepare,921 trigger: snd_gf1_pcm_capture_trigger,922 pointer: snd_gf1_pcm_capture_pointer,923 };924 #endif925 838 926 839 int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pcm_t ** rpcm) -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_reset.c
r32 r210 15 15 * You should have received a copy of the GNU General Public License 16 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 * 19 19 */ 20 20 21 21 #include <sound/driver.h> 22 #include <linux/delay.h> 23 #include <linux/interrupt.h> 24 #include <linux/time.h> 25 #include <sound/core.h> 22 26 #include <sound/gus.h> 23 27 -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_sample.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/time.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_simple.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/time.h> 24 #include <sound/core.h> 23 25 #include <sound/gus.h> 24 26 #include "gus_tables.h" -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_timer.c
r32 r210 18 18 * You should have received a copy of the GNU General Public License 19 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 * 22 22 */ 23 23 24 24 #include <sound/driver.h> 25 #include <linux/time.h> 26 #include <sound/core.h> 25 27 #include <sound/gus.h> 26 28 … … 125 127 */ 126 128 127 #ifdef TARGET_OS2128 129 static struct _snd_timer_hardware snd_gf1_timer1 = 129 130 { 130 SNDRV_TIMER_HW_STOP, 131 80000, 132 256, 133 0,0,0, 134 snd_gf1_timer1_start, 135 snd_gf1_timer1_stop, 131 .flags = SNDRV_TIMER_HW_STOP, 132 .resolution = 80000, 133 .ticks = 256, 134 .start = snd_gf1_timer1_start, 135 .stop = snd_gf1_timer1_stop, 136 136 }; 137 137 138 138 static struct _snd_timer_hardware snd_gf1_timer2 = 139 139 { 140 SNDRV_TIMER_HW_STOP, 141 320000, 142 256, 143 0,0,0, 144 snd_gf1_timer2_start, 145 snd_gf1_timer2_stop, 140 .flags = SNDRV_TIMER_HW_STOP, 141 .resolution = 320000, 142 .ticks = 256, 143 .start = snd_gf1_timer2_start, 144 .stop = snd_gf1_timer2_stop, 146 145 }; 147 #else148 static struct _snd_timer_hardware snd_gf1_timer1 =149 {150 flags: SNDRV_TIMER_HW_STOP,151 resolution: 80000,152 ticks: 256,153 start: snd_gf1_timer1_start,154 stop: snd_gf1_timer1_stop,155 };156 157 static struct _snd_timer_hardware snd_gf1_timer2 =158 {159 flags: SNDRV_TIMER_HW_STOP,160 resolution: 320000,161 ticks: 256,162 start: snd_gf1_timer2_start,163 stop: snd_gf1_timer2_stop,164 };165 #endif166 146 167 147 static void snd_gf1_timer1_free(snd_timer_t *timer) -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_uart.c
r32 r210 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 * 20 20 */ 21 21 22 22 #include <sound/driver.h> 23 #include <linux/delay.h> 24 #include <linux/interrupt.h> 25 #include <linux/time.h> 26 #include <sound/core.h> 23 27 #include <sound/gus.h> 24 28 … … 221 225 } 222 226 223 #ifdef TARGET_OS2224 227 static snd_rawmidi_ops_t snd_gf1_uart_output = 225 228 { 226 snd_gf1_uart_output_open,227 snd_gf1_uart_output_close,228 snd_gf1_uart_output_trigger,0229 .open = snd_gf1_uart_output_open, 230 .close = snd_gf1_uart_output_close, 231 .trigger = snd_gf1_uart_output_trigger, 229 232 }; 230 233 231 234 static snd_rawmidi_ops_t snd_gf1_uart_input = 232 235 { 233 snd_gf1_uart_input_open,234 snd_gf1_uart_input_close,235 snd_gf1_uart_input_trigger,0236 .open = snd_gf1_uart_input_open, 237 .close = snd_gf1_uart_input_close, 238 .trigger = snd_gf1_uart_input_trigger, 236 239 }; 237 #else238 static snd_rawmidi_ops_t snd_gf1_uart_output =239 {240 open: snd_gf1_uart_output_open,241 close: snd_gf1_uart_output_close,242 trigger: snd_gf1_uart_output_trigger,243 };244 245 static snd_rawmidi_ops_t snd_gf1_uart_input =246 {247 open: snd_gf1_uart_input_open,248 close: snd_gf1_uart_input_close,249 trigger: snd_gf1_uart_input_trigger,250 };251 #endif252 240 253 241 int snd_gf1_rawmidi_new(snd_gus_card_t * gus, int device, snd_rawmidi_t ** rrawmidi) -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_volume.c
r32 r210 15 15 * You should have received a copy of the GNU General Public License 16 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 * 19 19 */ 20 20 21 21 #include <sound/driver.h> 22 #include <linux/time.h> 23 #include <sound/core.h> 22 24 #include <sound/gus.h> 23 25 #define __GUS_TABLES_ALLOC__ 24 26 #include "gus_tables.h" 27 28 EXPORT_SYMBOL(snd_gf1_atten_table); /* for snd-gus-synth module */ 25 29 26 30 unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol) -
GPL/branches/alsa-resync1/alsa-kernel/isa/makefile.os2
r32 r210 33 33 #=================================================================== 34 34 FILE1 = opl3sa2.obj 35 #als100.obj azt2320.obj cmi8330.obj dt019 7h.obj es18xx.obj35 #als100.obj azt2320.obj cmi8330.obj dt019x.obj es18xx.obj 36 36 FILE2 = 37 37 # sgalaxy.obj -
GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c
r207 r210 80 80 MODULE_PARM_DESC(snd_enable, "Enable OPL3-SA soundcard."); 81 81 MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC); 82 #ifdef __ISAPNP__ 82 83 MODULE_PARM(snd_isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 83 84 MODULE_PARM_DESC(snd_isapnp, "ISA PnP detection for specified soundcard."); 84 85 MODULE_PARM_SYNTAX(snd_isapnp, SNDRV_ISAPNP_DESC); 86 #endif 85 87 MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 86 88 MODULE_PARM_DESC(snd_port, "Port # for OPL3-SA driver."); … … 364 366 #else 365 367 #define OPL3SA2_SINGLE(xname, xindex, reg, shift, mask, invert) \ 366 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index:xindex, \367 info:snd_opl3sa2_info_single, \368 get: snd_opl3sa2_get_single, put:snd_opl3sa2_put_single, \369 private_value:reg | (shift << 8) | (mask << 16) | (invert << 24) }368 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 369 .info = snd_opl3sa2_info_single, \ 370 .get = snd_opl3sa2_get_single, .put = snd_opl3sa2_put_single, \ 371 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 370 372 #endif 371 373 … … 432 434 #else 433 435 #define OPL3SA2_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 434 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index:xindex, \435 info:snd_opl3sa2_info_double, \436 get: snd_opl3sa2_get_double, put:snd_opl3sa2_put_double, \437 private_value:left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }436 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 437 .info = snd_opl3sa2_info_double, \ 438 .get = snd_opl3sa2_get_double, .put = snd_opl3sa2_put_double, \ 439 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 438 440 #endif 439 441 … … 714 716 opl3_t *opl3; 715 717 static snd_device_ops_t ops = { 716 /* dev_free: */snd_opl3sa2_dev_free,718 .dev_free = snd_opl3sa2_dev_free, 717 719 }; 718 720 int err; -
GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c
r207 r210 287 287 #ifdef __ISAPNP__ 288 288 289 #ifdef TARGET_OS2290 #define ISAPNP_OPTI9XX(_va, _vb, _vc, _device, _fa, _fb, _fc, _audio, _mpu401) \291 { \292 0, ISAPNP_CARD_ID(_va, _vb, _vc, _device), \293 { ISAPNP_DEVICE_ID(_fa, _fb, _fc, _audio), \294 ISAPNP_DEVICE_ID(_fa, _fb, _fc, _mpu401), } \295 }296 #else297 289 #define ISAPNP_OPTI9XX(_va, _vb, _vc, _device, _fa, _fb, _fc, _audio, _mpu401) \ 298 290 { \ 299 291 ISAPNP_CARD_ID(_va, _vb, _vc, _device), \ 300 devs:{ ISAPNP_DEVICE_ID(_fa, _fb, _fc, _audio), \292 .devs = { ISAPNP_DEVICE_ID(_fa, _fb, _fc, _audio), \ 301 293 ISAPNP_DEVICE_ID(_fa, _fb, _fc, _mpu401), } \ 302 294 } 303 #endif304 295 305 296 static struct isapnp_card_id snd_card_opti9xx_pnpids[] = { … … 336 327 static int __init snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware) 337 328 { 329 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; 330 338 331 chip->hardware = hardware; 339 332 strcpy(chip->name, snd_opti9xx_names[hardware]); 333 334 chip->mc_base_size = opti9xx_mc_size[hardware]; 340 335 341 336 spin_lock_init(&chip->lock); … … 610 605 611 606 spin_lock_irqsave(&chip->lock, flags); 612 outb(irq_bits << 3 | dma_bits, chip->wss_base);607 snd_opti9xx_write(chip, OPTi9XX_MC_REG(3), (irq_bits << 3 | dma_bits)); 613 608 spin_unlock_irqrestore(&chip->lock, flags); 614 609 … … 826 821 #define RATES sizeof(rates) / sizeof(rates[0]) 827 822 828 #ifdef TARGET_OS2829 823 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 830 RATES,831 rates,832 0,824 .count = RATES, 825 .list = rates, 826 .mask = 0, 833 827 }; 834 #else835 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {836 count: RATES,837 list: rates,838 mask: 0,839 };840 #endif841 828 842 829 unsigned char bits[] = { 0x01, 0x0f, 0x00, 0x0e, 0x03, 0x02, 0x05, … … 990 977 } while (s != substream); 991 978 spin_lock(&chip->lock); 992 if ( SNDRV_PCM_TRIGGER_START)979 if (cmd == SNDRV_PCM_TRIGGER_START) 993 980 snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, what); 994 981 else … … 1148 1135 1149 1136 1150 #ifdef TARGET_OS21151 1137 static snd_pcm_hardware_t snd_opti93x_playback = { 1152 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1138 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1153 1139 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), 1154 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1140 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | 1155 1141 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), 1156 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1157 /* rate_min: */5512,1158 /* rate_max: */48000,1159 /* channels_min: */1,1160 /* channels_max: */2,1161 /* buffer_bytes_max: */(128*1024),1162 /* period_bytes_min: */64,1163 /* period_bytes_max: */(128*1024),1164 /* periods_min: */1,1165 /* periods_max: */1024,1166 /* fifo_size: */0,1142 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000, 1143 .rate_min = 5512, 1144 .rate_max = 48000, 1145 .channels_min = 1, 1146 .channels_max = 2, 1147 .buffer_bytes_max = (128*1024), 1148 .period_bytes_min = 64, 1149 .period_bytes_max = (128*1024), 1150 .periods_min = 1, 1151 .periods_max = 1024, 1152 .fifo_size = 0, 1167 1153 }; 1168 1154 1169 1155 static snd_pcm_hardware_t snd_opti93x_capture = { 1170 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1156 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1171 1157 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), 1172 /* formats: */(SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1158 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | 1173 1159 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), 1174 /* rates: */SNDRV_PCM_RATE_8000_48000,1175 /* rate_min: */5512,1176 /* rate_max: */48000,1177 /* channels_min: */1,1178 /* channels_max: */2,1179 /* buffer_bytes_max: */(128*1024),1180 /* period_bytes_min: */64,1181 /* period_bytes_max: */(128*1024),1182 /* periods_min: */1,1183 /* periods_max: */1024,1184 /* fifo_size: */0,1160 .rates = SNDRV_PCM_RATE_8000_48000, 1161 .rate_min = 5512, 1162 .rate_max = 48000, 1163 .channels_min = 1, 1164 .channels_max = 2, 1165 .buffer_bytes_max = (128*1024), 1166 .period_bytes_min = 64, 1167 .period_bytes_max = (128*1024), 1168 .periods_min = 1, 1169 .periods_max = 1024, 1170 .fifo_size = 0, 1185 1171 }; 1186 #else1187 static snd_pcm_hardware_t snd_opti93x_playback = {1188 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1189 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),1190 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1191 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),1192 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_48000,1193 rate_min: 5512,1194 rate_max: 48000,1195 channels_min: 1,1196 channels_max: 2,1197 buffer_bytes_max: (128*1024),1198 period_bytes_min: 64,1199 period_bytes_max: (128*1024),1200 periods_min: 1,1201 periods_max: 1024,1202 fifo_size: 0,1203 };1204 1205 static snd_pcm_hardware_t snd_opti93x_capture = {1206 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1207 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START),1208 formats: (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |1209 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),1210 rates: SNDRV_PCM_RATE_8000_48000,1211 rate_min: 5512,1212 rate_max: 48000,1213 channels_min: 1,1214 channels_max: 2,1215 buffer_bytes_max: (128*1024),1216 period_bytes_min: 64,1217 period_bytes_max: (128*1024),1218 periods_min: 1,1219 periods_max: 1024,1220 fifo_size: 0,1221 };1222 #endif1223 1172 1224 1173 static int snd_opti93x_playback_open(snd_pcm_substream_t *substream) … … 1234 1183 runtime->hw = snd_opti93x_playback; 1235 1184 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max); 1236 snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max);1237 1185 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); 1238 1186 return error; … … 1250 1198 snd_pcm_set_sync(substream); 1251 1199 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); 1252 snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max);1253 1200 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); 1254 1201 return error; … … 1314 1261 disable_dma(chip->dma2); 1315 1262 free_dma(chip->dma2); 1263 } 1264 if (chip->irq >= 0) { 1265 free_irq(chip->irq, chip); 1316 1266 } 1317 1267 snd_magic_kfree(chip); … … 1339 1289 opti93x_t **rcodec) 1340 1290 { 1341 #ifdef TARGET_OS21342 1291 static snd_device_ops_t ops = { 1343 snd_opti93x_dev_free,0, 01292 .dev_free = snd_opti93x_dev_free, 1344 1293 }; 1345 #else1346 static snd_device_ops_t ops = {1347 dev_free: snd_opti93x_dev_free,1348 };1349 #endif1350 1294 int error; 1351 1295 opti93x_t *codec; … … 1374 1318 codec->dma2 = chip->dma2; 1375 1319 1320 if (request_irq(chip->irq, snd_opti93x_interrupt, SA_INTERRUPT, DRIVER_NAME" - WSS", codec)) { 1321 snd_opti93x_free(codec); 1322 return -EBUSY; 1323 } 1324 1376 1325 codec->card = card; 1377 1326 codec->port = chip->wss_base + 4; … … 1390 1339 1391 1340 /* Register device */ 1392 if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, c hip, &ops)) < 0) {1341 if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, codec, &ops)) < 0) { 1393 1342 snd_opti93x_free(codec); 1394 1343 return error; … … 1399 1348 } 1400 1349 1401 #ifdef TARGET_OS21402 1350 static snd_pcm_ops_t snd_opti93x_playback_ops = { 1403 /* open: */ snd_opti93x_playback_open, 1404 /* close: */ snd_opti93x_playback_close, 1405 /* ioctl: */ snd_pcm_lib_ioctl, 1406 /* hw_params:*/ snd_opti93x_hw_params, 1407 /* hw_free: */ snd_opti93x_hw_free, 1408 /* prepare: */ snd_opti93x_playback_prepare, 1409 /* trigger: */ snd_opti93x_playback_trigger, 1410 /* pointer: */ snd_opti93x_playback_pointer, 1411 0, 0 1351 .open = snd_opti93x_playback_open, 1352 .close = snd_opti93x_playback_close, 1353 .ioctl = snd_pcm_lib_ioctl, 1354 .hw_params = snd_opti93x_hw_params, 1355 .hw_free = snd_opti93x_hw_free, 1356 .prepare = snd_opti93x_playback_prepare, 1357 .trigger = snd_opti93x_playback_trigger, 1358 .pointer = snd_opti93x_playback_pointer, 1412 1359 }; 1413 1360 1414 1361 static snd_pcm_ops_t snd_opti93x_capture_ops = { 1415 /* open: */ snd_opti93x_capture_open, 1416 /* close: */ snd_opti93x_capture_close, 1417 /* ioctl: */ snd_pcm_lib_ioctl, 1418 /* hw_params:*/ snd_opti93x_hw_params, 1419 /* hw_free: */ snd_opti93x_hw_free, 1420 /* prepare: */ snd_opti93x_capture_prepare, 1421 /* trigger: */ snd_opti93x_capture_trigger, 1422 /* pointer: */ snd_opti93x_capture_pointer, 1423 0, 0 1424 }; 1425 #else 1426 static snd_pcm_ops_t snd_opti93x_playback_ops = { 1427 open: snd_opti93x_playback_open, 1428 close: snd_opti93x_playback_close, 1429 ioctl: snd_pcm_lib_ioctl, 1430 hw_params: snd_opti93x_hw_params, 1431 hw_free: snd_opti93x_hw_free, 1432 prepare: snd_opti93x_playback_prepare, 1433 trigger: snd_opti93x_playback_trigger, 1434 pointer: snd_opti93x_playback_pointer, 1362 .open = snd_opti93x_capture_open, 1363 .close = snd_opti93x_capture_close, 1364 .ioctl = snd_pcm_lib_ioctl, 1365 .hw_params = snd_opti93x_hw_params, 1366 .hw_free = snd_opti93x_hw_free, 1367 .prepare = snd_opti93x_capture_prepare, 1368 .trigger = snd_opti93x_capture_trigger, 1369 .pointer = snd_opti93x_capture_pointer, 1435 1370 }; 1436 1437 static snd_pcm_ops_t snd_opti93x_capture_ops = {1438 open: snd_opti93x_capture_open,1439 close: snd_opti93x_capture_close,1440 ioctl: snd_pcm_lib_ioctl,1441 hw_params: snd_opti93x_hw_params,1442 hw_free: snd_opti93x_hw_free,1443 prepare: snd_opti93x_capture_prepare,1444 trigger: snd_opti93x_capture_trigger,1445 pointer: snd_opti93x_capture_pointer,1446 };1447 #endif1448 1371 1449 1372 static void snd_opti93x_pcm_free(snd_pcm_t *pcm) … … 1527 1450 change = left != chip->image[OPTi93X_MIXOUT_LEFT] || 1528 1451 right != chip->image[OPTi93X_MIXOUT_RIGHT]; 1529 snd_opti93x_out (chip, OPTi93X_MIXOUT_LEFT, left);1530 snd_opti93x_out (chip, OPTi93X_MIXOUT_RIGHT, right);1452 snd_opti93x_out_image(chip, OPTi93X_MIXOUT_LEFT, left); 1453 snd_opti93x_out_image(chip, OPTi93X_MIXOUT_RIGHT, right); 1531 1454 spin_unlock_irqrestore(&chip->lock, flags); 1532 1455 return change; … … 1535 1458 #if 0 1536 1459 1537 #ifdef TARGET_OS21538 1460 #define OPTi93X_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1539 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1540 0, 0, snd_opti93x_info_single, \ 1541 snd_opti93x_get_single, snd_opti93x_put_single, \ 1542 reg | (shift << 8) | (mask << 16) | (invert << 24) } 1543 #else 1544 #define OPTi93X_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1545 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1546 info: snd_opti93x_info_single, \ 1547 get: snd_opti93x_get_single, put: snd_opti93x_put_single, \ 1548 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 1549 #endif 1461 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1462 .info = snd_opti93x_info_single, \ 1463 .get = snd_opti93x_get_single, .put = snd_opti93x_put_single, \ 1464 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 1550 1465 1551 1466 static int snd_opti93x_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1602 1517 #endif /* single */ 1603 1518 1604 #ifdef TARGET_OS21605 1519 #define OPTi93X_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1606 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1607 0, 0, snd_opti93x_info_double, \ 1608 snd_opti93x_get_double, snd_opti93x_put_double, \ 1609 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1610 #else 1611 #define OPTi93X_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1612 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1613 info: snd_opti93x_info_double, \ 1614 get: snd_opti93x_get_double, put: snd_opti93x_put_double, \ 1615 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1616 #endif 1520 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1521 .info = snd_opti93x_info_double, \ 1522 .get = snd_opti93x_get_double, .put = snd_opti93x_put_double, \ 1523 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1617 1524 1618 1525 #define OPTi93X_DOUBLE_INVERT_INVERT(xctl) \ … … 1624 1531 static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1625 1532 { 1626 int mask = (kcontrol->private_value >> 16) & 0xff;1533 int mask = (kcontrol->private_value >> 24) & 0xff; 1627 1534 1628 1535 uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER; … … 1680 1587 val2 = (chip->image[right_reg] & ~(mask << shift_right)) | val2; 1681 1588 change = val1 != chip->image[left_reg] || val2 != chip->image[right_reg]; 1682 snd_opti93x_out (chip, left_reg, val1);1683 snd_opti93x_out (chip, right_reg, val1);1589 snd_opti93x_out_image(chip, left_reg, val1); 1590 snd_opti93x_out_image(chip, right_reg, val2); 1684 1591 spin_unlock_irqrestore(&chip->lock, flags); 1685 1592 return change; … … 1690 1597 static snd_kcontrol_new_t snd_opti93x_controls[] = { 1691 1598 OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), 1692 OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 0, 0, 31, 1),1599 OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1), 1693 1600 OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1), 1694 OPTi93X_DOUBLE("PCM Playback Volume", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 0, 0, 31, 0),1601 OPTi93X_DOUBLE("PCM Playback Volume", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 0, 0, 31, 1), 1695 1602 OPTi93X_DOUBLE("FM Playback Switch", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 7, 7, 1, 1), 1696 OPTi93X_DOUBLE("FM Playback Volume", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 0, 0, 15, 1),1603 OPTi93X_DOUBLE("FM Playback Volume", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 1, 1, 15, 1), 1697 1604 OPTi93X_DOUBLE("Line Playback Switch", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 7, 7, 1, 1), 1698 OPTi93X_DOUBLE("Line Playback Volume", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 0, 0, 15, 1),1605 OPTi93X_DOUBLE("Line Playback Volume", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 1, 1, 15, 1), 1699 1606 OPTi93X_DOUBLE("Mic Playback Switch", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1), 1700 OPTi93X_DOUBLE("Mic Playback Volume", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 0, 0, 15, 1),1607 OPTi93X_DOUBLE("Mic Playback Volume", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1), 1701 1608 OPTi93X_DOUBLE("Mic Boost", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 5, 5, 1, 1), 1702 1609 OPTi93X_DOUBLE("CD Playback Switch", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 7, 7, 1, 1), 1703 OPTi93X_DOUBLE("CD Playback Volume", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 0, 0, 15, 1),1610 OPTi93X_DOUBLE("CD Playback Volume", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 1, 1, 15, 1), 1704 1611 OPTi93X_DOUBLE("Aux Playback Switch", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1), 1705 OPTi93X_DOUBLE("Aux Playback Volume", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 0, 0, 15, 1),1612 OPTi93X_DOUBLE("Aux Playback Volume", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1), 1706 1613 OPTi93X_DOUBLE("Capture Volume", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 0, 0, 15, 0), 1707 1614 { 1708 #ifdef TARGET_OS2 1709 SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, 1710 "Capture Source", 0, 0, 0, 1711 snd_opti93x_info_mux, 1712 snd_opti93x_get_mux, 1713 snd_opti93x_put_mux, 1714 #else 1715 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1716 name: "Capture Source", 1717 info: snd_opti93x_info_mux, 1718 get: snd_opti93x_get_mux, 1719 put: snd_opti93x_put_mux, 1720 #endif 1615 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1616 .name = "Capture Source", 1617 .info = snd_opti93x_info_mux, 1618 .get = snd_opti93x_get_mux, 1619 .put = snd_opti93x_put_mux, 1721 1620 } 1722 1621 }; … … 1759 1658 { 1760 1659 int i, err; 1761 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};1762 1660 1763 1661 #ifndef OPTi93X … … 1767 1665 if ((err = snd_opti9xx_init(chip, i)) < 0) 1768 1666 return err; 1769 chip->mc_base_size = opti9xx_mc_size[i]; 1667 1770 1668 if (check_region(chip->mc_base, chip->mc_base_size)) 1771 1669 continue; … … 1783 1681 if ((err = snd_opti9xx_init(chip, i)) < 0) 1784 1682 return err; 1785 chip->mc_base_size = opti9xx_mc_size[i]; 1683 1786 1684 if (check_region(chip->mc_base, chip->mc_base_size)) 1787 1685 continue; … … 2015 1913 { 2016 1914 static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; 2017 static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x3 10, -1};1915 static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1}; 2018 1916 #ifdef OPTi93X 2019 1917 static int possible_irqs[] = {5, 9, 10, 11, 7, -1}; -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c
r207 r210 21 21 */ 22 22 23 #define __NO_VERSION__24 23 #include <sound/driver.h> 25 24 #include <linux/wait.h> … … 866 865 } 867 866 868 #ifdef TARGET_OS2869 867 static snd_kcontrol_new_t mixer_bass_control = 870 868 { 871 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,872 "Synth Tone Control - Bass",0,0, 0,873 mixer_bass_treble_info,874 mixer_bass_treble_get,875 mixer_bass_treble_put,876 0,869 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 870 .name = "Synth Tone Control - Bass", 871 .info = mixer_bass_treble_info, 872 .get = mixer_bass_treble_get, 873 .put = mixer_bass_treble_put, 874 .private_value = 0, 877 875 }; 878 876 879 877 static snd_kcontrol_new_t mixer_treble_control = 880 878 { 881 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 882 "Synth Tone Control - Treble",0,0, 0, 883 mixer_bass_treble_info, 884 mixer_bass_treble_get, 885 mixer_bass_treble_put, 886 1, 887 }; 888 #else 889 static snd_kcontrol_new_t mixer_bass_control = 890 { 891 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 892 name: "Synth Tone Control - Bass", 893 info: mixer_bass_treble_info, 894 get: mixer_bass_treble_get, 895 put: mixer_bass_treble_put, 896 private_value: 0, 897 }; 898 899 static snd_kcontrol_new_t mixer_treble_control = 900 { 901 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 902 name: "Synth Tone Control - Treble", 903 info: mixer_bass_treble_info, 904 get: mixer_bass_treble_get, 905 put: mixer_bass_treble_put, 906 private_value: 1, 907 }; 908 #endif 879 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 880 .name = "Synth Tone Control - Treble", 881 .info = mixer_bass_treble_info, 882 .get = mixer_bass_treble_get, 883 .put = mixer_bass_treble_put, 884 .private_value = 1, 885 }; 909 886 910 887 /* … … 955 932 } 956 933 957 #ifdef TARGET_OS2958 934 static snd_kcontrol_new_t mixer_chorus_mode_control = 959 935 { 960 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,961 "Chorus Mode",0,0, 0,962 mixer_chorus_reverb_info,963 mixer_chorus_reverb_get,964 mixer_chorus_reverb_put,965 1,936 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 937 .name = "Chorus Mode", 938 .info = mixer_chorus_reverb_info, 939 .get = mixer_chorus_reverb_get, 940 .put = mixer_chorus_reverb_put, 941 .private_value = 1, 966 942 }; 967 943 968 944 static snd_kcontrol_new_t mixer_reverb_mode_control = 969 945 { 970 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 971 "Reverb Mode",0,0,0, 972 mixer_chorus_reverb_info, 973 mixer_chorus_reverb_get, 974 mixer_chorus_reverb_put, 975 0, 976 }; 977 #else 978 static snd_kcontrol_new_t mixer_chorus_mode_control = 979 { 980 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 981 name: "Chorus Mode", 982 info: mixer_chorus_reverb_info, 983 get: mixer_chorus_reverb_get, 984 put: mixer_chorus_reverb_put, 985 private_value: 1, 986 }; 987 988 static snd_kcontrol_new_t mixer_reverb_mode_control = 989 { 990 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 991 name: "Reverb Mode", 992 info: mixer_chorus_reverb_info, 993 get: mixer_chorus_reverb_get, 994 put: mixer_chorus_reverb_put, 995 private_value: 0, 996 }; 997 #endif 946 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 947 .name = "Reverb Mode", 948 .info = mixer_chorus_reverb_info, 949 .get = mixer_chorus_reverb_get, 950 .put = mixer_chorus_reverb_put, 951 .private_value = 0, 952 }; 998 953 999 954 /* … … 1039 994 } 1040 995 1041 #ifdef TARGET_OS21042 996 static snd_kcontrol_new_t mixer_fm_chorus_depth_control = 1043 997 { 1044 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1045 "FM Chorus Depth",0,0,0,1046 mixer_fm_depth_info,1047 mixer_fm_depth_get,1048 mixer_fm_depth_put,1049 1,998 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 999 .name = "FM Chorus Depth", 1000 .info = mixer_fm_depth_info, 1001 .get = mixer_fm_depth_get, 1002 .put = mixer_fm_depth_put, 1003 .private_value = 1, 1050 1004 }; 1051 1005 1052 1006 static snd_kcontrol_new_t mixer_fm_reverb_depth_control = 1053 1007 { 1054 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1055 "FM Reverb Depth",0,0,0, 1056 mixer_fm_depth_info, 1057 mixer_fm_depth_get, 1058 mixer_fm_depth_put, 1059 0, 1060 }; 1061 #else 1062 static snd_kcontrol_new_t mixer_fm_chorus_depth_control = 1063 { 1064 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1065 name: "FM Chorus Depth", 1066 info: mixer_fm_depth_info, 1067 get: mixer_fm_depth_get, 1068 put: mixer_fm_depth_put, 1069 private_value: 1, 1070 }; 1071 1072 static snd_kcontrol_new_t mixer_fm_reverb_depth_control = 1073 { 1074 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1075 name: "FM Reverb Depth", 1076 info: mixer_fm_depth_info, 1077 get: mixer_fm_depth_get, 1078 put: mixer_fm_depth_put, 1079 private_value: 0, 1080 }; 1081 #endif 1008 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1009 .name = "FM Reverb Depth", 1010 .info = mixer_fm_depth_info, 1011 .get = mixer_fm_depth_get, 1012 .put = mixer_fm_depth_put, 1013 .private_value = 0, 1014 }; 1015 1082 1016 1083 1017 static snd_kcontrol_new_t *mixer_defs[EMU8000_NUM_CONTROLS] = { … … 1156 1090 emu8000_t *hw; 1157 1091 int err; 1158 #ifdef TARGET_OS21159 1092 static snd_device_ops_t ops = { 1160 snd_emu8000_dev_free,0,01093 .dev_free = snd_emu8000_dev_free, 1161 1094 }; 1162 #else1163 static snd_device_ops_t ops = {1164 dev_free: snd_emu8000_dev_free,1165 };1166 #endif1167 1095 1168 1096 if (awe_ret) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_callback.c
r207 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include "emu8000_local.h" 24 23 #include <sound/asoundef.h> … … 60 59 * set up operators 61 60 */ 62 #ifdef TARGET_OS263 61 static snd_emux_operators_t emu8000_ops = { 64 THIS_MODULE, 65 get_voice, 66 start_voice, 67 trigger_voice, 68 release_voice, 69 update_voice, 70 terminate_voice, 71 0, 72 reset_voice, 73 snd_emu8000_sample_new, 74 snd_emu8000_sample_free, 75 snd_emu8000_sample_reset, 76 load_fx, 77 sysex, 78 #ifdef CONFIG_SND_OSSEMUL 79 oss_ioctl, 62 .owner = THIS_MODULE, 63 .get_voice = get_voice, 64 .prepare = start_voice, 65 .trigger = trigger_voice, 66 .release = release_voice, 67 .update = update_voice, 68 .terminate = terminate_voice, 69 .reset = reset_voice, 70 .sample_new = snd_emu8000_sample_new, 71 .sample_free = snd_emu8000_sample_free, 72 .sample_reset = snd_emu8000_sample_reset, 73 .load_fx = load_fx, 74 .sysex = sysex, 75 #ifdef CONFIG_SND_SEQUENCER_OSS 76 .oss_ioctl = oss_ioctl, 80 77 #endif 81 78 }; 82 #else83 static snd_emux_operators_t emu8000_ops = {84 owner: THIS_MODULE,85 get_voice: get_voice,86 prepare: start_voice,87 trigger: trigger_voice,88 release: release_voice,89 update: update_voice,90 terminate: terminate_voice,91 reset: reset_voice,92 sample_new: snd_emu8000_sample_new,93 sample_free: snd_emu8000_sample_free,94 sample_reset: snd_emu8000_sample_reset,95 load_fx: load_fx,96 sysex: sysex,97 #ifdef CONFIG_SND_SEQUENCER_OSS98 oss_ioctl: oss_ioctl,99 #endif100 };101 #endif102 79 103 80 void -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_patch.c
r32 r210 17 17 * You should have received a copy of the GNU General Public License 18 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 */ 21 21 22 22 #include "emu8000_local.h" 23 #include <asm/uaccess.h> 23 24 24 25 MODULE_PARM(emu8000_reset_addr, "i"); … … 230 231 write_word(emu, &dram_offset, s); 231 232 233 /* we may take too long time in this loop. 234 * so give controls back to kernel if needed. 235 */ 236 if (need_resched()) { 237 if (current->state != TASK_RUNNING) 238 set_current_state(TASK_RUNNING); 239 schedule(); 240 } 241 232 242 if (i == sp->v.loopend && 233 243 (sp->v.mode_flags & (SNDRV_SFNT_SAMPLE_BIDIR_LOOP|SNDRV_SFNT_SAMPLE_REVERSE_LOOP))) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c
r207 r210 82 82 static struct isapnp_card_id snd_es968_pnpids[] __devinitdata = { 83 83 { 84 #ifdef TARGET_OS285 0, ISAPNP_CARD_ID('E','S','S',0x0968),86 { ISAPNP_DEVICE_ID('E','S','S',0x0968), }87 #else88 84 ISAPNP_CARD_ID('E','S','S',0x0968), 89 devs: { ISAPNP_DEVICE_ID('E','S','S',0x0968), } 90 #endif 85 .devs = { ISAPNP_DEVICE_ID('E','S','S',0x0968), } 91 86 }, 92 87 { ISAPNP_CARD_END, } -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c
r207 r210 252 252 /* Note: This card has also a CTL0051:StereoEnhance device!!! */ 253 253 ISAPNP_SBAWE('C','T','L',0x0045,0x0031,0x0021), 254 /* Sound Blaster AWE 32 PnP */ 255 ISAPNP_SBAWE('C','T','L',0x0046,0x0031,0x0021), 254 256 /* Sound Blaster AWE 32 PnP */ 255 257 ISAPNP_SBAWE('C','T','L',0x0047,0x0031,0x0021), -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_csp.c
r92 r210 1011 1011 #ifdef TARGET_OS2 1012 1012 static snd_kcontrol_new_t snd_sb_qsound_switch = { 1013 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1014 "3D Control - Switch",0,0, 0,1015 1016 1017 snd_sb_qsound_switch_put,0 1013 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1014 .name = "3D Control - Switch", 1015 .info = snd_sb_qsound_switch_info, 1016 .get = snd_sb_qsound_switch_get, 1017 .put = snd_sb_qsound_switch_put 1018 1018 }; 1019 1019 1020 1020 static snd_kcontrol_new_t snd_sb_qsound_space = { 1021 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1022 "3D Control - Space",0,0, 0,1023 1024 1025 snd_sb_qsound_space_put,0 1021 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1022 .name = "3D Control - Space", 1023 .info = snd_sb_qsound_space_info, 1024 .get = snd_sb_qsound_space_get, 1025 .put = snd_sb_qsound_space_put 1026 1026 }; 1027 #else1028 static snd_kcontrol_new_t snd_sb_qsound_switch = {1029 iface: SNDRV_CTL_ELEM_IFACE_MIXER,1030 name: "3D Control - Switch",1031 info: snd_sb_qsound_switch_info,1032 get: snd_sb_qsound_switch_get,1033 put: snd_sb_qsound_switch_put1034 };1035 1036 static snd_kcontrol_new_t snd_sb_qsound_space = {1037 iface: SNDRV_CTL_ELEM_IFACE_MIXER,1038 name: "3D Control - Space",1039 info: snd_sb_qsound_space_info,1040 get: snd_sb_qsound_space_get,1041 put: snd_sb_qsound_space_put1042 };1043 #endif1044 1027 1045 1028 static int snd_sb_qsound_build(snd_sb_csp_t * p) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_main.c
r112 r210 468 468 static snd_pcm_hardware_t snd_sb16_playback = 469 469 { 470 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |470 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 471 471 SNDRV_PCM_INFO_MMAP_VALID), 472 /* formats: */0,473 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,474 /* rate_min: */4000,475 /* rate_max: */44100,476 /* channels_min: */1,477 /* channels_max: */2,478 /* buffer_bytes_max: */(128*1024),479 /* period_bytes_min: */64,480 /* period_bytes_max: */(128*1024),481 /* periods_min: */1,482 /* periods_max: */1024,483 /* fifo_size: */0,472 .formats = 0, 473 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100, 474 .rate_min = 4000, 475 .rate_max = 44100, 476 .channels_min = 1, 477 .channels_max = 2, 478 .buffer_bytes_max = (128*1024), 479 .period_bytes_min = 64, 480 .period_bytes_max = (128*1024), 481 .periods_min = 1, 482 .periods_max = 1024, 483 .fifo_size = 0, 484 484 }; 485 485 486 486 static snd_pcm_hardware_t snd_sb16_capture = 487 487 { 488 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |488 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 489 489 SNDRV_PCM_INFO_MMAP_VALID), 490 /* formats: */0,491 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,492 /* rate_min: */4000,493 /* rate_max: */44100,494 /* channels_min: */1,495 /* channels_max: */2,496 /* buffer_bytes_max: */(128*1024),497 /* period_bytes_min: */64,498 /* period_bytes_max: */(128*1024),499 /* periods_min: */1,500 /* periods_max: */1024,501 /* fifo_size: */0,490 .formats = 0, 491 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100, 492 .rate_min = 4000, 493 .rate_max = 44100, 494 .channels_min = 1, 495 .channels_max = 2, 496 .buffer_bytes_max = (128*1024), 497 .period_bytes_min = 64, 498 .period_bytes_max = (128*1024), 499 .periods_min = 1, 500 .periods_max = 1024, 501 .fifo_size = 0, 502 502 }; 503 #else504 static snd_pcm_hardware_t snd_sb16_playback =505 {506 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |507 SNDRV_PCM_INFO_MMAP_VALID),508 formats: 0,509 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,510 rate_min: 4000,511 rate_max: 44100,512 channels_min: 1,513 channels_max: 2,514 buffer_bytes_max: (128*1024),515 period_bytes_min: 64,516 period_bytes_max: (128*1024),517 periods_min: 1,518 periods_max: 1024,519 fifo_size: 0,520 };521 522 static snd_pcm_hardware_t snd_sb16_capture =523 {524 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |525 SNDRV_PCM_INFO_MMAP_VALID),526 formats: 0,527 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_44100,528 rate_min: 4000,529 rate_max: 44100,530 channels_min: 1,531 channels_max: 2,532 buffer_bytes_max: (128*1024),533 period_bytes_min: 64,534 period_bytes_max: (128*1024),535 periods_min: 1,536 periods_max: 1024,537 fifo_size: 0,538 };539 #endif540 503 541 504 /* … … 763 726 764 727 snd_kcontrol_new_t snd_sb16_dma_control = { 765 #ifdef TARGET_OS2 766 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 767 "16-bit DMA Allocation",0,0, 0, 768 snd_sb16_dma_control_info, 769 snd_sb16_dma_control_get, 770 snd_sb16_dma_control_put,0 771 #else 772 iface: SNDRV_CTL_ELEM_IFACE_PCM, 773 name: "16-bit DMA Allocation", 774 info: snd_sb16_dma_control_info, 775 get: snd_sb16_dma_control_get, 776 put: snd_sb16_dma_control_put 777 #endif 728 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 729 .name = "16-bit DMA Allocation", 730 .info = snd_sb16_dma_control_info, 731 .get = snd_sb16_dma_control_get, 732 .put = snd_sb16_dma_control_put 778 733 }; 779 734 … … 871 826 } 872 827 873 #ifdef TARGET_OS2874 828 static snd_pcm_ops_t snd_sb16_playback_ops = { 875 876 877 878 879 880 881 882 snd_sb16_playback_pointer,0,0 829 .open = snd_sb16_playback_open, 830 .close = snd_sb16_playback_close, 831 .ioctl = snd_pcm_lib_ioctl, 832 .hw_params = snd_sb16_hw_params, 833 .hw_free = snd_sb16_hw_free, 834 .prepare = snd_sb16_playback_prepare, 835 .trigger = snd_sb16_playback_trigger, 836 .pointer = snd_sb16_playback_pointer, 883 837 }; 884 838 885 839 static snd_pcm_ops_t snd_sb16_capture_ops = { 886 887 888 889 890 891 892 893 snd_sb16_capture_pointer,0 840 .open = snd_sb16_capture_open, 841 .close = snd_sb16_capture_close, 842 .ioctl = snd_pcm_lib_ioctl, 843 .hw_params = snd_sb16_hw_params, 844 .hw_free = snd_sb16_hw_free, 845 .prepare = snd_sb16_capture_prepare, 846 .trigger = snd_sb16_capture_trigger, 847 .pointer = snd_sb16_capture_pointer, 894 848 }; 895 #else896 static snd_pcm_ops_t snd_sb16_playback_ops = {897 open: snd_sb16_playback_open,898 close: snd_sb16_playback_close,899 ioctl: snd_pcm_lib_ioctl,900 hw_params: snd_sb16_hw_params,901 hw_free: snd_sb16_hw_free,902 prepare: snd_sb16_playback_prepare,903 trigger: snd_sb16_playback_trigger,904 pointer: snd_sb16_playback_pointer,905 };906 907 static snd_pcm_ops_t snd_sb16_capture_ops = {908 open: snd_sb16_capture_open,909 close: snd_sb16_capture_close,910 ioctl: snd_pcm_lib_ioctl,911 hw_params: snd_sb16_hw_params,912 hw_free: snd_sb16_hw_free,913 prepare: snd_sb16_capture_prepare,914 trigger: snd_sb16_capture_trigger,915 pointer: snd_sb16_capture_pointer,916 };917 #endif918 849 919 850 static void snd_sb16dsp_pcm_free(snd_pcm_t *pcm) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8_main.c
r92 r210 49 49 #define SB8_RATE(v) (SB8_CLOCK / SB8_DEN(v)) 50 50 51 #ifdef TARGET_OS252 51 static ratnum_t clock = { 53 54 55 56 52 .num = SB8_CLOCK, 53 .den_min = 1, 54 .den_max = 256, 55 .den_step = 1, 57 56 }; 58 57 59 58 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clock = { 60 61 59 .nrats = 1, 60 .rats = &clock, 62 61 }; 63 62 64 63 static ratnum_t stereo_clocks[] = { 65 64 { 66 67 68 69 65 .num = SB8_CLOCK, 66 .den_min = SB8_DEN(22050), 67 .den_max = SB8_DEN(22050), 68 .den_step = 1, 70 69 }, 71 70 { 72 SB8_CLOCK, 73 SB8_DEN(11025), 74 SB8_DEN(11025), 75 1, 76 } 77 }; 78 #else 79 static ratnum_t clock = { 80 num: SB8_CLOCK, 81 den_min: 1, 82 den_max: 256, 83 den_step: 1, 84 }; 85 86 static snd_pcm_hw_constraint_ratnums_t hw_constraints_clock = { 87 nrats: 1, 88 rats: &clock, 89 }; 90 91 static ratnum_t stereo_clocks[] = { 92 { 93 num: SB8_CLOCK, 94 den_min: SB8_DEN(22050), 95 den_max: SB8_DEN(22050), 96 den_step: 1, 97 }, 98 { 99 num: SB8_CLOCK, 100 den_min: SB8_DEN(11025), 101 den_max: SB8_DEN(11025), 102 den_step: 1, 103 } 104 }; 105 #endif 71 .num = SB8_CLOCK, 72 .den_min = SB8_DEN(11025), 73 .den_max = SB8_DEN(11025), 74 .den_step = 1, 75 } 76 }; 106 77 107 78 static int snd_sb8_hw_constraint_rate_channels(snd_pcm_hw_params_t *params, … … 418 389 */ 419 390 420 #ifdef TARGET_OS2421 391 static snd_pcm_hardware_t snd_sb8_playback = 422 392 { 423 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |393 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 424 394 SNDRV_PCM_INFO_MMAP_VALID), 425 /* formats: */SNDRV_PCM_FMTBIT_U8,426 /* rates: */(SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 |395 .formats = SNDRV_PCM_FMTBIT_U8, 396 .rates = (SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 | 427 397 SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050), 428 /* rate_min: */4000,429 /* rate_max: */23000,430 /* channels_min: */1,431 /* channels_max: */1,432 /* buffer_bytes_max: */65536,433 /* period_bytes_min: */64,434 /* period_bytes_max: */65536,435 /* periods_min: */1,436 /* periods_max: */1024,437 /* fifo_size: */0,398 .rate_min = 4000, 399 .rate_max = 23000, 400 .channels_min = 1, 401 .channels_max = 1, 402 .buffer_bytes_max = 65536, 403 .period_bytes_min = 64, 404 .period_bytes_max = 65536, 405 .periods_min = 1, 406 .periods_max = 1024, 407 .fifo_size = 0, 438 408 }; 439 409 440 410 static snd_pcm_hardware_t snd_sb8_capture = 441 411 { 442 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |412 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 443 413 SNDRV_PCM_INFO_MMAP_VALID), 444 /* formats: */SNDRV_PCM_FMTBIT_U8,445 /* rates: */(SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 |414 .formats = SNDRV_PCM_FMTBIT_U8, 415 .rates = (SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 | 446 416 SNDRV_PCM_RATE_11025), 447 /* rate_min: */ 4000, 448 /* rate_max: */ 13000, 449 /* channels_min: */ 1, 450 /* channels_max: */ 1, 451 /* buffer_bytes_max: */ 65536, 452 /* period_bytes_min: */ 64, 453 /* period_bytes_max: */ 65536, 454 /* periods_min: */ 1, 455 /* periods_max: */ 1024, 456 /* fifo_size: */ 0, 457 }; 458 #else 459 static snd_pcm_hardware_t snd_sb8_playback = 460 { 461 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 462 SNDRV_PCM_INFO_MMAP_VALID), 463 formats: SNDRV_PCM_FMTBIT_U8, 464 rates: (SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 | 465 SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050), 466 rate_min: 4000, 467 rate_max: 23000, 468 channels_min: 1, 469 channels_max: 1, 470 buffer_bytes_max: 65536, 471 period_bytes_min: 64, 472 period_bytes_max: 65536, 473 periods_min: 1, 474 periods_max: 1024, 475 fifo_size: 0, 476 }; 477 478 static snd_pcm_hardware_t snd_sb8_capture = 479 { 480 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 481 SNDRV_PCM_INFO_MMAP_VALID), 482 formats: SNDRV_PCM_FMTBIT_U8, 483 rates: (SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000 | 484 SNDRV_PCM_RATE_11025), 485 rate_min: 4000, 486 rate_max: 13000, 487 channels_min: 1, 488 channels_max: 1, 489 buffer_bytes_max: 65536, 490 period_bytes_min: 64, 491 period_bytes_max: 65536, 492 periods_min: 1, 493 periods_max: 1024, 494 fifo_size: 0, 495 }; 496 #endif 417 .rate_min = 4000, 418 .rate_max = 13000, 419 .channels_min = 1, 420 .channels_max = 1, 421 .buffer_bytes_max = 65536, 422 .period_bytes_min = 64, 423 .period_bytes_max = 65536, 424 .periods_min = 1, 425 .periods_max = 1024, 426 .fifo_size = 0, 427 }; 497 428 498 429 /* … … 563 494 */ 564 495 565 #ifdef TARGET_OS2566 496 static snd_pcm_ops_t snd_sb8_playback_ops = { 567 568 569 570 571 572 573 574 snd_sb8_playback_pointer,0,0 497 .open = snd_sb8_open, 498 .close = snd_sb8_close, 499 .ioctl = snd_pcm_lib_ioctl, 500 .hw_params = snd_sb8_hw_params, 501 .hw_free = snd_sb8_hw_free, 502 .prepare = snd_sb8_playback_prepare, 503 .trigger = snd_sb8_playback_trigger, 504 .pointer = snd_sb8_playback_pointer, 575 505 }; 576 506 577 507 static snd_pcm_ops_t snd_sb8_capture_ops = { 578 snd_sb8_open, 579 snd_sb8_close, 580 snd_pcm_lib_ioctl, 581 snd_sb8_hw_params, 582 snd_sb8_hw_free, 583 snd_sb8_capture_prepare, 584 snd_sb8_capture_trigger, 585 snd_sb8_capture_pointer,0,0 586 }; 587 #else 588 static snd_pcm_ops_t snd_sb8_playback_ops = { 589 open: snd_sb8_open, 590 close: snd_sb8_close, 591 ioctl: snd_pcm_lib_ioctl, 592 hw_params: snd_sb8_hw_params, 593 hw_free: snd_sb8_hw_free, 594 prepare: snd_sb8_playback_prepare, 595 trigger: snd_sb8_playback_trigger, 596 pointer: snd_sb8_playback_pointer, 597 }; 598 599 static snd_pcm_ops_t snd_sb8_capture_ops = { 600 open: snd_sb8_open, 601 close: snd_sb8_close, 602 ioctl: snd_pcm_lib_ioctl, 603 hw_params: snd_sb8_hw_params, 604 hw_free: snd_sb8_hw_free, 605 prepare: snd_sb8_capture_prepare, 606 trigger: snd_sb8_capture_trigger, 607 pointer: snd_sb8_capture_pointer, 608 }; 609 #endif 508 .open = snd_sb8_open, 509 .close = snd_sb8_close, 510 .ioctl = snd_pcm_lib_ioctl, 511 .hw_params = snd_sb8_hw_params, 512 .hw_free = snd_sb8_hw_free, 513 .prepare = snd_sb8_capture_prepare, 514 .trigger = snd_sb8_capture_trigger, 515 .pointer = snd_sb8_capture_pointer, 516 }; 610 517 611 518 static void snd_sb8dsp_pcm_free(snd_pcm_t *pcm) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8_midi.c
r32 r210 15 15 * You should have received a copy of the GNU General Public License 16 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 * 19 19 * -- … … 25 25 26 26 #include <sound/driver.h> 27 #include <asm/io.h> 28 #include <linux/time.h> 29 #include <sound/core.h> 27 30 #include <sound/sb.h> 28 31 … … 224 227 */ 225 228 226 #ifdef TARGET_OS2227 229 static snd_rawmidi_ops_t snd_sb8dsp_midi_output = 228 230 { 229 230 231 snd_sb8dsp_midi_output_trigger,0 231 .open = snd_sb8dsp_midi_output_open, 232 .close = snd_sb8dsp_midi_output_close, 233 .trigger = snd_sb8dsp_midi_output_trigger, 232 234 }; 233 235 234 236 static snd_rawmidi_ops_t snd_sb8dsp_midi_input = 235 237 { 236 237 238 snd_sb8dsp_midi_input_trigger,0 238 .open = snd_sb8dsp_midi_input_open, 239 .close = snd_sb8dsp_midi_input_close, 240 .trigger = snd_sb8dsp_midi_input_trigger, 239 241 }; 240 #else241 static snd_rawmidi_ops_t snd_sb8dsp_midi_output =242 {243 open: snd_sb8dsp_midi_output_open,244 close: snd_sb8dsp_midi_output_close,245 trigger: snd_sb8dsp_midi_output_trigger,246 };247 248 static snd_rawmidi_ops_t snd_sb8dsp_midi_input =249 {250 open: snd_sb8dsp_midi_input_open,251 close: snd_sb8dsp_midi_input_close,252 trigger: snd_sb8dsp_midi_input_trigger,253 };254 #endif255 242 256 243 int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb_common.c
r112 r210 165 165 str = "16 (ALS-4000)"; 166 166 break; 167 case SB_HW_DT019X: 168 str = "(DT019X/ALS007)"; 169 break; 167 170 default: 168 171 return -ENODEV; … … 210 213 struct snd_sb *chip; 211 214 int err; 212 #ifdef TARGET_OS2213 215 static snd_device_ops_t ops = { 214 snd_sbdsp_dev_free,0,0 216 .dev_free = snd_sbdsp_dev_free, 215 217 }; 216 #else217 static snd_device_ops_t ops = {218 dev_free: snd_sbdsp_dev_free,219 };220 #endif221 218 222 219 snd_assert(r_chip != NULL, return -EINVAL); -
GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c
r207 r210 72 72 #endif 73 73 MODULE_PARM(snd_cs4232_pcm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 74 MODULE_PARM_DESC(snd_ 4232_port, "Port # for CS4232 PCM interface.");75 MODULE_PARM_SYNTAX(snd_cs4232_p ort, SNDRV_PORT12_DESC);74 MODULE_PARM_DESC(snd_cs4232_pcm_port, "Port # for CS4232 PCM interface."); 75 MODULE_PARM_SYNTAX(snd_cs4232_pcm_port, SNDRV_PORT12_DESC); 76 76 MODULE_PARM(snd_cs4232_pcm_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 77 77 MODULE_PARM_DESC(snd_cs4232_pcm_irq, "IRQ # for CS4232 PCM interface."); … … 112 112 { 113 113 ISAPNP_CARD_ID('C','S','C',0x7532), /* Tropez */ 114 devs:{ ISAPNP_DEVICE_ID('C','S','C',0x0000), /* WSS */114 .devs = { ISAPNP_DEVICE_ID('C','S','C',0x0000), /* WSS */ 115 115 ISAPNP_DEVICE_ID('C','S','C',0x0010), /* CTRL */ 116 116 ISAPNP_DEVICE_ID('P','n','P',0xb006), /* MPU */ … … 119 119 { 120 120 ISAPNP_CARD_ID('C','S','C',0x7632), /* Tropez+ */ 121 devs:{ ISAPNP_DEVICE_ID('C','S','C',0x0000), /* WSS */121 .devs = { ISAPNP_DEVICE_ID('C','S','C',0x0000), /* WSS */ 122 122 ISAPNP_DEVICE_ID('C','S','C',0x0010), /* CTRL */ 123 123 ISAPNP_DEVICE_ID('P','n','P',0xb006), /* MPU */ -
GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_fx.c
r112 r210 17 17 */ 18 18 19 #define __NO_VERSION__20 19 #include <sound/driver.h> 21 20 #include <asm/io.h> -
GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_midi.c
r112 r210 49 49 50 50 #include <sound/driver.h> 51 #include <asm/io.h> 52 #include <linux/init.h> 53 #include <linux/time.h> 54 #include <linux/wait.h> 55 #include <sound/core.h> 51 56 #include <sound/snd_wavefront.h> 52 57 … … 555 560 snd_rawmidi_ops_t snd_wavefront_midi_output = 556 561 { 557 open:snd_wavefront_midi_output_open,558 close:snd_wavefront_midi_output_close,559 trigger:snd_wavefront_midi_output_trigger,562 .open = snd_wavefront_midi_output_open, 563 .close = snd_wavefront_midi_output_close, 564 .trigger = snd_wavefront_midi_output_trigger, 560 565 }; 561 566 562 567 snd_rawmidi_ops_t snd_wavefront_midi_input = 563 568 { 564 open:snd_wavefront_midi_input_open,565 close:snd_wavefront_midi_input_close,566 trigger:snd_wavefront_midi_input_trigger,569 .open = snd_wavefront_midi_input_open, 570 .close = snd_wavefront_midi_input_close, 571 .trigger = snd_wavefront_midi_input_trigger, 567 572 }; 568 573 -
GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_synth.c
r112 r210 21 21 */ 22 22 23 #define __NO_VERSION__24 23 #include <sound/driver.h> 25 24 #include <asm/io.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/ali5451/ali5451.c
r207 r210 1592 1592 static snd_pcm_hardware_t snd_ali_playback = 1593 1593 { 1594 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1594 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1595 1595 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1596 1596 SNDRV_PCM_INFO_MMAP_VALID | 1597 1597 SNDRV_PCM_INFO_RESUME | 1598 1598 SNDRV_PCM_INFO_SYNC_START), 1599 /* formats: */(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |1599 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 1600 1600 SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE), 1601 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1602 /* rate_min: */4000,1603 /* rate_max: */48000,1604 /* channels_min: */1,1605 /* channels_max: */2,1606 /* buffer_bytes_max: */(256*1024),1607 /* period_bytes_min: */64,1608 /* period_bytes_max: */(256*1024),1609 /* periods_min: */1,1610 /* periods_max: */1024,1611 /* fifo_size: */0,1601 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1602 .rate_min = 4000, 1603 .rate_max = 48000, 1604 .channels_min = 1, 1605 .channels_max = 2, 1606 .buffer_bytes_max = (256*1024), 1607 .period_bytes_min = 64, 1608 .period_bytes_max = (256*1024), 1609 .periods_min = 1, 1610 .periods_max = 1024, 1611 .fifo_size = 0, 1612 1612 }; 1613 1613 … … 1618 1618 static snd_pcm_hardware_t snd_ali_capture = 1619 1619 { 1620 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1620 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1621 1621 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1622 1622 SNDRV_PCM_INFO_MMAP_VALID | 1623 1623 SNDRV_PCM_INFO_RESUME | 1624 1624 SNDRV_PCM_INFO_SYNC_START), 1625 /* formats: */(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |1625 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 1626 1626 SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE), 1627 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1628 /* rate_min: */4000,1629 /* rate_max: */48000,1630 /* channels_min: */1,1631 /* channels_max: */2,1632 /* buffer_bytes_max: */(128*1024),1633 /* period_bytes_min: */64,1634 /* period_bytes_max: */(128*1024),1635 /* periods_min: */1,1636 /* periods_max: */1024,1637 /* fifo_size: */0,1627 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1628 .rate_min = 4000, 1629 .rate_max = 48000, 1630 .channels_min = 1, 1631 .channels_max = 2, 1632 .buffer_bytes_max = (128*1024), 1633 .period_bytes_min = 64, 1634 .period_bytes_max = (128*1024), 1635 .periods_min = 1, 1636 .periods_max = 1024, 1637 .fifo_size = 0, 1638 1638 }; 1639 1639 … … 1721 1721 } 1722 1722 1723 #ifdef TARGET_OS21724 1723 static snd_pcm_ops_t snd_ali_playback_ops = { 1725 1726 1727 1728 1729 1730 1731 1732 snd_ali_playback_pointer,0,0 1724 .open = snd_ali_playback_open, 1725 .close = snd_ali_playback_close, 1726 .ioctl = snd_ali_ioctl, 1727 .hw_params = snd_ali_playback_hw_params, 1728 .hw_free = snd_ali_playback_hw_free, 1729 .prepare = snd_ali_playback_prepare, 1730 .trigger = snd_ali_trigger, 1731 .pointer = snd_ali_playback_pointer, 1733 1732 }; 1734 1733 1735 1734 static snd_pcm_ops_t snd_ali_capture_ops = { 1736 1737 1738 1739 1740 1741 1742 1743 snd_ali_capture_pointer,0,0 1735 .open = snd_ali_capture_open, 1736 .close = snd_ali_capture_close, 1737 .ioctl = snd_ali_ioctl, 1738 .hw_params = snd_ali_capture_hw_params, 1739 .hw_free = snd_ali_capture_hw_free, 1740 .prepare = snd_ali_capture_prepare, 1741 .trigger = snd_ali_trigger, 1742 .pointer = snd_ali_capture_pointer, 1744 1743 }; 1745 #else1746 static snd_pcm_ops_t snd_ali_playback_ops = {1747 open: snd_ali_playback_open,1748 close: snd_ali_playback_close,1749 ioctl: snd_ali_ioctl,1750 hw_params: snd_ali_playback_hw_params,1751 hw_free: snd_ali_playback_hw_free,1752 prepare: snd_ali_playback_prepare,1753 trigger: snd_ali_trigger,1754 pointer: snd_ali_playback_pointer,1755 };1756 1757 static snd_pcm_ops_t snd_ali_capture_ops = {1758 open: snd_ali_capture_open,1759 close: snd_ali_capture_close,1760 ioctl: snd_ali_ioctl,1761 hw_params: snd_ali_capture_hw_params,1762 hw_free: snd_ali_capture_hw_free,1763 prepare: snd_ali_capture_prepare,1764 trigger: snd_ali_trigger,1765 pointer: snd_ali_capture_pointer,1766 };1767 #endif1768 1744 1769 1745 static void snd_ali_pcm_free(snd_pcm_t *pcm) … … 1801 1777 } 1802 1778 1803 1804 #ifdef TARGET_OS21805 1779 #define ALI5451_SPDIF(xname, xindex, value) \ 1806 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex,\ 1807 0, 0, snd_ali5451_spdif_info, snd_ali5451_spdif_get, \ 1808 snd_ali5451_spdif_put, 0, value} 1809 #else 1810 #define ALI5451_SPDIF(xname, xindex, value) \ 1811 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex,\ 1812 info: snd_ali5451_spdif_info, get: snd_ali5451_spdif_get, \ 1813 put: snd_ali5451_spdif_put, private_value: value} 1814 #endif 1780 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex,\ 1781 .info = snd_ali5451_spdif_info, .get = snd_ali5451_spdif_get, \ 1782 .put = snd_ali5451_spdif_put, .private_value = value} 1815 1783 1816 1784 static int snd_ali5451_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) … … 2317 2285 2318 2286 static struct pci_driver driver = { 2319 0,0,0,"ALI 5451",2320 2321 2322 snd_ali_remove,2287 .name = "ALI 5451", 2288 .id_table = snd_ali_ids, 2289 .probe = snd_ali_probe, 2290 .remove = __devexit_p(snd_ali_remove), 2323 2291 SND_PCI_PM_CALLBACKS 2324 2292 }; -
GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c
r207 r210 404 404 /*****************************************************************/ 405 405 406 #ifdef TARGET_OS2407 406 static snd_pcm_hardware_t snd_als4000_playback = 408 407 { 409 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |410 411 /* formats: */SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |412 413 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,414 /* rate_min: */4000,415 /* rate_max: */48000,416 /* channels_min: */1,417 /* channels_max: */2,418 /* buffer_bytes_max: */65536,419 /* period_bytes_min: */64,420 /* period_bytes_max: */65536,421 /* periods_min: */1,422 /* periods_max: */1024,423 /* fifo_size: */0408 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 409 SNDRV_PCM_INFO_MMAP_VALID), 410 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | 411 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE, /* formats */ 412 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 413 .rate_min = 4000, 414 .rate_max = 48000, 415 .channels_min = 1, 416 .channels_max = 2, 417 .buffer_bytes_max = 65536, 418 .period_bytes_min = 64, 419 .period_bytes_max = 65536, 420 .periods_min = 1, 421 .periods_max = 1024, 422 .fifo_size = 0 424 423 }; 425 424 426 425 static snd_pcm_hardware_t snd_als4000_capture = 427 426 { 428 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |429 430 /* formats: */SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |431 432 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,433 /* rate_min: */4000,434 /* rate_max: */48000,435 /* channels_min: */1,436 /* channels_max: */2,437 /* buffer_bytes_max: */65536,438 /* period_bytes_min: */64,439 /* period_bytes_max: */65536,440 /* periods_min: */1,441 /* periods_max: */1024,442 /* fifo_size: */0427 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 428 SNDRV_PCM_INFO_MMAP_VALID), 429 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 | 430 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE, /* formats */ 431 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 432 .rate_min = 4000, 433 .rate_max = 48000, 434 .channels_min = 1, 435 .channels_max = 2, 436 .buffer_bytes_max = 65536, 437 .period_bytes_min = 64, 438 .period_bytes_max = 65536, 439 .periods_min = 1, 440 .periods_max = 1024, 441 .fifo_size = 0 443 442 }; 444 #else445 static snd_pcm_hardware_t snd_als4000_playback =446 {447 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |448 SNDRV_PCM_INFO_MMAP_VALID),449 formats: SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |450 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE, /* formats */451 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,452 rate_min: 4000,453 rate_max: 48000,454 channels_min: 1,455 channels_max: 2,456 buffer_bytes_max: 65536,457 period_bytes_min: 64,458 period_bytes_max: 65536,459 periods_min: 1,460 periods_max: 1024,461 fifo_size: 0462 };463 464 static snd_pcm_hardware_t snd_als4000_capture =465 {466 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |467 SNDRV_PCM_INFO_MMAP_VALID),468 formats: SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |469 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE, /* formats */470 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,471 rate_min: 4000,472 rate_max: 48000,473 channels_min: 1,474 channels_max: 2,475 buffer_bytes_max: 65536,476 period_bytes_min: 64,477 period_bytes_max: 65536,478 periods_min: 1,479 periods_max: 1024,480 fifo_size: 0481 };482 #endif483 443 484 444 /*****************************************************************/ … … 524 484 /******************************************************************/ 525 485 526 #ifdef TARGET_OS2527 486 static snd_pcm_ops_t snd_als4000_playback_ops = { 528 529 530 531 532 533 534 535 snd_als4000_playback_pointer,0,0 487 .open = snd_als4000_playback_open, 488 .close = snd_als4000_playback_close, 489 .ioctl = snd_pcm_lib_ioctl, 490 .hw_params = snd_als4000_hw_params, 491 .hw_free = snd_als4000_hw_free, 492 .prepare = snd_als4000_playback_prepare, 493 .trigger = snd_als4000_playback_trigger, 494 .pointer = snd_als4000_playback_pointer 536 495 }; 537 496 538 497 static snd_pcm_ops_t snd_als4000_capture_ops = { 539 540 541 542 543 544 545 546 snd_als4000_capture_pointer,0,0 498 .open = snd_als4000_capture_open, 499 .close = snd_als4000_capture_close, 500 .ioctl = snd_pcm_lib_ioctl, 501 .hw_params = snd_als4000_hw_params, 502 .hw_free = snd_als4000_hw_free, 503 .prepare = snd_als4000_capture_prepare, 504 .trigger = snd_als4000_capture_trigger, 505 .pointer = snd_als4000_capture_pointer 547 506 }; 548 #else549 static snd_pcm_ops_t snd_als4000_playback_ops = {550 open: snd_als4000_playback_open,551 close: snd_als4000_playback_close,552 ioctl: snd_pcm_lib_ioctl,553 hw_params: snd_als4000_hw_params,554 hw_free: snd_als4000_hw_free,555 prepare: snd_als4000_playback_prepare,556 trigger: snd_als4000_playback_trigger,557 pointer: snd_als4000_playback_pointer558 };559 560 static snd_pcm_ops_t snd_als4000_capture_ops = {561 open: snd_als4000_capture_open,562 close: snd_als4000_capture_close,563 ioctl: snd_pcm_lib_ioctl,564 hw_params: snd_als4000_hw_params,565 hw_free: snd_als4000_hw_free,566 prepare: snd_als4000_capture_prepare,567 trigger: snd_als4000_capture_trigger,568 pointer: snd_als4000_capture_pointer569 };570 #endif571 507 572 508 static void snd_als4000_pcm_free(snd_pcm_t *pcm) … … 781 717 } 782 718 783 #ifdef TARGET_OS2784 719 static struct pci_driver driver = { 785 0,0,0,"ALS4000",786 787 788 snd_card_als4000_remove,0,0 720 .name = "ALS4000", 721 .id_table = snd_als4000_ids, 722 .probe = snd_card_als4000_probe, 723 .remove = __devexit_p(snd_card_als4000_remove), 789 724 }; 790 #else791 static struct pci_driver driver = {792 name: "ALS4000",793 id_table: snd_als4000_ids,794 probe: snd_card_als4k_probe,795 remove: snd_card_als4k_remove,796 };797 #endif798 725 799 726 static int __init alsa_card_als4000_init(void) -
GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c
r206 r210 1002 1002 static struct snd_kcontrol_new snd_cmipci_spdif_default __devinitdata = 1003 1003 { 1004 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1005 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,1006 1007 1008 snd_cmipci_spdif_default_put,0 1004 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1005 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1006 .info = snd_cmipci_spdif_default_info, 1007 .get = snd_cmipci_spdif_default_get, 1008 .put = snd_cmipci_spdif_default_put 1009 1009 }; 1010 1010 … … 1029 1029 static struct snd_kcontrol_new snd_cmipci_spdif_mask __devinitdata = 1030 1030 { 1031 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1032 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,1033 SNDRV_CTL_ELEM_ACCESS_READ,0,1034 1035 snd_cmipci_spdif_mask_get,0,0 1031 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1032 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1033 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1034 .info = snd_cmipci_spdif_mask_info, 1035 .get = snd_cmipci_spdif_mask_get, 1036 1036 }; 1037 1037 … … 1076 1076 static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata = 1077 1077 { 1078 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1079 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,1080 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,1081 1082 1083 snd_cmipci_spdif_stream_put,0 1078 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1079 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1080 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1081 .info = snd_cmipci_spdif_stream_info, 1082 .get = snd_cmipci_spdif_stream_get, 1083 .put = snd_cmipci_spdif_stream_put 1084 1084 }; 1085 1085 … … 1839 1839 1840 1840 #define CMIPCI_DOUBLE(xname, left_reg, right_reg, left_shift, right_shift, mask, invert, stereo) \ 1841 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 1842 0, 0, snd_cmipci_info_volume, \ 1843 snd_cmipci_get_volume, snd_cmipci_put_volume, \ 1844 0,\ 1845 COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \ 1841 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 1842 .info = snd_cmipci_info_volume, \ 1843 .get = snd_cmipci_get_volume, .put = snd_cmipci_put_volume, \ 1844 .private_value = COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \ 1846 1845 } 1847 1846 … … 1941 1940 */ 1942 1941 #define CMIPCI_SB_INPUT_SW(xname, left_shift, right_shift) \ 1943 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 1944 0, 0, snd_cmipci_info_input_sw, \ 1945 snd_cmipci_get_input_sw, snd_cmipci_put_input_sw, \ 1946 0, \ 1947 COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \ 1942 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 1943 .info = snd_cmipci_info_input_sw, \ 1944 .get = snd_cmipci_get_input_sw, .put = snd_cmipci_put_input_sw, \ 1945 .private_value = COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \ 1948 1946 } 1949 1947 static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol, … … 2006 2004 2007 2005 #define CMIPCI_MIXER_SW_STEREO(xname, reg, lshift, rshift, invert) \ 2008 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2009 0, 0, snd_cmipci_info_native_mixer, \ 2010 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2011 0, \ 2012 COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \ 2006 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2007 .info = snd_cmipci_info_native_mixer, \ 2008 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2009 .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \ 2013 2010 } 2014 2011 2015 2012 #define CMIPCI_MIXER_SW_MONO(xname, reg, shift, invert) \ 2016 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2017 0, 0, snd_cmipci_info_native_mixer, \ 2018 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2019 0, \ 2020 COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \ 2013 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2014 .info = snd_cmipci_info_native_mixer, \ 2015 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2016 .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \ 2021 2017 } 2022 2018 2023 2019 #define CMIPCI_MIXER_VOL_STEREO(xname, reg, lshift, rshift, mask) \ 2024 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2025 0, 0, snd_cmipci_info_native_mixer, \ 2026 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2027 0, \ 2028 COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \ 2020 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2021 .info = snd_cmipci_info_native_mixer, \ 2022 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2023 .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \ 2029 2024 } 2030 2025 2031 2026 #define CMIPCI_MIXER_VOL_MONO(xname, reg, shift, mask) \ 2032 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \ 2033 0, 0, snd_cmipci_info_native_mixer, \ 2034 snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \ 2035 0, \ 2036 COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \ 2027 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 2028 .info = snd_cmipci_info_native_mixer, \ 2029 .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \ 2030 .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \ 2037 2031 } 2038 2032 … … 2129 2123 //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1), 2130 2124 { /* switch with sensitivity */ 2131 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2132 "PCM Playback Switch",0,0,0, 2133 snd_cmipci_info_native_mixer, 2134 snd_cmipci_get_native_mixer_sensitive, 2135 snd_cmipci_put_native_mixer_sensitive, 2136 0, 2137 COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0), 2125 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2126 .name = "PCM Playback Switch", 2127 .info = snd_cmipci_info_native_mixer, 2128 .get = snd_cmipci_get_native_mixer_sensitive, 2129 .put = snd_cmipci_put_native_mixer_sensitive, 2130 .private_value = COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0), 2138 2131 }, 2139 2132 CMIPCI_MIXER_SW_STEREO("PCM Capture Switch", CM_REG_MIXER1, CM_WAVEINL_SHIFT, CM_WAVEINR_SHIFT, 0), … … 2260 2253 } 2261 2254 2255 #ifdef TARGET_OS2 2262 2256 #define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \ 2263 2257 static struct cmipci_switch_args cmipci_switch_arg_##sname = { \ 2264 xreg, \ 2265 xmask, \ 2266 xmask_on, \ 2267 xis_byte, \ 2268 xac3, \ 2269 } 2258 xreg, \ 2259 xmask, \ 2260 xmask_on, \ 2261 xis_byte, \ 2262 xac3, \ 2263 } 2264 #else 2265 #define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \ 2266 static struct cmipci_switch_args cmipci_switch_arg_##sname = { \ 2267 .reg = xreg, \ 2268 .mask = xmask, \ 2269 .mask_on = xmask_on, \ 2270 .is_byte = xis_byte, \ 2271 .ac3_sensitive = xac3, \ 2272 } 2273 #endif 2270 2274 2271 2275 #define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \ … … 2305 2309 // safe to do so in this case) 2306 2310 #define DEFINE_SWITCH(sname, stype, sarg) \ 2307 { stype, 0, 0, \ 2308 sname, 0, 0, 0, \ 2309 snd_cmipci_uswitch_info, \ 2310 snd_cmipci_uswitch_get, \ 2311 snd_cmipci_uswitch_put, \ 2312 0, \ 2313 (unsigned long)&cmipci_switch_arg_##sarg,\ 2311 { .name = sname, \ 2312 .iface = stype, \ 2313 .info = snd_cmipci_uswitch_info, \ 2314 .get = snd_cmipci_uswitch_get, \ 2315 .put = snd_cmipci_uswitch_put, \ 2316 .private_value = (unsigned long)&cmipci_switch_arg_##sarg,\ 2314 2317 } 2315 2318 … … 2473 2476 #endif 2474 2477 // DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable), 2475 { 2476 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2477 "IEC958 Output Switch",0,0, 0, 2478 snd_cmipci_uswitch_info, 2479 snd_cmipci_spdout_enable_get, 2480 snd_cmipci_spdout_enable_put,0 2478 { .name = "IEC958 Output Switch", 2479 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2480 .info = snd_cmipci_uswitch_info, 2481 .get = snd_cmipci_spdout_enable_get, 2482 .put = snd_cmipci_spdout_enable_put, 2481 2483 }, 2482 2484 DEFINE_MIXER_SWITCH("IEC958 In Valid", spdi_valid), -
GPL/branches/alsa-resync1/alsa-kernel/pci/cs4281.c
r206 r210 882 882 static snd_pcm_hardware_t snd_cs4281_playback = 883 883 { 884 /* info: */(SNDRV_PCM_INFO_MMAP |884 .info = (SNDRV_PCM_INFO_MMAP | 885 885 SNDRV_PCM_INFO_INTERLEAVED | 886 886 SNDRV_PCM_INFO_MMAP_VALID | … … 888 888 SNDRV_PCM_INFO_RESUME | 889 889 SNDRV_PCM_INFO_SYNC_START), 890 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |890 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | 891 891 SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE | 892 892 SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE | 893 893 SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE | 894 894 SNDRV_PCM_FMTBIT_U32_BE | SNDRV_PCM_FMTBIT_S32_BE, 895 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,896 /* rate_min: */4000,897 /* rate_max: */48000,898 /* channels_min: */1,899 /* channels_max: */2,900 /* buffer_bytes_max: */(512*1024),901 /* period_bytes_min: */64,902 /* period_bytes_max: */(512*1024),903 /* periods_min: */1,904 /* periods_max: */2,905 /* fifo_size: */CS4281_FIFO_SIZE,895 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 896 .rate_min = 4000, 897 .rate_max = 48000, 898 .channels_min = 1, 899 .channels_max = 2, 900 .buffer_bytes_max = (512*1024), 901 .period_bytes_min = 64, 902 .period_bytes_max = (512*1024), 903 .periods_min = 1, 904 .periods_max = 2, 905 .fifo_size = CS4281_FIFO_SIZE, 906 906 }; 907 907 908 908 static snd_pcm_hardware_t snd_cs4281_capture = 909 909 { 910 /* info: */(SNDRV_PCM_INFO_MMAP |910 .info = (SNDRV_PCM_INFO_MMAP | 911 911 SNDRV_PCM_INFO_INTERLEAVED | 912 912 SNDRV_PCM_INFO_MMAP_VALID | … … 914 914 SNDRV_PCM_INFO_RESUME | 915 915 SNDRV_PCM_INFO_SYNC_START), 916 /* formats: */ //SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 |916 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | 917 917 SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE | 918 918 SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE | 919 919 SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE | 920 920 SNDRV_PCM_FMTBIT_U32_BE | SNDRV_PCM_FMTBIT_S32_BE, 921 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,922 /* rate_min: */4000,923 /* rate_max: */48000,924 /* channels_min: */1,925 /* channels_max: */2,926 /* buffer_bytes_max: */(512*1024),927 /* period_bytes_min: */64,928 /* period_bytes_max: */(512*1024),929 /* periods_min: */1,930 /* periods_max: */2,931 /* fifo_size: */CS4281_FIFO_SIZE,921 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 922 .rate_min = 4000, 923 .rate_max = 48000, 924 .channels_min = 1, 925 .channels_max = 2, 926 .buffer_bytes_max = (512*1024), 927 .period_bytes_min = 64, 928 .period_bytes_max = (512*1024), 929 .periods_min = 1, 930 .periods_max = 2, 931 .fifo_size = CS4281_FIFO_SIZE, 932 932 }; 933 933 … … 989 989 990 990 static snd_pcm_ops_t snd_cs4281_playback_ops = { 991 /* .open = */ snd_cs4281_playback_open, 992 /* .close = */ snd_cs4281_playback_close, 993 /* .ioctl = */ snd_pcm_lib_ioctl, 994 /* .hw_params = */ snd_cs4281_hw_params, 995 /* .hw_free = */ snd_cs4281_hw_free, 996 /* .prepare = */ snd_cs4281_playback_prepare, 997 /* .trigger = */ snd_cs4281_trigger, 998 /* .pointer = */ snd_cs4281_pointer, 999 0,0,0,0 991 .open = snd_cs4281_playback_open, 992 .close = snd_cs4281_playback_close, 993 .ioctl = snd_pcm_lib_ioctl, 994 .hw_params = snd_cs4281_hw_params, 995 .hw_free = snd_cs4281_hw_free, 996 .prepare = snd_cs4281_playback_prepare, 997 .trigger = snd_cs4281_trigger, 998 .pointer = snd_cs4281_pointer, 1000 999 }; 1001 1000 1002 1001 static snd_pcm_ops_t snd_cs4281_capture_ops = { 1003 /* .open = */ snd_cs4281_capture_open, 1004 /* .close = */ snd_cs4281_capture_close, 1005 /* .ioctl = */ snd_pcm_lib_ioctl, 1006 /* .hw_params = */ snd_cs4281_hw_params, 1007 /* .hw_free = */ snd_cs4281_hw_free, 1008 /* .prepare = */ snd_cs4281_capture_prepare, 1009 /* .trigger = */ snd_cs4281_trigger, 1010 /* .pointer = */ snd_cs4281_pointer, 1011 0,0,0,0 1002 .open = snd_cs4281_capture_open, 1003 .close = snd_cs4281_capture_close, 1004 .ioctl = snd_pcm_lib_ioctl, 1005 .hw_params = snd_cs4281_hw_params, 1006 .hw_free = snd_cs4281_hw_free, 1007 .prepare = snd_cs4281_capture_prepare, 1008 .trigger = snd_cs4281_trigger, 1009 .pointer = snd_cs4281_pointer, 1012 1010 }; 1013 1011 … … 1393 1391 unsigned int tmp; 1394 1392 int err; 1395 #ifdef TARGET_OS21396 1393 static snd_device_ops_t ops = { 1397 snd_cs4281_dev_free,0,0,0 1394 .dev_free = snd_cs4281_dev_free, 1398 1395 }; 1399 #else1400 static snd_device_ops_t ops = {1401 dev_free: snd_cs4281_dev_free,1402 };1403 #endif1404 1396 1405 1397 *rchip = NULL; -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emumixer.c
r207 r210 31 31 */ 32 32 33 #define __NO_VERSION__34 33 #include <sound/driver.h> 35 34 #include <linux/time.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emumpu401.c
r207 r210 20 20 */ 21 21 22 #define __NO_VERSION__23 22 #include <sound/driver.h> 24 23 #include <linux/time.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emuproc.c
r207 r210 26 26 */ 27 27 28 #define __NO_VERSION__29 28 #include <sound/driver.h> 30 29 #include <linux/slab.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/irq.c
r206 r210 26 26 */ 27 27 28 #define __NO_VERSION__29 28 #include <sound/driver.h> 30 29 #include <linux/time.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/voice.c
r84 r210 29 29 */ 30 30 31 #define __NO_VERSION__32 31 #include <sound/driver.h> 33 32 #include <linux/time.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/es1968.c
r207 r210 1727 1727 1728 1728 static snd_pcm_ops_t snd_es1968_playback_ops = { 1729 /* open: */ snd_es1968_playback_open, 1730 /* close: */ snd_es1968_playback_close, 1731 /* ioctl: */ snd_pcm_lib_ioctl, 1732 /* hw_params:*/ snd_es1968_hw_params, 1733 /* hw_free: */ snd_es1968_hw_free, 1734 /* prepare: */ snd_es1968_pcm_prepare, 1735 /* trigger: */ snd_es1968_pcm_trigger, 1736 /* pointer: */ snd_es1968_pcm_pointer, 1737 0,0 1729 .open = snd_es1968_playback_open, 1730 .close = snd_es1968_playback_close, 1731 .ioctl = snd_pcm_lib_ioctl, 1732 .hw_params = snd_es1968_hw_params, 1733 .hw_free = snd_es1968_hw_free, 1734 .prepare = snd_es1968_pcm_prepare, 1735 .trigger = snd_es1968_pcm_trigger, 1736 .pointer = snd_es1968_pcm_pointer, 1738 1737 }; 1739 1738 1740 1739 static snd_pcm_ops_t snd_es1968_capture_ops = { 1741 /* open: */ snd_es1968_capture_open, 1742 /* close: */ snd_es1968_capture_close, 1743 /* ioctl: */ snd_pcm_lib_ioctl, 1744 /* hw_params:*/ snd_es1968_hw_params, 1745 /* hw_free: */ snd_es1968_hw_free, 1746 /* prepare: */ snd_es1968_pcm_prepare, 1747 /* trigger: */ snd_es1968_pcm_trigger, 1748 /* pointer: */ snd_es1968_pcm_pointer, 1749 /* copy: */ 0, 1750 0 1740 .open = snd_es1968_capture_open, 1741 .close = snd_es1968_capture_close, 1742 .ioctl = snd_pcm_lib_ioctl, 1743 .hw_params = snd_es1968_hw_params, 1744 .hw_free = snd_es1968_hw_free, 1745 .prepare = snd_es1968_pcm_prepare, 1746 .trigger = snd_es1968_pcm_trigger, 1747 .pointer = snd_es1968_pcm_pointer, 1751 1748 }; 1752 1749 … … 2548 2545 #ifdef TARGET_OS2 2549 2546 static snd_device_ops_t ops = { 2550 snd_es1968_dev_free,0,0,0 2547 .dev_free = snd_es1968_dev_free, 2551 2548 }; 2552 2549 #else … … 2692 2689 static snd_kcontrol_new_t snd_es1968_control_switches[] __devinitdata = { 2693 2690 { 2694 /* .iface = */SNDRV_CTL_ELEM_IFACE_CARD,0,0,2695 /* .name = */"Joystick",0,0,0,2696 /* .info = */snd_es1968_joystick_info,2697 /* .get = */snd_es1968_joystick_get,2698 /* .put = */snd_es1968_joystick_put,2691 .name = "Joystick", 2692 .iface = SNDRV_CTL_ELEM_IFACE_CARD, 2693 .info = snd_es1968_joystick_info, 2694 .get = snd_es1968_joystick_get, 2695 .put = snd_es1968_joystick_put, 2699 2696 } 2700 2697 }; … … 2839 2836 2840 2837 static struct pci_driver driver = { 2841 0, 0, 0, 2842 "ES1968 (ESS Maestro)", 2843 snd_es1968_ids, 2844 snd_es1968_probe, 2845 snd_es1968_remove, 2846 SND_PCI_PM_CALLBACKS 2838 .name = "ES1968 (ESS Maestro)", 2839 .id_table = snd_es1968_ids, 2840 .probe = snd_es1968_probe, 2841 .remove = __devexit_p(snd_es1968_remove), 2842 SND_PCI_PM_CALLBACKS 2847 2843 }; 2848 2844 -
GPL/branches/alsa-resync1/alsa-kernel/pci/fm801.c
r206 r210 302 302 303 303 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 304 /* .count = */ARRAY_SIZE(rates),305 /* .list = */rates,306 /* .mask = */0,304 .count = ARRAY_SIZE(rates), 305 .list = rates, 306 .mask = 0, 307 307 }; 308 308 … … 314 314 315 315 static snd_pcm_hw_constraint_list_t hw_constraints_channels = { 316 /* .count = */CHANNELS,317 /* .list = */channels,318 /* .mask = */0,316 .count = CHANNELS, 317 .list = channels, 318 .mask = 0, 319 319 }; 320 320 … … 561 561 static snd_pcm_hardware_t snd_fm801_playback = 562 562 { 563 /*.info = */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |563 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 564 564 SNDRV_PCM_INFO_BLOCK_TRANSFER | 565 565 SNDRV_PCM_INFO_PAUSE | … … 581 581 static snd_pcm_hardware_t snd_fm801_capture = 582 582 { 583 /*.info = */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |583 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 584 584 SNDRV_PCM_INFO_BLOCK_TRANSFER | 585 585 SNDRV_PCM_INFO_PAUSE | … … 648 648 649 649 static snd_pcm_ops_t snd_fm801_playback_ops = { 650 /*.open = */ snd_fm801_playback_open, 651 /*.close = */ snd_fm801_playback_close, 652 /*.ioctl = */ snd_pcm_lib_ioctl, 653 /*.hw_params = */ snd_fm801_hw_params, 654 /*.hw_free = */ snd_fm801_hw_free, 655 /*.prepare = */ snd_fm801_playback_prepare, 656 /*.trigger = */ snd_fm801_playback_trigger, 657 /*.pointer = */ snd_fm801_playback_pointer, 658 0,0,0,0 650 .open = snd_fm801_playback_open, 651 .close = snd_fm801_playback_close, 652 .ioctl = snd_pcm_lib_ioctl, 653 .hw_params = snd_fm801_hw_params, 654 .hw_free = snd_fm801_hw_free, 655 .prepare = snd_fm801_playback_prepare, 656 .trigger = snd_fm801_playback_trigger, 657 .pointer = snd_fm801_playback_pointer, 659 658 }; 660 659 661 660 static snd_pcm_ops_t snd_fm801_capture_ops = { 662 /*.open = */ snd_fm801_capture_open, 663 /*.close = */ snd_fm801_capture_close, 664 /*.ioctl = */ snd_pcm_lib_ioctl, 665 /*.hw_params = */ snd_fm801_hw_params, 666 /*.hw_free = */ snd_fm801_hw_free, 667 /*.prepare = */ snd_fm801_capture_prepare, 668 /*.trigger = */ snd_fm801_capture_trigger, 669 /*.pointer = */ snd_fm801_capture_pointer, 670 0,0,0,0 661 .open = snd_fm801_capture_open, 662 .close = snd_fm801_capture_close, 663 .ioctl = snd_pcm_lib_ioctl, 664 .hw_params = snd_fm801_hw_params, 665 .hw_free = snd_fm801_hw_free, 666 .prepare = snd_fm801_capture_prepare, 667 .trigger = snd_fm801_capture_trigger, 668 .pointer = snd_fm801_capture_pointer, 671 669 }; 672 670 … … 1000 998 1001 999 #define FM801_SINGLE(xname, reg, shift, mask, invert) \ 1002 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, 0,0,0,snd_fm801_info_single, \1003 snd_fm801_get_single,snd_fm801_put_single, \1004 0,reg | (shift << 8) | (mask << 16) | (invert << 24) }1000 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_single, \ 1001 .get = snd_fm801_get_single, .put = snd_fm801_put_single, \ 1002 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 1005 1003 1006 1004 static int snd_fm801_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1045 1043 1046 1044 #define FM801_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \ 1047 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, 0,0,0,snd_fm801_info_double, \1048 snd_fm801_get_double,snd_fm801_put_double, \1049 0,reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) }1045 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_double, \ 1046 .get = snd_fm801_get_double, .put = snd_fm801_put_double, \ 1047 .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } 1050 1048 1051 1049 static int snd_fm801_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1148 1146 FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1), 1149 1147 { 1150 SNDRV_CTL_ELEM_IFACE_MIXER, 0,0,1151 "Digital Capture Source",0,0,0,1152 snd_fm801_info_mux,1153 snd_fm801_get_mux,1154 snd_fm801_put_mux,01148 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1149 .name = "Digital Capture Source", 1150 .info = snd_fm801_info_mux, 1151 .get = snd_fm801_get_mux, 1152 .put = snd_fm801_put_mux, 1155 1153 } 1156 1154 }; … … 1263 1261 int err; 1264 1262 static snd_device_ops_t ops = { 1265 snd_fm801_dev_free, 0,0,01263 .dev_free = snd_fm801_dev_free, 1266 1264 }; 1267 1265 … … 1468 1466 1469 1467 static struct pci_driver driver = { 1470 0,0,0, 1471 "FM801", 1472 snd_fm801_ids, 1473 snd_card_fm801_probe, 1474 snd_card_fm801_remove, 1475 0,0 1468 .name = "FM801", 1469 .id_table = snd_fm801_ids, 1470 .probe = snd_card_fm801_probe, 1471 .remove = __devexit_p(snd_card_fm801_remove), 1476 1472 }; 1477 1473 -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712.c
r207 r210 700 700 701 701 static snd_kcontrol_new_t snd_ice1712_mixer_digmix_route_ac97 __devinitdata = { 702 #ifdef TARGET_OS2 703 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 704 "Digital Mixer To AC97",0,0, 705 snd_ice1712_digmix_route_ac97_info, 706 snd_ice1712_digmix_route_ac97_get, 707 snd_ice1712_digmix_route_ac97_put,0 708 #else 709 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 710 name: "Digital Mixer To AC97", 711 info: snd_ice1712_digmix_route_ac97_info, 712 get: snd_ice1712_digmix_route_ac97_get, 713 put: snd_ice1712_digmix_route_ac97_put, 714 #endif 702 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 703 .name = "Digital Mixer To AC97", 704 .info = snd_ice1712_digmix_route_ac97_info, 705 .get = snd_ice1712_digmix_route_ac97_get, 706 .put = snd_ice1712_digmix_route_ac97_put, 715 707 }; 716 708 … … 873 865 } 874 866 875 #ifdef TARGET_OS2 876 static ice1712_cs8427_ops_t snd_ice1712_ap_cs8427_ops = { 877 ap_cs8427_sendbytes, 878 ap_cs8427_readbytes, 879 ap_cs8427_probeaddr, 867 static snd_i2c_ops_t ap_cs8427_i2c_ops = { 868 .sendbytes = ap_cs8427_sendbytes, 869 .readbytes = ap_cs8427_readbytes, 870 .probeaddr = ap_cs8427_probeaddr, 880 871 }; 881 #else882 static snd_i2c_ops_t ap_cs8427_i2c_ops = {883 sendbytes: ap_cs8427_sendbytes,884 readbytes: ap_cs8427_readbytes,885 probeaddr: ap_cs8427_probeaddr,886 };887 #endif888 872 889 873 /* … … 967 951 } 968 952 969 #ifdef TARGET_OS2970 953 static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = { 971 ewx_i2c_start,972 ewx_i2c_stop,973 ewx_i2c_direction,974 ewx_i2c_setlines,975 ewx_i2c_getclock,976 ewx_i2c_getdata,954 .start = ewx_i2c_start, 955 .stop = ewx_i2c_stop, 956 .direction = ewx_i2c_direction, 957 .setlines = ewx_i2c_setlines, 958 .getclock = ewx_i2c_getclock, 959 .getdata = ewx_i2c_getdata, 977 960 }; 978 #else979 static snd_i2c_bit_ops_t snd_ice1712_ewx_cs8427_bit_ops = {980 start: ewx_i2c_start,981 stop: ewx_i2c_stop,982 direction: ewx_i2c_direction,983 setlines: ewx_i2c_setlines,984 getclock: ewx_i2c_getclock,985 getdata: ewx_i2c_getdata,986 };987 #endif988 961 989 962 /* AK4524 chip select; address 0x48 bit 0-3 */ 990 static voidsnd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)963 static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask) 991 964 { 992 965 unsigned char data, ndata; 993 966 994 snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return );967 snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL); 995 968 snd_i2c_lock(ice->i2c); 996 snd_runtime_check(snd_i2c_readbytes(ice->pcf8574[1], &data, 1) == 1, snd_i2c_unlock(ice->i2c); return); 969 if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) 970 goto __error; 997 971 ndata = (data & 0xf0) | chip_mask; 998 972 if (ndata != data) 999 snd_runtime_check(snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) == 1, snd_i2c_unlock(ice->i2c); return); 973 if (snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1) 974 goto __error; 1000 975 snd_i2c_unlock(ice->i2c); 976 return 0; 977 978 __error: 979 snd_i2c_unlock(ice->i2c); 980 snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n"); 981 return -EIO; 1001 982 } 1002 983 … … 1016 997 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_EWS88MT) { 1017 998 /* assert AK4524 CS */ 1018 snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f); 999 if (snd_ice1712_ews88mt_chip_select(ice, ~(1 << chip) & 0x0f) < 0) 1000 return; 1019 1001 //snd_ice1712_ews88mt_chip_select(ice, 0x0f); 1020 1002 } … … 1170 1152 unsigned char reg[2] = { 0x80 | 4, 0 }; /* CS8427 auto increment | register number 4 + data */ 1171 1153 unsigned char val, nval; 1154 int res = 0; 1155 1172 1156 snd_i2c_lock(ice->i2c); 1173 1157 if (snd_i2c_sendbytes(ice->cs8427, reg, 1) != 1) { 1174 1158 snd_i2c_unlock(ice->i2c); 1175 return -E REMOTE;1159 return -EIO; 1176 1160 } 1177 1161 if (snd_i2c_readbytes(ice->cs8427, &val, 1) != 1) { 1178 1162 snd_i2c_unlock(ice->i2c); 1179 return -E REMOTE;1163 return -EIO; 1180 1164 } 1181 1165 nval = val & 0xf0; … … 1187 1171 reg[1] = nval; 1188 1172 if (snd_i2c_sendbytes(ice->cs8427, reg, 2) != 2) { 1173 res = -EIO; 1174 } else { 1175 res++; 1176 } 1177 } 1189 1178 snd_i2c_unlock(ice->i2c); 1190 return -EREMOTE; 1191 } 1192 return 1; 1193 } 1194 snd_i2c_unlock(ice->i2c); 1195 return 0; 1179 return res; 1196 1180 } 1197 1181 … … 1553 1537 } 1554 1538 1555 #ifdef TARGET_OS21556 1539 static snd_pcm_hardware_t snd_ice1712_playback = 1557 1540 { 1558 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1541 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1559 1542 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1560 1543 SNDRV_PCM_INFO_MMAP_VALID | 1561 1544 SNDRV_PCM_INFO_PAUSE), 1562 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1563 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1564 /* rate_min: */4000,1565 /* rate_max: */48000,1566 /* channels_min: */1,1567 /* channels_max: */2,1568 /* buffer_bytes_max: */(64*1024),1569 /* period_bytes_min: */64,1570 /* period_bytes_max: */(64*1024),1571 /* periods_min: */1,1572 /* periods_max: */1024,1573 /* fifo_size: */0,1545 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 1546 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1547 .rate_min = 4000, 1548 .rate_max = 48000, 1549 .channels_min = 1, 1550 .channels_max = 2, 1551 .buffer_bytes_max = (64*1024), 1552 .period_bytes_min = 64, 1553 .period_bytes_max = (64*1024), 1554 .periods_min = 1, 1555 .periods_max = 1024, 1556 .fifo_size = 0, 1574 1557 }; 1575 1558 1576 1559 static snd_pcm_hardware_t snd_ice1712_playback_ds = 1577 1560 { 1578 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1561 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1579 1562 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1580 1563 SNDRV_PCM_INFO_MMAP_VALID | 1581 1564 SNDRV_PCM_INFO_PAUSE), 1582 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1583 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1584 /* rate_min: */4000,1585 /* rate_max: */48000,1586 /* channels_min: */1,1587 /* channels_max: */2,1588 /* buffer_bytes_max: */(128*1024),1589 /* period_bytes_min: */64,1590 /* period_bytes_max: */(128*1024),1591 /* periods_min: */2,1592 /* periods_max: */2,1593 /* fifo_size: */0,1565 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 1566 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1567 .rate_min = 4000, 1568 .rate_max = 48000, 1569 .channels_min = 1, 1570 .channels_max = 2, 1571 .buffer_bytes_max = (128*1024), 1572 .period_bytes_min = 64, 1573 .period_bytes_max = (128*1024), 1574 .periods_min = 2, 1575 .periods_max = 2, 1576 .fifo_size = 0, 1594 1577 }; 1595 1578 1596 1579 static snd_pcm_hardware_t snd_ice1712_capture = 1597 1580 { 1598 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1581 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1599 1582 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1600 1583 SNDRV_PCM_INFO_MMAP_VALID), 1601 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1602 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1603 /* rate_min: */4000,1604 /* rate_max: */48000,1605 /* channels_min: */1,1606 /* channels_max: */2,1607 /* buffer_bytes_max: */(64*1024),1608 /* period_bytes_min: */64,1609 /* period_bytes_max: */(64*1024),1610 /* periods_min: */1,1611 /* periods_max: */1024,1612 /* fifo_size: */0,1584 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 1585 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1586 .rate_min = 4000, 1587 .rate_max = 48000, 1588 .channels_min = 1, 1589 .channels_max = 2, 1590 .buffer_bytes_max = (64*1024), 1591 .period_bytes_min = 64, 1592 .period_bytes_max = (64*1024), 1593 .periods_min = 1, 1594 .periods_max = 1024, 1595 .fifo_size = 0, 1613 1596 }; 1614 #else1615 static snd_pcm_hardware_t snd_ice1712_playback =1616 {1617 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1618 SNDRV_PCM_INFO_BLOCK_TRANSFER |1619 SNDRV_PCM_INFO_MMAP_VALID |1620 SNDRV_PCM_INFO_PAUSE),1621 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1622 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1623 rate_min: 4000,1624 rate_max: 48000,1625 channels_min: 1,1626 channels_max: 2,1627 buffer_bytes_max: (64*1024),1628 period_bytes_min: 64,1629 period_bytes_max: (64*1024),1630 periods_min: 1,1631 periods_max: 1024,1632 fifo_size: 0,1633 };1634 1635 static snd_pcm_hardware_t snd_ice1712_playback_ds =1636 {1637 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1638 SNDRV_PCM_INFO_BLOCK_TRANSFER |1639 SNDRV_PCM_INFO_MMAP_VALID |1640 SNDRV_PCM_INFO_PAUSE),1641 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1642 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1643 rate_min: 4000,1644 rate_max: 48000,1645 channels_min: 1,1646 channels_max: 2,1647 buffer_bytes_max: (128*1024),1648 period_bytes_min: 64,1649 period_bytes_max: (128*1024),1650 periods_min: 2,1651 periods_max: 2,1652 fifo_size: 0,1653 };1654 1655 static snd_pcm_hardware_t snd_ice1712_capture =1656 {1657 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1658 SNDRV_PCM_INFO_BLOCK_TRANSFER |1659 SNDRV_PCM_INFO_MMAP_VALID),1660 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,1661 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1662 rate_min: 4000,1663 rate_max: 48000,1664 channels_min: 1,1665 channels_max: 2,1666 buffer_bytes_max: (64*1024),1667 period_bytes_min: 64,1668 period_bytes_max: (64*1024),1669 periods_min: 1,1670 periods_max: 1024,1671 fifo_size: 0,1672 };1673 #endif1674 1597 1675 1598 static int snd_ice1712_playback_open(snd_pcm_substream_t * substream) … … 1744 1667 } 1745 1668 1746 #ifdef TARGET_OS21747 1669 static snd_pcm_ops_t snd_ice1712_playback_ops = { 1748 snd_ice1712_playback_open,1749 snd_ice1712_playback_close,1750 snd_pcm_lib_ioctl,1751 snd_ice1712_hw_params,1752 snd_ice1712_hw_free,1753 snd_ice1712_playback_prepare,1754 snd_ice1712_playback_trigger,1755 snd_ice1712_playback_pointer,0,01670 .open = snd_ice1712_playback_open, 1671 .close = snd_ice1712_playback_close, 1672 .ioctl = snd_pcm_lib_ioctl, 1673 .hw_params = snd_ice1712_hw_params, 1674 .hw_free = snd_ice1712_hw_free, 1675 .prepare = snd_ice1712_playback_prepare, 1676 .trigger = snd_ice1712_playback_trigger, 1677 .pointer = snd_ice1712_playback_pointer, 1756 1678 }; 1757 1679 1758 1680 static snd_pcm_ops_t snd_ice1712_playback_ds_ops = { 1759 snd_ice1712_playback_ds_open,1760 snd_ice1712_playback_ds_close,1761 snd_pcm_lib_ioctl,1762 snd_ice1712_hw_params,1763 snd_ice1712_hw_free,1764 snd_ice1712_playback_ds_prepare,1765 snd_ice1712_playback_ds_trigger,1766 snd_ice1712_playback_ds_pointer,0,01681 .open = snd_ice1712_playback_ds_open, 1682 .close = snd_ice1712_playback_ds_close, 1683 .ioctl = snd_pcm_lib_ioctl, 1684 .hw_params = snd_ice1712_hw_params, 1685 .hw_free = snd_ice1712_hw_free, 1686 .prepare = snd_ice1712_playback_ds_prepare, 1687 .trigger = snd_ice1712_playback_ds_trigger, 1688 .pointer = snd_ice1712_playback_ds_pointer, 1767 1689 }; 1768 1690 1769 1691 static snd_pcm_ops_t snd_ice1712_capture_ops = { 1770 snd_ice1712_capture_open,1771 snd_ice1712_capture_close,1772 snd_pcm_lib_ioctl,1773 snd_ice1712_hw_params,1774 snd_ice1712_hw_free,1775 snd_ice1712_capture_prepare,1776 snd_ice1712_capture_trigger,1777 snd_ice1712_capture_pointer,0,01692 .open = snd_ice1712_capture_open, 1693 .close = snd_ice1712_capture_close, 1694 .ioctl = snd_pcm_lib_ioctl, 1695 .hw_params = snd_ice1712_hw_params, 1696 .hw_free = snd_ice1712_hw_free, 1697 .prepare = snd_ice1712_capture_prepare, 1698 .trigger = snd_ice1712_capture_trigger, 1699 .pointer = snd_ice1712_capture_pointer, 1778 1700 }; 1779 #else1780 static snd_pcm_ops_t snd_ice1712_playback_ops = {1781 open: snd_ice1712_playback_open,1782 close: snd_ice1712_playback_close,1783 ioctl: snd_pcm_lib_ioctl,1784 hw_params: snd_ice1712_hw_params,1785 hw_free: snd_ice1712_hw_free,1786 prepare: snd_ice1712_playback_prepare,1787 trigger: snd_ice1712_playback_trigger,1788 pointer: snd_ice1712_playback_pointer,1789 };1790 1791 static snd_pcm_ops_t snd_ice1712_playback_ds_ops = {1792 open: snd_ice1712_playback_ds_open,1793 close: snd_ice1712_playback_ds_close,1794 ioctl: snd_pcm_lib_ioctl,1795 hw_params: snd_ice1712_hw_params,1796 hw_free: snd_ice1712_hw_free,1797 prepare: snd_ice1712_playback_ds_prepare,1798 trigger: snd_ice1712_playback_ds_trigger,1799 pointer: snd_ice1712_playback_ds_pointer,1800 };1801 1802 static snd_pcm_ops_t snd_ice1712_capture_ops = {1803 open: snd_ice1712_capture_open,1804 close: snd_ice1712_capture_close,1805 ioctl: snd_pcm_lib_ioctl,1806 hw_params: snd_ice1712_hw_params,1807 hw_free: snd_ice1712_hw_free,1808 prepare: snd_ice1712_capture_prepare,1809 trigger: snd_ice1712_capture_trigger,1810 pointer: snd_ice1712_capture_pointer,1811 };1812 #endif1813 1701 1814 1702 static void snd_ice1712_pcm_free(snd_pcm_t *pcm) … … 1892 1780 #define RATES sizeof(rates) / sizeof(rates[0]) 1893 1781 1894 #ifdef TARGET_OS21895 1782 static snd_pcm_hw_constraint_list_t hw_constraints_rates = { 1896 RATES,1897 rates,1898 0,1783 .count = RATES, 1784 .list = rates, 1785 .mask = 0, 1899 1786 }; 1900 #else1901 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {1902 count: RATES,1903 list: rates,1904 mask: 0,1905 };1906 #endif1907 1787 1908 1788 #if 0 … … 2099 1979 } 2100 1980 2101 #ifdef TARGET_OS22102 1981 static snd_pcm_hardware_t snd_ice1712_playback_pro = 2103 1982 { 2104 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1983 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 2105 1984 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2106 1985 SNDRV_PCM_INFO_MMAP_VALID | 2107 1986 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START), 2108 /* formats: */SNDRV_PCM_FMTBIT_S32_LE,2109 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,2110 /* rate_min: */4000,2111 /* rate_max: */96000,2112 /* channels_min: */10,2113 /* channels_max: */10,2114 /* buffer_bytes_max: */(256*1024),2115 /* period_bytes_min: */10 * 4 * 2,2116 /* period_bytes_max: */131040,2117 /* periods_min: */1,2118 /* periods_max: */1024,2119 /* fifo_size: */0,1987 .formats = SNDRV_PCM_FMTBIT_S32_LE, 1988 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000, 1989 .rate_min = 4000, 1990 .rate_max = 96000, 1991 .channels_min = 10, 1992 .channels_max = 10, 1993 .buffer_bytes_max = (256*1024), 1994 .period_bytes_min = 10 * 4 * 2, 1995 .period_bytes_max = 131040, 1996 .periods_min = 1, 1997 .periods_max = 1024, 1998 .fifo_size = 0, 2120 1999 }; 2121 2000 2122 2001 static snd_pcm_hardware_t snd_ice1712_capture_pro = 2123 2002 { 2124 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |2003 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 2125 2004 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2126 2005 SNDRV_PCM_INFO_MMAP_VALID | 2127 2006 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START), 2128 /* formats: */SNDRV_PCM_FMTBIT_S32_LE,2129 /* rates: */SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,2130 /* rate_min: */4000,2131 /* rate_max: */96000,2132 /* channels_min: */12,2133 /* channels_max: */12,2134 /* buffer_bytes_max: */(256*1024),2135 /* period_bytes_min: */12 * 4 * 2,2136 /* period_bytes_max: */131040,2137 /* periods_min: */1,2138 /* periods_max: */1024,2139 /* fifo_size: */0,2007 .formats = SNDRV_PCM_FMTBIT_S32_LE, 2008 .rates = SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000, 2009 .rate_min = 4000, 2010 .rate_max = 96000, 2011 .channels_min = 12, 2012 .channels_max = 12, 2013 .buffer_bytes_max = (256*1024), 2014 .period_bytes_min = 12 * 4 * 2, 2015 .period_bytes_max = 131040, 2016 .periods_min = 1, 2017 .periods_max = 1024, 2018 .fifo_size = 0, 2140 2019 }; 2141 #else2142 static snd_pcm_hardware_t snd_ice1712_playback_pro =2143 {2144 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |2145 SNDRV_PCM_INFO_BLOCK_TRANSFER |2146 SNDRV_PCM_INFO_MMAP_VALID |2147 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),2148 formats: SNDRV_PCM_FMTBIT_S32_LE,2149 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,2150 rate_min: 4000,2151 rate_max: 96000,2152 channels_min: 10,2153 channels_max: 10,2154 buffer_bytes_max: (256*1024),2155 period_bytes_min: 10 * 4 * 2,2156 period_bytes_max: 131040,2157 periods_min: 1,2158 periods_max: 1024,2159 fifo_size: 0,2160 };2161 2162 static snd_pcm_hardware_t snd_ice1712_capture_pro =2163 {2164 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |2165 SNDRV_PCM_INFO_BLOCK_TRANSFER |2166 SNDRV_PCM_INFO_MMAP_VALID |2167 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_SYNC_START),2168 formats: SNDRV_PCM_FMTBIT_S32_LE,2169 rates: SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_8000_96000,2170 rate_min: 4000,2171 rate_max: 96000,2172 channels_min: 12,2173 channels_max: 12,2174 buffer_bytes_max: (256*1024),2175 period_bytes_min: 12 * 4 * 2,2176 period_bytes_max: 131040,2177 periods_min: 1,2178 periods_max: 1024,2179 fifo_size: 0,2180 };2181 #endif2182 2020 2183 2021 static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream) … … 2238 2076 } 2239 2077 2240 #ifdef TARGET_OS22241 2078 static snd_pcm_ops_t snd_ice1712_playback_pro_ops = { 2242 snd_ice1712_playback_pro_open,2243 snd_ice1712_playback_pro_close,2244 snd_pcm_lib_ioctl,2245 snd_ice1712_hw_params,2246 snd_ice1712_hw_free,2247 snd_ice1712_playback_pro_prepare,2248 snd_ice1712_pro_trigger,2249 snd_ice1712_playback_pro_pointer,0,02079 .open = snd_ice1712_playback_pro_open, 2080 .close = snd_ice1712_playback_pro_close, 2081 .ioctl = snd_pcm_lib_ioctl, 2082 .hw_params = snd_ice1712_hw_params, 2083 .hw_free = snd_ice1712_hw_free, 2084 .prepare = snd_ice1712_playback_pro_prepare, 2085 .trigger = snd_ice1712_pro_trigger, 2086 .pointer = snd_ice1712_playback_pro_pointer, 2250 2087 }; 2251 2088 2252 2089 static snd_pcm_ops_t snd_ice1712_capture_pro_ops = { 2253 snd_ice1712_capture_pro_open,2254 snd_ice1712_capture_pro_close,2255 snd_pcm_lib_ioctl,2256 snd_ice1712_hw_params,2257 snd_ice1712_hw_free,2258 snd_ice1712_capture_pro_prepare,2259 snd_ice1712_pro_trigger,2260 snd_ice1712_capture_pro_pointer,0,02090 .open = snd_ice1712_capture_pro_open, 2091 .close = snd_ice1712_capture_pro_close, 2092 .ioctl = snd_pcm_lib_ioctl, 2093 .hw_params = snd_ice1712_hw_params, 2094 .hw_free = snd_ice1712_hw_free, 2095 .prepare = snd_ice1712_capture_pro_prepare, 2096 .trigger = snd_ice1712_pro_trigger, 2097 .pointer = snd_ice1712_capture_pro_pointer, 2261 2098 }; 2262 #else2263 static snd_pcm_ops_t snd_ice1712_playback_pro_ops = {2264 open: snd_ice1712_playback_pro_open,2265 close: snd_ice1712_playback_pro_close,2266 ioctl: snd_pcm_lib_ioctl,2267 hw_params: snd_ice1712_hw_params,2268 hw_free: snd_ice1712_hw_free,2269 prepare: snd_ice1712_playback_pro_prepare,2270 trigger: snd_ice1712_pro_trigger,2271 pointer: snd_ice1712_playback_pro_pointer,2272 };2273 2274 static snd_pcm_ops_t snd_ice1712_capture_pro_ops = {2275 open: snd_ice1712_capture_pro_open,2276 close: snd_ice1712_capture_pro_close,2277 ioctl: snd_pcm_lib_ioctl,2278 hw_params: snd_ice1712_hw_params,2279 hw_free: snd_ice1712_hw_free,2280 prepare: snd_ice1712_capture_pro_prepare,2281 trigger: snd_ice1712_pro_trigger,2282 pointer: snd_ice1712_capture_pro_pointer,2283 };2284 #endif2285 2099 2286 2100 static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm) … … 2716 2530 2717 2531 static snd_kcontrol_new_t snd_ice1712_eeprom __devinitdata = { 2718 #ifdef TARGET_OS2 2719 SNDRV_CTL_ELEM_IFACE_CARD,0,0, 2720 "ICE1712 EEPROM",0, 2721 SNDRV_CTL_ELEM_ACCESS_READ, 2722 snd_ice1712_eeprom_info, 2723 snd_ice1712_eeprom_get,0,0 2724 #else 2725 iface: SNDRV_CTL_ELEM_IFACE_CARD, 2726 name: "ICE1712 EEPROM", 2727 access: SNDRV_CTL_ELEM_ACCESS_READ, 2728 info: snd_ice1712_eeprom_info, 2729 get: snd_ice1712_eeprom_get 2730 #endif 2532 .iface = SNDRV_CTL_ELEM_IFACE_CARD, 2533 .name = "ICE1712 EEPROM", 2534 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2535 .info = snd_ice1712_eeprom_info, 2536 .get = snd_ice1712_eeprom_get 2731 2537 }; 2732 2538 … … 2803 2609 static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata = 2804 2610 { 2805 #ifdef TARGET_OS2 2806 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 2807 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0, 2808 snd_ice1712_spdif_default_info, 2809 snd_ice1712_spdif_default_get, 2810 snd_ice1712_spdif_default_put,0 2811 #else 2812 iface: SNDRV_CTL_ELEM_IFACE_PCM, 2813 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2814 info: snd_ice1712_spdif_default_info, 2815 get: snd_ice1712_spdif_default_get, 2816 put: snd_ice1712_spdif_default_put 2817 #endif 2611 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2612 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2613 .info = snd_ice1712_spdif_default_info, 2614 .get = snd_ice1712_spdif_default_get, 2615 .put = snd_ice1712_spdif_default_put 2818 2616 }; 2819 2617 … … 2887 2685 static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata = 2888 2686 { 2889 #ifdef TARGET_OS2 2890 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2891 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0, 2892 SNDRV_CTL_ELEM_ACCESS_READ, 2893 snd_ice1712_spdif_mask_info, 2894 snd_ice1712_spdif_maskc_get,0,0 2895 #else 2896 access: SNDRV_CTL_ELEM_ACCESS_READ, 2897 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 2898 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 2899 info: snd_ice1712_spdif_mask_info, 2900 get: snd_ice1712_spdif_maskc_get, 2901 #endif 2687 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2688 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2689 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 2690 .info = snd_ice1712_spdif_mask_info, 2691 .get = snd_ice1712_spdif_maskc_get, 2902 2692 }; 2903 2693 2904 2694 static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata = 2905 2695 { 2906 #ifdef TARGET_OS2 2907 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2908 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),0, 2909 SNDRV_CTL_ELEM_ACCESS_READ, 2910 snd_ice1712_spdif_mask_info, 2911 snd_ice1712_spdif_maskp_get,0,0 2912 #else 2913 access: SNDRV_CTL_ELEM_ACCESS_READ, 2914 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 2915 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 2916 info: snd_ice1712_spdif_mask_info, 2917 get: snd_ice1712_spdif_maskp_get, 2918 #endif 2696 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2697 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2698 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 2699 .info = snd_ice1712_spdif_mask_info, 2700 .get = snd_ice1712_spdif_maskp_get, 2919 2701 }; 2920 2702 … … 2989 2771 static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata = 2990 2772 { 2991 #ifdef TARGET_OS2 2992 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 2993 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0, 2994 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2995 snd_ice1712_spdif_stream_info, 2996 snd_ice1712_spdif_stream_get, 2997 snd_ice1712_spdif_stream_put,0 2998 #else 2999 access: SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 3000 iface: SNDRV_CTL_ELEM_IFACE_PCM, 3001 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 3002 info: snd_ice1712_spdif_stream_info, 3003 get: snd_ice1712_spdif_stream_get, 3004 put: snd_ice1712_spdif_stream_put 3005 #endif 2773 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2774 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2775 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 2776 .info = snd_ice1712_spdif_stream_info, 2777 .get = snd_ice1712_spdif_stream_get, 2778 .put = snd_ice1712_spdif_stream_put 3006 2779 }; 3007 2780 3008 #ifdef TARGET_OS23009 2781 #define ICE1712_GPIO(xiface, xname, xindex, mask, invert, xaccess) \ 3010 { xiface, 0, 0, xname, 0, xaccess, snd_ice1712_gpio_info, \ 3011 snd_ice1712_gpio_get, snd_ice1712_gpio_put, \ 3012 mask | (invert << 24) } 3013 #else 3014 #define ICE1712_GPIO(xiface, xname, xindex, mask, invert, xaccess) \ 3015 { iface: xiface, name: xname, access: xaccess, info: snd_ice1712_gpio_info, \ 3016 get: snd_ice1712_gpio_get, put: snd_ice1712_gpio_put, \ 3017 private_value: mask | (invert << 24) } 3018 #endif 2782 { .iface = xiface, .name = xname, .access = xaccess, .info = snd_ice1712_gpio_info, \ 2783 .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \ 2784 .private_value = mask | (invert << 24) } 3019 2785 3020 2786 static int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 3110 2876 3111 2877 static snd_kcontrol_new_t snd_ice1712_pro_spdif_master __devinitdata = { 3112 #ifdef TARGET_OS2 3113 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3114 "Multi Track IEC958 Master",0,0, 3115 snd_ice1712_pro_spdif_master_info, 3116 snd_ice1712_pro_spdif_master_get, 3117 snd_ice1712_pro_spdif_master_put,0 3118 #else 3119 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3120 name: "Multi Track IEC958 Master", 3121 info: snd_ice1712_pro_spdif_master_info, 3122 get: snd_ice1712_pro_spdif_master_get, 3123 put: snd_ice1712_pro_spdif_master_put 3124 #endif 2878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2879 .name = "Multi Track IEC958 Master", 2880 .info = snd_ice1712_pro_spdif_master_info, 2881 .get = snd_ice1712_pro_spdif_master_get, 2882 .put = snd_ice1712_pro_spdif_master_put 3125 2883 }; 3126 2884 … … 3269 3027 3270 3028 static snd_kcontrol_new_t snd_ice1712_mixer_pro_analog_route __devinitdata = { 3271 #ifdef TARGET_OS2 3272 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3273 "H/W Playback Route",0,0, 3274 snd_ice1712_pro_route_info, 3275 snd_ice1712_pro_route_analog_get, 3276 snd_ice1712_pro_route_analog_put,0 3277 #else 3278 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3279 name: "H/W Playback Route", 3280 info: snd_ice1712_pro_route_info, 3281 get: snd_ice1712_pro_route_analog_get, 3282 put: snd_ice1712_pro_route_analog_put, 3283 #endif 3029 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3030 .name = "H/W Playback Route", 3031 .info = snd_ice1712_pro_route_info, 3032 .get = snd_ice1712_pro_route_analog_get, 3033 .put = snd_ice1712_pro_route_analog_put, 3284 3034 }; 3285 3035 3286 3036 static snd_kcontrol_new_t snd_ice1712_mixer_pro_spdif_route __devinitdata = { 3287 #ifdef TARGET_OS2 3288 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3289 "IEC958 Playback Route",0,0, 3290 snd_ice1712_pro_route_info, 3291 snd_ice1712_pro_route_spdif_get, 3292 snd_ice1712_pro_route_spdif_put,0 3293 #else 3294 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3295 name: "IEC958 Playback Route", 3296 info: snd_ice1712_pro_route_info, 3297 get: snd_ice1712_pro_route_spdif_get, 3298 put: snd_ice1712_pro_route_spdif_put, 3299 #endif 3037 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3038 .name = "IEC958 Playback Route", 3039 .info = snd_ice1712_pro_route_info, 3040 .get = snd_ice1712_pro_route_spdif_get, 3041 .put = snd_ice1712_pro_route_spdif_put, 3300 3042 }; 3301 3043 … … 3335 3077 3336 3078 static snd_kcontrol_new_t snd_ice1712_mixer_pro_volume_rate __devinitdata = { 3337 #ifdef TARGET_OS2 3338 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3339 "Multi Track Volume Rate",0,0, 3340 snd_ice1712_pro_volume_rate_info, 3341 snd_ice1712_pro_volume_rate_get, 3342 snd_ice1712_pro_volume_rate_put,0 3343 #else 3344 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3345 name: "Multi Track Volume Rate", 3346 info: snd_ice1712_pro_volume_rate_info, 3347 get: snd_ice1712_pro_volume_rate_get, 3348 put: snd_ice1712_pro_volume_rate_put 3349 #endif 3079 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3080 .name = "Multi Track Volume Rate", 3081 .info = snd_ice1712_pro_volume_rate_info, 3082 .get = snd_ice1712_pro_volume_rate_get, 3083 .put = snd_ice1712_pro_volume_rate_put 3350 3084 }; 3351 3085 … … 3375 3109 3376 3110 static snd_kcontrol_new_t snd_ice1712_mixer_pro_peak __devinitdata = { 3377 #ifdef TARGET_OS2 3378 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3379 "Multi Track Peak",0, 3380 SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 3381 snd_ice1712_pro_peak_info, 3382 snd_ice1712_pro_peak_get,0,0 3383 #else 3384 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3385 name: "Multi Track Peak", 3386 access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 3387 info: snd_ice1712_pro_peak_info, 3388 get: snd_ice1712_pro_peak_get 3389 #endif 3111 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3112 .name = "Multi Track Peak", 3113 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 3114 .info = snd_ice1712_pro_peak_info, 3115 .get = snd_ice1712_pro_peak_get 3390 3116 }; 3391 3117 … … 3439 3165 3440 3166 static snd_kcontrol_new_t snd_ice1712_ewx_input_sense __devinitdata = { 3441 #ifdef TARGET_OS2 3442 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3443 "Input Sensitivity Switch",0,0, 3444 snd_ice1712_ewx_io_sense_info, 3445 snd_ice1712_ewx_io_sense_get, 3446 snd_ice1712_ewx_io_sense_put, 3447 ICE1712_EWX2496_AIN_SEL, 3448 #else 3449 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3450 name: "Input Sensitivity Switch", 3451 info: snd_ice1712_ewx_io_sense_info, 3452 get: snd_ice1712_ewx_io_sense_get, 3453 put: snd_ice1712_ewx_io_sense_put, 3454 private_value: ICE1712_EWX2496_AIN_SEL, 3455 #endif 3167 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3168 .name = "Input Sensitivity Switch", 3169 .info = snd_ice1712_ewx_io_sense_info, 3170 .get = snd_ice1712_ewx_io_sense_get, 3171 .put = snd_ice1712_ewx_io_sense_put, 3172 .private_value = ICE1712_EWX2496_AIN_SEL, 3456 3173 }; 3457 3174 3458 3175 static snd_kcontrol_new_t snd_ice1712_ewx_output_sense __devinitdata = { 3459 #ifdef TARGET_OS2 3460 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3461 "Output Sensitivity Switch",0,0, 3462 snd_ice1712_ewx_io_sense_info, 3463 snd_ice1712_ewx_io_sense_get, 3464 snd_ice1712_ewx_io_sense_put, 3465 ICE1712_EWX2496_AOUT_SEL, 3466 #else 3467 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3468 name: "Output Sensitivity Switch", 3469 info: snd_ice1712_ewx_io_sense_info, 3470 get: snd_ice1712_ewx_io_sense_get, 3471 put: snd_ice1712_ewx_io_sense_put, 3472 private_value: ICE1712_EWX2496_AOUT_SEL, 3473 #endif 3176 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3177 .name = "Output Sensitivity Switch", 3178 .info = snd_ice1712_ewx_io_sense_info, 3179 .get = snd_ice1712_ewx_io_sense_get, 3180 .put = snd_ice1712_ewx_io_sense_put, 3181 .private_value = ICE1712_EWX2496_AOUT_SEL, 3474 3182 }; 3475 3183 … … 3487 3195 if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) { 3488 3196 snd_i2c_unlock(ice->i2c); 3489 return -E REMOTE;3197 return -EIO; 3490 3198 } 3491 3199 snd_i2c_unlock(ice->i2c); … … 3503 3211 if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) { 3504 3212 snd_i2c_unlock(ice->i2c); 3505 return -E REMOTE;3213 return -EIO; 3506 3214 } 3507 3215 ndata = (data & ~ICE1712_EWS88MT_OUTPUT_SENSE) | (ucontrol->value.enumerated.item[0] ? ICE1712_EWS88MT_OUTPUT_SENSE : 0); 3508 3216 if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1) { 3509 3217 snd_i2c_unlock(ice->i2c); 3510 return -E REMOTE;3218 return -EIO; 3511 3219 } 3512 3220 snd_i2c_unlock(ice->i2c); … … 3525 3233 if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) { 3526 3234 snd_i2c_unlock(ice->i2c); 3527 return -E REMOTE;3235 return -EIO; 3528 3236 } 3529 3237 /* reversed; high = +4dBu, low = -10dBV */ … … 3543 3251 if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) { 3544 3252 snd_i2c_unlock(ice->i2c); 3545 return -E REMOTE;3253 return -EIO; 3546 3254 } 3547 3255 ndata = (data & ~(1 << channel)) | (ucontrol->value.enumerated.item[0] ? 0 : (1 << channel)); 3548 3256 if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[0], &ndata, 1) != 1) { 3549 3257 snd_i2c_unlock(ice->i2c); 3550 return -E REMOTE;3258 return -EIO; 3551 3259 } 3552 3260 snd_i2c_unlock(ice->i2c); … … 3555 3263 3556 3264 static snd_kcontrol_new_t snd_ice1712_ews88mt_input_sense __devinitdata = { 3557 #ifdef TARGET_OS2 3558 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3559 "Input Sensitivity Switch",0,0, 3560 snd_ice1712_ewx_io_sense_info, 3561 snd_ice1712_ews88mt_input_sense_get, 3562 snd_ice1712_ews88mt_input_sense_put,0 3563 #else 3564 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3565 name: "Input Sensitivity Switch", 3566 info: snd_ice1712_ewx_io_sense_info, 3567 get: snd_ice1712_ews88mt_input_sense_get, 3568 put: snd_ice1712_ews88mt_input_sense_put, 3569 #endif 3265 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3266 .name = "Input Sensitivity Switch", 3267 .info = snd_ice1712_ewx_io_sense_info, 3268 .get = snd_ice1712_ews88mt_input_sense_get, 3269 .put = snd_ice1712_ews88mt_input_sense_put, 3570 3270 }; 3571 3271 3572 3272 static snd_kcontrol_new_t snd_ice1712_ews88mt_output_sense __devinitdata = { 3573 #ifdef TARGET_OS2 3574 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 3575 "Output Sensitivity Switch",0,0, 3576 snd_ice1712_ewx_io_sense_info, 3577 snd_ice1712_ews88mt_output_sense_get, 3578 snd_ice1712_ews88mt_output_sense_put,0 3579 #else 3580 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 3581 name: "Output Sensitivity Switch", 3582 info: snd_ice1712_ewx_io_sense_info, 3583 get: snd_ice1712_ews88mt_output_sense_get, 3584 put: snd_ice1712_ews88mt_output_sense_put, 3585 #endif 3273 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3274 .name = "Output Sensitivity Switch", 3275 .info = snd_ice1712_ewx_io_sense_info, 3276 .get = snd_ice1712_ews88mt_output_sense_get, 3277 .put = snd_ice1712_ews88mt_output_sense_put, 3586 3278 }; 3587 3279 … … 3610 3302 if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) { 3611 3303 snd_i2c_unlock(ice->i2c); 3612 return -E REMOTE;3304 return -EIO; 3613 3305 } 3614 3306 snd_i2c_unlock(ice->i2c); … … 3631 3323 if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) { 3632 3324 snd_i2c_unlock(ice->i2c); 3633 return -E REMOTE;3325 return -EIO; 3634 3326 } 3635 3327 ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7)); … … 3644 3336 if (change && snd_i2c_sendbytes(ice->pcf8575, data, 2) != 2) { 3645 3337 snd_i2c_unlock(ice->i2c); 3646 return -E REMOTE;3338 return -EIO; 3647 3339 } 3648 3340 snd_i2c_unlock(ice->i2c); … … 3650 3342 } 3651 3343 3652 #ifdef TARGET_OS23653 3344 #define EWS88D_CONTROL(xiface, xname, xshift, xinvert, xaccess) \ 3654 { xiface,0,0,\ 3655 xname, 0,\ 3656 xaccess,\ 3657 snd_ice1712_ews88d_control_info,\ 3658 snd_ice1712_ews88d_control_get,\ 3659 snd_ice1712_ews88d_control_put,\ 3660 xshift | (xinvert << 8),\ 3661 } 3662 #else 3663 #define EWS88D_CONTROL(xiface, xname, xshift, xinvert, xaccess) \ 3664 { iface: xiface,\ 3665 name: xname,\ 3666 access: xaccess,\ 3667 info: snd_ice1712_ews88d_control_info,\ 3668 get: snd_ice1712_ews88d_control_get,\ 3669 put: snd_ice1712_ews88d_control_put,\ 3670 private_value: xshift | (xinvert << 8),\ 3671 } 3672 #endif 3345 { .iface = xiface,\ 3346 .name = xname,\ 3347 .access = xaccess,\ 3348 .info = snd_ice1712_ews88d_control_info,\ 3349 .get = snd_ice1712_ews88d_control_get,\ 3350 .put = snd_ice1712_ews88d_control_put,\ 3351 .private_value = xshift | (xinvert << 8),\ 3352 } 3673 3353 3674 3354 static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = { … … 3694 3374 if (snd_i2c_readbytes(ice->pcf8575, &byte, 1) != 1) { 3695 3375 snd_i2c_unlock(ice->i2c); 3696 return -E REMOTE;3376 return -EIO; 3697 3377 } 3698 3378 snd_i2c_unlock(ice->i2c); … … 3708 3388 if (snd_i2c_sendbytes(ice->pcf8575, bytes, 2) != 2) { 3709 3389 snd_i2c_unlock(ice->i2c); 3710 return -E REMOTE;3390 return -EIO; 3711 3391 } 3712 3392 snd_i2c_unlock(ice->i2c); … … 3761 3441 3762 3442 #define DMX6FIRE_CONTROL(xiface, xname, xshift, xinvert, xaccess) \ 3763 { iface:xiface,\3764 name:xname,\3765 access:xaccess,\3766 info:snd_ice1712_6fire_control_info,\3767 get:snd_ice1712_6fire_control_get,\3768 put:snd_ice1712_6fire_control_put,\3769 private_value:xshift | (xinvert << 8),\3443 { .iface = xiface,\ 3444 .name = xname,\ 3445 .access = xaccess,\ 3446 .info = snd_ice1712_6fire_control_info,\ 3447 .get = snd_ice1712_6fire_control_get,\ 3448 .put = snd_ice1712_6fire_control_put,\ 3449 .private_value = xshift | (xinvert << 8),\ 3770 3450 } 3771 3451 … … 4164 3844 /* second stage of initialization, analog parts and others */ 4165 3845 switch (ice->eeprom.subvendor) { 3846 case ICE1712_SUBDEVICE_EWS88MT: 3847 /* Check if the front module is connected */ 3848 if ((err = snd_ice1712_ews88mt_chip_select(ice, 0x0f)) < 0) 3849 return err; 3850 /* Fall through */ 4166 3851 case ICE1712_SUBDEVICE_DELTA66: 4167 3852 case ICE1712_SUBDEVICE_DELTA44: 4168 3853 case ICE1712_SUBDEVICE_AUDIOPHILE: 4169 3854 case ICE1712_SUBDEVICE_EWX2496: 4170 case ICE1712_SUBDEVICE_EWS88MT:4171 3855 case ICE1712_SUBDEVICE_DMX6FIRE: 4172 3856 snd_ice1712_ak4524_init(ice); … … 4408 4092 __hw_end: 4409 4093 snd_ice1712_proc_done(ice); 4410 synchronize_irq();4411 if (ice->irq)4094 if (ice->irq >= 0) { 4095 synchronize_irq(ice->irq); 4412 4096 free_irq(ice->irq, (void *) ice); 4097 } 4413 4098 if (ice->res_port) { 4414 4099 release_resource(ice->res_port); … … 4444 4129 ice1712_t *ice; 4445 4130 int err; 4446 #ifdef TARGET_OS24447 4131 static snd_device_ops_t ops = { 4448 snd_ice1712_dev_free,0,0,04132 .dev_free = snd_ice1712_dev_free, 4449 4133 }; 4450 #else4451 static snd_device_ops_t ops = {4452 dev_free: snd_ice1712_dev_free,4453 };4454 #endif4455 4134 4456 4135 *r_ice1712 = NULL; … … 4487 4166 pci_write_config_word(ice->pci, 0x42, 0x0006); 4488 4167 snd_ice1712_proc_init(ice); 4489 synchronize_irq( );4168 synchronize_irq(pci->irq); 4490 4169 4491 4170 if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) { … … 4666 4345 } 4667 4346 4668 #ifdef TARGET_OS24669 4347 static struct pci_driver driver = { 4670 0,0,"ICE1712",4671 snd_ice1712_ids,4672 snd_ice1712_probe,4673 snd_ice1712_remove,0,04348 .name = "ICE1712", 4349 .id_table = snd_ice1712_ids, 4350 .probe = snd_ice1712_probe, 4351 .remove = __devexit_p(snd_ice1712_remove), 4674 4352 }; 4675 #else4676 static struct pci_driver driver = {4677 name: "ICE1712",4678 id_table: snd_ice1712_ids,4679 probe: snd_ice1712_probe,4680 remove: __devexit_p(snd_ice1712_remove),4681 };4682 #endif4683 4353 4684 4354 static int __init alsa_card_ice1712_init(void) -
GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c
r206 r210 3272 3272 3273 3273 static struct pci_driver joystick_driver = { 3274 0, 0, 0, 3275 /* name: */ "Intel ICH Joystick", 3276 /* id_table: */ snd_intel8x0_joystick_ids, 3277 /* probe: */ snd_intel8x0_joystick_probe, 3278 0,0,0 3274 .name = "Intel ICH Joystick", 3275 .id_table = snd_intel8x0_joystick_ids, 3276 .probe = snd_intel8x0_joystick_probe, 3279 3277 }; 3280 3278 static int have_joystick; -
GPL/branches/alsa-resync1/alsa-kernel/pci/korg1212/korg1212.c
r207 r210 30 30 #include <sound/control.h> 31 31 #include <sound/pcm.h> 32 #include <sound/pcm_params.h> 32 33 #define SNDRV_GET_ID 33 34 #include <sound/initval.h> … … 1162 1163 static snd_pcm_hardware_t snd_korg1212_playback_info = 1163 1164 { 1164 info:(SNDRV_PCM_INFO_MMAP |1165 .info = (SNDRV_PCM_INFO_MMAP | 1165 1166 SNDRV_PCM_INFO_MMAP_VALID | 1166 1167 SNDRV_PCM_INFO_INTERLEAVED), 1167 formats:SNDRV_PCM_FMTBIT_S16_LE,1168 rates:(SNDRV_PCM_RATE_44100 |1168 .formats = SNDRV_PCM_FMTBIT_S16_LE, 1169 .rates = (SNDRV_PCM_RATE_44100 | 1169 1170 SNDRV_PCM_RATE_48000), 1170 rate_min:44100,1171 rate_max:48000,1172 channels_min:K1212_CHANNELS,1173 channels_max:K1212_CHANNELS,1174 buffer_bytes_max:K1212_BUF_SIZE,1175 period_bytes_min:K1212_PERIOD_BYTES,1176 period_bytes_max:K1212_PERIOD_BYTES,1177 periods_min:K1212_PERIODS,1178 periods_max:K1212_PERIODS,1179 fifo_size:0,1171 .rate_min = 44100, 1172 .rate_max = 48000, 1173 .channels_min = K1212_CHANNELS, 1174 .channels_max = K1212_CHANNELS, 1175 .buffer_bytes_max = K1212_BUF_SIZE, 1176 .period_bytes_min = K1212_PERIOD_BYTES, 1177 .period_bytes_max = K1212_PERIOD_BYTES, 1178 .periods_min = K1212_PERIODS, 1179 .periods_max = K1212_PERIODS, 1180 .fifo_size = 0, 1180 1181 }; 1181 1182 1182 1183 static snd_pcm_hardware_t snd_korg1212_capture_info = 1183 1184 { 1184 info:(SNDRV_PCM_INFO_MMAP |1185 .info = (SNDRV_PCM_INFO_MMAP | 1185 1186 SNDRV_PCM_INFO_MMAP_VALID | 1186 1187 SNDRV_PCM_INFO_INTERLEAVED), 1187 formats:SNDRV_PCM_FMTBIT_S16_LE,1188 rates:(SNDRV_PCM_RATE_44100 |1188 .formats = SNDRV_PCM_FMTBIT_S16_LE, 1189 .rates = (SNDRV_PCM_RATE_44100 | 1189 1190 SNDRV_PCM_RATE_48000), 1190 rate_min:44100,1191 rate_max:48000,1192 channels_min:K1212_CHANNELS,1193 channels_max:K1212_CHANNELS,1194 buffer_bytes_max:K1212_BUF_SIZE,1195 period_bytes_min:K1212_PERIOD_BYTES,1196 period_bytes_max:K1212_PERIOD_BYTES,1197 periods_min:K1212_PERIODS,1198 periods_max:K1212_PERIODS,1199 fifo_size:0,1191 .rate_min = 44100, 1192 .rate_max = 48000, 1193 .channels_min = K1212_CHANNELS, 1194 .channels_max = K1212_CHANNELS, 1195 .buffer_bytes_max = K1212_BUF_SIZE, 1196 .period_bytes_min = K1212_PERIOD_BYTES, 1197 .period_bytes_max = K1212_PERIOD_BYTES, 1198 .periods_min = K1212_PERIODS, 1199 .periods_max = K1212_PERIODS, 1200 .fifo_size = 0, 1200 1201 }; 1201 1202 … … 1216 1217 1217 1218 static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = { 1218 count:PERIOD_BYTES,1219 list:period_bytes,1220 mask:01219 .count = PERIOD_BYTES, 1220 .list = period_bytes, 1221 .mask = 0 1221 1222 }; 1222 1223 … … 1504 1505 1505 1506 static snd_pcm_ops_t snd_korg1212_playback_ops = { 1506 open:snd_korg1212_playback_open,1507 close:snd_korg1212_playback_close,1508 ioctl:snd_korg1212_ioctl,1509 hw_params:snd_korg1212_hw_params,1510 prepare:snd_korg1212_prepare,1511 trigger:snd_korg1212_trigger,1512 pointer:snd_korg1212_pointer,1513 copy:snd_korg1212_playback_copy,1514 silence:snd_korg1212_playback_silence,1507 .open = snd_korg1212_playback_open, 1508 .close = snd_korg1212_playback_close, 1509 .ioctl = snd_korg1212_ioctl, 1510 .hw_params = snd_korg1212_hw_params, 1511 .prepare = snd_korg1212_prepare, 1512 .trigger = snd_korg1212_trigger, 1513 .pointer = snd_korg1212_pointer, 1514 .copy = snd_korg1212_playback_copy, 1515 .silence = snd_korg1212_playback_silence, 1515 1516 }; 1516 1517 1517 1518 static snd_pcm_ops_t snd_korg1212_capture_ops = { 1518 open:snd_korg1212_capture_open,1519 close:snd_korg1212_capture_close,1520 ioctl:snd_korg1212_ioctl,1521 hw_params:snd_korg1212_hw_params,1522 prepare:snd_korg1212_prepare,1523 trigger:snd_korg1212_trigger,1524 pointer:snd_korg1212_pointer,1525 copy:snd_korg1212_capture_copy,1519 .open = snd_korg1212_capture_open, 1520 .close = snd_korg1212_capture_close, 1521 .ioctl = snd_korg1212_ioctl, 1522 .hw_params = snd_korg1212_hw_params, 1523 .prepare = snd_korg1212_prepare, 1524 .trigger = snd_korg1212_trigger, 1525 .pointer = snd_korg1212_pointer, 1526 .copy = snd_korg1212_capture_copy, 1526 1527 }; 1527 1528 … … 1803 1804 #define MON_MIXER(ord,c_name) \ 1804 1805 { \ 1805 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \1806 iface:SNDRV_CTL_ELEM_IFACE_MIXER, \1807 name: c_name " Monitor Volume",\1808 info:snd_korg1212_control_volume_info, \1809 get:snd_korg1212_control_volume_get, \1810 put:snd_korg1212_control_volume_put, \1811 private_value:ord, \1806 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \ 1807 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1808 .name = c_name " Monitor Volume", \ 1809 .info = snd_korg1212_control_volume_info, \ 1810 .get = snd_korg1212_control_volume_get, \ 1811 .put = snd_korg1212_control_volume_put, \ 1812 .private_value = ord, \ 1812 1813 }, \ 1813 1814 { \ 1814 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \1815 iface:SNDRV_CTL_ELEM_IFACE_MIXER, \1816 name: c_name " Monitor Route",\1817 info:snd_korg1212_control_route_info, \1818 get:snd_korg1212_control_route_get, \1819 put:snd_korg1212_control_route_put, \1820 private_value:ord, \1815 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \ 1816 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1817 .name = c_name " Monitor Route", \ 1818 .info = snd_korg1212_control_route_info, \ 1819 .get = snd_korg1212_control_route_get, \ 1820 .put = snd_korg1212_control_route_put, \ 1821 .private_value = ord, \ 1821 1822 }, \ 1822 1823 { \ 1823 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \1824 iface:SNDRV_CTL_ELEM_IFACE_PCM, \1825 name: c_name " Monitor Phase Invert",\1826 info:snd_korg1212_control_phase_info, \1827 get:snd_korg1212_control_phase_get, \1828 put:snd_korg1212_control_phase_put, \1829 private_value:ord, \1824 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, \ 1825 .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1826 .name = c_name " Monitor Phase Invert", \ 1827 .info = snd_korg1212_control_phase_info, \ 1828 .get = snd_korg1212_control_phase_get, \ 1829 .put = snd_korg1212_control_phase_put, \ 1830 .private_value = ord, \ 1830 1831 } 1831 1832 … … 1836 1837 MON_MIXER(4, "ADAT-5"), MON_MIXER(5, "ADAT-6"), MON_MIXER(6, "ADAT-7"), MON_MIXER(7, "ADAT-8"), 1837 1838 { 1838 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,1839 iface:SNDRV_CTL_ELEM_IFACE_PCM,1840 name:"Sync Source",1841 info:snd_korg1212_control_sync_info,1842 get:snd_korg1212_control_sync_get,1843 put:snd_korg1212_control_sync_put,1839 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, 1840 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1841 .name = "Sync Source", 1842 .info = snd_korg1212_control_sync_info, 1843 .get = snd_korg1212_control_sync_get, 1844 .put = snd_korg1212_control_sync_put, 1844 1845 }, 1845 1846 { 1846 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE,1847 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1848 name:"ADC Attenuation",1849 info:snd_korg1212_control_analog_info,1850 get:snd_korg1212_control_analog_get,1851 put:snd_korg1212_control_analog_put,1847 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE, 1848 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1849 .name = "ADC Attenuation", 1850 .info = snd_korg1212_control_analog_info, 1851 .get = snd_korg1212_control_analog_get, 1852 .put = snd_korg1212_control_analog_put, 1852 1853 } 1853 1854 }; … … 2305 2306 2306 2307 static struct pci_driver driver = { 2307 name:"korg1212",2308 id_table:snd_korg1212_ids,2309 probe:snd_korg1212_probe,2310 remove:__devexit_p(snd_korg1212_remove),2308 .name = "korg1212", 2309 .id_table = snd_korg1212_ids, 2310 .probe = snd_korg1212_probe, 2311 .remove = __devexit_p(snd_korg1212_remove), 2311 2312 }; 2312 2313 -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c
r207 r210 34 34 #include <sound/control.h> 35 35 #include <sound/pcm.h> 36 #include <sound/pcm_params.h> 36 37 #include <sound/asoundef.h> 37 38 #define SNDRV_GET_ID … … 374 375 * Digital output capabilites (S/PDIF) 375 376 */ 376 #ifdef TARGET_OS2377 377 static snd_pcm_hardware_t snd_rme96_playback_spdif_info = 378 378 { 379 /* info: */(SNDRV_PCM_INFO_MMAP |379 .info = (SNDRV_PCM_INFO_MMAP | 380 380 SNDRV_PCM_INFO_MMAP_VALID | 381 381 SNDRV_PCM_INFO_INTERLEAVED | 382 382 SNDRV_PCM_INFO_PAUSE), 383 /* formats: */(SNDRV_PCM_FMTBIT_S16_LE |383 .formats = (SNDRV_PCM_FMTBIT_S16_LE | 384 384 SNDRV_PCM_FMTBIT_S32_LE), 385 /* rates: */(SNDRV_PCM_RATE_32000 |385 .rates = (SNDRV_PCM_RATE_32000 | 386 386 SNDRV_PCM_RATE_44100 | 387 387 SNDRV_PCM_RATE_48000 | … … 389 389 SNDRV_PCM_RATE_88200 | 390 390 SNDRV_PCM_RATE_96000), 391 /* rate_min: */32000,392 /* rate_max: */96000,393 /* channels_min: */2,394 /* channels_max: */2,395 /* buffer_bytes_max: */RME96_BUFFER_SIZE,396 /* period_bytes_min: */RME96_SMALL_BLOCK_SIZE,397 /* period_bytes_max: */RME96_LARGE_BLOCK_SIZE,398 /* periods_min: */RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,399 /* periods_max: */RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,400 /* fifo_size: */0,391 .rate_min = 32000, 392 .rate_max = 96000, 393 .channels_min = 2, 394 .channels_max = 2, 395 .buffer_bytes_max = RME96_BUFFER_SIZE, 396 .period_bytes_min = RME96_SMALL_BLOCK_SIZE, 397 .period_bytes_max = RME96_LARGE_BLOCK_SIZE, 398 .periods_min = RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE, 399 .periods_max = RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE, 400 .fifo_size = 0, 401 401 }; 402 402 … … 406 406 static snd_pcm_hardware_t snd_rme96_capture_spdif_info = 407 407 { 408 /* info: */(SNDRV_PCM_INFO_MMAP |408 .info = (SNDRV_PCM_INFO_MMAP | 409 409 SNDRV_PCM_INFO_MMAP_VALID | 410 410 SNDRV_PCM_INFO_INTERLEAVED | 411 411 SNDRV_PCM_INFO_PAUSE), 412 /* formats: */(SNDRV_PCM_FMTBIT_S16_LE |412 .formats = (SNDRV_PCM_FMTBIT_S16_LE | 413 413 SNDRV_PCM_FMTBIT_S32_LE), 414 /* rates: */(SNDRV_PCM_RATE_32000 |414 .rates = (SNDRV_PCM_RATE_32000 | 415 415 SNDRV_PCM_RATE_44100 | 416 416 SNDRV_PCM_RATE_48000 | … … 418 418 SNDRV_PCM_RATE_88200 | 419 419 SNDRV_PCM_RATE_96000), 420 /* rate_min: */32000,421 /* rate_max: */96000,422 /* channels_min: */2,423 /* channels_max: */2,424 /* buffer_bytes_max: */RME96_BUFFER_SIZE,425 /* period_bytes_min: */RME96_SMALL_BLOCK_SIZE,426 /* period_bytes_max: */RME96_LARGE_BLOCK_SIZE,427 /* periods_min: */RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,428 /* periods_max: */RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,429 /* fifo_size: */0,420 .rate_min = 32000, 421 .rate_max = 96000, 422 .channels_min = 2, 423 .channels_max = 2, 424 .buffer_bytes_max = RME96_BUFFER_SIZE, 425 .period_bytes_min = RME96_SMALL_BLOCK_SIZE, 426 .period_bytes_max = RME96_LARGE_BLOCK_SIZE, 427 .periods_min = RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE, 428 .periods_max = RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE, 429 .fifo_size = 0, 430 430 }; 431 431 … … 435 435 static snd_pcm_hardware_t snd_rme96_playback_adat_info = 436 436 { 437 /* info: */(SNDRV_PCM_INFO_MMAP |437 .info = (SNDRV_PCM_INFO_MMAP | 438 438 SNDRV_PCM_INFO_MMAP_VALID | 439 439 SNDRV_PCM_INFO_INTERLEAVED | 440 440 SNDRV_PCM_INFO_PAUSE), 441 /* formats: */ SNDRV_PCM_FMTBIT_S16_LE, 442 /* rates: */ (SNDRV_PCM_RATE_44100 | 441 .formats = (SNDRV_PCM_FMTBIT_S16_LE | 442 SNDRV_PCM_FMTBIT_S32_LE), 443 .rates = (SNDRV_PCM_RATE_44100 | 443 444 SNDRV_PCM_RATE_48000), 444 /* rate_min: */44100,445 /* rate_max: */48000,446 /* channels_min: */8,447 /* channels_max: */8,448 /* buffer_bytes_max: */RME96_BUFFER_SIZE,449 /* period_bytes_min: */RME96_SMALL_BLOCK_SIZE,450 /* period_bytes_max: */RME96_LARGE_BLOCK_SIZE,451 /* periods_min: */RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,452 /* periods_max: */RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,453 /* fifo_size: */0,445 .rate_min = 44100, 446 .rate_max = 48000, 447 .channels_min = 8, 448 .channels_max = 8, 449 .buffer_bytes_max = RME96_BUFFER_SIZE, 450 .period_bytes_min = RME96_SMALL_BLOCK_SIZE, 451 .period_bytes_max = RME96_LARGE_BLOCK_SIZE, 452 .periods_min = RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE, 453 .periods_max = RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE, 454 .fifo_size = 0, 454 455 }; 455 456 … … 459 460 static snd_pcm_hardware_t snd_rme96_capture_adat_info = 460 461 { 461 /* info: */(SNDRV_PCM_INFO_MMAP |462 .info = (SNDRV_PCM_INFO_MMAP | 462 463 SNDRV_PCM_INFO_MMAP_VALID | 463 464 SNDRV_PCM_INFO_INTERLEAVED | 464 465 SNDRV_PCM_INFO_PAUSE), 465 /* formats: */ SNDRV_PCM_FMTBIT_S16_LE, 466 /* rates: */ (SNDRV_PCM_RATE_44100 | 466 .formats = (SNDRV_PCM_FMTBIT_S16_LE | 467 SNDRV_PCM_FMTBIT_S32_LE), 468 .rates = (SNDRV_PCM_RATE_44100 | 467 469 SNDRV_PCM_RATE_48000), 468 /* rate_min: */44100,469 /* rate_max: */48000,470 /* channels_min: */8,471 /* channels_max: */8,472 /* buffer_bytes_max: */RME96_BUFFER_SIZE,473 /* period_bytes_min: */RME96_SMALL_BLOCK_SIZE,474 /* period_bytes_max: */RME96_LARGE_BLOCK_SIZE,475 /* periods_min: */RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,476 /* periods_max: */RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,477 /* fifo_size: */0,470 .rate_min = 44100, 471 .rate_max = 48000, 472 .channels_min = 8, 473 .channels_max = 8, 474 .buffer_bytes_max = RME96_BUFFER_SIZE, 475 .period_bytes_min = RME96_SMALL_BLOCK_SIZE, 476 .period_bytes_max = RME96_LARGE_BLOCK_SIZE, 477 .periods_min = RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE, 478 .periods_max = RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE, 479 .fifo_size = 0, 478 480 }; 479 #else480 static snd_pcm_hardware_t snd_rme96_playback_spdif_info =481 {482 info: (SNDRV_PCM_INFO_MMAP |483 SNDRV_PCM_INFO_MMAP_VALID |484 SNDRV_PCM_INFO_INTERLEAVED |485 SNDRV_PCM_INFO_PAUSE),486 formats: (SNDRV_PCM_FMTBIT_S16_LE |487 SNDRV_PCM_FMTBIT_S32_LE),488 rates: (SNDRV_PCM_RATE_32000 |489 SNDRV_PCM_RATE_44100 |490 SNDRV_PCM_RATE_48000 |491 SNDRV_PCM_RATE_64000 |492 SNDRV_PCM_RATE_88200 |493 SNDRV_PCM_RATE_96000),494 rate_min: 32000,495 rate_max: 96000,496 channels_min: 2,497 channels_max: 2,498 buffer_bytes_max: RME96_BUFFER_SIZE,499 period_bytes_min: RME96_SMALL_BLOCK_SIZE,500 period_bytes_max: RME96_LARGE_BLOCK_SIZE,501 periods_min: RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,502 periods_max: RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,503 fifo_size: 0,504 };505 506 /*507 * Digital input capabilites (S/PDIF)508 */509 static snd_pcm_hardware_t snd_rme96_capture_spdif_info =510 {511 info: (SNDRV_PCM_INFO_MMAP |512 SNDRV_PCM_INFO_MMAP_VALID |513 SNDRV_PCM_INFO_INTERLEAVED |514 SNDRV_PCM_INFO_PAUSE),515 formats: (SNDRV_PCM_FMTBIT_S16_LE |516 SNDRV_PCM_FMTBIT_S32_LE),517 rates: (SNDRV_PCM_RATE_32000 |518 SNDRV_PCM_RATE_44100 |519 SNDRV_PCM_RATE_48000 |520 SNDRV_PCM_RATE_64000 |521 SNDRV_PCM_RATE_88200 |522 SNDRV_PCM_RATE_96000),523 rate_min: 32000,524 rate_max: 96000,525 channels_min: 2,526 channels_max: 2,527 buffer_bytes_max: RME96_BUFFER_SIZE,528 period_bytes_min: RME96_SMALL_BLOCK_SIZE,529 period_bytes_max: RME96_LARGE_BLOCK_SIZE,530 periods_min: RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,531 periods_max: RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,532 fifo_size: 0,533 };534 535 /*536 * Digital output capabilites (ADAT)537 */538 static snd_pcm_hardware_t snd_rme96_playback_adat_info =539 {540 info: (SNDRV_PCM_INFO_MMAP |541 SNDRV_PCM_INFO_MMAP_VALID |542 SNDRV_PCM_INFO_INTERLEAVED |543 SNDRV_PCM_INFO_PAUSE),544 formats: SNDRV_PCM_FMTBIT_S16_LE,545 rates: (SNDRV_PCM_RATE_44100 |546 SNDRV_PCM_RATE_48000),547 rate_min: 44100,548 rate_max: 48000,549 channels_min: 8,550 channels_max: 8,551 buffer_bytes_max: RME96_BUFFER_SIZE,552 period_bytes_min: RME96_SMALL_BLOCK_SIZE,553 period_bytes_max: RME96_LARGE_BLOCK_SIZE,554 periods_min: RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,555 periods_max: RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,556 fifo_size: 0,557 };558 559 /*560 * Digital input capabilites (ADAT)561 */562 static snd_pcm_hardware_t snd_rme96_capture_adat_info =563 {564 info: (SNDRV_PCM_INFO_MMAP |565 SNDRV_PCM_INFO_MMAP_VALID |566 SNDRV_PCM_INFO_INTERLEAVED |567 SNDRV_PCM_INFO_PAUSE),568 formats: SNDRV_PCM_FMTBIT_S16_LE,569 rates: (SNDRV_PCM_RATE_44100 |570 SNDRV_PCM_RATE_48000),571 rate_min: 44100,572 rate_max: 48000,573 channels_min: 8,574 channels_max: 8,575 buffer_bytes_max: RME96_BUFFER_SIZE,576 period_bytes_min: RME96_SMALL_BLOCK_SIZE,577 period_bytes_max: RME96_LARGE_BLOCK_SIZE,578 periods_min: RME96_BUFFER_SIZE / RME96_LARGE_BLOCK_SIZE,579 periods_max: RME96_BUFFER_SIZE / RME96_SMALL_BLOCK_SIZE,580 fifo_size: 0,581 };582 #endif583 481 584 482 /* … … 1253 1151 #define PERIOD_BYTES sizeof(period_bytes) / sizeof(period_bytes[0]) 1254 1152 1255 #ifdef TARGET_OS21256 1153 static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = { 1257 PERIOD_BYTES,1258 period_bytes,1259 01154 .count = PERIOD_BYTES, 1155 .list = period_bytes, 1156 .mask = 0 1260 1157 }; 1261 #else1262 static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = {1263 count: PERIOD_BYTES,1264 list: period_bytes,1265 mask: 01266 };1267 #endif1268 1158 1269 1159 static int … … 1604 1494 } 1605 1495 1606 #ifdef TARGET_OS21607 1496 static snd_pcm_ops_t snd_rme96_playback_spdif_ops = { 1608 /* open: */snd_rme96_playback_spdif_open,1609 /* close: */snd_rme96_playback_close,1610 /* ioctl: */snd_pcm_lib_ioctl,1611 /* hw_params:*/snd_rme96_playback_hw_params,1612 /* hw_free: */snd_rme96_playback_hw_free,1613 /* prepare: */snd_rme96_playback_prepare,1614 /* trigger: */snd_rme96_playback_trigger,1615 /* pointer: */snd_rme96_playback_pointer,1616 /* copy: */snd_rme96_playback_copy,1617 /* silence: */snd_rme96_playback_silence,1497 .open = snd_rme96_playback_spdif_open, 1498 .close = snd_rme96_playback_close, 1499 .ioctl = snd_pcm_lib_ioctl, 1500 .hw_params = snd_rme96_playback_hw_params, 1501 .hw_free = snd_rme96_playback_hw_free, 1502 .prepare = snd_rme96_playback_prepare, 1503 .trigger = snd_rme96_playback_trigger, 1504 .pointer = snd_rme96_playback_pointer, 1505 .copy = snd_rme96_playback_copy, 1506 .silence = snd_rme96_playback_silence, 1618 1507 }; 1619 1508 1620 1509 static snd_pcm_ops_t snd_rme96_capture_spdif_ops = { 1621 /* open: */ snd_rme96_capture_spdif_open, 1622 /* close: */ snd_rme96_capture_close, 1623 /* ioctl: */ snd_pcm_lib_ioctl, 1624 /* hw_params:*/ snd_rme96_capture_hw_params, 1625 /* hw_free: */ snd_rme96_capture_hw_free, 1626 /* prepare: */ snd_rme96_capture_prepare, 1627 /* trigger: */ snd_rme96_capture_trigger, 1628 /* pointer: */ snd_rme96_capture_pointer, 1629 /* copy: */ snd_rme96_capture_copy, 1630 0 1510 .open = snd_rme96_capture_spdif_open, 1511 .close = snd_rme96_capture_close, 1512 .ioctl = snd_pcm_lib_ioctl, 1513 .hw_params = snd_rme96_capture_hw_params, 1514 .hw_free = snd_rme96_capture_hw_free, 1515 .prepare = snd_rme96_capture_prepare, 1516 .trigger = snd_rme96_capture_trigger, 1517 .pointer = snd_rme96_capture_pointer, 1518 .copy = snd_rme96_capture_copy, 1631 1519 }; 1632 1520 1633 1521 static snd_pcm_ops_t snd_rme96_playback_adat_ops = { 1634 /* open: */snd_rme96_playback_adat_open,1635 /* close: */snd_rme96_playback_close,1636 /* ioctl: */snd_pcm_lib_ioctl,1637 /* hw_params:*/snd_rme96_playback_hw_params,1638 /* hw_free: */snd_rme96_playback_hw_free,1639 /* prepare: */snd_rme96_playback_prepare,1640 /* trigger: */snd_rme96_playback_trigger,1641 /* pointer: */snd_rme96_playback_pointer,1642 /* copy: */snd_rme96_playback_copy,1643 /* silence: */snd_rme96_playback_silence,1522 .open = snd_rme96_playback_adat_open, 1523 .close = snd_rme96_playback_close, 1524 .ioctl = snd_pcm_lib_ioctl, 1525 .hw_params = snd_rme96_playback_hw_params, 1526 .hw_free = snd_rme96_playback_hw_free, 1527 .prepare = snd_rme96_playback_prepare, 1528 .trigger = snd_rme96_playback_trigger, 1529 .pointer = snd_rme96_playback_pointer, 1530 .copy = snd_rme96_playback_copy, 1531 .silence = snd_rme96_playback_silence, 1644 1532 }; 1645 1533 1646 1534 static snd_pcm_ops_t snd_rme96_capture_adat_ops = { 1647 /* open: */snd_rme96_capture_adat_open,1648 /* close: */snd_rme96_capture_close,1649 /* ioctl: */snd_pcm_lib_ioctl,1650 /* hw_params:*/snd_rme96_capture_hw_params,1651 /* hw_free: */snd_rme96_capture_hw_free,1652 /* prepare: */snd_rme96_capture_prepare,1653 /* trigger: */snd_rme96_capture_trigger,1654 /* pointer: */snd_rme96_capture_pointer,1655 /* copy: */snd_rme96_capture_copy,1535 .open = snd_rme96_capture_adat_open, 1536 .close = snd_rme96_capture_close, 1537 .ioctl = snd_pcm_lib_ioctl, 1538 .hw_params = snd_rme96_capture_hw_params, 1539 .hw_free = snd_rme96_capture_hw_free, 1540 .prepare = snd_rme96_capture_prepare, 1541 .trigger = snd_rme96_capture_trigger, 1542 .pointer = snd_rme96_capture_pointer, 1543 .copy = snd_rme96_capture_copy, 1656 1544 }; 1657 #else1658 static snd_pcm_ops_t snd_rme96_playback_spdif_ops = {1659 open: snd_rme96_playback_spdif_open,1660 close: snd_rme96_playback_close,1661 ioctl: snd_pcm_lib_ioctl,1662 hw_params: snd_rme96_playback_hw_params,1663 hw_free: snd_rme96_playback_hw_free,1664 prepare: snd_rme96_playback_prepare,1665 trigger: snd_rme96_playback_trigger,1666 pointer: snd_rme96_playback_pointer,1667 copy: snd_rme96_playback_copy,1668 silence: snd_rme96_playback_silence,1669 };1670 1671 static snd_pcm_ops_t snd_rme96_capture_spdif_ops = {1672 open: snd_rme96_capture_spdif_open,1673 close: snd_rme96_capture_close,1674 ioctl: snd_pcm_lib_ioctl,1675 hw_params: snd_rme96_capture_hw_params,1676 hw_free: snd_rme96_capture_hw_free,1677 prepare: snd_rme96_capture_prepare,1678 trigger: snd_rme96_capture_trigger,1679 pointer: snd_rme96_capture_pointer,1680 copy: snd_rme96_capture_copy,1681 };1682 1683 static snd_pcm_ops_t snd_rme96_playback_adat_ops = {1684 open: snd_rme96_playback_adat_open,1685 close: snd_rme96_playback_close,1686 ioctl: snd_pcm_lib_ioctl,1687 hw_params: snd_rme96_playback_hw_params,1688 hw_free: snd_rme96_playback_hw_free,1689 prepare: snd_rme96_playback_prepare,1690 trigger: snd_rme96_playback_trigger,1691 pointer: snd_rme96_playback_pointer,1692 copy: snd_rme96_playback_copy,1693 silence: snd_rme96_playback_silence,1694 };1695 1696 static snd_pcm_ops_t snd_rme96_capture_adat_ops = {1697 open: snd_rme96_capture_adat_open,1698 close: snd_rme96_capture_close,1699 ioctl: snd_pcm_lib_ioctl,1700 hw_params: snd_rme96_capture_hw_params,1701 hw_free: snd_rme96_capture_hw_free,1702 prepare: snd_rme96_capture_prepare,1703 trigger: snd_rme96_capture_trigger,1704 pointer: snd_rme96_capture_pointer,1705 copy: snd_rme96_capture_copy,1706 };1707 #endif1708 1545 1709 1546 static void … … 2468 2305 } 2469 2306 2470 #ifdef TARGET_OS22471 2307 static snd_kcontrol_new_t snd_rme96_controls[] = { 2472 2308 { 2473 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2474 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,2475 snd_rme96_control_spdif_info,2476 snd_rme96_control_spdif_get,2477 snd_rme96_control_spdif_put,02309 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2310 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2311 .info = snd_rme96_control_spdif_info, 2312 .get = snd_rme96_control_spdif_get, 2313 .put = snd_rme96_control_spdif_put 2478 2314 }, 2479 2315 { 2480 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2481 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,2482 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,2483 snd_rme96_control_spdif_stream_info,2484 snd_rme96_control_spdif_stream_get,2485 snd_rme96_control_spdif_stream_put,02316 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2317 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2318 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 2319 .info = snd_rme96_control_spdif_stream_info, 2320 .get = snd_rme96_control_spdif_stream_get, 2321 .put = snd_rme96_control_spdif_stream_put 2486 2322 }, 2487 2323 { 2488 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,2489 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,2490 SNDRV_CTL_ELEM_ACCESS_READ,0,2491 snd_rme96_control_spdif_mask_info,2492 snd_rme96_control_spdif_mask_get,0,2493 2324 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2325 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2326 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 2327 .info = snd_rme96_control_spdif_mask_info, 2328 .get = snd_rme96_control_spdif_mask_get, 2329 .private_value = IEC958_AES0_NONAUDIO | 2494 2330 IEC958_AES0_PROFESSIONAL | 2495 2331 IEC958_AES0_CON_EMPHASIS 2496 2332 }, 2497 2333 { 2498 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,2499 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),0,2500 SNDRV_CTL_ELEM_ACCESS_READ,0,2501 snd_rme96_control_spdif_mask_info,2502 snd_rme96_control_spdif_mask_get,0,2503 2334 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2335 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2336 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 2337 .info = snd_rme96_control_spdif_mask_info, 2338 .get = snd_rme96_control_spdif_mask_get, 2339 .private_value = IEC958_AES0_NONAUDIO | 2504 2340 IEC958_AES0_PROFESSIONAL | 2505 2341 IEC958_AES0_PRO_EMPHASIS 2506 2342 }, 2507 2343 { 2508 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2509 "Input Connector",0,0,0,2510 2511 snd_rme96_get_inputtype_control,2512 snd_rme96_put_inputtype_control, 02344 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2345 .name = "Input Connector", 2346 .info = snd_rme96_info_inputtype_control, 2347 .get = snd_rme96_get_inputtype_control, 2348 .put = snd_rme96_put_inputtype_control 2513 2349 }, 2514 2350 { 2515 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2516 "Loopback Input",0,0,0,2517 2518 2519 snd_rme96_put_loopback_control,02351 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2352 .name = "Loopback Input", 2353 .info = snd_rme96_info_loopback_control, 2354 .get = snd_rme96_get_loopback_control, 2355 .put = snd_rme96_put_loopback_control 2520 2356 }, 2521 2357 { 2522 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 2523 "Clock Mode",0,0,0, 2524 snd_rme96_info_clockmode_control, 2525 snd_rme96_get_clockmode_control, 2526 snd_rme96_put_clockmode_control,0 2527 }, 2528 { 2529 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 2530 "Monitor Tracks",0,0,0, 2531 snd_rme96_info_montracks_control, 2532 snd_rme96_get_montracks_control, 2533 snd_rme96_put_montracks_control,0 2358 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2359 .name = "Clock Mode", 2360 .info = snd_rme96_info_clockmode_control, 2361 .get = snd_rme96_get_clockmode_control, 2362 .put = snd_rme96_put_clockmode_control 2534 2363 }, 2535 2364 { 2536 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2537 "Attenuation",0,0,0,2538 snd_rme96_info_attenuation_control,2539 snd_rme96_get_attenuation_control,2540 snd_rme96_put_attenuation_control,02365 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2366 .name = "Monitor Tracks", 2367 .info = snd_rme96_info_montracks_control, 2368 .get = snd_rme96_get_montracks_control, 2369 .put = snd_rme96_put_montracks_control 2541 2370 }, 2542 2371 { 2543 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2544 "DAC Playback Volume",0,0,0, 2545 snd_rme96_dac_volume_info, 2546 snd_rme96_dac_volume_get, 2547 snd_rme96_dac_volume_put,0 2372 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2373 .name = "Attenuation", 2374 .info = snd_rme96_info_attenuation_control, 2375 .get = snd_rme96_get_attenuation_control, 2376 .put = snd_rme96_put_attenuation_control 2377 }, 2378 { 2379 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2380 .name = "DAC Playback Volume", 2381 .info = snd_rme96_dac_volume_info, 2382 .get = snd_rme96_dac_volume_get, 2383 .put = snd_rme96_dac_volume_put 2548 2384 } 2549 2385 }; 2550 #else2551 static snd_kcontrol_new_t snd_rme96_controls[] = {2552 {2553 iface: SNDRV_CTL_ELEM_IFACE_PCM,2554 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),2555 info: snd_rme96_control_spdif_info,2556 get: snd_rme96_control_spdif_get,2557 put: snd_rme96_control_spdif_put2558 },2559 {2560 access: SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,2561 iface: SNDRV_CTL_ELEM_IFACE_PCM,2562 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),2563 info: snd_rme96_control_spdif_stream_info,2564 get: snd_rme96_control_spdif_stream_get,2565 put: snd_rme96_control_spdif_stream_put2566 },2567 {2568 access: SNDRV_CTL_ELEM_ACCESS_READ,2569 iface: SNDRV_CTL_ELEM_IFACE_MIXER,2570 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),2571 info: snd_rme96_control_spdif_mask_info,2572 get: snd_rme96_control_spdif_mask_get,2573 private_value: IEC958_AES0_NONAUDIO |2574 IEC958_AES0_PROFESSIONAL |2575 IEC958_AES0_CON_EMPHASIS2576 },2577 {2578 access: SNDRV_CTL_ELEM_ACCESS_READ,2579 iface: SNDRV_CTL_ELEM_IFACE_MIXER,2580 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),2581 info: snd_rme96_control_spdif_mask_info,2582 get: snd_rme96_control_spdif_mask_get,2583 private_value: IEC958_AES0_NONAUDIO |2584 IEC958_AES0_PROFESSIONAL |2585 IEC958_AES0_PRO_EMPHASIS2586 },2587 {2588 iface: SNDRV_CTL_ELEM_IFACE_PCM,2589 name: "Input Connector",2590 info: snd_rme96_info_inputtype_control,2591 get: snd_rme96_get_inputtype_control,2592 put: snd_rme96_put_inputtype_control2593 },2594 {2595 iface: SNDRV_CTL_ELEM_IFACE_PCM,2596 name: "Loopback Input",2597 info: snd_rme96_info_loopback_control,2598 get: snd_rme96_get_loopback_control,2599 put: snd_rme96_put_loopback_control2600 },2601 {2602 iface: SNDRV_CTL_ELEM_IFACE_PCM,2603 name: "Clock Mode",2604 info: snd_rme96_info_clockmode_control,2605 get: snd_rme96_get_clockmode_control,2606 put: snd_rme96_put_clockmode_control2607 },2608 {2609 iface: SNDRV_CTL_ELEM_IFACE_PCM,2610 name: "Monitor Tracks",2611 info: snd_rme96_info_montracks_control,2612 get: snd_rme96_get_montracks_control,2613 put: snd_rme96_put_montracks_control2614 },2615 {2616 iface: SNDRV_CTL_ELEM_IFACE_PCM,2617 name: "Attenuation",2618 info: snd_rme96_info_attenuation_control,2619 get: snd_rme96_get_attenuation_control,2620 put: snd_rme96_put_attenuation_control2621 },2622 {2623 iface: SNDRV_CTL_ELEM_IFACE_MIXER,2624 name: "DAC Playback Volume",2625 info: snd_rme96_dac_volume_info,2626 get: snd_rme96_dac_volume_get,2627 put: snd_rme96_dac_volume_put2628 }2629 };2630 #endif2631 2386 2632 2387 static int … … 2729 2484 } 2730 2485 2731 #ifdef TARGET_OS22732 2486 static struct pci_driver driver = { 2733 0,0,0,"RME Digi96",2734 snd_rme96_ids,2735 snd_rme96_probe,2736 snd_rme96_remove,0,02487 .name = "RME Digi96", 2488 .id_table = snd_rme96_ids, 2489 .probe = snd_rme96_probe, 2490 .remove = __devexit_p(snd_rme96_remove), 2737 2491 }; 2738 #else2739 static struct pci_driver driver = {2740 name: "RME Digi96",2741 id_table: snd_rme96_ids,2742 probe: snd_rme96_probe,2743 remove: __devexit_p(snd_rme96_remove),2744 };2745 #endif2746 2492 2747 2493 static int __init alsa_card_rme96_init(void) -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c
r207 r210 26 26 #include <linux/init.h> 27 27 #include <linux/slab.h> 28 #include <linux/pci.h> 28 29 #include <sound/core.h> 29 30 #include <sound/control.h> … … 42 43 static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 43 44 static int snd_precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */ 45 static int snd_line_outs_monitor[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0}; /* Send all inputs/playback to line outs */ 46 static int snd_force_firmware[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0}; /* Force firmware reload */ 44 47 45 48 MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); … … 55 58 MODULE_PARM_DESC(snd_precise_ptr, "Enable precise pointer (doesn't work reliably)."); 56 59 MODULE_PARM_SYNTAX(snd_precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); 60 MODULE_PARM(snd_line_outs_monitor,"1-" __MODULE_STRING(SNDRV_CARDS) "i"); 61 MODULE_PARM_DESC(snd_line_outs_monitor, "Send all input and playback streams to line outs by default."); 62 MODULE_PARM_SYNTAX(snd_line_outs_monitor, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); 63 MODULE_PARM(snd_force_firmware,"1-" __MODULE_STRING(SNDRV_CARDS) "i"); 64 MODULE_PARM_DESC(snd_force_firmware, "Force a reload of the I/O box firmware"); 65 MODULE_PARM_SYNTAX(snd_force_firmware, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); 57 66 MODULE_AUTHOR("Paul Davis <pbd@op.net>"); 58 MODULE_DESCRIPTION("RME Hammerfall D DSP");67 MODULE_DESCRIPTION("RME Hammerfall DSP"); 59 68 MODULE_LICENSE("GPL"); 60 69 MODULE_CLASSES("{sound}"); … … 474 483 return -1; 475 484 } 476 477 485 hdsp_write (hdsp, HDSP_fifoData, ad); 478 486 hdsp->mixer_matrix[addr] = data; … … 846 854 847 855 if (clear_timer && hmidi->istimer && --hmidi->istimer <= 0) { 848 printk ("removing timer because there is nothing to do\n"); 849 if (del_timer(&hmidi->timer)) { 850 printk ("not removed\n"); 851 } 856 del_timer(&hmidi->timer); 852 857 } 853 858 } … … 948 953 hmidi->timer.data = (unsigned long) hmidi; 949 954 hmidi->timer.expires = 1 + jiffies; 950 printk ("add timer from output trigger\n");951 955 add_timer(&hmidi->timer); 952 956 hmidi->istimer++; … … 954 958 } else { 955 959 if (hmidi->istimer && --hmidi->istimer <= 0) { 956 printk ("remove timer in trigger off\n"); 957 if (del_timer (&hmidi->timer)) { 958 printk ("not removed\n"); 959 } 960 del_timer (&hmidi->timer); 960 961 } 961 962 } … … 1022 1023 snd_rawmidi_ops_t snd_hdsp_midi_output = 1023 1024 { 1024 open:snd_hdsp_midi_output_open,1025 close:snd_hdsp_midi_output_close,1026 trigger:snd_hdsp_midi_output_trigger,1025 .open = snd_hdsp_midi_output_open, 1026 .close = snd_hdsp_midi_output_close, 1027 .trigger = snd_hdsp_midi_output_trigger, 1027 1028 }; 1028 1029 1029 1030 snd_rawmidi_ops_t snd_hdsp_midi_input = 1030 1031 { 1031 open:snd_hdsp_midi_input_open,1032 close:snd_hdsp_midi_input_close,1033 trigger:snd_hdsp_midi_input_trigger,1032 .open = snd_hdsp_midi_input_open, 1033 .close = snd_hdsp_midi_input_close, 1034 .trigger = snd_hdsp_midi_input_trigger, 1034 1035 }; 1035 1036 … … 1166 1167 1167 1168 #define HDSP_SPDIF_IN(xname, xindex) \ 1168 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1169 info:snd_hdsp_info_spdif_in, \1170 get: snd_hdsp_get_spdif_in, put:snd_hdsp_put_spdif_in }1169 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1170 .info = snd_hdsp_info_spdif_in, \ 1171 .get = snd_hdsp_get_spdif_in, .put = snd_hdsp_put_spdif_in } 1171 1172 1172 1173 static unsigned int hdsp_spdif_in(hdsp_t *hdsp) … … 1226 1227 1227 1228 #define HDSP_SPDIF_OUT(xname, xindex) \ 1228 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1229 info:snd_hdsp_info_spdif_out, \1230 get: snd_hdsp_get_spdif_out, put:snd_hdsp_put_spdif_out }1229 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1230 .info = snd_hdsp_info_spdif_out, \ 1231 .get = snd_hdsp_get_spdif_out, .put = snd_hdsp_put_spdif_out } 1231 1232 1232 1233 static int hdsp_spdif_out(hdsp_t *hdsp) … … 1284 1285 1285 1286 #define HDSP_SYNC_PREF(xname, xindex) \ 1286 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1287 info:snd_hdsp_info_sync_pref, \1288 get: snd_hdsp_get_sync_pref, put:snd_hdsp_put_sync_pref }1287 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1288 .info = snd_hdsp_info_sync_pref, \ 1289 .get = snd_hdsp_get_sync_pref, .put = snd_hdsp_put_sync_pref } 1289 1290 1290 1291 static int hdsp_sync_pref(hdsp_t *hdsp) … … 1399 1400 1400 1401 #define HDSP_PASSTHRU(xname, xindex) \ 1401 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1402 info:snd_hdsp_info_passthru, \1403 put:snd_hdsp_put_passthru, \1404 get:snd_hdsp_get_passthru }1402 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1403 .info = snd_hdsp_info_passthru, \ 1404 .put = snd_hdsp_put_passthru, \ 1405 .get = snd_hdsp_get_passthru } 1405 1406 1406 1407 static int snd_hdsp_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) … … 1445 1446 1446 1447 #define HDSP_LINE_OUT(xname, xindex) \ 1447 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1448 info:snd_hdsp_info_line_out, \1449 get: snd_hdsp_get_line_out, put:snd_hdsp_put_line_out }1448 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1449 .info = snd_hdsp_info_line_out, \ 1450 .get = snd_hdsp_get_line_out, .put = snd_hdsp_put_line_out } 1450 1451 1451 1452 static int hdsp_line_out(hdsp_t *hdsp) … … 1503 1504 1504 1505 #define HDSP_MIXER(xname, xindex) \ 1505 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index:xindex, \1506 info:snd_hdsp_info_mixer, \1507 get: snd_hdsp_get_mixer, put:snd_hdsp_put_mixer }1506 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1507 .info = snd_hdsp_info_mixer, \ 1508 .get = snd_hdsp_get_mixer, .put = snd_hdsp_put_mixer } 1508 1509 1509 1510 static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1577 1578 1578 1579 #define HDSP_PLAYBACK_MIXER \ 1579 { iface:SNDRV_CTL_ELEM_IFACE_MIXER, \1580 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | \1580 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 1581 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | \ 1581 1582 SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1582 info:snd_hdsp_info_playback_mixer, \1583 get: snd_hdsp_get_playback_mixer, put:snd_hdsp_put_playback_mixer }1583 .info = snd_hdsp_info_playback_mixer, \ 1584 .get = snd_hdsp_get_playback_mixer, .put = snd_hdsp_put_playback_mixer } 1584 1585 1585 1586 static int snd_hdsp_info_playback_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1634 1635 1635 1636 #define HDSP_PEAK_PLAYBACK \ 1636 { iface:SNDRV_CTL_ELEM_IFACE_PCM, \1637 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \1638 info:snd_hdsp_info_peak_playback, \1639 get:snd_hdsp_get_peak_playback \1637 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1638 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1639 .info = snd_hdsp_info_peak_playback, \ 1640 .get = snd_hdsp_get_peak_playback \ 1640 1641 } 1641 1642 … … 1657 1658 1658 1659 #define HDSP_PEAK_INPUT \ 1659 { iface:SNDRV_CTL_ELEM_IFACE_PCM, \1660 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \1661 info:snd_hdsp_info_peak_input, \1662 get:snd_hdsp_get_peak_input \1660 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1661 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1662 .info = snd_hdsp_info_peak_input, \ 1663 .get = snd_hdsp_get_peak_input \ 1663 1664 } 1664 1665 … … 1680 1681 1681 1682 #define HDSP_PEAK_OUTPUT \ 1682 { iface:SNDRV_CTL_ELEM_IFACE_PCM, \1683 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \1684 info:snd_hdsp_info_peak_output, \1685 get:snd_hdsp_get_peak_output \1683 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1684 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1685 .info = snd_hdsp_info_peak_output, \ 1686 .get = snd_hdsp_get_peak_output \ 1686 1687 } 1687 1688 … … 1703 1704 1704 1705 #define HDSP_RMS_INPUT \ 1705 { iface:SNDRV_CTL_ELEM_IFACE_PCM, \1706 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \1707 info:snd_hdsp_info_rms_input, \1708 get:snd_hdsp_get_rms_input \1706 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1707 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1708 .info = snd_hdsp_info_rms_input, \ 1709 .get = snd_hdsp_get_rms_input \ 1709 1710 } 1710 1711 … … 1724 1725 1725 1726 #define HDSP_RMS_PLAYBACK \ 1726 { iface:SNDRV_CTL_ELEM_IFACE_PCM, \1727 access:SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \1728 info:snd_hdsp_info_rms_playback, \1729 get:snd_hdsp_get_rms_playback \1727 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, \ 1728 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1729 .info = snd_hdsp_info_rms_playback, \ 1730 .get = snd_hdsp_get_rms_playback \ 1730 1731 } 1731 1732 … … 1746 1747 static snd_kcontrol_new_t snd_hdsp_controls[] = { 1747 1748 { 1748 iface:SNDRV_CTL_ELEM_IFACE_PCM,1749 name:SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),1750 info:snd_hdsp_control_spdif_info,1751 get:snd_hdsp_control_spdif_get,1752 put:snd_hdsp_control_spdif_put,1749 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1750 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1751 .info = snd_hdsp_control_spdif_info, 1752 .get = snd_hdsp_control_spdif_get, 1753 .put = snd_hdsp_control_spdif_put, 1753 1754 }, 1754 1755 { 1755 access:SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,1756 iface:SNDRV_CTL_ELEM_IFACE_PCM,1757 name:SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),1758 info:snd_hdsp_control_spdif_stream_info,1759 get:snd_hdsp_control_spdif_stream_get,1760 put:snd_hdsp_control_spdif_stream_put,1756 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1757 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1758 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1759 .info = snd_hdsp_control_spdif_stream_info, 1760 .get = snd_hdsp_control_spdif_stream_get, 1761 .put = snd_hdsp_control_spdif_stream_put, 1761 1762 }, 1762 1763 { 1763 access:SNDRV_CTL_ELEM_ACCESS_READ,1764 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1765 name:SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),1766 info:snd_hdsp_control_spdif_mask_info,1767 get:snd_hdsp_control_spdif_mask_get,1768 private_value:IEC958_AES0_NONAUDIO |1764 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1765 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1766 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1767 .info = snd_hdsp_control_spdif_mask_info, 1768 .get = snd_hdsp_control_spdif_mask_get, 1769 .private_value = IEC958_AES0_NONAUDIO | 1769 1770 IEC958_AES0_PROFESSIONAL | 1770 1771 IEC958_AES0_CON_EMPHASIS, 1771 1772 }, 1772 1773 { 1773 access:SNDRV_CTL_ELEM_ACCESS_READ,1774 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1775 name:SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),1776 info:snd_hdsp_control_spdif_mask_info,1777 get:snd_hdsp_control_spdif_mask_get,1778 private_value:IEC958_AES0_NONAUDIO |1774 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1775 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1776 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 1777 .info = snd_hdsp_control_spdif_mask_info, 1778 .get = snd_hdsp_control_spdif_mask_get, 1779 .private_value = IEC958_AES0_NONAUDIO | 1779 1780 IEC958_AES0_PROFESSIONAL | 1780 1781 IEC958_AES0_PRO_EMPHASIS, … … 2190 2191 hdsp_write_gain (hdsp, i, MINUS_INFINITY_GAIN); 2191 2192 2193 if (snd_line_outs_monitor[hdsp->dev]) { 2194 2195 snd_printk ("sending all inputs and playback streams to line outs.\n"); 2196 2197 /* route all inputs to the line outs for easy monitoring. send 2198 odd numbered channels to right, even to left. 2199 */ 2200 2201 for (i = 0; i < HDSP_MAX_CHANNELS; i++) { 2202 if (i & 1) { 2203 hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY (i, 26), UNITY_GAIN); 2204 hdsp_write_gain (hdsp, PLAYBACK_TO_OUTPUT_KEY (i, 26), UNITY_GAIN); 2205 } else { 2206 hdsp_write_gain (hdsp, INPUT_TO_OUTPUT_KEY (i, 27), UNITY_GAIN); 2207 hdsp_write_gain (hdsp, PLAYBACK_TO_OUTPUT_KEY (i, 27), UNITY_GAIN); 2208 } 2209 } 2210 } 2211 2192 2212 hdsp->passthru = 0; 2193 2213 … … 2527 2547 static snd_pcm_hardware_t snd_hdsp_playback_subinfo = 2528 2548 { 2529 info:(SNDRV_PCM_INFO_MMAP |2549 .info = (SNDRV_PCM_INFO_MMAP | 2530 2550 SNDRV_PCM_INFO_MMAP_VALID | 2531 2551 SNDRV_PCM_INFO_NONINTERLEAVED | 2532 2552 SNDRV_PCM_INFO_SYNC_START | 2533 2553 SNDRV_PCM_INFO_DOUBLE), 2534 formats:SNDRV_PCM_FMTBIT_S32_LE,2535 rates: (SNDRV_PCM_RATE_32000 |2554 .formats = SNDRV_PCM_FMTBIT_S32_LE, 2555 .rates = (SNDRV_PCM_RATE_32000 | 2536 2556 SNDRV_PCM_RATE_44100 | 2537 2557 SNDRV_PCM_RATE_48000 | … … 2539 2559 SNDRV_PCM_RATE_88200 | 2540 2560 SNDRV_PCM_RATE_96000), 2541 rate_min:32000,2542 rate_max:96000,2543 channels_min:10,2544 channels_max:HDSP_MAX_CHANNELS,2545 buffer_bytes_max:1024*1024,2546 period_bytes_min:1,2547 period_bytes_max:1024*1024,2548 periods_min:2,2549 periods_max:2,2550 fifo_size:0,2561 .rate_min = 32000, 2562 .rate_max = 96000, 2563 .channels_min = 10, 2564 .channels_max = HDSP_MAX_CHANNELS, 2565 .buffer_bytes_max = 1024*1024, 2566 .period_bytes_min = 1, 2567 .period_bytes_max = 1024*1024, 2568 .periods_min = 2, 2569 .periods_max = 2, 2570 .fifo_size = 0, 2551 2571 }; 2552 2572 2553 2573 static snd_pcm_hardware_t snd_hdsp_capture_subinfo = 2554 2574 { 2555 info:(SNDRV_PCM_INFO_MMAP |2575 .info = (SNDRV_PCM_INFO_MMAP | 2556 2576 SNDRV_PCM_INFO_MMAP_VALID | 2557 2577 SNDRV_PCM_INFO_NONINTERLEAVED | 2558 2578 SNDRV_PCM_INFO_SYNC_START), 2559 formats:SNDRV_PCM_FMTBIT_S32_LE,2560 rates:(SNDRV_PCM_RATE_32000 |2579 .formats = SNDRV_PCM_FMTBIT_S32_LE, 2580 .rates = (SNDRV_PCM_RATE_32000 | 2561 2581 SNDRV_PCM_RATE_44100 | 2562 2582 SNDRV_PCM_RATE_48000 | … … 2564 2584 SNDRV_PCM_RATE_88200 | 2565 2585 SNDRV_PCM_RATE_96000), 2566 rate_min:32000,2567 rate_max:96000,2568 channels_min:10,2569 channels_max:HDSP_MAX_CHANNELS,2570 buffer_bytes_max:1024*1024,2571 period_bytes_min:1,2572 period_bytes_max:1024*1024,2573 periods_min:2,2574 periods_max:2,2575 fifo_size:0,2586 .rate_min = 32000, 2587 .rate_max = 96000, 2588 .channels_min = 10, 2589 .channels_max = HDSP_MAX_CHANNELS, 2590 .buffer_bytes_max = 1024*1024, 2591 .period_bytes_min = 1, 2592 .period_bytes_max = 1024*1024, 2593 .periods_min = 2, 2594 .periods_max = 2, 2595 .fifo_size = 0, 2576 2596 }; 2577 2597 … … 2581 2601 2582 2602 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { 2583 count:PERIOD_SIZES,2584 list:period_sizes,2585 mask:02603 .count = PERIOD_SIZES, 2604 .list = period_sizes, 2605 .mask = 0 2586 2606 }; 2587 2607 … … 2608 2628 }; 2609 2629 return snd_interval_refine(c, &t); 2610 } else if (r->max < 88200) {2630 } else if (r->max < 64000) { 2611 2631 snd_interval_t t = { 2612 2632 min: hdsp->ss_channels, … … 2627 2647 if (c->min >= hdsp->ss_channels) { 2628 2648 snd_interval_t t = { 2629 min: 44100,2649 min: 32000, 2630 2650 max: 48000, 2631 2651 integer: 1, … … 2634 2654 } else if (c->max <= hdsp->ds_channels) { 2635 2655 snd_interval_t t = { 2636 min: 88200,2656 min: 64000, 2637 2657 max: 96000, 2638 2658 integer: 1, … … 2766 2786 2767 2787 static snd_pcm_ops_t snd_hdsp_playback_ops = { 2768 open:snd_hdsp_playback_open,2769 close:snd_hdsp_playback_release,2770 ioctl:snd_hdsp_ioctl,2771 hw_params:snd_hdsp_hw_params,2772 prepare:snd_hdsp_prepare,2773 trigger:snd_hdsp_trigger,2774 pointer:snd_hdsp_hw_pointer,2775 copy:snd_hdsp_playback_copy,2776 silence:snd_hdsp_hw_silence,2788 .open = snd_hdsp_playback_open, 2789 .close = snd_hdsp_playback_release, 2790 .ioctl = snd_hdsp_ioctl, 2791 .hw_params = snd_hdsp_hw_params, 2792 .prepare = snd_hdsp_prepare, 2793 .trigger = snd_hdsp_trigger, 2794 .pointer = snd_hdsp_hw_pointer, 2795 .copy = snd_hdsp_playback_copy, 2796 .silence = snd_hdsp_hw_silence, 2777 2797 }; 2778 2798 2779 2799 static snd_pcm_ops_t snd_hdsp_capture_ops = { 2780 open:snd_hdsp_capture_open,2781 close:snd_hdsp_capture_release,2782 ioctl:snd_hdsp_ioctl,2783 hw_params:snd_hdsp_hw_params,2784 prepare:snd_hdsp_prepare,2785 trigger:snd_hdsp_trigger,2786 pointer:snd_hdsp_hw_pointer,2787 copy:snd_hdsp_capture_copy,2800 .open = snd_hdsp_capture_open, 2801 .close = snd_hdsp_capture_release, 2802 .ioctl = snd_hdsp_ioctl, 2803 .hw_params = snd_hdsp_hw_params, 2804 .prepare = snd_hdsp_prepare, 2805 .trigger = snd_hdsp_trigger, 2806 .pointer = snd_hdsp_hw_pointer, 2807 .copy = snd_hdsp_capture_copy, 2788 2808 }; 2789 2809 … … 2812 2832 { 2813 2833 int i; 2814 int status_reg;2815 2834 u32 *firmware_ptr; 2816 2835 … … 2830 2849 } 2831 2850 2832 status_reg = hdsp_read (hdsp, HDSP_statusRegister); 2833 2834 if ((status_reg & HDSP_DllError) == 0) { 2835 2836 /* i/o box is connected, firmware already loaded */ 2837 2838 if (hdsp_read (hdsp, HDSP_status2Register) & HDSP_version1) { 2839 hdsp->type = Multiface; 2840 hdsp->card_name = "RME Hammerfall DSP (Multiface)"; 2841 hdsp->ss_channels = MULTIFACE_SS_CHANNELS; 2842 hdsp->ds_channels = MULTIFACE_DS_CHANNELS; 2843 } else { 2844 hdsp->type = Digiface; 2845 hdsp->card_name = "RME Hammerfall DSP (Digiface)"; 2846 hdsp->ss_channels = DIGIFACE_SS_CHANNELS; 2847 hdsp->ds_channels = DIGIFACE_DS_CHANNELS; 2848 } 2849 2850 } else { 2851 2852 /* firmware not loaded, but i/o box is connected */ 2853 2851 if (snd_force_firmware[hdsp->dev] || (hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) { 2852 2853 snd_printk ("loading firmware\n"); 2854 2854 2855 hdsp_write (hdsp, HDSP_jtagReg, HDSP_PROGRAM); 2855 2856 hdsp_write (hdsp, HDSP_fifoData, 0); 2856 hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT); 2857 if (hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT) < 0) { 2858 snd_printk ("timeout waiting for firmware setup\n"); 2859 return -EIO; 2860 } 2857 2861 2858 2862 hdsp_write (hdsp, HDSP_jtagReg, HDSP_S_LOAD); 2859 2863 hdsp_write (hdsp, HDSP_fifoData, 0); 2860 2864 2861 if (hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT) < 0) { 2862 printk ("looks like a multiface\n"); 2865 if (hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT)) { 2863 2866 hdsp->type = Multiface; 2864 hdsp->card_name = "RME Hammerfall DSP (Multiface)";2865 2867 hdsp_write (hdsp, HDSP_jtagReg, HDSP_VERSION_BIT); 2866 2868 hdsp_write (hdsp, HDSP_jtagReg, HDSP_S_LOAD); 2867 2869 hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT); 2868 2870 } else { 2869 printk ("looks like a digiface\n");2870 2871 hdsp->type = Digiface; 2871 hdsp->card_name = "RME Hammerfall DSP (Digiface)";2872 2872 } 2873 2873 … … 2875 2875 hdsp_write (hdsp, HDSP_fifoData, 0); 2876 2876 2877 if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT) < 0) {2877 if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) { 2878 2878 snd_printk ("timeout waiting for download preparation\n"); 2879 2879 return -EIO; … … 2883 2883 2884 2884 if (hdsp->type == Digiface) { 2885 firmware_ptr = digiface_firmware;2885 firmware_ptr = (u32 *) digiface_firmware; 2886 2886 } else { 2887 firmware_ptr = multiface_firmware;2887 firmware_ptr = (u32 *) multiface_firmware; 2888 2888 } 2889 2889 … … 2901 2901 } 2902 2902 2903 } 2904 2903 } else { 2904 2905 /* firmware already loaded, but we need to know what type 2906 of I/O box is connected. 2907 */ 2908 2909 if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1) { 2910 hdsp->type = Multiface; 2911 } else { 2912 hdsp->type = Digiface; 2913 } 2914 } 2915 2916 if (hdsp->type == Digiface) { 2917 snd_printk ("I/O Box is a Digiface\n"); 2918 hdsp->card_name = "RME Hammerfall DSP (Digiface)"; 2919 hdsp->ss_channels = DIGIFACE_SS_CHANNELS; 2920 hdsp->ds_channels = DIGIFACE_DS_CHANNELS; 2921 } else { 2922 snd_printk ("I/O Box is a Multiface\n"); 2923 hdsp->card_name = "RME Hammerfall DSP (Multiface)"; 2924 hdsp->ss_channels = MULTIFACE_SS_CHANNELS; 2925 hdsp->ds_channels = MULTIFACE_DS_CHANNELS; 2926 } 2905 2927 2906 2928 snd_hdsp_flush_midi_input (hdsp, 0); … … 3094 3116 3095 3117 static struct pci_driver driver = { 3096 name:"RME Hammerfall DSP",3097 id_table:snd_hdsp_ids,3098 probe:snd_hdsp_probe,3099 remove:__devexit_p(snd_hdsp_remove),3118 .name = "RME Hammerfall DSP", 3119 .id_table = snd_hdsp_ids, 3120 .probe = snd_hdsp_probe, 3121 .remove = __devexit_p(snd_hdsp_remove), 3100 3122 }; 3101 3123 -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/rme9652.c
r207 r210 524 524 break; 525 525 default: 526 spin_unlock_irq(&rme9652->lock); 526 527 return -EINVAL; 527 528 } … … 876 877 } 877 878 878 #ifdef TARGET_OS2879 879 #define RME9652_ADAT1_IN(xname, xindex) \ 880 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 881 0, 0, snd_rme9652_info_adat1_in, \ 882 snd_rme9652_get_adat1_in, \ 883 snd_rme9652_put_adat1_in,0 } 884 #else 885 #define RME9652_ADAT1_IN(xname, xindex) \ 886 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 887 info: snd_rme9652_info_adat1_in, \ 888 get: snd_rme9652_get_adat1_in, \ 889 put: snd_rme9652_put_adat1_in } 890 #endif 880 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 881 .info = snd_rme9652_info_adat1_in, \ 882 .get = snd_rme9652_get_adat1_in, \ 883 .put = snd_rme9652_put_adat1_in } 891 884 892 885 static unsigned int rme9652_adat1_in(rme9652_t *rme9652) … … 964 957 } 965 958 966 #ifdef TARGET_OS2967 959 #define RME9652_SPDIF_IN(xname, xindex) \ 968 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 969 0, 0, snd_rme9652_info_spdif_in, \ 970 snd_rme9652_get_spdif_in, snd_rme9652_put_spdif_in,0 } 971 #else 972 #define RME9652_SPDIF_IN(xname, xindex) \ 973 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 974 info: snd_rme9652_info_spdif_in, \ 975 get: snd_rme9652_get_spdif_in, put: snd_rme9652_put_spdif_in } 976 #endif 960 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 961 .info = snd_rme9652_info_spdif_in, \ 962 .get = snd_rme9652_get_spdif_in, .put = snd_rme9652_put_spdif_in } 977 963 978 964 static unsigned int rme9652_spdif_in(rme9652_t *rme9652) … … 1044 1030 } 1045 1031 1046 #ifdef TARGET_OS21047 1032 #define RME9652_SPDIF_OUT(xname, xindex) \ 1048 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 1049 0, 0, snd_rme9652_info_spdif_out, \ 1050 snd_rme9652_get_spdif_out, snd_rme9652_put_spdif_out, 0 } 1051 #else 1052 #define RME9652_SPDIF_OUT(xname, xindex) \ 1053 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1054 info: snd_rme9652_info_spdif_out, \ 1055 get: snd_rme9652_get_spdif_out, put: snd_rme9652_put_spdif_out } 1056 #endif 1033 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1034 .info = snd_rme9652_info_spdif_out, \ 1035 .get = snd_rme9652_get_spdif_out, .put = snd_rme9652_put_spdif_out } 1057 1036 1058 1037 static int rme9652_spdif_out(rme9652_t *rme9652) … … 1121 1100 } 1122 1101 1123 #ifdef TARGET_OS21124 1102 #define RME9652_SYNC_MODE(xname, xindex) \ 1125 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 1126 0, 0, snd_rme9652_info_sync_mode, \ 1127 snd_rme9652_get_sync_mode, snd_rme9652_put_sync_mode,0 } 1128 #else 1129 #define RME9652_SYNC_MODE(xname, xindex) \ 1130 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1131 info: snd_rme9652_info_sync_mode, \ 1132 get: snd_rme9652_get_sync_mode, put: snd_rme9652_put_sync_mode } 1133 #endif 1103 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1104 .info = snd_rme9652_info_sync_mode, \ 1105 .get = snd_rme9652_get_sync_mode, .put = snd_rme9652_put_sync_mode } 1134 1106 1135 1107 static int rme9652_sync_mode(rme9652_t *rme9652) … … 1215 1187 } 1216 1188 1217 #ifdef TARGET_OS21218 1189 #define RME9652_SYNC_PREF(xname, xindex) \ 1219 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 1220 0, 0, snd_rme9652_info_sync_pref, \ 1221 snd_rme9652_get_sync_pref, snd_rme9652_put_sync_pref, 0 } 1222 #else 1223 #define RME9652_SYNC_PREF(xname, xindex) \ 1224 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1225 info: snd_rme9652_info_sync_pref, \ 1226 get: snd_rme9652_get_sync_pref, put: snd_rme9652_put_sync_pref } 1227 #endif 1190 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1191 .info = snd_rme9652_info_sync_pref, \ 1192 .get = snd_rme9652_get_sync_pref, .put = snd_rme9652_put_sync_pref } 1228 1193 1229 1194 static int rme9652_sync_pref(rme9652_t *rme9652) … … 1370 1335 } 1371 1336 1372 #ifdef TARGET_OS21373 1337 #define RME9652_PASSTHRU(xname, xindex) \ 1374 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 1375 0, 0, snd_rme9652_info_passthru, \ 1376 snd_rme9652_put_passthru, \ 1377 snd_rme9652_get_passthru,0 } 1378 #else 1379 #define RME9652_PASSTHRU(xname, xindex) \ 1380 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1381 info: snd_rme9652_info_passthru, \ 1382 put: snd_rme9652_put_passthru, \ 1383 get: snd_rme9652_get_passthru } 1384 #endif 1338 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1339 .info = snd_rme9652_info_passthru, \ 1340 .put = snd_rme9652_put_passthru, \ 1341 .get = snd_rme9652_get_passthru } 1385 1342 1386 1343 static int snd_rme9652_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) … … 1426 1383 /* Read-only switches */ 1427 1384 1428 #ifdef TARGET_OS21429 1385 #define RME9652_SPDIF_RATE(xname, xindex) \ 1430 { SNDRV_CTL_ELEM_IFACE_PCM, 0,0, xname, xindex, \ 1431 SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1432 0, snd_rme9652_info_spdif_rate, \ 1433 snd_rme9652_get_spdif_rate, 0,0 } 1434 #else 1435 #define RME9652_SPDIF_RATE(xname, xindex) \ 1436 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1437 access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1438 info: snd_rme9652_info_spdif_rate, \ 1439 get: snd_rme9652_get_spdif_rate } 1440 #endif 1386 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1387 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1388 .info = snd_rme9652_info_spdif_rate, \ 1389 .get = snd_rme9652_get_spdif_rate } 1441 1390 1442 1391 static int snd_rme9652_info_spdif_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1460 1409 } 1461 1410 1462 #ifdef TARGET_OS21463 1411 #define RME9652_ADAT_SYNC(xname, xindex, xidx) \ 1464 { SNDRV_CTL_ELEM_IFACE_PCM, 0, 0, xname, xindex, \ 1465 SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1466 0, snd_rme9652_info_adat_sync, \ 1467 snd_rme9652_get_adat_sync, 0, xidx } 1468 #else 1469 #define RME9652_ADAT_SYNC(xname, xindex, xidx) \ 1470 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1471 access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1472 info: snd_rme9652_info_adat_sync, \ 1473 get: snd_rme9652_get_adat_sync, private_value: xidx } 1474 #endif 1412 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1413 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1414 .info = snd_rme9652_info_adat_sync, \ 1415 .get = snd_rme9652_get_adat_sync, .private_value = xidx } 1475 1416 1476 1417 static int snd_rme9652_info_adat_sync(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1504 1445 } 1505 1446 1506 #ifdef TARGET_OS21507 1447 #define RME9652_TC_VALID(xname, xindex) \ 1508 { SNDRV_CTL_ELEM_IFACE_PCM, 0,0, xname, xindex, \ 1509 SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1510 0, snd_rme9652_info_tc_valid, \ 1511 snd_rme9652_get_tc_valid,0,0 } 1512 #else 1513 #define RME9652_TC_VALID(xname, xindex) \ 1514 { iface: SNDRV_CTL_ELEM_IFACE_PCM, name: xname, index: xindex, \ 1515 access: SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1516 info: snd_rme9652_info_tc_valid, \ 1517 get: snd_rme9652_get_tc_valid } 1518 #endif 1448 { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = xname, .index = xindex, \ 1449 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ 1450 .info = snd_rme9652_info_tc_valid, \ 1451 .get = snd_rme9652_get_tc_valid } 1519 1452 1520 1453 static int snd_rme9652_info_tc_valid(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1596 1529 1597 1530 static snd_kcontrol_new_t snd_rme9652_controls[] = { 1598 #ifdef TARGET_OS2 1599 { 1600 SNDRV_CTL_ELEM_IFACE_PCM,0,0, 1601 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0, 1602 snd_rme9652_control_spdif_info, 1603 snd_rme9652_control_spdif_get, 1604 snd_rme9652_control_spdif_put,0 1531 { 1532 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1533 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1534 .info = snd_rme9652_control_spdif_info, 1535 .get = snd_rme9652_control_spdif_get, 1536 .put = snd_rme9652_control_spdif_put, 1605 1537 }, 1606 1538 { 1607 SNDRV_CTL_ELEM_IFACE_PCM,0, 0,1608 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,1609 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,1610 snd_rme9652_control_spdif_stream_info,1611 snd_rme9652_control_spdif_stream_get,1612 snd_rme9652_control_spdif_stream_put,01539 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1540 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1541 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1542 .info = snd_rme9652_control_spdif_stream_info, 1543 .get = snd_rme9652_control_spdif_stream_get, 1544 .put = snd_rme9652_control_spdif_stream_put, 1613 1545 }, 1614 1546 { 1615 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1616 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0, 1617 SNDRV_CTL_ELEM_ACCESS_READ,0, 1618 snd_rme9652_control_spdif_mask_info, 1619 snd_rme9652_control_spdif_mask_get,0, 1620 IEC958_AES0_NONAUDIO | 1621 IEC958_AES0_PROFESSIONAL | 1622 IEC958_AES0_CON_EMPHASIS 1623 }, 1624 { 1625 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1626 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),0, 1627 SNDRV_CTL_ELEM_ACCESS_READ,0, 1628 snd_rme9652_control_spdif_mask_info, 1629 snd_rme9652_control_spdif_mask_get,0, 1630 IEC958_AES0_NONAUDIO | 1631 IEC958_AES0_PROFESSIONAL | 1632 IEC958_AES0_PRO_EMPHASIS 1633 }, 1634 #else 1635 { 1636 iface: SNDRV_CTL_ELEM_IFACE_PCM, 1637 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1638 info: snd_rme9652_control_spdif_info, 1639 get: snd_rme9652_control_spdif_get, 1640 put: snd_rme9652_control_spdif_put, 1641 }, 1642 { 1643 access: SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1644 iface: SNDRV_CTL_ELEM_IFACE_PCM, 1645 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1646 info: snd_rme9652_control_spdif_stream_info, 1647 get: snd_rme9652_control_spdif_stream_get, 1648 put: snd_rme9652_control_spdif_stream_put, 1649 }, 1650 { 1651 access: SNDRV_CTL_ELEM_ACCESS_READ, 1652 iface: SNDRV_CTL_ELEM_IFACE_MIXER, 1653 name: SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1654 info: snd_rme9652_control_spdif_mask_info, 1655 get: snd_rme9652_control_spdif_mask_get, 1656 private_value: IEC958_AES0_NONAUDIO | 1547 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1548 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1549 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1550 .info = snd_rme9652_control_spdif_mask_info, 1551 .get = snd_rme9652_control_spdif_mask_get, 1552 .private_value = IEC958_AES0_NONAUDIO | 1657 1553 IEC958_AES0_PROFESSIONAL | 1658 1554 IEC958_AES0_CON_EMPHASIS, 1659 1555 }, 1660 1556 { 1661 access:SNDRV_CTL_ELEM_ACCESS_READ,1662 iface:SNDRV_CTL_ELEM_IFACE_MIXER,1663 name:SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK),1664 info:snd_rme9652_control_spdif_mask_info,1665 get:snd_rme9652_control_spdif_mask_get,1666 private_value:IEC958_AES0_NONAUDIO |1667 1668 1557 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1558 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1559 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PRO_MASK), 1560 .info = snd_rme9652_control_spdif_mask_info, 1561 .get = snd_rme9652_control_spdif_mask_get, 1562 .private_value = IEC958_AES0_NONAUDIO | 1563 IEC958_AES0_PROFESSIONAL | 1564 IEC958_AES0_PRO_EMPHASIS, 1669 1565 }, 1670 #endif1671 1566 RME9652_SPDIF_IN("IEC958 Input Connector", 0), 1672 1567 RME9652_SPDIF_OUT("IEC958 Output also on ADAT1", 0), … … 1674 1569 RME9652_SYNC_PREF("Preferred Sync Source", 0), 1675 1570 { 1676 #ifdef TARGET_OS2 1677 SNDRV_CTL_ELEM_IFACE_PCM,0, 0, 1678 "Channels Thru", 1679 0,0,0, 1680 snd_rme9652_info_thru, 1681 snd_rme9652_get_thru, 1682 snd_rme9652_put_thru,0 1683 #else 1684 iface: SNDRV_CTL_ELEM_IFACE_PCM, 1685 name: "Channels Thru", 1686 index: 0, 1687 info: snd_rme9652_info_thru, 1688 get: snd_rme9652_get_thru, 1689 put: snd_rme9652_put_thru, 1690 #endif 1571 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1572 .name = "Channels Thru", 1573 .index = 0, 1574 .info = snd_rme9652_info_thru, 1575 .get = snd_rme9652_get_thru, 1576 .put = snd_rme9652_put_thru, 1691 1577 }, 1692 1578 RME9652_SPDIF_RATE("IEC958 Sample Rate", 0), … … 2374 2260 } 2375 2261 2376 #ifdef TARGET_OS22377 2262 static snd_pcm_hardware_t snd_rme9652_playback_subinfo = 2378 2263 { 2379 /* info: */(SNDRV_PCM_INFO_MMAP |2264 .info = (SNDRV_PCM_INFO_MMAP | 2380 2265 SNDRV_PCM_INFO_MMAP_VALID | 2381 2266 SNDRV_PCM_INFO_NONINTERLEAVED | 2382 2267 SNDRV_PCM_INFO_SYNC_START | 2383 2268 SNDRV_PCM_INFO_DOUBLE), 2384 /* formats: */SNDRV_PCM_FMTBIT_S32_LE,2385 /* rates: */(SNDRV_PCM_RATE_44100 |2269 .formats = SNDRV_PCM_FMTBIT_S32_LE, 2270 .rates = (SNDRV_PCM_RATE_44100 | 2386 2271 SNDRV_PCM_RATE_48000 | 2387 2272 SNDRV_PCM_RATE_88200 | 2388 2273 SNDRV_PCM_RATE_96000), 2389 /* rate_min: */44100,2390 /* rate_max: */96000,2391 /* channels_min: */10,2392 /* channels_max: */26,2393 /* buffer_bytes_max: */1024*1024,2394 /* period_bytes_min: */1,2395 /* period_bytes_max: */1024*1024,2396 /* periods_min: */2,2397 /* periods_max: */2,2398 /* fifo_size: */0,2274 .rate_min = 44100, 2275 .rate_max = 96000, 2276 .channels_min = 10, 2277 .channels_max = 26, 2278 .buffer_bytes_max = 1024*1024, 2279 .period_bytes_min = 1, 2280 .period_bytes_max = 1024*1024, 2281 .periods_min = 2, 2282 .periods_max = 2, 2283 .fifo_size = 0, 2399 2284 }; 2400 2285 2401 2286 static snd_pcm_hardware_t snd_rme9652_capture_subinfo = 2402 2287 { 2403 /* info: */ (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | 2288 .info = (SNDRV_PCM_INFO_MMAP | 2289 SNDRV_PCM_INFO_MMAP_VALID | 2404 2290 SNDRV_PCM_INFO_NONINTERLEAVED | 2405 2291 SNDRV_PCM_INFO_SYNC_START), 2406 /* formats: */SNDRV_PCM_FMTBIT_S32_LE,2407 /* rates: */(SNDRV_PCM_RATE_44100 |2292 .formats = SNDRV_PCM_FMTBIT_S32_LE, 2293 .rates = (SNDRV_PCM_RATE_44100 | 2408 2294 SNDRV_PCM_RATE_48000 | 2409 2295 SNDRV_PCM_RATE_88200 | 2410 2296 SNDRV_PCM_RATE_96000), 2411 /* rate_min: */44100,2412 /* rate_max: */96000,2413 /* channels_min: */10,2414 /* channels_max: */26,2415 /* buffer_bytes_max: */1024*1024,2416 /* period_bytes_min: */1,2417 /* period_bytes_max: */1024*1024,2418 /* periods_min: */2,2419 /* periods_max: */2,2420 /* fifo_size: */0,2297 .rate_min = 44100, 2298 .rate_max = 96000, 2299 .channels_min = 10, 2300 .channels_max = 26, 2301 .buffer_bytes_max = 1024*1024, 2302 .period_bytes_min = 1, 2303 .period_bytes_max = 1024*1024, 2304 .periods_min = 2, 2305 .periods_max = 2, 2306 .fifo_size = 0, 2421 2307 }; 2422 #else 2423 static snd_pcm_hardware_t snd_rme9652_playback_subinfo = 2424 { 2425 info: (SNDRV_PCM_INFO_MMAP | 2426 SNDRV_PCM_INFO_MMAP_VALID | 2427 SNDRV_PCM_INFO_NONINTERLEAVED | 2428 SNDRV_PCM_INFO_SYNC_START | 2429 SNDRV_PCM_INFO_DOUBLE), 2430 formats: SNDRV_PCM_FMTBIT_S32_LE, 2431 rates: (SNDRV_PCM_RATE_44100 | 2432 SNDRV_PCM_RATE_48000 | 2433 SNDRV_PCM_RATE_88200 | 2434 SNDRV_PCM_RATE_96000), 2435 rate_min: 44100, 2436 rate_max: 96000, 2437 channels_min: 10, 2438 channels_max: 26, 2439 buffer_bytes_max: 1024*1024, 2440 period_bytes_min: 1, 2441 period_bytes_max: 1024*1024, 2442 periods_min: 2, 2443 periods_max: 2, 2444 fifo_size: 0, 2308 2309 static unsigned int period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 }; 2310 2311 #define PERIOD_SIZES sizeof(period_sizes) / sizeof(period_sizes[0]) 2312 2313 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = { 2314 .count = PERIOD_SIZES, 2315 .list = period_sizes, 2316 .mask = 0 2445 2317 }; 2446 2447 static snd_pcm_hardware_t snd_rme9652_capture_subinfo =2448 {2449 info: (SNDRV_PCM_INFO_MMAP |2450 SNDRV_PCM_INFO_MMAP_VALID |2451 SNDRV_PCM_INFO_NONINTERLEAVED |2452 SNDRV_PCM_INFO_SYNC_START),2453 formats: SNDRV_PCM_FMTBIT_S32_LE,2454 rates: (SNDRV_PCM_RATE_44100 |2455 SNDRV_PCM_RATE_48000 |2456 SNDRV_PCM_RATE_88200 |2457 SNDRV_PCM_RATE_96000),2458 rate_min: 44100,2459 rate_max: 96000,2460 channels_min: 10,2461 channels_max: 26,2462 buffer_bytes_max: 1024*1024,2463 period_bytes_min: 1,2464 period_bytes_max: 1024*1024,2465 periods_min: 2,2466 periods_max: 2,2467 fifo_size: 0,2468 };2469 #endif2470 2471 static unsigned int period_sizes[] = { 64, 128, 256, 512, 1024, 2048, 4096, 8192 };2472 2473 #define PERIOD_SIZES sizeof(period_sizes) / sizeof(period_sizes[0])2474 2475 #ifdef TARGET_OS22476 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {2477 PERIOD_SIZES,2478 period_sizes,2479 02480 };2481 #else2482 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {2483 count: PERIOD_SIZES,2484 list: period_sizes,2485 mask: 02486 };2487 #endif2488 2318 2489 2319 static int snd_rme9652_hw_rule_channels(snd_pcm_hw_params_t *params, … … 2689 2519 } 2690 2520 2691 #ifdef TARGET_OS22692 2521 static snd_pcm_ops_t snd_rme9652_playback_ops = { 2693 /* open: */ snd_rme9652_playback_open, 2694 /* close: */ snd_rme9652_playback_release, 2695 /* ioctl: */ snd_rme9652_ioctl, 2696 /* hw_params: */ snd_rme9652_hw_params, 2697 0, 2698 /* prepare: */ snd_rme9652_prepare, 2699 /* trigger: */ snd_rme9652_trigger, 2700 /* pointer: */ snd_rme9652_hw_pointer, 2701 /* copy: */ snd_rme9652_playback_copy, 2702 /* silence: */ snd_rme9652_hw_silence, 2522 .open = snd_rme9652_playback_open, 2523 .close = snd_rme9652_playback_release, 2524 .ioctl = snd_rme9652_ioctl, 2525 .hw_params = snd_rme9652_hw_params, 2526 .prepare = snd_rme9652_prepare, 2527 .trigger = snd_rme9652_trigger, 2528 .pointer = snd_rme9652_hw_pointer, 2529 .copy = snd_rme9652_playback_copy, 2530 .silence = snd_rme9652_hw_silence, 2703 2531 }; 2704 2532 2705 2533 static snd_pcm_ops_t snd_rme9652_capture_ops = { 2706 /* open: */ snd_rme9652_capture_open, 2707 /* close: */ snd_rme9652_capture_release, 2708 /* ioctl: */ snd_rme9652_ioctl, 2709 /* hw_params: */ snd_rme9652_hw_params, 2710 0, 2711 /* prepare: */ snd_rme9652_prepare, 2712 /* trigger: */ snd_rme9652_trigger, 2713 /* pointer: */ snd_rme9652_hw_pointer, 2714 /* copy: */ snd_rme9652_capture_copy, 2715 0 2534 .open = snd_rme9652_capture_open, 2535 .close = snd_rme9652_capture_release, 2536 .ioctl = snd_rme9652_ioctl, 2537 .hw_params = snd_rme9652_hw_params, 2538 .prepare = snd_rme9652_prepare, 2539 .trigger = snd_rme9652_trigger, 2540 .pointer = snd_rme9652_hw_pointer, 2541 .copy = snd_rme9652_capture_copy, 2716 2542 }; 2717 #else2718 static snd_pcm_ops_t snd_rme9652_playback_ops = {2719 open: snd_rme9652_playback_open,2720 close: snd_rme9652_playback_release,2721 ioctl: snd_rme9652_ioctl,2722 hw_params: snd_rme9652_hw_params,2723 prepare: snd_rme9652_prepare,2724 trigger: snd_rme9652_trigger,2725 pointer: snd_rme9652_hw_pointer,2726 copy: snd_rme9652_playback_copy,2727 silence: snd_rme9652_hw_silence,2728 };2729 2730 static snd_pcm_ops_t snd_rme9652_capture_ops = {2731 open: snd_rme9652_capture_open,2732 close: snd_rme9652_capture_release,2733 ioctl: snd_rme9652_ioctl,2734 hw_params: snd_rme9652_hw_params,2735 prepare: snd_rme9652_prepare,2736 trigger: snd_rme9652_trigger,2737 pointer: snd_rme9652_hw_pointer,2738 copy: snd_rme9652_capture_copy,2739 };2740 #endif2741 2543 2742 2544 static int __init snd_rme9652_create_pcm(snd_card_t *card, … … 2958 2760 } 2959 2761 2960 #ifdef TARGET_OS22961 2762 static struct pci_driver driver = { 2962 0, 0,"RME Digi9652 (Hammerfall)",2963 snd_rme9652_ids,2964 snd_rme9652_probe,2965 snd_rme9652_remove,0,02763 .name ="RME Digi9652 (Hammerfall)", 2764 .id_table = snd_rme9652_ids, 2765 .probe = snd_rme9652_probe, 2766 .remove = __devexit_p(snd_rme9652_remove), 2966 2767 }; 2967 #else2968 static struct pci_driver driver = {2969 name:"RME Digi9652 (Hammerfall)",2970 id_table:snd_rme9652_ids,2971 probe:snd_rme9652_probe,2972 remove:__devexit_p(snd_rme9652_remove),2973 };2974 #endif2975 2768 2976 2769 static int __init alsa_card_hammerfall_init(void) -
GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
r207 r210 776 776 } 777 777 778 #ifdef TARGET_OS2779 778 static snd_pcm_hardware_t snd_sonicvibes_playback = 780 779 { 781 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |780 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 782 781 SNDRV_PCM_INFO_BLOCK_TRANSFER | 783 782 SNDRV_PCM_INFO_MMAP_VALID), 784 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,785 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,786 /* rate_min: */4000,787 /* rate_max: */48000,788 /* channels_min: */1,789 /* channels_max: */2,790 /* buffer_bytes_max: */(128*1024),791 /* period_bytes_min: */32,792 /* period_bytes_max: */(128*1024),793 /* periods_min: */1,794 /* periods_max: */1024,795 /* fifo_size: */0,783 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 784 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 785 .rate_min = 4000, 786 .rate_max = 48000, 787 .channels_min = 1, 788 .channels_max = 2, 789 .buffer_bytes_max = (128*1024), 790 .period_bytes_min = 32, 791 .period_bytes_max = (128*1024), 792 .periods_min = 1, 793 .periods_max = 1024, 794 .fifo_size = 0, 796 795 }; 797 796 798 797 static snd_pcm_hardware_t snd_sonicvibes_capture = 799 798 { 800 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |799 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 801 800 SNDRV_PCM_INFO_BLOCK_TRANSFER | 802 801 SNDRV_PCM_INFO_MMAP_VALID), 803 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,804 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,805 /* rate_min: */4000,806 /* rate_max: */48000,807 /* channels_min: */1,808 /* channels_max: */2,809 /* buffer_bytes_max: */(128*1024),810 /* period_bytes_min: */32,811 /* period_bytes_max: */(128*1024),812 /* periods_min: */1,813 /* periods_max: */1024,814 /* fifo_size: */0,802 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 803 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 804 .rate_min = 4000, 805 .rate_max = 48000, 806 .channels_min = 1, 807 .channels_max = 2, 808 .buffer_bytes_max = (128*1024), 809 .period_bytes_min = 32, 810 .period_bytes_max = (128*1024), 811 .periods_min = 1, 812 .periods_max = 1024, 813 .fifo_size = 0, 815 814 }; 816 #else817 static snd_pcm_hardware_t snd_sonicvibes_playback =818 {819 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |820 SNDRV_PCM_INFO_BLOCK_TRANSFER |821 SNDRV_PCM_INFO_MMAP_VALID),822 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,823 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,824 rate_min: 4000,825 rate_max: 48000,826 channels_min: 1,827 channels_max: 2,828 buffer_bytes_max: (128*1024),829 period_bytes_min: 32,830 period_bytes_max: (128*1024),831 periods_min: 1,832 periods_max: 1024,833 fifo_size: 0,834 };835 836 static snd_pcm_hardware_t snd_sonicvibes_capture =837 {838 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |839 SNDRV_PCM_INFO_BLOCK_TRANSFER |840 SNDRV_PCM_INFO_MMAP_VALID),841 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,842 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,843 rate_min: 4000,844 rate_max: 48000,845 channels_min: 1,846 channels_max: 2,847 buffer_bytes_max: (128*1024),848 period_bytes_min: 32,849 period_bytes_max: (128*1024),850 periods_min: 1,851 periods_max: 1024,852 fifo_size: 0,853 };854 #endif855 815 856 816 static int snd_sonicvibes_playback_open(snd_pcm_substream_t * substream) … … 897 857 } 898 858 899 900 #ifdef TARGET_OS2901 859 static snd_pcm_ops_t snd_sonicvibes_playback_ops = { 902 /* open: */ snd_sonicvibes_playback_open, 903 /* close: */ snd_sonicvibes_playback_close, 904 /* ioctl: */ snd_pcm_lib_ioctl, 905 /* hw_params:*/ snd_sonicvibes_hw_params, 906 /* hw_free: */ snd_sonicvibes_hw_free, 907 /* prepare: */ snd_sonicvibes_playback_prepare, 908 /* trigger: */ snd_sonicvibes_playback_trigger, 909 /* pointer: */ snd_sonicvibes_playback_pointer, 910 0, 0 860 .open = snd_sonicvibes_playback_open, 861 .close = snd_sonicvibes_playback_close, 862 .ioctl = snd_pcm_lib_ioctl, 863 .hw_params = snd_sonicvibes_hw_params, 864 .hw_free = snd_sonicvibes_hw_free, 865 .prepare = snd_sonicvibes_playback_prepare, 866 .trigger = snd_sonicvibes_playback_trigger, 867 .pointer = snd_sonicvibes_playback_pointer, 911 868 }; 912 869 913 870 static snd_pcm_ops_t snd_sonicvibes_capture_ops = { 914 /* open: */ snd_sonicvibes_capture_open, 915 /* close: */ snd_sonicvibes_capture_close, 916 /* ioctl: */ snd_pcm_lib_ioctl, 917 /* hw_params:*/ snd_sonicvibes_hw_params, 918 /* hw_free: */ snd_sonicvibes_hw_free, 919 /* prepare: */ snd_sonicvibes_capture_prepare, 920 /* trigger: */ snd_sonicvibes_capture_trigger, 921 /* pointer: */ snd_sonicvibes_capture_pointer, 922 0, 0 871 .open = snd_sonicvibes_capture_open, 872 .close = snd_sonicvibes_capture_close, 873 .ioctl = snd_pcm_lib_ioctl, 874 .hw_params = snd_sonicvibes_hw_params, 875 .hw_free = snd_sonicvibes_hw_free, 876 .prepare = snd_sonicvibes_capture_prepare, 877 .trigger = snd_sonicvibes_capture_trigger, 878 .pointer = snd_sonicvibes_capture_pointer, 923 879 }; 924 #else925 static snd_pcm_ops_t snd_sonicvibes_playback_ops = {926 open: snd_sonicvibes_playback_open,927 close: snd_sonicvibes_playback_close,928 ioctl: snd_pcm_lib_ioctl,929 hw_params: snd_sonicvibes_hw_params,930 hw_free: snd_sonicvibes_hw_free,931 prepare: snd_sonicvibes_playback_prepare,932 trigger: snd_sonicvibes_playback_trigger,933 pointer: snd_sonicvibes_playback_pointer,934 };935 936 static snd_pcm_ops_t snd_sonicvibes_capture_ops = {937 open: snd_sonicvibes_capture_open,938 close: snd_sonicvibes_capture_close,939 ioctl: snd_pcm_lib_ioctl,940 hw_params: snd_sonicvibes_hw_params,941 hw_free: snd_sonicvibes_hw_free,942 prepare: snd_sonicvibes_capture_prepare,943 trigger: snd_sonicvibes_capture_trigger,944 pointer: snd_sonicvibes_capture_pointer,945 };946 #endif947 880 948 881 static void snd_sonicvibes_pcm_free(snd_pcm_t *pcm) … … 981 914 */ 982 915 983 #ifdef TARGET_OS2984 916 #define SONICVIBES_MUX(xname, xindex) \ 985 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 986 0, 0,snd_sonicvibes_info_mux, \ 987 snd_sonicvibes_get_mux, snd_sonicvibes_put_mux, 0} 988 #else 989 #define SONICVIBES_MUX(xname, xindex) \ 990 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 991 info: snd_sonicvibes_info_mux, \ 992 get: snd_sonicvibes_get_mux, put: snd_sonicvibes_put_mux } 993 #endif 917 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 918 .info = snd_sonicvibes_info_mux, \ 919 .get = snd_sonicvibes_get_mux, .put = snd_sonicvibes_put_mux } 994 920 995 921 static int snd_sonicvibes_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1044 970 } 1045 971 1046 #ifdef TARGET_OS21047 972 #define SONICVIBES_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1048 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1049 0, 0, snd_sonicvibes_info_single, \ 1050 snd_sonicvibes_get_single, snd_sonicvibes_put_single, \ 1051 reg | (shift << 8) | (mask << 16) | (invert << 24) } 1052 #else 1053 #define SONICVIBES_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1054 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1055 info: snd_sonicvibes_info_single, \ 1056 get: snd_sonicvibes_get_single, put: snd_sonicvibes_put_single, \ 1057 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 1058 #endif 973 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 974 .info = snd_sonicvibes_info_single, \ 975 .get = snd_sonicvibes_get_single, .put = snd_sonicvibes_put_single, \ 976 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 1059 977 1060 978 static int snd_sonicvibes_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1110 1028 } 1111 1029 1112 #ifdef TARGET_OS21113 1030 #define SONICVIBES_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1114 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1115 0, 0, snd_sonicvibes_info_double, \ 1116 snd_sonicvibes_get_double, snd_sonicvibes_put_double, \ 1117 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1118 #else 1119 #define SONICVIBES_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1120 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1121 info: snd_sonicvibes_info_double, \ 1122 get: snd_sonicvibes_get_double, put: snd_sonicvibes_put_double, \ 1123 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1124 #endif 1031 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1032 .info = snd_sonicvibes_info_double, \ 1033 .get = snd_sonicvibes_get_double, .put = snd_sonicvibes_put_double, \ 1034 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1125 1035 1126 1036 static int snd_sonicvibes_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1365 1275 unsigned int dmaa, dmac; 1366 1276 int err; 1367 #ifdef TARGET_OS21368 1277 static snd_device_ops_t ops = { 1369 snd_sonicvibes_dev_free,0,0,01278 .dev_free = snd_sonicvibes_dev_free, 1370 1279 }; 1371 #else1372 static snd_device_ops_t ops = {1373 dev_free: snd_sonicvibes_dev_free,1374 };1375 #endif1376 1280 1377 1281 *rsonic = NULL; … … 1652 1556 1653 1557 static struct pci_driver driver = { 1654 #ifdef TARGET_OS2 1655 0, 0, 0, 1656 "S3 SonicVibes", 1657 snd_sonic_ids, 1658 snd_sonic_probe, 1659 snd_sonic_remove, 1660 0, 0 1661 #else 1662 name: "S3 SonicVibes", 1663 id_table: snd_sonic_ids, 1664 probe: snd_sonic_probe, 1665 remove: __devexit_p(snd_sonic_remove), 1666 #endif 1558 .name = "S3 SonicVibes", 1559 .id_table = snd_sonic_ids, 1560 .probe = snd_sonic_probe, 1561 .remove = __devexit_p(snd_sonic_remove), 1667 1562 }; 1668 1563 -
GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident.c
r207 r210 187 187 188 188 static struct pci_driver driver = { 189 0, 0, 0, "Trident4DWaveAudio", 190 snd_trident_ids, 191 snd_trident_probe, 192 snd_trident_remove, 193 SND_PCI_PM_CALLBACKS 194 }; 189 .name = "Trident4DWaveAudio", 190 .id_table = snd_trident_ids, 191 .probe = snd_trident_probe, 192 .remove = __devexit_p(snd_trident_remove), 193 #ifdef CONFIG_PM 194 .suspend = snd_trident_suspend, 195 .resume = snd_trident_resume, 196 #endif 197 }; 195 198 196 199 static int __init alsa_card_trident_init(void) -
GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_main.c
r207 r210 28 28 */ 29 29 30 #define __NO_VERSION__31 30 #include <sound/driver.h> 32 31 #include <asm/io.h> … … 1676 1675 static snd_pcm_hardware_t snd_trident_playback = 1677 1676 { 1678 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1677 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1679 1678 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1680 1679 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 1681 SNDRV_PCM_INFO_PAUSE /* | SNDRV_PCM_INFO_RESUME */),1682 /* formats: */(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |1680 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), 1681 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 1683 1682 SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE), 1684 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1685 /* rate_min: */4000,1686 /* rate_max: */48000,1687 /* channels_min: */1,1688 /* channels_max: */2,1689 /* buffer_bytes_max: */(256*1024),1690 /* period_bytes_min: */64,1691 /* period_bytes_max: */(256*1024),1692 /* periods_min: */1,1693 /* periods_max: */1024,1694 /* fifo_size: */0,1683 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1684 .rate_min = 4000, 1685 .rate_max = 48000, 1686 .channels_min = 1, 1687 .channels_max = 2, 1688 .buffer_bytes_max = (256*1024), 1689 .period_bytes_min = 64, 1690 .period_bytes_max = (256*1024), 1691 .periods_min = 1, 1692 .periods_max = 1024, 1693 .fifo_size = 0, 1695 1694 }; 1696 1695 … … 1701 1700 static snd_pcm_hardware_t snd_trident_capture = 1702 1701 { 1703 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1702 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1704 1703 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1705 1704 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 1706 SNDRV_PCM_INFO_PAUSE /* | SNDRV_PCM_INFO_RESUME */),1707 /* formats: */(SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |1705 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), 1706 .formats = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | 1708 1707 SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U16_LE), 1709 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,1710 /* rate_min: */4000,1711 /* rate_max: */48000,1712 /* channels_min: */1,1713 /* channels_max: */2,1714 /* buffer_bytes_max: */(128*1024),1715 /* period_bytes_min: */64,1716 /* period_bytes_max: */(128*1024),1717 /* periods_min: */1,1718 /* periods_max: */1024,1719 /* fifo_size: */0,1708 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 1709 .rate_min = 4000, 1710 .rate_max = 48000, 1711 .channels_min = 1, 1712 .channels_max = 2, 1713 .buffer_bytes_max = (128*1024), 1714 .period_bytes_min = 64, 1715 .period_bytes_max = (128*1024), 1716 .periods_min = 1, 1717 .periods_max = 1024, 1718 .fifo_size = 0, 1720 1719 }; 1721 1720 … … 1726 1725 static snd_pcm_hardware_t snd_trident_foldback = 1727 1726 { 1728 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1727 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1729 1728 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1730 1729 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 1731 SNDRV_PCM_INFO_PAUSE /* | SNDRV_PCM_INFO_RESUME */),1732 /* formats: */SNDRV_PCM_FMTBIT_S16_LE,1733 /* rates: */SNDRV_PCM_RATE_48000,1734 /* rate_min: */48000,1735 /* rate_max: */48000,1736 /* channels_min: */2,1737 /* channels_max: */2,1738 /* buffer_bytes_max: */(128*1024),1739 /* period_bytes_min: */64,1740 /* period_bytes_max: */(128*1024),1741 /* periods_min: */1,1742 /* periods_max: */1024,1743 /* fifo_size: */0,1730 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), 1731 .formats = SNDRV_PCM_FMTBIT_S16_LE, 1732 .rates = SNDRV_PCM_RATE_48000, 1733 .rate_min = 48000, 1734 .rate_max = 48000, 1735 .channels_min = 2, 1736 .channels_max = 2, 1737 .buffer_bytes_max = (128*1024), 1738 .period_bytes_min = 64, 1739 .period_bytes_max = (128*1024), 1740 .periods_min = 1, 1741 .periods_max = 1024, 1742 .fifo_size = 0, 1744 1743 }; 1745 1744 … … 1750 1749 static snd_pcm_hardware_t snd_trident_spdif = 1751 1750 { 1752 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |1751 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1753 1752 SNDRV_PCM_INFO_BLOCK_TRANSFER | 1754 1753 SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START | 1755 SNDRV_PCM_INFO_PAUSE /* | SNDRV_PCM_INFO_RESUME */),1756 /* formats: */SNDRV_PCM_FMTBIT_S16_LE,1757 /* rates: */(SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |1754 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME), 1755 .formats = SNDRV_PCM_FMTBIT_S16_LE, 1756 .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | 1758 1757 SNDRV_PCM_RATE_48000), 1759 /* rate_min: */32000,1760 /* rate_max: */48000,1761 /* channels_min: */2,1762 /* channels_max: */2,1763 /* buffer_bytes_max: */(128*1024),1764 /* period_bytes_min: */64,1765 /* period_bytes_max: */(128*1024),1766 /* periods_min: */1,1767 /* periods_max: */1024,1768 /* fifo_size: */0,1758 .rate_min = 32000, 1759 .rate_max = 48000, 1760 .channels_min = 2, 1761 .channels_max = 2, 1762 .buffer_bytes_max = (128*1024), 1763 .period_bytes_min = 64, 1764 .period_bytes_max = (128*1024), 1765 .periods_min = 1, 1766 .periods_max = 1024, 1767 .fifo_size = 0, 1769 1768 }; 1770 1769 … … 2018 2017 2019 2018 static snd_pcm_ops_t snd_trident_playback_ops = { 2020 2021 2022 2023 2024 2025 2026 2027 snd_trident_playback_pointer,0,0 2019 .open = snd_trident_playback_open, 2020 .close = snd_trident_playback_close, 2021 .ioctl = snd_trident_ioctl, 2022 .hw_params = snd_trident_hw_params, 2023 .hw_free = snd_trident_hw_free, 2024 .prepare = snd_trident_playback_prepare, 2025 .trigger = snd_trident_trigger, 2026 .pointer = snd_trident_playback_pointer, 2028 2027 }; 2029 2028 … … 2041 2040 2042 2041 static snd_pcm_ops_t snd_trident_capture_ops = { 2043 2044 2045 2046 2047 2048 2049 2050 snd_trident_capture_pointer,0,0 2042 .open = snd_trident_capture_open, 2043 .close = snd_trident_capture_close, 2044 .ioctl = snd_trident_ioctl, 2045 .hw_params = snd_trident_capture_hw_params, 2046 .hw_free = snd_trident_hw_free, 2047 .prepare = snd_trident_capture_prepare, 2048 .trigger = snd_trident_trigger, 2049 .pointer = snd_trident_capture_pointer, 2051 2050 }; 2052 2051 2053 2052 static snd_pcm_ops_t snd_trident_si7018_capture_ops = { 2054 2055 2056 2057 2058 2059 2060 2061 snd_trident_playback_pointer,0,0 2053 .open = snd_trident_capture_open, 2054 .close = snd_trident_capture_close, 2055 .ioctl = snd_trident_ioctl, 2056 .hw_params = snd_trident_si7018_capture_hw_params, 2057 .hw_free = snd_trident_si7018_capture_hw_free, 2058 .prepare = snd_trident_si7018_capture_prepare, 2059 .trigger = snd_trident_trigger, 2060 .pointer = snd_trident_playback_pointer, 2062 2061 }; 2063 2062 2064 2063 static snd_pcm_ops_t snd_trident_foldback_ops = { 2065 2066 2067 2068 2069 2070 2071 2072 snd_trident_playback_pointer,0,0 2064 .open = snd_trident_foldback_open, 2065 .close = snd_trident_foldback_close, 2066 .ioctl = snd_trident_ioctl, 2067 .hw_params = snd_trident_hw_params, 2068 .hw_free = snd_trident_hw_free, 2069 .prepare = snd_trident_foldback_prepare, 2070 .trigger = snd_trident_trigger, 2071 .pointer = snd_trident_playback_pointer, 2073 2072 }; 2074 2073 … … 2086 2085 2087 2086 static snd_pcm_ops_t snd_trident_spdif_ops = { 2088 2089 2090 2091 2092 2093 2094 2095 snd_trident_spdif_pointer,0,0 2087 .open = snd_trident_spdif_open, 2088 .close = snd_trident_spdif_close, 2089 .ioctl = snd_trident_ioctl, 2090 .hw_params = snd_trident_spdif_hw_params, 2091 .hw_free = snd_trident_hw_free, 2092 .prepare = snd_trident_spdif_prepare, 2093 .trigger = snd_trident_trigger, 2094 .pointer = snd_trident_spdif_pointer, 2096 2095 }; 2097 2096 … … 2358 2357 static snd_kcontrol_new_t snd_trident_spdif_control __devinitdata = 2359 2358 { 2360 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2361 SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH),0,0,0, 2362 snd_trident_spdif_control_info, 2363 snd_trident_spdif_control_get, 2364 snd_trident_spdif_control_put, 2365 0, 2366 0x28, 2359 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2360 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 2361 .info = snd_trident_spdif_control_info, 2362 .get = snd_trident_spdif_control_get, 2363 .put = snd_trident_spdif_control_put, 2364 .private_value = 0x28, 2367 2365 }; 2368 2366 … … 2421 2419 static snd_kcontrol_new_t snd_trident_spdif_default __devinitdata = 2422 2420 { 2423 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2424 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,2425 2426 2427 snd_trident_spdif_default_put,0 2421 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2422 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 2423 .info = snd_trident_spdif_default_info, 2424 .get = snd_trident_spdif_default_get, 2425 .put = snd_trident_spdif_default_put 2428 2426 }; 2429 2427 … … 2453 2451 static snd_kcontrol_new_t snd_trident_spdif_mask __devinitdata = 2454 2452 { 2455 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2456 SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),0,2457 SNDRV_CTL_ELEM_ACCESS_READ,0,2458 2459 snd_trident_spdif_mask_get,0,0 2453 .access = SNDRV_CTL_ELEM_ACCESS_READ, 2454 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2455 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK), 2456 .info = snd_trident_spdif_mask_info, 2457 .get = snd_trident_spdif_mask_get, 2460 2458 }; 2461 2459 … … 2514 2512 static snd_kcontrol_new_t snd_trident_spdif_stream __devinitdata = 2515 2513 { 2516 SNDRV_CTL_ELEM_IFACE_PCM,0,0,2517 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,2518 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,2519 2520 2521 snd_trident_spdif_stream_put,0 2514 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2515 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 2516 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 2517 .info = snd_trident_spdif_stream_info, 2518 .get = snd_trident_spdif_stream_get, 2519 .put = snd_trident_spdif_stream_put 2522 2520 }; 2523 2521 … … 2571 2569 static snd_kcontrol_new_t snd_trident_ac97_rear_control __devinitdata = 2572 2570 { 2573 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2574 "Rear Path",0,0,0, 2575 snd_trident_ac97_control_info, 2576 snd_trident_ac97_control_get, 2577 snd_trident_ac97_control_put, 2578 0, 2579 4, 2571 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2572 .name = "Rear Path", 2573 .info = snd_trident_ac97_control_info, 2574 .get = snd_trident_ac97_control_get, 2575 .put = snd_trident_ac97_control_put, 2576 .private_value = 4, 2580 2577 }; 2581 2578 … … 2628 2625 static snd_kcontrol_new_t snd_trident_vol_music_control __devinitdata = 2629 2626 { 2630 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2631 "Music Playback Volume",0,0,0, 2632 snd_trident_vol_control_info, 2633 snd_trident_vol_control_get, 2634 snd_trident_vol_control_put, 2635 0, // tlv 2636 16 // private 2627 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2628 .name = "Music Playback Volume", 2629 .info = snd_trident_vol_control_info, 2630 .get = snd_trident_vol_control_get, 2631 .put = snd_trident_vol_control_put, 2632 .private_value = 16, 2637 2633 }; 2638 2634 … … 2640 2636 static snd_kcontrol_new_t snd_trident_vol_wave_control __devinitdata = 2641 2637 { 2642 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,2643 "Wave Playback Volume",0,0,0,2644 2645 2646 2647 2638 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2639 .name = "Wave Playback Volume", 2640 .info = snd_trident_vol_control_info, 2641 .get = snd_trident_vol_control_get, 2642 .put = snd_trident_vol_control_put, 2643 .private_value = 0, 2648 2644 }; 2649 2645 … … 2705 2701 static snd_kcontrol_new_t snd_trident_pcm_vol_control __devinitdata = 2706 2702 { 2707 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2708 "PCM Front Playback Volume",0, 2709 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2710 32, 2711 snd_trident_pcm_vol_control_info, 2712 snd_trident_pcm_vol_control_get, 2713 snd_trident_pcm_vol_control_put,0 2703 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2704 .name = "PCM Front Playback Volume", 2705 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2706 .info = snd_trident_pcm_vol_control_info, 2707 .get = snd_trident_pcm_vol_control_get, 2708 .put = snd_trident_pcm_vol_control_put, 2714 2709 }; 2715 2710 … … 2767 2762 static snd_kcontrol_new_t snd_trident_pcm_pan_control __devinitdata = 2768 2763 { 2769 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2770 "PCM Pan Playback Control",0, 2771 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2772 32, 2773 snd_trident_pcm_pan_control_info, 2774 snd_trident_pcm_pan_control_get, 2775 snd_trident_pcm_pan_control_put,0 2764 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2765 .name = "PCM Pan Playback Control", 2766 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2767 .info = snd_trident_pcm_pan_control_info, 2768 .get = snd_trident_pcm_pan_control_get, 2769 .put = snd_trident_pcm_pan_control_put, 2776 2770 }; 2777 2771 … … 2821 2815 static snd_kcontrol_new_t snd_trident_pcm_rvol_control __devinitdata = 2822 2816 { 2823 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2824 "PCM Reverb Playback Volume",0, 2825 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2826 32, 2827 snd_trident_pcm_rvol_control_info, 2828 snd_trident_pcm_rvol_control_get, 2829 snd_trident_pcm_rvol_control_put,0 2817 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2818 .name = "PCM Reverb Playback Volume", 2819 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2820 .info = snd_trident_pcm_rvol_control_info, 2821 .get = snd_trident_pcm_rvol_control_get, 2822 .put = snd_trident_pcm_rvol_control_put, 2830 2823 }; 2831 2824 … … 2875 2868 static snd_kcontrol_new_t snd_trident_pcm_cvol_control __devinitdata = 2876 2869 { 2877 SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 2878 "PCM Chorus Playback Volume",0, 2879 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2880 32, 2881 snd_trident_pcm_cvol_control_info, 2882 snd_trident_pcm_cvol_control_get, 2883 snd_trident_pcm_cvol_control_put,0 2870 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2871 .name = "PCM Chorus Playback Volume", 2872 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 2873 .info = snd_trident_pcm_cvol_control_info, 2874 .get = snd_trident_pcm_cvol_control_get, 2875 .put = snd_trident_pcm_cvol_control_put, 2884 2876 }; 2885 2877 … … 3524 3516 #ifdef TARGET_OS2 3525 3517 static snd_device_ops_t ops = { 3526 snd_trident_dev_free,0,0,0 3518 .dev_free = snd_trident_dev_free, 3527 3519 }; 3528 3520 #endif -
GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_memory.c
r106 r210 24 24 */ 25 25 26 #define __NO_VERSION__27 26 #include <sound/driver.h> 28 27 #include <asm/io.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci_main.c
r207 r210 25 25 */ 26 26 27 #define __NO_VERSION__28 27 #include <sound/driver.h> 29 28 #include <asm/io.h> … … 32 31 #include <linux/pci.h> 33 32 #include <linux/slab.h> 33 #include <linux/vmalloc.h> 34 34 #include <sound/core.h> 35 35 #include <sound/control.h> … … 785 785 static snd_pcm_hardware_t snd_ymfpci_playback = 786 786 { 787 /* info: */ (SNDRV_PCM_INFO_MMAP | 787 .info = (SNDRV_PCM_INFO_MMAP | 788 SNDRV_PCM_INFO_MMAP_VALID | 789 SNDRV_PCM_INFO_INTERLEAVED | 790 SNDRV_PCM_INFO_BLOCK_TRANSFER | 791 SNDRV_PCM_INFO_PAUSE | 792 SNDRV_PCM_INFO_RESUME), 793 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 794 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 795 .rate_min = 8000, 796 .rate_max = 48000, 797 .channels_min = 1, 798 .channels_max = 2, 799 .buffer_bytes_max = 256 * 1024, /* FIXME: enough? */ 800 .period_bytes_min = 64, 801 .period_bytes_max = 256 * 1024, /* FIXME: enough? */ 802 .periods_min = 3, 803 .periods_max = 1024, 804 .fifo_size = 0, 805 }; 806 807 static snd_pcm_hardware_t snd_ymfpci_capture = 808 { 809 .info = (SNDRV_PCM_INFO_MMAP | 788 810 SNDRV_PCM_INFO_MMAP_VALID | 789 811 SNDRV_PCM_INFO_INTERLEAVED | … … 791 813 SNDRV_PCM_INFO_PAUSE | 792 814 SNDRV_PCM_INFO_RESUME), 793 /* formats: */ SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 794 /* rates: */ SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 795 /* rate_min: */ 8000, 796 /* rate_max: */ 48000, 797 /* channels_min: */ 1, 798 /* channels_max: */ 2, 799 /* buffer_bytes_max: */ 256 * 1024, /* FIXME: enough? */ 800 /* period_bytes_min: */ 64, 801 /* period_bytes_max: */ 256 * 1024, /* FIXME: enough? */ 802 /* periods_min: */ 3, 803 /* periods_max: */ 1024, 804 /* fifo_size: */ 0, 805 }; 806 807 static snd_pcm_hardware_t snd_ymfpci_capture = 808 { 809 /* info: */ (SNDRV_PCM_INFO_MMAP | 810 SNDRV_PCM_INFO_MMAP_VALID | 811 SNDRV_PCM_INFO_INTERLEAVED | 812 SNDRV_PCM_INFO_BLOCK_TRANSFER | 813 SNDRV_PCM_INFO_PAUSE | 814 SNDRV_PCM_INFO_RESUME), 815 /* formats: */ SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 816 /* rates: */ SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 817 /* rate_min: */ 8000, 818 /* rate_max: */ 48000, 819 /* channels_min: */ 1, 820 /* channels_max: */ 2, 821 /* buffer_bytes_max: */ 256 * 1024, /* FIXME: enough? */ 822 /* period_bytes_min: */ 64, 823 /* period_bytes_max: */ 256 * 1024, /* FIXME: enough? */ 824 /* periods_min: */ 3, 825 /* periods_max: */ 1024, 826 /* fifo_size: */ 0, 815 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 816 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 817 .rate_min = 8000, 818 .rate_max = 48000, 819 .channels_min = 1, 820 .channels_max = 2, 821 .buffer_bytes_max = 256 * 1024, /* FIXME: enough? */ 822 .period_bytes_min = 64, 823 .period_bytes_max = 256 * 1024, /* FIXME: enough? */ 824 .periods_min = 3, 825 .periods_max = 1024, 826 .fifo_size = 0, 827 827 }; 828 828 … … 1053 1053 1054 1054 static snd_pcm_ops_t snd_ymfpci_playback_ops = { 1055 1056 1057 1058 1059 1060 1061 1062 snd_ymfpci_playback_pointer,0,0,0,0 1055 .open = snd_ymfpci_playback_open, 1056 .close = snd_ymfpci_playback_close, 1057 .ioctl = snd_pcm_lib_ioctl, 1058 .hw_params = snd_ymfpci_playback_hw_params, 1059 .hw_free = snd_ymfpci_playback_hw_free, 1060 .prepare = snd_ymfpci_playback_prepare, 1061 .trigger = snd_ymfpci_playback_trigger, 1062 .pointer = snd_ymfpci_playback_pointer, 1063 1063 }; 1064 1064 1065 1065 static snd_pcm_ops_t snd_ymfpci_capture_rec_ops = { 1066 1067 1068 1069 1070 1071 1072 1073 snd_ymfpci_capture_pointer,0,0,0,0 1066 .open = snd_ymfpci_capture_rec_open, 1067 .close = snd_ymfpci_capture_close, 1068 .ioctl = snd_pcm_lib_ioctl, 1069 .hw_params = snd_ymfpci_capture_hw_params, 1070 .hw_free = snd_ymfpci_capture_hw_free, 1071 .prepare = snd_ymfpci_capture_prepare, 1072 .trigger = snd_ymfpci_capture_trigger, 1073 .pointer = snd_ymfpci_capture_pointer, 1074 1074 }; 1075 1075 … … 1111 1111 1112 1112 static snd_pcm_ops_t snd_ymfpci_capture_ac97_ops = { 1113 1114 1115 1116 1117 1118 1119 1120 snd_ymfpci_capture_pointer,0,0 1113 .open = snd_ymfpci_capture_ac97_open, 1114 .close = snd_ymfpci_capture_close, 1115 .ioctl = snd_pcm_lib_ioctl, 1116 .hw_params = snd_ymfpci_capture_hw_params, 1117 .hw_free = snd_ymfpci_capture_hw_free, 1118 .prepare = snd_ymfpci_capture_prepare, 1119 .trigger = snd_ymfpci_capture_trigger, 1120 .pointer = snd_ymfpci_capture_pointer, 1121 1121 }; 1122 1122 … … 1158 1158 1159 1159 static snd_pcm_ops_t snd_ymfpci_playback_spdif_ops = { 1160 1161 1162 1163 1164 1165 1166 1167 snd_ymfpci_playback_pointer,0,0 1160 .open = snd_ymfpci_playback_spdif_open, 1161 .close = snd_ymfpci_playback_spdif_close, 1162 .ioctl = snd_pcm_lib_ioctl, 1163 .hw_params = snd_ymfpci_playback_hw_params, 1164 .hw_free = snd_ymfpci_playback_hw_free, 1165 .prepare = snd_ymfpci_playback_prepare, 1166 .trigger = snd_ymfpci_playback_trigger, 1167 .pointer = snd_ymfpci_playback_pointer, 1168 1168 }; 1169 1169 … … 1203 1203 1204 1204 static snd_pcm_ops_t snd_ymfpci_playback_4ch_ops = { 1205 1206 1207 1208 1209 1210 1211 1212 snd_ymfpci_playback_pointer,0,0,0,0 1205 .open = snd_ymfpci_playback_4ch_open, 1206 .close = snd_ymfpci_playback_4ch_close, 1207 .ioctl = snd_pcm_lib_ioctl, 1208 .hw_params = snd_ymfpci_playback_hw_params, 1209 .hw_free = snd_ymfpci_playback_hw_free, 1210 .prepare = snd_ymfpci_playback_prepare, 1211 .trigger = snd_ymfpci_playback_trigger, 1212 .pointer = snd_ymfpci_playback_pointer, 1213 1213 }; 1214 1214 … … 1316 1316 { 1317 1317 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1318 .iface = SNDRV_CTL_ELEM_IFACE_PCM,1319 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),1318 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1319 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1320 1320 .info = snd_ymfpci_spdif_mask_info, 1321 1321 .get = snd_ymfpci_spdif_mask_get, … … 1363 1363 { 1364 1364 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1365 .iface = SNDRV_CTL_ELEM_IFACE_PCM,1366 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),1365 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1366 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1367 1367 .info = snd_ymfpci_spdif_stream_info, 1368 1368 .get = snd_ymfpci_spdif_stream_get, … … 1434 1434 .private_value = ((reg) | ((shift) << 16)) } 1435 1435 1436 #if 01437 #define YMFPCI_SINGLE(xname, xindex, reg) \1438 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \1439 0, 0, snd_ymfpci_info_single, \1440 snd_ymfpci_get_single, snd_ymfpci_put_single, \1441 reg }1442 1443 #endif1444 1436 static int snd_ymfpci_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1445 1437 {
Note:
See TracChangeset
for help on using the changeset viewer.