Changeset 210


Ignore:
Timestamp:
Jul 13, 2007, 4:47:31 PM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to Alsa 0.9.0rc3

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  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
     23#include <linux/threads.h>
    2424#include <linux/interrupt.h>
    2525#include <linux/slab.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/device.c

    r92 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/slab.h>
    2524#include <linux/time.h>
     25#include <linux/errno.h>
    2626#include <sound/core.h>
    2727
  • GPL/branches/alsa-resync1/alsa-kernel/core/info.c

    r207 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/init.h>
     
    535534{
    536535#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,
    547546};
    548547
     
    606605{
    607606#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,
    612611};
    613612#endif //TARGET_OS2
  • GPL/branches/alsa-resync1/alsa-kernel/core/init.c

    r207 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/init.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/isadma.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
     
    2828
    2929#include <sound/driver.h>
     30#include <sound/core.h>
     31#include <asm/dma.h>
    3032
    31 #ifdef CONFIG_SND_ISA
     33#ifdef CONFIG_ISA
    3234
    3335/*
     
    3638 
    3739void snd_dma_program(unsigned long dma,
    38                      const void *buf, unsigned int size,
     40                     unsigned long addr, unsigned int size,
    3941                     unsigned short mode)
    4042{
     
    4547        clear_dma_ff(dma);
    4648        set_dma_mode(dma, mode);
    47         set_dma_addr(dma, virt_to_bus((void *) buf));
     49        set_dma_addr(dma, addr);
    4850        set_dma_count(dma, size);
    4951        if (!(mode & DMA_MODE_NO_ENABLE))
     
    7880}
    7981
    80 #endif /* CONFIG_SND_ISA */
     82#endif /* CONFIG_ISA */
  • GPL/branches/alsa-resync1/alsa-kernel/core/memory.c

    r207 r210  
    2121 */
    2222
    23 #define __NO_VERSION__
    2423#include <sound/driver.h>
    2524#include <asm/io.h>
     
    3130#include <sound/core.h>
    3231#include <sound/info.h>
     32#ifdef CONFIG_SBUS
     33#include <asm/sbus.h>
     34#endif
    3335#include <sound/memalloc.h>
    3436
  • GPL/branches/alsa-resync1/alsa-kernel/core/misc.c

    r206 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/init.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_lib.c

    r105 r210  
    2121 */
    2222
    23 #define __NO_VERSION__
    2423#include <sound/driver.h>
    2524#include <linux/slab.h>
     
    26942693EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page);
    26952694#endif
     2695#ifdef CONFIG_SBUS
     2696EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages);
     2697EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages_for_all);
     2698#endif
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_memory.c

    r105 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <asm/io.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_native.c

    r109 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/mm.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_timer.c

    r105 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/time.h>
  • GPL/branches/alsa-resync1/alsa-kernel/core/rtctimer.c

    r207 r210  
    2424#include <linux/init.h>
    2525#include <linux/time.h>
     26#include <linux/threads.h>
    2627#include <linux/interrupt.h>
    2728#include <sound/core.h>
     
    5253 */
    5354static 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,
    6061};
    6162
  • GPL/branches/alsa-resync1/alsa-kernel/core/seq/seq_virmidi.c

    r34 r210  
    556556
    557557EXPORT_SYMBOL(snd_virmidi_new);
     558EXPORT_SYMBOL(snd_virmidi_receive);
  • GPL/branches/alsa-resync1/alsa-kernel/core/sound.c

    r112 r210  
    173173{
    174174#ifndef LINUX_2_2
    175 owner:          THIS_MODULE,
    176 #endif
    177     open:               snd_open
     175        .owner =        THIS_MODULE,
     176#endif
     177        .open =         snd_open
    178178};
    179179#endif
  • GPL/branches/alsa-resync1/alsa-kernel/core/timer.c

    r207 r210  
    17871787
    17881788            remove_wait_queue(&tu->qchange_sleep, &wait);
     1789                        set_current_state(TASK_RUNNING);
    17891790
    17901791            if (signal_pending(current)) {
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c

    r207 r210  
    123123#define SNDRV_SERIAL_MS124W_SA 2   /* Midiator MS-124W in S/A mode */
    124124#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
    126127static char *adaptor_names[] = {
    127128    "Soundcanvas",
    128129    "MS-124T",
    129130    "MS-124W S/A",
    130     "MS-124W M/B"
     131        "MS-124W M/B",
     132        "Generic"
    131133};
    132134
     
    140142static int snd_base[SNDRV_CARDS] = {REPEAT_SNDRV(115200)}; /* baud base */
    141143static int snd_outs[SNDRV_CARDS] = {REPEAT_SNDRV(1)};   /* 1 to 16 */
     144static int snd_ins[SNDRV_CARDS] = {REPEAT_SNDRV(1)};    /* 1 to 16 */
    142145static int snd_adaptor[SNDRV_CARDS] = {REPEAT_SNDRV(SNDRV_SERIAL_SOUNDCANVAS)};
    143146#else
    144147static int snd_speed[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 38400}; /* 9600,19200,38400,57600,115200 */
    145148static 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 */
     149static int snd_outs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};      /* 1 to 16 */
     150static int snd_ins[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};      /* 1 to 16 */
    147151static int snd_adaptor[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = SNDRV_SERIAL_SOUNDCANVAS};
    148152#endif
     
    171175MODULE_PARM(snd_outs, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    172176MODULE_PARM_DESC(snd_outs, "Number of MIDI outputs.");
     177MODULE_PARM(snd_ins, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     178MODULE_PARM_DESC(snd_ins, "Number of MIDI inputs.");
     179
    173180MODULE_PARM_SYNTAX(snd_outs, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
     181MODULE_PARM_SYNTAX(snd_ins, SNDRV_ENABLED ",allows:{{1,16}},dialog:list");
    174182MODULE_PARM(snd_adaptor, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    175183MODULE_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");
     184MODULE_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");
    177185
    178186/*#define SNDRV_SERIAL_MS124W_MB_NOCOMBO 1*/  /* Address outs as 0-3 instead of bitmap */
    179187
    180188#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 */
    183192#define TX_BUFF_MASK            (TX_BUFF_SIZE - 1)
    184193
     
    193202    snd_rawmidi_t *rmidi;
    194203    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];
    196205
    197206    int filemode;               //open status of file
     
    218227    // type of adaptor
    219228    int adaptor;
     229
     230        // inputs
     231        int prev_in;
     232        unsigned char rstatus;
    220233
    221234    // outputs
     
    274287{
    275288    unsigned char c, status;
     289        int substream;
     290
     291        /* recall previous stream */
     292        substream = uart->prev_in;
    276293
    277294    /* Read Loop */
     
    279296        /* while receive data ready */
    280297        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
    284319        if (status & UART_LSR_OE)
    285320            snd_printk("%s: Overrun on device at 0x%lx\n",
    286321                       uart->rmidi->name, uart->base);
    287322    }
     323
     324        /* remember the last stream */
     325        uart->prev_in = substream;
    288326
    289327    /* no need of check SERIAL_MODE_OUTPUT_OPEN because if not,
     
    293331        uart->fifo_count = 0;
    294332    }
    295     if (uart->adaptor == SNDRV_SERIAL_MS124W_SA) {
     333        if (uart->adaptor == SNDRV_SERIAL_MS124W_SA
     334           || uart->adaptor == SNDRV_SERIAL_GENERIC) {
    296335        /* Can't use FIFO, must send only when CTS is true */
    297336        status = inb(uart->base + UART_MSR);
     
    474513            | UART_IER_MSI      /* Enable Modem status interrupt */
    475514            ;
     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                    ;
    476520    } else {
    477521        byte = UART_IER_RDI     /* Enable Receiver data interupt */
     
    546590        snd_uart16550_do_open(uart);
    547591    uart->filemode |= SERIAL_MODE_INPUT_OPEN;
    548     uart->midi_input = substream;
     592        uart->midi_input[substream->number] = substream;
    549593    spin_unlock_irqrestore(&uart->open_lock, flags);
    550594    return 0;
     
    558602    spin_lock_irqsave(&uart->open_lock, flags);
    559603    uart->filemode &= ~SERIAL_MODE_INPUT_OPEN;
    560     uart->midi_input = NULL;
     604        uart->midi_input[substream->number] = NULL;
    561605    if (uart->filemode == SERIAL_MODE_NOT_OPENED)
    562606        snd_uart16550_do_close(uart);
     
    622666{
    623667    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) ||
    625670            (uart->fifo_count == 0                               /* FIFO empty? */
    626671             && (inb(uart->base + UART_MSR) & UART_MSR_CTS)))) { /* CTS? */
     
    656701    snd_uart16550_t *uart = substream->rmidi->private_data;
    657702    char first;
     703        static unsigned long lasttime=0;
    658704
    659705    /* Interupts are disabled during the updating of the tx_buff,
     
    691737        first = 0;
    692738        while (1) {
    693             /* buffer full? */
    694             if (uart->buff_in_count >= TX_BUFF_SIZE)
    695                 break;
    696739            if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1)
    697740                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
    700750                /* Roland Soundcanvas part selection */
    701751                /* If this substream of the data is different previous
     
    707757                snd_uart16550_output_byte(uart, substream, uart->prev_out + 1);
    708758                /* 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))
    710760                    snd_uart16550_output_byte(uart, substream, uart->prev_status[uart->prev_out]);
    711761            }
     762
     763                        /* buffer full? */
     764                        if (uart->buff_in_count >= TX_BUFF_SIZE)
     765                                break;
     766
    712767            /* send midi byte */
    713768            snd_uart16550_output_byte(uart, substream, midi_byte);
     
    716771            first = 1;
    717772        }
     773                lasttime = jiffies;
    718774    }
    719775    spin_unlock_irqrestore(&uart->open_lock, flags);
     
    753809static snd_rawmidi_ops_t snd_uart16550_output =
    754810{
    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,
    758814};
    759815
    760816static snd_rawmidi_ops_t snd_uart16550_input =
    761817{
    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,
    765821};
    766822#endif
     
    829885    uart->speed_base = base;
    830886    uart->prev_out = -1;
     887        uart->prev_in = 0;
     888        uart->rstatus = 0;
    831889    memset(uart->prev_status, 0x80, sizeof(unsigned char) * SNDRV_SERIAL_MAX_OUTS);
    832890    uart->buffer_timer.function = snd_uart16550_buffer_timer;
     
    862920}
    863921
    864 static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, snd_rawmidi_t **rmidi)
     922static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, snd_rawmidi_t **rmidi)
    865923{
    866924    snd_rawmidi_t *rrawmidi;
    867925    int err;
    868926
    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)
    870928        return err;
    871929    snd_rawmidi_set_ops(rrawmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_uart16550_input);
     
    892950    switch (snd_adaptor[dev]) {
    893951    case SNDRV_SERIAL_SOUNDCANVAS:
     952                snd_ins[dev] = 1;
    894953        break;
    895954    case SNDRV_SERIAL_MS124T:
    896955    case SNDRV_SERIAL_MS124W_SA:
    897956        snd_outs[dev] = 1;
     957                snd_ins[dev] = 1;
    898958        break;
    899959    case SNDRV_SERIAL_MS124W_MB:
    900960        snd_outs[dev] = 16;
     961                snd_ins[dev] = 1;
     962                break;
     963        case SNDRV_SERIAL_GENERIC:
    901964        break;
    902965    default:
     
    909972        snd_printk("Count of outputs is out of range 1-%d (%d)\n",
    910973                   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]);
    911980        return -ENODEV;
    912981    }
     
    9361005    }
    9371006
    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) {
    9391008        snd_card_free(card);
    9401009        return err;
    9411010    }
    9421011
    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",
    9441013            card->shortname,
    9451014            uart->base,
     
    9481017            (int)uart->divisor,
    9491018            snd_outs[dev],
     1019                snd_ins[dev],
    9501020            adaptor_names[uart->adaptor]);
    9511021
     
    9931063
    9941064/* 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 */
    9961067
    9971068static int __init alsa_card_serial_setup(char *str)
     
    10091080           get_option(&str,&snd_base[nr_dev]) == 2 &&
    10101081           get_option(&str,&snd_outs[nr_dev]) == 2 &&
     1082               get_option(&str,&snd_ins[nr_dev]) == 2 &&
    10111083           get_option(&str,&snd_adaptor[nr_dev]) == 2);
    10121084    nr_dev++;
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/ad1848.h

    r96 r210  
    167167void snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs);
    168168
    169 #ifdef TARGET_OS2
    170169#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) }
    182174
    183175int snd_ad1848_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
     
    185177int snd_ad1848_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
    186178
    187 #ifdef TARGET_OS2
    188179#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) }
    200184
    201185int 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  
    373373
    374374#ifdef CONFIG_SND_VERBOSE_PRINTK
    375 #define snd_printk(format, args...) \
    376         snd_verbose_printk(__FILE__, __LINE__, format, ##args)
    377 #else
    378 #define snd_printk(format, args...) \
    379         printk(format, ##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)
    380380#endif
    381381
     
    385385
    386386#ifdef CONFIG_SND_VERBOSE_PRINTK
    387 #define snd_printd(format, args...) \
    388         snd_verbose_printd(__FILE__, __LINE__, format, ##args)
     387#define snd_printd(fmt, args...) \
     388        snd_verbose_printd(__FILE__, __LINE__, fmt ,##args)
    389389#endif
    390390#define snd_assert(expr, args...) do {\
     
    403403#else /* !CONFIG_SND_DEBUG */
    404404
    405 #define snd_printd(format, args...)     /* nothing */
    406 #define snd_assert(expr, args...)       /* nothing */
     405#define snd_printd(fmt, args...)        /* nothing */
     406#define snd_assert(expr, args...)       (void)(expr)
    407407#define snd_runtime_check(expr, args...) do { if (!(expr)) { args; } } while (0)
    408408
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/cs4231.h

    r96 r210  
    297297 */
    298298
    299 #ifdef TARGET_OS2
    300299#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) }
    312304
    313305int snd_cs4231_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo);
     
    315307int snd_cs4231_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol);
    316308
    317 #ifdef TARGET_OS2
    318309#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) }
    330314
    331315int 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  
    5858
    5959#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
    60 #if defined(__i386__) || defined(__ppc__)
     60#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
    6161/*
    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.
    6363 */
    6464#define HACK_PCI_ALLOC_CONSISTENT
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/initval.h

    r92 r210  
    179179#if defined(SNDRV_GET_ID) && !defined(MODULE)
    180180#include <linux/ctype.h>
     181#include <linux/init.h>
    181182static int __init get_id(char **str, char **dst)
    182183{
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/mixer_oss.h

    r96 r210  
    2323 */
    2424
    25 #ifdef CONFIG_SND_OSSEMUL
     25#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
    2626
    2727typedef struct _snd_oss_mixer_slot snd_mixer_oss_slot_t;
     
    6767};
    6868
    69 #endif /* CONFIG_SND_OSSEMUL */
     69#endif /* CONFIG_SND_MIXER_OSS */
    7070
    7171#endif /* __SOUND_MIXER_OSS_H */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm_params.h

    r112 r210  
    3737
    3838#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 
    4439#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))
    4545
    4646INLINE unsigned int ld2(u_int32_t v)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a_lib.c

    r112 r210  
    333333}
    334334
    335 #ifdef TARGET_OS2
     335
    336336static 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 |
    338338                                 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 |
    340340                                 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |
    341341                                 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,
    353353};
    354354
    355355static 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 |
    357357                                 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 |
    359359                                 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE |
    360360                                 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,
    372372};
    373 #else
    374 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 #endif
    412373
    413374static int snd_ad1816a_timer_close(snd_timer_t *timer)
     
    464425}
    465426
    466 #ifdef TARGET_OS2
    467427static 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,
    476436};
    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
    489438
    490439static int snd_ad1816a_playback_open(snd_pcm_substream_t *substream)
     
    626575                       ad1816a_t **rchip)
    627576{
    628 #ifdef TARGET_OS2
    629577        static snd_device_ops_t ops = {
    630                 snd_ad1816a_dev_free,0,0
     578                .dev_free =     snd_ad1816a_dev_free,
    631579        };
    632 #else
    633         static snd_device_ops_t ops = {
    634                 dev_free:       snd_ad1816a_dev_free,
    635         };
    636 #endif
    637580        int error;
    638581        ad1816a_t *chip;
     
    688631}
    689632
    690 #ifdef TARGET_OS2
    691633static 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,0
     634        .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,
    700642};
    701643
    702644static 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,0
     645        .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,
    711653};
    712 #else
    713 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 #endif
    735654
    736655static void snd_ad1816a_pcm_free(snd_pcm_t *pcm)
     
    849768}
    850769
    851 #ifdef TARGET_OS2
    852770#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) }
    862774
    863775static int snd_ad1816a_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    913825}
    914826
    915 #ifdef TARGET_OS2
    916827#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) }
    926831
    927832static int snd_ad1816a_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    1004909AD1816A_DOUBLE("FM Playback Volume", AD1816A_FM_ATT, 8, 0, 63, 1),
    1005910AD1816A_SINGLE("Mic Playback Switch", AD1816A_MIC_GAIN_ATT, 15, 1, 1),
    1006 AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 63, 1),
     911AD1816A_SINGLE("Mic Playback Volume", AD1816A_MIC_GAIN_ATT, 8, 31, 1),
    1007912AD1816A_SINGLE("Mic Boost", AD1816A_MIC_GAIN_ATT, 14, 1, 0),
    1008913AD1816A_DOUBLE("Video Playback Switch", AD1816A_VID_GAIN_ATT, 15, 7, 1, 1),
     
    1013918AD1816A_SINGLE("Phone Playback Volume", AD1816A_PHONE_OUT_ATT, 0, 31, 1),
    1014919{
    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,
    1028925},
    1029926AD1816A_DOUBLE("Capture Switch", AD1816A_ADC_PGA, 15, 7, 1, 1),
     
    1066963module_init(alsa_ad1816a_init)
    1067964module_exit(alsa_ad1816a_exit)
    1068 
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848_lib.c

    r112 r210  
    2525#include <asm/dma.h>
    2626#include <linux/delay.h>
     27#include <linux/init.h>
    2728#include <linux/slab.h>
    2829#include <linux/ioport.h>
    2930#include <sound/core.h>
    3031#include <sound/ad1848.h>
     32#include <sound/pcm_params.h>
    3133
    3234MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     
    6668};
    6769
    68 #ifdef TARGET_OS2
    6970static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    70         14,
    71         rates,
    72         0,
     71        .count = 14,
     72        .list = rates,
     73        .mask = 0,
    7374};
    74 #else
    75 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    76         count: 14,
    77         list: rates,
    78         mask: 0,
    79 };
    80 #endif
    8175
    8276static unsigned char snd_ad1848_original_image[16] =
     
    706700 */
    707701
    708 #ifdef TARGET_OS2
    709702static snd_pcm_hardware_t snd_ad1848_playback =
    710703{
    711 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     704        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    712705                                 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 |
    714707                                 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,
    726719};
    727720
    728721static snd_pcm_hardware_t snd_ad1848_capture =
    729722{
    730 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     723        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    731724                                 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 |
    733726                                 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,
    745738};
    746 #else
    747 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 #endif
    785739
    786740/*
     
    879833                      ad1848_t ** rchip)
    880834{
    881 #ifdef TARGET_OS2
    882835        static snd_device_ops_t ops = {
    883                 snd_ad1848_dev_free,0,0
     836                .dev_free =     snd_ad1848_dev_free,
    884837        };
    885 #else
    886         static snd_device_ops_t ops = {
    887                 dev_free:       snd_ad1848_dev_free,
    888         };
    889 #endif
    890838        ad1848_t *chip;
    891839        int err;
     
    934882}
    935883
    936 #ifdef TARGET_OS2
    937884static 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,0
     885        .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,
    946893};
    947894
    948895static 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,0
     896        .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,
    957904};
    958 #else
    959 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 #endif
    981905
    982906static void snd_ad1848_pcm_free(snd_pcm_t *pcm)
     
    11971121AD1848_DOUBLE("Capture Volume", 0, AD1848_LEFT_INPUT, AD1848_RIGHT_INPUT, 0, 0, 15, 0),
    11981122{
    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,
    12121128},
    12131129AD1848_SINGLE("Loopback Capture Switch", 0, AD1848_LOOPBACK, 0, 1, 0),
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c

    r112 r210  
    3636#include <sound/core.h>
    3737#include <sound/cs4231.h>
     38#include <sound/pcm_params.h>
    3839
    3940MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     
    7374};
    7475
    75 #ifdef TARGET_OS2
    7676static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    77         14,
    78         rates,
    79         0,
     77        .count = 14,
     78        .list = rates,
     79        .mask = 0,
    8080};
    81 #else
    82 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    83         count: 14,
    84         list: rates,
    85         mask: 0,
    86 };
    87 #endif
    8881
    8982static int snd_cs4231_xrate(snd_pcm_runtime_t *runtime)
     
    801794}
    802795
    803 #ifdef TARGET_OS2
    804796static struct _snd_timer_hardware snd_cs4231_timer_table =
    805797{
    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,
    814806};
    815 #else
    816 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 #endif
    828807
    829808/*
     
    11471126 */
    11481127
    1149 #ifdef TARGET_OS2
    11501128static snd_pcm_hardware_t snd_cs4231_playback =
    11511129{
    1152 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1130        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    11531131                                 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 |
    11551133                                 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,
    11671145};
    11681146
    11691147static snd_pcm_hardware_t snd_cs4231_capture =
    11701148{
    1171 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1149        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    11721150                                 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 |
    11741152                                 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,
    11861164};
    1187 #else
    1188 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 #endif
    12261165
    12271166/*
     
    14561395                      cs4231_t ** rchip)
    14571396{
    1458 #ifdef TARGET_OS2
    14591397        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        };
    14671400        cs4231_t *chip;
    14681401        int err;
     
    15481481}
    15491482
    1550 #ifdef TARGET_OS2
    15511483static 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,0
     1484        .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,
    15601492};
    15611493
    15621494static 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,0
     1495        .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,
    15711503};
    1572 #else
    1573 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 #endif
    15951504
    15961505static void snd_cs4231_pcm_free(snd_pcm_t *pcm)
     
    18651774CS4231_DOUBLE("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 0, 0, 15, 0),
    18661775{
    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,
    18801781},
    18811782CS4231_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  
    255255        /* Typhoon Soundsystem PnP - CS4236B */
    256256        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),
    257259        /* TerraTec AudioSystem EWS64XL - CS4236B */
    258260        ISAPNP_CS4232('C','S','C',0xa836,0xa800,0xa810,0xa803),
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236_lib.c

    r32 r210  
    2121 *   You should have received a copy of the GNU General Public License
    2222 *   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
    2424 *
    2525 */
     
    8080 */
    8181
    82 #define SNDRV_MAIN_OBJECT_FILE
    8382#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>
    8489#include <sound/cs4231.h>
     90#include <sound/asoundef.h>
     91
     92MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     93MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips");
     94MODULE_LICENSE("GPL");
    8595
    8696#define chip_t cs4231_t
     
    133143#define CLOCKS 8
    134144
    135 #ifdef TARGET_OS2
    136145static 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 }
    145154};
    146155
    147156static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = {
    148         CLOCKS,
    149         clocks,
     157        .nrats = CLOCKS,
     158        .rats = clocks,
    150159};
    151 #else
    152 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 #endif
    168160
    169161static int snd_cs4236_xrate(snd_pcm_runtime_t *runtime)
     
    305297        ver1 = snd_cs4236_ctrl_in(chip, 1);
    306298        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);
    308300        if (ver1 != ver2) {
    309301                snd_printk("CS4236+ chip detected, but control port 0x%lx is not valid\n", cport);
     
    314306        snd_cs4236_ctrl_out(chip, 2, 0xff);
    315307        snd_cs4236_ctrl_out(chip, 3, 0x00);
    316         snd_cs4236_ctrl_out(chip, 4, 0x00);
    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);
    319311        snd_cs4236_ctrl_out(chip, 7, 0x00);
    320         /* 0x07 for 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 */
    321313        /* is working with this setup, other hardware should have */
    322314        /* different signal paths and this value should be selectable */
    323315        /* in the future */
    324         snd_cs4236_ctrl_out(chip, 8, 0x07);
     316        snd_cs4236_ctrl_out(chip, 8, 0x8c);
    325317        chip->rate_constraint = snd_cs4236_xrate;
    326318        chip->set_playback_format = snd_cs4236_playback_format;
     
    374366 */
    375367
    376 #ifdef TARGET_OS2
    377368#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) }
    389373
    390374static int snd_cs4236_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    439423}
    440424
    441 #ifdef TARGET_OS2
    442425#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) }
    454430
    455431static int snd_cs4236_get_singlec(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
     
    493469}
    494470
    495 #ifdef TARGET_OS2
    496471#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) }
    508476
    509477static int snd_cs4236_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    577545}
    578546
    579 #ifdef TARGET_OS2
    580547#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) }
    592552
    593553static int snd_cs4236_get_double1(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
     
    644604}
    645605
    646 #ifdef TARGET_OS2
    647606#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 }
    659611
    660612static inline int snd_cs4236_mixer_master_digital_invert_volume(int vol)
     
    694646}
    695647
    696 #ifdef TARGET_OS2
    697648#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 }
    709653
    710654static inline int snd_cs4235_mixer_output_accu_get_volume(int vol)
     
    863807};
    864808
    865 #ifdef TARGET_OS2
    866809#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
     815static 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));
    877830#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;
    886831        spin_unlock_irqrestore(&chip->reg_lock, flags);
    887832        return 0;
     
    900845        snd_cs4231_mce_up(chip);
    901846        spin_lock_irqsave(&chip->reg_lock, flags);
    902         val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x02) | (enable << 1);
     847        val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1);
    903848        change = val != chip->image[CS4231_ALT_FEATURE_1];
    904849        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;
    907854        snd_cs4236_ctrl_out(chip, 4, val);
    908855        spin_unlock_irqrestore(&chip->reg_lock, flags);
     
    925872
    926873static 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)
     874CS4236_IEC958_ENABLE("IEC958 Output Enable", 0),
     875CS4236_SINGLEC("IEC958 Output Validity", 0, 4, 4, 1, 0),
     876CS4236_SINGLEC("IEC958 Output User", 0, 4, 5, 1, 0),
     877CS4236_SINGLEC("IEC958 Output CSBR", 0, 4, 6, 1, 0),
     878CS4236_SINGLEC("IEC958 Output Channel Status Low", 0, 5, 1, 127, 0),
     879CS4236_SINGLEC("IEC958 Output Channel Status High", 0, 6, 0, 255, 0)
    934880};
    935881
     
    948894CS4236_SINGLEC("3D Control - Center", 0, 2, 0, 15, 1),
    949895CS4236_SINGLEC("3D Control - Mono", 0, 3, 6, 1, 0),
    950 CS4236_SINGLEC("3D Control - S/PDIF", 0, 3, 5, 1, 0)
     896CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0)
    951897};
    952898
     
    957903CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1),
    958904CS4236_SINGLEC("3D Control - Volume", 0, 2, 0, 15, 1),
    959 CS4236_SINGLEC("3D Control - S/PDIF", 0, 3, 5, 1, 0)
     905CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0)
    960906};
    961907
  • GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c

    r209 r210  
    11
    22/*
    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.
    58
    69    This program is free software; you can redistribute it and/or modify
     
    2326#include <linux/sched.h>
    2427#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
    2533#include <sound/core.h>
    2634#define SNDRV_GET_ID
     
    3240#define chip_t sb_t
    3341
    34 #define PFX "dt0197h: "
     42#define PFX "dt019x: "
    3543
    3644MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
    37 MODULE_DESCRIPTION("Diamond Technologies DT-0197H");
     45MODULE_DESCRIPTION("Diamond Technologies DT-019X / Avance Logic ALS-007");
    3846MODULE_LICENSE("GPL");
    3947MODULE_CLASSES("{sound}");
    40 MODULE_DEVICES("{{Diamond Technologies,DT-0197H}}");
     48MODULE_DEVICES("{{Diamond Technologies DT-019X},"
     49               "{Avance Logic ALS-007}}");
    4150
    4251static int snd_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;  /* Index 0-MAX */
     
    5160
    5261MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    53 MODULE_PARM_DESC(snd_index, "Index value for dt0197h based soundcard.");
     62MODULE_PARM_DESC(snd_index, "Index value for DT-019X based soundcard.");
    5463MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
    5564MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
    56 MODULE_PARM_DESC(snd_id, "ID string for dt0197h based soundcard.");
     65MODULE_PARM_DESC(snd_id, "ID string for DT-019X based soundcard.");
    5766MODULE_PARM_SYNTAX(snd_id, SNDRV_ID_DESC);
    5867MODULE_PARM(snd_enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    59 MODULE_PARM_DESC(snd_enable, "Enable dt0197h based soundcard.");
     68MODULE_PARM_DESC(snd_enable, "Enable DT-019X based soundcard.");
    6069MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
    6170MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
    62 MODULE_PARM_DESC(snd_port, "Port # for dt0197h driver.");
     71MODULE_PARM_DESC(snd_port, "Port # for dt019x driver.");
    6372MODULE_PARM_SYNTAX(snd_port, SNDRV_PORT12_DESC);
    6473MODULE_PARM(snd_mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
    65 MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for dt0197h driver.");
     74MODULE_PARM_DESC(snd_mpu_port, "MPU-401 port # for dt019x driver.");
    6675MODULE_PARM_SYNTAX(snd_mpu_port, SNDRV_PORT12_DESC);
    6776MODULE_PARM(snd_fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
    68 MODULE_PARM_DESC(snd_fm_port, "FM port # for dt0197h driver.");
     77MODULE_PARM_DESC(snd_fm_port, "FM port # for dt019x driver.");
    6978MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_PORT12_DESC);
    7079MODULE_PARM(snd_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    71 MODULE_PARM_DESC(snd_irq, "IRQ # for dt0197h driver.");
     80MODULE_PARM_DESC(snd_irq, "IRQ # for dt019x driver.");
    7281MODULE_PARM_SYNTAX(snd_irq, SNDRV_IRQ_DESC);
    7382MODULE_PARM(snd_mpu_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    74 MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for dt0197h driver.");
     83MODULE_PARM_DESC(snd_mpu_irq, "MPU-401 IRQ # for dt019x driver.");
    7584MODULE_PARM_SYNTAX(snd_mpu_irq, SNDRV_IRQ_DESC);
    7685MODULE_PARM(snd_dma8, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    77 MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for dt0197h driver.");
     86MODULE_PARM_DESC(snd_dma8, "8-bit DMA # for dt019x driver.");
    7887MODULE_PARM_SYNTAX(snd_dma8, SNDRV_DMA8_DESC);
    7988
    80 struct snd_card_dt0197h {
     89struct snd_card_dt019x {
    8190#ifdef __ISAPNP__
    8291        struct isapnp_dev *dev;
     
    8695};
    8796
    88 static snd_card_t *snd_dt0197h_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
    89 
    90 #ifdef __ISAPNP__
    91 static struct isapnp_card *snd_dt0197h_isapnp_cards[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;
    92 static const struct isapnp_card_id *snd_dt0197h_isapnp_id[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;
    93 
    94 static struct isapnp_card_id snd_dt0197h_pnpids[] __devinitdata = {
     97static snd_card_t *snd_dt019x_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
     98
     99#ifdef __ISAPNP__
     100static struct isapnp_card *snd_dt019x_isapnp_cards[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;
     101static const struct isapnp_card_id *snd_dt019x_isapnp_id[SNDRV_CARDS] __devinitdata = SNDRV_DEFAULT_PTR;
     102
     103static struct isapnp_card_id snd_dt019x_pnpids[] __devinitdata = {
    95104        /* DT197A30 */
    96105        {
     
    102111#else
    103112                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),
    105121                        ISAPNP_DEVICE_ID('@','X','@',0x0001),
    106122                        ISAPNP_DEVICE_ID('@','H','@',0x0001) }
     
    110126};
    111127
    112 ISAPNP_CARD_TABLE(snd_dt0197h_pnpids);
     128ISAPNP_CARD_TABLE(snd_dt019x_pnpids);
    113129
    114130#endif  /* __ISAPNP__ */
    115131
    116 #define DRIVER_NAME     "snd-card-dt0197h"
    117 
    118 
    119 #ifdef __ISAPNP__
    120 static int __init snd_card_dt0197h_isapnp(int dev, struct snd_card_dt0197h *acard)
    121 {
    122         const struct isapnp_card_id *id = snd_dt0197h_isapnp_id[dev];
    123         struct isapnp_card *card = snd_dt0197h_isapnp_cards[dev];
     132#define DRIVER_NAME     "snd-card-dt019x"
     133
     134
     135#ifdef __ISAPNP__
     136static 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];
    124140        struct isapnp_dev *pdev;
    125141
     
    141157
    142158        pdev = acard->dev;
    143         if (pdev->prepare(pdev)<0)
     159        if (!pdev || pdev->prepare(pdev)<0)
    144160                return -EAGAIN;
    145161
     
    153169
    154170        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");
    156172                return -EBUSY;
    157173        }
    158 
    159174        snd_port[dev] = pdev->resource[0].start;
    160175        snd_dma8[dev] = pdev->dma_resource[0].start;
    161176        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]);
    162179
    163180        pdev = acard->devmpu;
    164         if (pdev || pdev->prepare(pdev)<0)
     181        if (!pdev || pdev->prepare(pdev)<0)
    165182                return 0;
    166183
     
    173190
    174191        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");
    176193                snd_mpu_port[dev] = -1;
    177194                acard->devmpu = NULL;
     
    179196                snd_mpu_port[dev] = pdev->resource[0].start;
    180197                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]);
    181200        }
    182201
    183202        pdev = acard->devopl;
    184         if (pdev == NULL || pdev->prepare(pdev)<0)
     203        if (!pdev || pdev->prepare(pdev)<0)
    185204                return 0;
    186205
     
    189208
    190209        if (pdev->activate(pdev)<0) {
    191                 printk(KERN_ERR PFX "OPL isapnp configure failure\n");
     210                printk(KERN_ERR PFX "DT-019X OPL3 isapnp configure failure\n");
    192211                snd_fm_port[dev] = -1;
    193212                acard->devopl = NULL;
    194213        } else {
    195214                snd_fm_port[dev] = pdev->resource[0].start;
     215                snd_printdd("dt019x: found OPL3 synth: port=0x%lx\n",snd_fm_port[dev]);
    196216        }
    197217
     
    199219}
    200220
    201 static void snd_card_dt0197h_deactivate(struct snd_card_dt0197h *acard)
     221static void snd_card_dt019x_deactivate(struct snd_card_dt019x *acard)
    202222{
    203223        if (acard->dev) {
     
    216236#endif  /* __ISAPNP__ */
    217237
    218 static void snd_card_dt0197h_free(snd_card_t *card)
    219 {
    220         struct snd_card_dt0197h *acard = (struct snd_card_dt0197h *)card->private_data;
     238static void snd_card_dt019x_free(snd_card_t *card)
     239{
     240        struct snd_card_dt019x *acard = (struct snd_card_dt019x *)card->private_data;
    221241
    222242        if (acard != NULL) {
    223243#ifdef __ISAPNP__
    224                 snd_card_dt0197h_deactivate(acard);
     244                snd_card_dt019x_deactivate(acard);
    225245#endif  /* __ISAPNP__ */
    226246        }
    227247}
    228248
    229 static int __init snd_card_dt0197h_probe(int dev)
     249static int __init snd_card_dt019x_probe(int dev)
    230250{
    231251        int error;
    232252        sb_t *chip;
    233253        snd_card_t *card;
    234         struct snd_card_dt0197h *acard;
     254        struct snd_card_dt019x *acard;
    235255        opl3_t *opl3;
    236256
    237257        if ((card = snd_card_new(snd_index[dev], snd_id[dev], THIS_MODULE,
    238                                  sizeof(struct snd_card_dt0197h))) == NULL)
     258                                 sizeof(struct snd_card_dt019x))) == NULL)
    239259                return -ENOMEM;
    240         acard = (struct snd_card_dt0197h *)card->private_data;
    241         card->private_free = snd_card_dt0197h_free;
    242 
    243 #ifdef __ISAPNP__
    244         if ((error = snd_card_dt0197h_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))) {
    245265                snd_card_free(card);
    246266                return error;
     
    257277                                      snd_dma8[dev],
    258278                                      -1,
    259                                       SB_HW_AUTO,
     279                                      SB_HW_DT019X,
    260280                                      &chip)) < 0) {
    261281                snd_card_free(card);
     
    274294        if (snd_mpu_port[dev] > 0) {
    275295                if (snd_mpu401_uart_new(card, 0,
     296/*                                      MPU401_HW_SB,*/
    276297                                        MPU401_HW_MPU401,
    277298                                        snd_mpu_port[dev], 0,
     
    302323        }
    303324
    304         strcpy(card->driver, "DT-0197H");
    305         strcpy(card->shortname, "Diamond Tech. DT-0197H");
     325        strcpy(card->driver, "DT-019X");
     326        strcpy(card->shortname, "Diamond Tech. DT-019X");
    306327        sprintf(card->longname, "%s soundcard, %s at 0x%lx, irq %d, dma %d",
    307328                card->shortname, chip->name, chip->port,
     
    311332                return error;
    312333        }
    313         snd_dt0197h_cards[dev] = card;
     334        snd_dt019x_cards[dev] = card;
    314335        return 0;
    315336}
    316337
    317338#ifdef __ISAPNP__
    318 static int __init snd_dt0197h_isapnp_detect(struct isapnp_card *card,
     339static int __init snd_dt019x_isapnp_detect(struct isapnp_card *card,
    319340                                            const struct isapnp_card_id *id)
    320341{
     
    325346                if (!snd_enable[dev])
    326347                        continue;
    327                 snd_dt0197h_isapnp_cards[dev] = card;
    328                 snd_dt0197h_isapnp_id[dev] = id;
    329                 res = snd_card_dt0197h_probe(dev);
     348                snd_dt019x_isapnp_cards[dev] = card;
     349                snd_dt019x_isapnp_id[dev] = id;
     350                res = snd_card_dt019x_probe(dev);
    330351                if (res < 0)
    331352                        return res;
     
    337358#endif /* __ISAPNP__ */
    338359
    339 static int __init alsa_card_dt0197h_init(void)
     360static int __init alsa_card_dt019x_init(void)
    340361{
    341362        int cards = 0;
    342363
    343364#ifdef __ISAPNP__
    344         cards += isapnp_probe_cards(snd_dt0197h_pnpids, snd_dt0197h_isapnp_detect);
     365        cards += isapnp_probe_cards(snd_dt019x_pnpids, snd_dt019x_isapnp_detect);
    345366#else
    346367        printk(KERN_ERR PFX "you have to enable ISA PnP support.\n");
     
    348369#ifdef MODULE
    349370        if (!cards)
    350                 printk(KERN_ERR "no DT-0197H based soundcards found\n");
     371                printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n");
    351372#endif
    352373        return cards ? 0 : -ENODEV;
    353374}
    354375
    355 static void __exit alsa_card_dt0197h_exit(void)
     376static void __exit alsa_card_dt019x_exit(void)
    356377{
    357378        int dev;
    358379
    359380        for (dev = 0; dev < SNDRV_CARDS; dev++)
    360                 snd_card_free(snd_dt0197h_cards[dev]);
    361 }
    362 
    363 module_init(alsa_card_dt0197h_init)
    364 module_exit(alsa_card_dt0197h_exit)
     381                snd_card_free(snd_dt019x_cards[dev]);
     382}
     383
     384module_init(alsa_card_dt019x_init)
     385module_exit(alsa_card_dt019x_exit)
    365386
    366387#ifndef MODULE
    367388
    368 /* format is: snd-dt0197h=snd_enable,snd_index,snd_id,snd_isapnp,
    369                                snd_port,snd_mpu_port,snd_fm_port,
    370                                snd_irq,snd_mpu_irq,snd_dma8,snd_dma8_size */
    371 
    372 static int __init alsa_card_dt0197h_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
     393static int __init alsa_card_dt019x_setup(char *str)
    373394{
    374395        static unsigned __initdata nr_dev = 0;
     
    389410}
    390411
    391 __setup("snd-dt0197h=", alsa_card_dt0197h_setup);
     412__setup("snd-dt019x=", alsa_card_dt019x_setup);
    392413
    393414#endif /* ifndef MODULE */
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688_lib.c

    r112 r210  
    285285 */
    286286
    287 #ifdef TARGET_OS2
    288287static ratnum_t clocks[2] = {
    289288        {
    290                 795444,
    291                 1,
    292                 128,
    293                 1,
     289                .num = 795444,
     290                .den_min = 1,
     291                .den_max = 128,
     292                .den_step = 1,
    294293        },
    295294        {
    296                 397722,
    297                 1,
    298                 128,
    299                 1,
     295                .num = 397722,
     296                .den_min = 1,
     297                .den_max = 128,
     298                .den_step = 1,
    300299        }
    301300};
    302301
    303302static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks  = {
    304         2,
    305         clocks,
     303        .nrats = 2,
     304        .rats = clocks,
    306305};
    307 #else
    308 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 #endif
    328306
    329307static void snd_es1688_set_rate(es1688_t *chip, snd_pcm_substream_t *substream)
     
    541519 */
    542520
    543 #ifdef TARGET_OS2
    544521static snd_pcm_hardware_t snd_es1688_playback =
    545522{
    546 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     523        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    547524                                 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,
    560537};
    561538
    562539static snd_pcm_hardware_t snd_es1688_capture =
    563540{
    564 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     541        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    565542                                 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,
    578555};
    579 #else
    580 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 #endif
    616556
    617557/*
     
    702642                      es1688_t **rchip)
    703643{
    704 #ifdef TARGET_OS2
    705644        static snd_device_ops_t ops = {
    706                 snd_es1688_dev_free,0,0
     645                .dev_free =     snd_es1688_dev_free,
    707646        };
    708 #else
    709         static snd_device_ops_t ops = {
    710                 dev_free:       snd_es1688_dev_free,
    711         };
    712 #endif                               
     647                               
    713648        es1688_t *chip;
    714649        int err;
     
    766701}
    767702
    768 #ifdef TARGET_OS2
    769703static 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,0
     704        .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,
    778712};
    779713
    780714static 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,
    789723};
    790 #else
    791 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 #endif
    813724
    814725static void snd_es1688_pcm_free(snd_pcm_t *pcm)
     
    889800}
    890801
    891 #ifdef TARGET_OS2
    892802#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) }
    904807
    905808static int snd_es1688_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    956859}
    957860
    958 #ifdef TARGET_OS2
    959861#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) }
    971866
    972867static int snd_es1688_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    1092987ES1688_SINGLE("Capture Switch", 0, ES1688_REC_DEV, 4, 1, 1),
    1093988{
    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,
    1107994},
    1108995};
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c

    r207 r210  
    7979#include <sound/control.h>
    8080#include <sound/pcm.h>
     81#include <sound/pcm_params.h>
    8182#include <sound/mpu401.h>
    8283#include <sound/opl3.h>
     
    404405static ratnum_t new_clocks[2] = {
    405406        {
    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,
    410411        },
    411412        {
    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,
    416417        }
    417418};
    418419
    419420static snd_pcm_hw_constraint_ratnums_t new_hw_constraints_clocks = {
    420         nrats: 2,
    421         rats: new_clocks,
     421        .nrats = 2,
     422        .rats = new_clocks,
    422423};
    423424
    424425static ratnum_t old_clocks[2] = {
    425426        {
    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,
    430431        },
    431432        {
    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,
    436437        }
    437438};
    438439
    439440static snd_pcm_hw_constraint_ratnums_t old_hw_constraints_clocks  = {
    440         nrats: 2,
    441         rats: old_clocks,
     441        .nrats = 2,
     442        .rats = old_clocks,
    442443};
    443444#endif
     
    906907static snd_pcm_hardware_t snd_es18xx_playback =
    907908{
    908         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     909        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    909910                                 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 |
    911912                                 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,
    923924};
    924925
    925926static snd_pcm_hardware_t snd_es18xx_capture =
    926927{
    927         info:                   (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     928        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    928929                                 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 |
    930931                                 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,
    942943};
    943944#endif
     
    11551156#else
    11561157#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) }
    11611162#endif
    11621163
     
    12131214#else
    12141215#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) }
    12191220#endif
    12201221
     
    13121313        snd_es18xx_put_mux, 0
    13131314#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,
    13191320#endif
    13201321}
     
    13541355        snd_es18xx_put_spatializer_enable,
    13551356#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,
    13611362#endif
    13621363}
     
    13871388#else
    13881389{
    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,
    13941395},
    13951396{
    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,
    14011402},
    14021403#endif
     
    17051706#else
    17061707static 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,
    17141715};
    17151716
    17161717static 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,
    17241725};
    17251726#endif
     
    18951896#else
    18961897        static snd_device_ops_t ops = {
    1897                 dev_free:       snd_es18xx_dev_free,
     1898                .dev_free =     snd_es18xx_dev_free,
    18981899        };
    18991900#endif
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_dma.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <asm/dma.h>
     24#include <linux/slab.h>
     25#include <sound/core.h>
    2326#include <sound/gus.h>
    2427
     
    3538void snd_gf1_dma_program(snd_gus_card_t * gus,
    3639                         unsigned int addr,
    37                          const void *buf,
     40                         unsigned long buf_addr,
    3841                         unsigned int count,
    3942                         unsigned int cmd)
     
    7477        }
    7578        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);
    7780#if 0
    7881        snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd);
     
    138141        block = snd_gf1_dma_next_block(gus);
    139142        spin_unlock(&gus->dma_lock);
    140         snd_gf1_dma_program(gus, block->addr, block->buffer, block->count, (unsigned short) block->cmd);
     143        snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
    141144        kfree(block);
    142145#if 0
     
    233236                if (block == NULL)
    234237                        return 0;
    235                 snd_gf1_dma_program(gus, block->addr, block->buffer, block->count, (unsigned short) block->cmd);
     238                snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
    236239                kfree(block);
    237240                return 0;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_dram.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/time.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426#include <sound/info.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_instr.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/time.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_io.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/delay.h>
     24#include <linux/time.h>
     25#include <sound/core.h>
    2326#include <sound/gus.h>
    2427
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_irq.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <sound/core.h>
    2324#include <sound/info.h>
    2425#include <sound/gus.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_lfo.c

    r32 r210  
    1717 *   You should have received a copy of the GNU General Public License
    1818 *   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
    2020 *
    2121 */
    2222
    2323#include <sound/driver.h>
     24#include <sound/core.h>
    2425#include <sound/gus.h>
    2526
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_main.c

    r112 r210  
    9393}
    9494
    95 #ifdef TARGET_OS2
    9695static 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,0
     96        .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
    102101};
    103 #else
    104 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_put
    110 };
    111 #endif
    112102
    113103static void snd_gus_init_control(snd_gus_card_t *gus)
     
    173163        snd_gus_card_t *gus;
    174164        int err;
    175 #ifdef TARGET_OS2
    176165        static snd_device_ops_t ops = {
    177                 snd_gus_dev_free,0,0
     166                .dev_free =     snd_gus_dev_free,
    178167        };
    179 #else
    180         static snd_device_ops_t ops = {
    181                 dev_free:       snd_gus_dev_free,
    182         };
    183 #endif
    184168
    185169        *rgus = NULL;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mem.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/slab.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426#include <sound/info.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mem_proc.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/slab.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426#include <sound/info.h>
     
    7476                file->f_pos += offset;
    7577                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;
    7880                break;
    7981        default:
     
    9193}
    9294
    93 #ifdef TARGET_OS2
    9495static 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,
    9898};
    99 #else
    100 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 #endif
    10599
    106100int snd_gf1_mem_proc_init(snd_gus_card_t * gus)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_mixer.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/time.h>
     24#include <linux/wait.h>
     25#include <sound/core.h>
    2326#include <sound/control.h>
    2427#include <sound/gus.h>
     
    3033 */
    3134
    32 #ifdef TARGET_OS2
    3335#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) }
    4540
    4641static int snd_gf1_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    8883}
    8984
    90 #ifdef TARGET_OS2
    9185#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 }
    10390
    10491static 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  
    2626 */
    2727
    28 #define __NO_VERSION__
    2928#include <sound/driver.h>
    3029#include <asm/dma.h>
     
    3332#include <sound/control.h>
    3433#include <sound/gus.h>
     34#include <sound/pcm_params.h>
    3535#include "gus_tables.h"
    3636
     
    530530}
    531531
    532 #ifdef TARGET_OS2
    533532static 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,
    538537};
    539538
    540539static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks  = {
    541         1,
    542         &clock,
     540        .nrats = 1,
     541        .rats = &clock,
    543542};
    544 #else
    545 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 #endif
    557543
    558544static int snd_gf1_pcm_capture_hw_params(snd_pcm_substream_t * substream,
     
    632618}
    633619
    634 #ifdef TARGET_OS2
    635620static snd_pcm_hardware_t snd_gf1_pcm_playback =
    636621{
    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 |
    639624                                 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,
    651636};
    652637
    653638static snd_pcm_hardware_t snd_gf1_pcm_capture =
    654639{
    655 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     640        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    656641                                 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,
    669654};
    670 #else
    671 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 #endif
    707655
    708656static void snd_gf1_pcm_playback_free(snd_pcm_runtime_t *runtime)
     
    856804}
    857805
    858 #ifdef TARGET_OS2
    859806static snd_kcontrol_new_t snd_gf1_pcm_volume_control =
    860807{
    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,0
     808        .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
    866813};
    867814
    868815static 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_silence
     816        .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,
    879826};
    880827
    881828static 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,0
     829        .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,
    890837};
    891 #else
    892 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_put
    899 };
    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 #endif
    925838
    926839int 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  
    1515 *   You should have received a copy of the GNU General Public License
    1616 *   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
    1818 *
    1919 */
    2020
    2121#include <sound/driver.h>
     22#include <linux/delay.h>
     23#include <linux/interrupt.h>
     24#include <linux/time.h>
     25#include <sound/core.h>
    2226#include <sound/gus.h>
    2327
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_sample.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/time.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_simple.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/time.h>
     24#include <sound/core.h>
    2325#include <sound/gus.h>
    2426#include "gus_tables.h"
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_timer.c

    r32 r210  
    1818 *   You should have received a copy of the GNU General Public License
    1919 *   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
    2121 *
    2222 */
    2323
    2424#include <sound/driver.h>
     25#include <linux/time.h>
     26#include <sound/core.h>
    2527#include <sound/gus.h>
    2628
     
    125127 */
    126128
    127 #ifdef TARGET_OS2
    128129static struct _snd_timer_hardware snd_gf1_timer1 =
    129130{
    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,
    136136};
    137137
    138138static struct _snd_timer_hardware snd_gf1_timer2 =
    139139{
    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,
    146145};
    147 #else
    148 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 #endif
    166146
    167147static void snd_gf1_timer1_free(snd_timer_t *timer)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_uart.c

    r32 r210  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   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
    1919 *
    2020 */
    2121
    2222#include <sound/driver.h>
     23#include <linux/delay.h>
     24#include <linux/interrupt.h>
     25#include <linux/time.h>
     26#include <sound/core.h>
    2327#include <sound/gus.h>
    2428
     
    221225}
    222226
    223 #ifdef TARGET_OS2
    224227static snd_rawmidi_ops_t snd_gf1_uart_output =
    225228{
    226         snd_gf1_uart_output_open,
    227         snd_gf1_uart_output_close,
    228         snd_gf1_uart_output_trigger,0
     229        .open =         snd_gf1_uart_output_open,
     230        .close =        snd_gf1_uart_output_close,
     231        .trigger =      snd_gf1_uart_output_trigger,
    229232};
    230233
    231234static snd_rawmidi_ops_t snd_gf1_uart_input =
    232235{
    233         snd_gf1_uart_input_open,
    234         snd_gf1_uart_input_close,
    235         snd_gf1_uart_input_trigger,0
     236        .open =         snd_gf1_uart_input_open,
     237        .close =        snd_gf1_uart_input_close,
     238        .trigger =      snd_gf1_uart_input_trigger,
    236239};
    237 #else
    238 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 #endif
    252240
    253241int 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  
    1515 *   You should have received a copy of the GNU General Public License
    1616 *   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
    1818 *
    1919 */
    2020
    2121#include <sound/driver.h>
     22#include <linux/time.h>
     23#include <sound/core.h>
    2224#include <sound/gus.h>
    2325#define __GUS_TABLES_ALLOC__
    2426#include "gus_tables.h"
     27
     28EXPORT_SYMBOL(snd_gf1_atten_table); /* for snd-gus-synth module */
    2529
    2630unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/makefile.os2

    r32 r210  
    3333#===================================================================
    3434FILE1    = opl3sa2.obj
    35 #als100.obj azt2320.obj cmi8330.obj dt0197h.obj es18xx.obj
     35#als100.obj azt2320.obj cmi8330.obj dt019x.obj es18xx.obj
    3636FILE2    =
    3737# sgalaxy.obj
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c

    r207 r210  
    8080MODULE_PARM_DESC(snd_enable, "Enable OPL3-SA soundcard.");
    8181MODULE_PARM_SYNTAX(snd_enable, SNDRV_ENABLE_DESC);
     82#ifdef __ISAPNP__
    8283MODULE_PARM(snd_isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    8384MODULE_PARM_DESC(snd_isapnp, "ISA PnP detection for specified soundcard.");
    8485MODULE_PARM_SYNTAX(snd_isapnp, SNDRV_ISAPNP_DESC);
     86#endif
    8587MODULE_PARM(snd_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
    8688MODULE_PARM_DESC(snd_port, "Port # for OPL3-SA driver.");
     
    364366#else
    365367#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) }
    370372#endif
    371373
     
    432434#else
    433435#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) }
    438440#endif
    439441
     
    714716        opl3_t *opl3;
    715717        static snd_device_ops_t ops = {
    716                 /* dev_free: */ snd_opl3sa2_dev_free,
     718                .dev_free =     snd_opl3sa2_dev_free,
    717719        };
    718720        int err;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c

    r207 r210  
    287287#ifdef __ISAPNP__
    288288
    289 #ifdef TARGET_OS2
    290 #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 #else
    297289#define ISAPNP_OPTI9XX(_va, _vb, _vc, _device, _fa, _fb, _fc, _audio, _mpu401) \
    298290        { \
    299291                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), \
    301293                        ISAPNP_DEVICE_ID(_fa, _fb, _fc, _mpu401), } \
    302294        }
    303 #endif
    304295
    305296static struct isapnp_card_id snd_card_opti9xx_pnpids[] = {
     
    336327static int __init snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware)
    337328{
     329        static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
     330
    338331        chip->hardware = hardware;
    339332        strcpy(chip->name, snd_opti9xx_names[hardware]);
     333
     334        chip->mc_base_size = opti9xx_mc_size[hardware]; 
    340335
    341336        spin_lock_init(&chip->lock);
     
    610605
    611606        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));
    613608        spin_unlock_irqrestore(&chip->lock, flags);
    614609
     
    826821#define RATES sizeof(rates) / sizeof(rates[0])
    827822
    828 #ifdef TARGET_OS2
    829823static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    830         RATES,
    831         rates,
    832         0,
     824        .count = RATES,
     825        .list = rates,
     826        .mask = 0,
    833827};
    834 #else
    835 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    836         count: RATES,
    837         list: rates,
    838         mask: 0,
    839 };
    840 #endif
    841828
    842829unsigned char bits[] = {  0x01,  0x0f,  0x00,  0x0e,  0x03,  0x02,  0x05,
     
    990977                } while (s != substream);
    991978                spin_lock(&chip->lock);
    992                 if (SNDRV_PCM_TRIGGER_START)
     979                if (cmd == SNDRV_PCM_TRIGGER_START)
    993980                        snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, what);
    994981                else
     
    11481135
    11491136
    1150 #ifdef TARGET_OS2
    11511137static 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 |
    11531139                                 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 |
    11551141                                 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,
    11671153};
    11681154
    11691155static 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 |
    11711157                                 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 |
    11731159                                 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,
    11851171};
    1186 #else
    1187 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 #endif
    12231172
    12241173static int snd_opti93x_playback_open(snd_pcm_substream_t *substream)
     
    12341183        runtime->hw = snd_opti93x_playback;
    12351184        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);
    12371185        snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
    12381186        return error;
     
    12501198        snd_pcm_set_sync(substream);
    12511199        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);
    12531200        snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
    12541201        return error;
     
    13141261                disable_dma(chip->dma2);
    13151262                free_dma(chip->dma2);
     1263        }
     1264        if (chip->irq >= 0) {
     1265          free_irq(chip->irq, chip);
    13161266        }
    13171267        snd_magic_kfree(chip);
     
    13391289                       opti93x_t **rcodec)
    13401290{
    1341 #ifdef TARGET_OS2
    13421291        static snd_device_ops_t ops = {
    1343                 snd_opti93x_dev_free,0, 0
     1292                .dev_free =     snd_opti93x_dev_free,
    13441293        };
    1345 #else
    1346         static snd_device_ops_t ops = {
    1347                 dev_free:       snd_opti93x_dev_free,
    1348         };
    1349 #endif
    13501294        int error;
    13511295        opti93x_t *codec;
     
    13741318        codec->dma2 = chip->dma2;
    13751319
     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
    13761325        codec->card = card;
    13771326        codec->port = chip->wss_base + 4;
     
    13901339
    13911340        /* Register device */
    1392         if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
     1341        if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, codec, &ops)) < 0) {
    13931342                snd_opti93x_free(codec);
    13941343                return error;
     
    13991348}
    14001349
    1401 #ifdef TARGET_OS2
    14021350static 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,
    14121359};
    14131360
    14141361static 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,
    14351370};
    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 #endif
    14481371
    14491372static void snd_opti93x_pcm_free(snd_pcm_t *pcm)
     
    15271450        change = left != chip->image[OPTi93X_MIXOUT_LEFT] ||
    15281451                 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);
    15311454        spin_unlock_irqrestore(&chip->lock, flags);
    15321455        return change;
     
    15351458#if 0
    15361459
    1537 #ifdef TARGET_OS2
    15381460#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) }
    15501465
    15511466static int snd_opti93x_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    16021517#endif /* single */
    16031518
    1604 #ifdef TARGET_OS2
    16051519#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) }
    16171524
    16181525#define OPTi93X_DOUBLE_INVERT_INVERT(xctl) \
     
    16241531static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
    16251532{
    1626         int mask = (kcontrol->private_value >> 16) & 0xff;
     1533        int mask = (kcontrol->private_value >> 24) & 0xff;
    16271534
    16281535        uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
     
    16801587        val2 = (chip->image[right_reg] & ~(mask << shift_right)) | val2;
    16811588        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);
    16841591        spin_unlock_irqrestore(&chip->lock, flags);
    16851592        return change;
     
    16901597static snd_kcontrol_new_t snd_opti93x_controls[] = {
    16911598OPTi93X_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),
     1599OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1),
    16931600OPTi93X_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),
     1601OPTi93X_DOUBLE("PCM Playback Volume", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 0, 0, 31, 1),
    16951602OPTi93X_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),
     1603OPTi93X_DOUBLE("FM Playback Volume", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 1, 1, 15, 1),
    16971604OPTi93X_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),
     1605OPTi93X_DOUBLE("Line Playback Volume", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 1, 1, 15, 1),
    16991606OPTi93X_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),
     1607OPTi93X_DOUBLE("Mic Playback Volume", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1),
    17011608OPTi93X_DOUBLE("Mic Boost", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 5, 5, 1, 1),
    17021609OPTi93X_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),
     1610OPTi93X_DOUBLE("CD Playback Volume", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 1, 1, 15, 1),
    17041611OPTi93X_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),
     1612OPTi93X_DOUBLE("Aux Playback Volume", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1),
    17061613OPTi93X_DOUBLE("Capture Volume", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 0, 0, 15, 0),
    17071614{
    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,
    17211620}
    17221621};
     
    17591658{
    17601659        int i, err;
    1761         static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
    17621660
    17631661#ifndef OPTi93X
     
    17671665                if ((err = snd_opti9xx_init(chip, i)) < 0)
    17681666                        return err;
    1769                 chip->mc_base_size = opti9xx_mc_size[i];
     1667
    17701668                if (check_region(chip->mc_base, chip->mc_base_size))
    17711669                        continue;
     
    17831681                if ((err = snd_opti9xx_init(chip, i)) < 0)
    17841682                        return err;
    1785                 chip->mc_base_size = opti9xx_mc_size[i];
     1683
    17861684                if (check_region(chip->mc_base, chip->mc_base_size))
    17871685                        continue;
     
    20151913{
    20161914        static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
    2017         static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x310, -1};
     1915        static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1};
    20181916#ifdef OPTi93X
    20191917        static int possible_irqs[] = {5, 9, 10, 11, 7, -1};
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c

    r207 r210  
    2121 */
    2222
    23 #define __NO_VERSION__
    2423#include <sound/driver.h>
    2524#include <linux/wait.h>
     
    866865}
    867866
    868 #ifdef TARGET_OS2
    869867static snd_kcontrol_new_t mixer_bass_control =
    870868{
    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,
    877875};
    878876
    879877static snd_kcontrol_new_t mixer_treble_control =
    880878{
    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};
    909886
    910887/*
     
    955932}
    956933
    957 #ifdef TARGET_OS2
    958934static snd_kcontrol_new_t mixer_chorus_mode_control =
    959935{
    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,
    966942};
    967943
    968944static snd_kcontrol_new_t mixer_reverb_mode_control =
    969945{
    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};
    998953
    999954/*
     
    1039994}
    1040995
    1041 #ifdef TARGET_OS2
    1042996static snd_kcontrol_new_t mixer_fm_chorus_depth_control =
    1043997{
    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,
    10501004};
    10511005
    10521006static snd_kcontrol_new_t mixer_fm_reverb_depth_control =
    10531007{
    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
    10821016
    10831017static snd_kcontrol_new_t *mixer_defs[EMU8000_NUM_CONTROLS] = {
     
    11561090        emu8000_t *hw;
    11571091        int err;
    1158 #ifdef TARGET_OS2
    11591092        static snd_device_ops_t ops = {
    1160                 snd_emu8000_dev_free,0,0
     1093                .dev_free = snd_emu8000_dev_free,
    11611094        };
    1162 #else
    1163         static snd_device_ops_t ops = {
    1164                 dev_free: snd_emu8000_dev_free,
    1165         };
    1166 #endif
    11671095
    11681096        if (awe_ret)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_callback.c

    r207 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include "emu8000_local.h"
    2423#include <sound/asoundef.h>
     
    6059 * set up operators
    6160 */
    62 #ifdef TARGET_OS2
    6361static 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,
    8077#endif
    8178};
    82 #else
    83 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_OSS
    98         oss_ioctl:      oss_ioctl,
    99 #endif
    100 };
    101 #endif
    10279
    10380void
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_patch.c

    r32 r210  
    1717 *   You should have received a copy of the GNU General Public License
    1818 *   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
    2020 */
    2121
    2222#include "emu8000_local.h"
     23#include <asm/uaccess.h>
    2324
    2425MODULE_PARM(emu8000_reset_addr, "i");
     
    230231                write_word(emu, &dram_offset, s);
    231232
     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
    232242                if (i == sp->v.loopend &&
    233243                    (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  
    8282static struct isapnp_card_id snd_es968_pnpids[] __devinitdata = {
    8383    {
    84 #ifdef TARGET_OS2
    85         0, ISAPNP_CARD_ID('E','S','S',0x0968),
    86         { ISAPNP_DEVICE_ID('E','S','S',0x0968), }
    87 #else
    8884        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), }
    9186    },
    9287    { ISAPNP_CARD_END, }
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c

    r207 r210  
    252252    /* Note: This card has also a CTL0051:StereoEnhance device!!! */
    253253    ISAPNP_SBAWE('C','T','L',0x0045,0x0031,0x0021),
     254        /* Sound Blaster AWE 32 PnP */
     255        ISAPNP_SBAWE('C','T','L',0x0046,0x0031,0x0021),
    254256    /* Sound Blaster AWE 32 PnP */
    255257    ISAPNP_SBAWE('C','T','L',0x0047,0x0031,0x0021),
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_csp.c

    r92 r210  
    10111011#ifdef TARGET_OS2
    10121012static snd_kcontrol_new_t snd_sb_qsound_switch = {
    1013     SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    1014     "3D Control - Switch",0,0, 0,
    1015     snd_sb_qsound_switch_info,
    1016     snd_sb_qsound_switch_get,
    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
    10181018};
    10191019
    10201020static snd_kcontrol_new_t snd_sb_qsound_space = {
    1021     SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    1022     "3D Control - Space",0,0, 0,
    1023     snd_sb_qsound_space_info,
    1024     snd_sb_qsound_space_get,
    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
    10261026};
    1027 #else
    1028 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_put
    1034 };
    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_put
    1042 };
    1043 #endif
    10441027
    10451028static int snd_sb_qsound_build(snd_sb_csp_t * p)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_main.c

    r112 r210  
    468468static snd_pcm_hardware_t snd_sb16_playback =
    469469{
    470     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     470        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    471471                                 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,
    484484};
    485485
    486486static snd_pcm_hardware_t snd_sb16_capture =
    487487{
    488     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     488        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    489489                                 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,
    502502};
    503 #else
    504 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 #endif
    540503
    541504/*
     
    763726
    764727snd_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
    778733};
    779734
     
    871826}
    872827
    873 #ifdef TARGET_OS2
    874828static snd_pcm_ops_t snd_sb16_playback_ops = {
    875     snd_sb16_playback_open,
    876     snd_sb16_playback_close,
    877     snd_pcm_lib_ioctl,
    878     snd_sb16_hw_params,
    879     snd_sb16_hw_free,
    880     snd_sb16_playback_prepare,
    881     snd_sb16_playback_trigger,
    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,
    883837};
    884838
    885839static snd_pcm_ops_t snd_sb16_capture_ops = {
    886     snd_sb16_capture_open,
    887     snd_sb16_capture_close,
    888     snd_pcm_lib_ioctl,
    889     snd_sb16_hw_params,
    890     snd_sb16_hw_free,
    891     snd_sb16_capture_prepare,
    892     snd_sb16_capture_trigger,
    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,
    894848};
    895 #else
    896 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 #endif
    918849
    919850static void snd_sb16dsp_pcm_free(snd_pcm_t *pcm)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8_main.c

    r92 r210  
    4949#define SB8_RATE(v)     (SB8_CLOCK / SB8_DEN(v))
    5050
    51 #ifdef TARGET_OS2
    5251static ratnum_t clock = {
    53     SB8_CLOCK,
    54     1,
    55     256,
    56     1,
     52        .num = SB8_CLOCK,
     53        .den_min = 1,
     54        .den_max = 256,
     55        .den_step = 1,
    5756};
    5857
    5958static snd_pcm_hw_constraint_ratnums_t hw_constraints_clock = {
    60     1,
    61     &clock,
     59        .nrats = 1,
     60        .rats = &clock,
    6261};
    6362
    6463static ratnum_t stereo_clocks[] = {
    6564    {
    66         SB8_CLOCK,
    67         SB8_DEN(22050),
    68         SB8_DEN(22050),
    69         1,
     65                .num = SB8_CLOCK,
     66                .den_min = SB8_DEN(22050),
     67                .den_max = SB8_DEN(22050),
     68                .den_step = 1,
    7069    },
    7170    {
    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};
    10677
    10778static int snd_sb8_hw_constraint_rate_channels(snd_pcm_hw_params_t *params,
     
    418389*/
    419390
    420 #ifdef TARGET_OS2
    421391static snd_pcm_hardware_t snd_sb8_playback =
    422392{
    423     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     393        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    424394                                 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 |
    427397                                                                 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,
    438408};
    439409
    440410static snd_pcm_hardware_t snd_sb8_capture =
    441411{
    442     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     412        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    443413                                 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 |
    446416                                                                 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};
    497428
    498429/*
     
    563494 */
    564495
    565 #ifdef TARGET_OS2
    566496static snd_pcm_ops_t snd_sb8_playback_ops = {
    567     snd_sb8_open,
    568     snd_sb8_close,
    569     snd_pcm_lib_ioctl,
    570     snd_sb8_hw_params,
    571     snd_sb8_hw_free,
    572     snd_sb8_playback_prepare,
    573     snd_sb8_playback_trigger,
    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,
    575505};
    576506
    577507static 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};
    610517
    611518static void snd_sb8dsp_pcm_free(snd_pcm_t *pcm)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8_midi.c

    r32 r210  
    1515 *   You should have received a copy of the GNU General Public License
    1616 *   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
    1818 *
    1919 * --
     
    2525
    2626#include <sound/driver.h>
     27#include <asm/io.h>
     28#include <linux/time.h>
     29#include <sound/core.h>
    2730#include <sound/sb.h>
    2831
     
    224227*/
    225228
    226 #ifdef TARGET_OS2
    227229static snd_rawmidi_ops_t snd_sb8dsp_midi_output =
    228230{
    229     snd_sb8dsp_midi_output_open,
    230     snd_sb8dsp_midi_output_close,
    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,
    232234};
    233235
    234236static snd_rawmidi_ops_t snd_sb8dsp_midi_input =
    235237{
    236     snd_sb8dsp_midi_input_open,
    237     snd_sb8dsp_midi_input_close,
    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,
    239241};
    240 #else
    241 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 #endif
    255242
    256243int 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  
    165165        str = "16 (ALS-4000)";
    166166        break;
     167        case SB_HW_DT019X:
     168                str = "(DT019X/ALS007)";
     169                break;
    167170    default:
    168171        return -ENODEV;
     
    210213    struct snd_sb *chip;
    211214    int err;
    212 #ifdef TARGET_OS2
    213215    static snd_device_ops_t ops = {
    214         snd_sbdsp_dev_free,0,0
     216                .dev_free =     snd_sbdsp_dev_free,
    215217    };
    216 #else
    217     static snd_device_ops_t ops = {
    218     dev_free:       snd_sbdsp_dev_free,
    219     };
    220 #endif
    221218
    222219    snd_assert(r_chip != NULL, return -EINVAL);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c

    r207 r210  
    7272#endif
    7373MODULE_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_port, SNDRV_PORT12_DESC);
     74MODULE_PARM_DESC(snd_cs4232_pcm_port, "Port # for CS4232 PCM interface.");
     75MODULE_PARM_SYNTAX(snd_cs4232_pcm_port, SNDRV_PORT12_DESC);
    7676MODULE_PARM(snd_cs4232_pcm_irq, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    7777MODULE_PARM_DESC(snd_cs4232_pcm_irq, "IRQ # for CS4232 PCM interface.");
     
    112112        {
    113113                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 */
    115115                        ISAPNP_DEVICE_ID('C','S','C',0x0010),   /* CTRL */
    116116                        ISAPNP_DEVICE_ID('P','n','P',0xb006),   /* MPU */
     
    119119        {
    120120                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 */
    122122                        ISAPNP_DEVICE_ID('C','S','C',0x0010),   /* CTRL */
    123123                        ISAPNP_DEVICE_ID('P','n','P',0xb006),   /* MPU */
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_fx.c

    r112 r210  
    1717 */
    1818
    19 #define __NO_VERSION__
    2019#include <sound/driver.h>
    2120#include <asm/io.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_midi.c

    r112 r210  
    4949
    5050#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>
    5156#include <sound/snd_wavefront.h>
    5257
     
    555560snd_rawmidi_ops_t snd_wavefront_midi_output =
    556561{
    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,
    560565};
    561566
    562567snd_rawmidi_ops_t snd_wavefront_midi_input =
    563568{
    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,
    567572};
    568573
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_synth.c

    r112 r210  
    2121 */
    2222
    23 #define __NO_VERSION__
    2423#include <sound/driver.h>
    2524#include <asm/io.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ali5451/ali5451.c

    r207 r210  
    15921592static snd_pcm_hardware_t snd_ali_playback =
    15931593{
    1594     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1594        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15951595                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    15961596                                 SNDRV_PCM_INFO_MMAP_VALID |
    15971597                                 SNDRV_PCM_INFO_RESUME |
    15981598                                 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 |
    16001600                                                                 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,
    16121612};
    16131613
     
    16181618static snd_pcm_hardware_t snd_ali_capture =
    16191619{
    1620     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1620        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    16211621                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    16221622                                 SNDRV_PCM_INFO_MMAP_VALID |
    16231623                                 SNDRV_PCM_INFO_RESUME |
    16241624                                 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 |
    16261626                                                                 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,
    16381638};
    16391639
     
    17211721}
    17221722
    1723 #ifdef TARGET_OS2
    17241723static snd_pcm_ops_t snd_ali_playback_ops = {
    1725     snd_ali_playback_open,
    1726     snd_ali_playback_close,
    1727     snd_ali_ioctl,
    1728     snd_ali_playback_hw_params,
    1729     snd_ali_playback_hw_free,
    1730     snd_ali_playback_prepare,
    1731     snd_ali_trigger,
    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,
    17331732};
    17341733
    17351734static snd_pcm_ops_t snd_ali_capture_ops = {
    1736     snd_ali_capture_open,
    1737     snd_ali_capture_close,
    1738     snd_ali_ioctl,
    1739     snd_ali_capture_hw_params,
    1740     snd_ali_capture_hw_free,
    1741     snd_ali_capture_prepare,
    1742     snd_ali_trigger,
    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,
    17441743};
    1745 #else
    1746 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 #endif
    17681744
    17691745static void snd_ali_pcm_free(snd_pcm_t *pcm)
     
    18011777}
    18021778
    1803 
    1804 #ifdef TARGET_OS2
    18051779#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}
    18151783
    18161784static int snd_ali5451_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
     
    23172285
    23182286static struct pci_driver driver = {
    2319     0,0,0,"ALI 5451",
    2320     snd_ali_ids,
    2321     snd_ali_probe,
    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),
    23232291    SND_PCI_PM_CALLBACKS
    23242292};
  • GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c

    r207 r210  
    404404/*****************************************************************/
    405405
    406 #ifdef TARGET_OS2
    407406static snd_pcm_hardware_t snd_als4000_playback =
    408407{
    409     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    410                                 SNDRV_PCM_INFO_MMAP_VALID),
    411                                  /*     formats:          */    SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
    412                                  SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE,     /* formats */
    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:        */    0
     408        .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
    424423};
    425424
    426425static snd_pcm_hardware_t snd_als4000_capture =
    427426{
    428     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    429                                 SNDRV_PCM_INFO_MMAP_VALID),
    430                                  /*     formats:          */    SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
    431                                  SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE,     /* formats */
    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:        */    0
     427        .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
    443442};
    444 #else
    445 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:          0
    462 };
    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:          0
    481 };
    482 #endif
    483443
    484444/*****************************************************************/
     
    524484/******************************************************************/
    525485
    526 #ifdef TARGET_OS2
    527486static snd_pcm_ops_t snd_als4000_playback_ops = {
    528     snd_als4000_playback_open,
    529     snd_als4000_playback_close,
    530     snd_pcm_lib_ioctl,
    531     snd_als4000_hw_params,
    532     snd_als4000_hw_free,
    533     snd_als4000_playback_prepare,
    534     snd_als4000_playback_trigger,
    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
    536495};
    537496
    538497static snd_pcm_ops_t snd_als4000_capture_ops = {
    539     snd_als4000_capture_open,
    540     snd_als4000_capture_close,
    541     snd_pcm_lib_ioctl,
    542     snd_als4000_hw_params,
    543     snd_als4000_hw_free,
    544     snd_als4000_capture_prepare,
    545     snd_als4000_capture_trigger,
    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
    547506};
    548 #else
    549 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_pointer
    558 };
    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_pointer
    569 };
    570 #endif
    571507
    572508static void snd_als4000_pcm_free(snd_pcm_t *pcm)
     
    781717}
    782718
    783 #ifdef TARGET_OS2
    784719static struct pci_driver driver = {
    785     0,0,0,"ALS4000",
    786     snd_als4000_ids,
    787     snd_card_als4000_probe,
    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),
    789724};
    790 #else
    791 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 #endif
    798725
    799726static int __init alsa_card_als4000_init(void)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c

    r206 r210  
    10021002static struct snd_kcontrol_new snd_cmipci_spdif_default __devinitdata =
    10031003{
    1004     SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    1005     SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,
    1006     snd_cmipci_spdif_default_info,
    1007     snd_cmipci_spdif_default_get,
    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
    10091009};
    10101010
     
    10291029static struct snd_kcontrol_new snd_cmipci_spdif_mask __devinitdata =
    10301030{
    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     snd_cmipci_spdif_mask_info,
    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,
    10361036};
    10371037
     
    10761076static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata =
    10771077{
    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     snd_cmipci_spdif_stream_info,
    1082     snd_cmipci_spdif_stream_get,
    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
    10841084};
    10851085
     
    18391839
    18401840#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), \
    18461845    }
    18471846
     
    19411940 */
    19421941#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), \
    19481946    }
    19491947static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol,
     
    20062004
    20072005#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), \
    20132010    }
    20142011
    20152012#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), \
    20212017    }
    20222018
    20232019#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), \
    20292024    }
    20302025
    20312026#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), \
    20372031    }
    20382032
     
    21292123    //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1),
    21302124    { /* 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),
    21382131    },
    21392132    CMIPCI_MIXER_SW_STEREO("PCM Capture Switch", CM_REG_MIXER1, CM_WAVEINL_SHIFT, CM_WAVEINR_SHIFT, 0),
     
    22602253}
    22612254
     2255#ifdef TARGET_OS2
    22622256#define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \
    22632257    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
    22702274
    22712275#define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \
     
    23052309// safe to do so in this case)
    23062310#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,\
    23142317    }
    23152318
     
    24732476#endif
    24742477    // 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,
    24812483    },
    24822484    DEFINE_MIXER_SWITCH("IEC958 In Valid", spdi_valid),
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cs4281.c

    r206 r210  
    882882static snd_pcm_hardware_t snd_cs4281_playback =
    883883{
    884     /*  info:                   */      (SNDRV_PCM_INFO_MMAP |
     884        .info =                 (SNDRV_PCM_INFO_MMAP |
    885885                                         SNDRV_PCM_INFO_INTERLEAVED |
    886886                                         SNDRV_PCM_INFO_MMAP_VALID |
     
    888888                                         SNDRV_PCM_INFO_RESUME |
    889889                                         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 |
    891891                                         SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
    892892                                         SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE |
    893893                                         SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE |
    894894                                         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,
    906906};
    907907
    908908static snd_pcm_hardware_t snd_cs4281_capture =
    909909{
    910     /*  info:                   */      (SNDRV_PCM_INFO_MMAP |
     910        .info =                 (SNDRV_PCM_INFO_MMAP |
    911911                                         SNDRV_PCM_INFO_INTERLEAVED |
    912912                                         SNDRV_PCM_INFO_MMAP_VALID |
     
    914914                                         SNDRV_PCM_INFO_RESUME |
    915915                                         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 |
    917917                                         SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE |
    918918                                         SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE |
    919919                                         SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_S32_LE |
    920920                                         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,
    932932};
    933933
     
    989989
    990990static 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,
    1000999};
    10011000
    10021001static 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,
    10121010};
    10131011
     
    13931391    unsigned int tmp;
    13941392    int err;
    1395 #ifdef TARGET_OS2
    13961393    static snd_device_ops_t ops = {
    1397         snd_cs4281_dev_free,0,0,0
     1394                .dev_free =     snd_cs4281_dev_free,
    13981395    };
    1399 #else
    1400     static snd_device_ops_t ops = {
    1401     dev_free:   snd_cs4281_dev_free,
    1402     };
    1403 #endif
    14041396
    14051397    *rchip = NULL;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emumixer.c

    r207 r210  
    3131 */
    3232
    33 #define __NO_VERSION__
    3433#include <sound/driver.h>
    3534#include <linux/time.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emumpu401.c

    r207 r210  
    2020 */
    2121
    22 #define __NO_VERSION__
    2322#include <sound/driver.h>
    2423#include <linux/time.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emuproc.c

    r207 r210  
    2626 */
    2727
    28 #define __NO_VERSION__
    2928#include <sound/driver.h>
    3029#include <linux/slab.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/irq.c

    r206 r210  
    2626 */
    2727
    28 #define __NO_VERSION__
    2928#include <sound/driver.h>
    3029#include <linux/time.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/voice.c

    r84 r210  
    2929 */
    3030
    31 #define __NO_VERSION__
    3231#include <sound/driver.h>
    3332#include <linux/time.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/es1968.c

    r207 r210  
    17271727
    17281728static 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,
    17381737};
    17391738
    17401739static 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,
    17511748};
    17521749
     
    25482545#ifdef TARGET_OS2
    25492546    static snd_device_ops_t ops = {
    2550         snd_es1968_dev_free,0,0,0
     2547                .dev_free =     snd_es1968_dev_free,
    25512548    };
    25522549#else
     
    26922689static snd_kcontrol_new_t snd_es1968_control_switches[] __devinitdata = {
    26932690    {
    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,
    26992696    }
    27002697};
     
    28392836
    28402837static 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
    28472843};
    28482844
  • GPL/branches/alsa-resync1/alsa-kernel/pci/fm801.c

    r206 r210  
    302302
    303303static 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,
    307307};
    308308
     
    314314
    315315static 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,
    319319};
    320320
     
    561561static snd_pcm_hardware_t snd_fm801_playback =
    562562{
    563         /*.info =             */        (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     563        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    564564                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    565565                                 SNDRV_PCM_INFO_PAUSE |
     
    581581static snd_pcm_hardware_t snd_fm801_capture =
    582582{
    583         /*.info =              */       (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     583        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    584584                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    585585                                 SNDRV_PCM_INFO_PAUSE |
     
    648648
    649649static 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,
    659658};
    660659
    661660static 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,
    671669};
    672670
     
    1000998
    1001999#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) }
    10051003
    10061004static int snd_fm801_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    10451043
    10461044#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) }
    10501048
    10511049static int snd_fm801_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    11481146FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1),
    11491147{
    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,0
     1148        .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,
    11551153}
    11561154};
     
    12631261        int err;
    12641262        static snd_device_ops_t ops = {
    1265                 snd_fm801_dev_free, 0,0,0
     1263                .dev_free =     snd_fm801_dev_free,
    12661264        };
    12671265
     
    14681466
    14691467static 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),
    14761472};
    14771473
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712.c

    r207 r210  
    700700
    701701static 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,
    715707};
    716708
     
    873865}
    874866
    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,
     867static snd_i2c_ops_t ap_cs8427_i2c_ops = {
     868        .sendbytes = ap_cs8427_sendbytes,
     869        .readbytes = ap_cs8427_readbytes,
     870        .probeaddr = ap_cs8427_probeaddr,
    880871};
    881 #else
    882 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 #endif
    888872
    889873/*
     
    967951}
    968952
    969 #ifdef TARGET_OS2
    970953static 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,
    977960};
    978 #else
    979 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 #endif
    988961
    989962/* AK4524 chip select; address 0x48 bit 0-3 */
    990 static void snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
     963static int snd_ice1712_ews88mt_chip_select(ice1712_t *ice, int chip_mask)
    991964{
    992965        unsigned char data, ndata;
    993966
    994         snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return);
     967        snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL);
    995968        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;
    997971        ndata = (data & 0xf0) | chip_mask;
    998972        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;
    1000975        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;
    1001982}
    1002983
     
    1016997        if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_EWS88MT) {
    1017998                /* 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;
    10191001                //snd_ice1712_ews88mt_chip_select(ice, 0x0f);
    10201002        }
     
    11701152        unsigned char reg[2] = { 0x80 | 4, 0 };   /* CS8427 auto increment | register number 4 + data */
    11711153        unsigned char val, nval;
     1154        int res = 0;
     1155       
    11721156        snd_i2c_lock(ice->i2c);
    11731157        if (snd_i2c_sendbytes(ice->cs8427, reg, 1) != 1) {
    11741158                snd_i2c_unlock(ice->i2c);
    1175                 return -EREMOTE;
     1159                return -EIO;
    11761160        }
    11771161        if (snd_i2c_readbytes(ice->cs8427, &val, 1) != 1) {
    11781162                snd_i2c_unlock(ice->i2c);
    1179                 return -EREMOTE;
     1163                return -EIO;
    11801164        }
    11811165        nval = val & 0xf0;
     
    11871171                reg[1] = nval;
    11881172                if (snd_i2c_sendbytes(ice->cs8427, reg, 2) != 2) {
     1173                        res = -EIO;
     1174                } else {
     1175                        res++;
     1176                }
     1177        }
    11891178                        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;
    11961180}
    11971181
     
    15531537}
    15541538
    1555 #ifdef TARGET_OS2
    15561539static snd_pcm_hardware_t snd_ice1712_playback =
    15571540{
    1558 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1541        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15591542                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    15601543                                 SNDRV_PCM_INFO_MMAP_VALID |
    15611544                                 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,
    15741557};
    15751558
    15761559static snd_pcm_hardware_t snd_ice1712_playback_ds =
    15771560{
    1578 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1561        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15791562                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    15801563                                 SNDRV_PCM_INFO_MMAP_VALID |
    15811564                                 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,
    15941577};
    15951578
    15961579static snd_pcm_hardware_t snd_ice1712_capture =
    15971580{
    1598 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1581        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    15991582                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    16001583                                 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,
    16131596};
    1614 #else
    1615 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 #endif
    16741597
    16751598static int snd_ice1712_playback_open(snd_pcm_substream_t * substream)
     
    17441667}
    17451668
    1746 #ifdef TARGET_OS2
    17471669static 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,0
     1670        .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,
    17561678};
    17571679
    17581680static 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,0
     1681        .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,
    17671689};
    17681690
    17691691static 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,0
     1692        .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,
    17781700};
    1779 #else
    1780 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 #endif
    18131701
    18141702static void snd_ice1712_pcm_free(snd_pcm_t *pcm)
     
    18921780#define RATES sizeof(rates) / sizeof(rates[0])
    18931781
    1894 #ifdef TARGET_OS2
    18951782static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    1896         RATES,
    1897         rates,
    1898         0,
     1783        .count = RATES,
     1784        .list = rates,
     1785        .mask = 0,
    18991786};
    1900 #else
    1901 static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
    1902         count: RATES,
    1903         list: rates,
    1904         mask: 0,
    1905 };
    1906 #endif
    19071787
    19081788#if 0
     
    20991979}
    21001980
    2101 #ifdef TARGET_OS2
    21021981static snd_pcm_hardware_t snd_ice1712_playback_pro =
    21031982{
    2104 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1983        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    21051984                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    21061985                                 SNDRV_PCM_INFO_MMAP_VALID |
    21071986                                 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,
    21201999};
    21212000
    21222001static snd_pcm_hardware_t snd_ice1712_capture_pro =
    21232002{
    2124 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     2003        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    21252004                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    21262005                                 SNDRV_PCM_INFO_MMAP_VALID |
    21272006                                 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,
    21402019};
    2141 #else
    2142 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 #endif
    21822020
    21832021static int snd_ice1712_playback_pro_open(snd_pcm_substream_t * substream)
     
    22382076}
    22392077
    2240 #ifdef TARGET_OS2
    22412078static 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,0
     2079        .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,
    22502087};
    22512088
    22522089static 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,0
     2090        .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,
    22612098};
    2262 #else
    2263 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 #endif
    22852099
    22862100static int __devinit snd_ice1712_pcm_profi(ice1712_t * ice, int device, snd_pcm_t ** rpcm)
     
    27162530
    27172531static 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
    27312537};
    27322538
     
    28032609static snd_kcontrol_new_t snd_ice1712_spdif_default __devinitdata =
    28042610{
    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
    28182616};
    28192617
     
    28872685static snd_kcontrol_new_t snd_ice1712_spdif_maskc __devinitdata =
    28882686{
    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,
    29022692};
    29032693
    29042694static snd_kcontrol_new_t snd_ice1712_spdif_maskp __devinitdata =
    29052695{
    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,
    29192701};
    29202702
     
    29892771static snd_kcontrol_new_t snd_ice1712_spdif_stream __devinitdata =
    29902772{
    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
    30062779};
    30072780
    3008 #ifdef TARGET_OS2
    30092781#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) }
    30192785
    30202786static int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    31102876
    31112877static 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
    31252883};
    31262884
     
    32693027
    32703028static 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,
    32843034};
    32853035
    32863036static 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,
    33003042};
    33013043
     
    33353077
    33363078static 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
    33503084};
    33513085
     
    33753109
    33763110static 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
    33903116};
    33913117
     
    34393165
    34403166static 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,
    34563173};
    34573174
    34583175static 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,
    34743182};
    34753183
     
    34873195        if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) {
    34883196                snd_i2c_unlock(ice->i2c);
    3489                 return -EREMOTE;
     3197                return -EIO;
    34903198        }
    34913199        snd_i2c_unlock(ice->i2c);
     
    35033211        if (snd_i2c_readbytes(ice->pcf8574[1], &data, 1) != 1) {
    35043212                snd_i2c_unlock(ice->i2c);
    3505                 return -EREMOTE;
     3213                return -EIO;
    35063214        }
    35073215        ndata = (data & ~ICE1712_EWS88MT_OUTPUT_SENSE) | (ucontrol->value.enumerated.item[0] ? ICE1712_EWS88MT_OUTPUT_SENSE : 0);
    35083216        if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[1], &ndata, 1) != 1) {
    35093217                snd_i2c_unlock(ice->i2c);
    3510                 return -EREMOTE;
     3218                return -EIO;
    35113219        }
    35123220        snd_i2c_unlock(ice->i2c);
     
    35253233        if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) {
    35263234                snd_i2c_unlock(ice->i2c);
    3527                 return -EREMOTE;
     3235                return -EIO;
    35283236        }
    35293237        /* reversed; high = +4dBu, low = -10dBV */
     
    35433251        if (snd_i2c_readbytes(ice->pcf8574[0], &data, 1) != 1) {
    35443252                snd_i2c_unlock(ice->i2c);
    3545                 return -EREMOTE;
     3253                return -EIO;
    35463254        }
    35473255        ndata = (data & ~(1 << channel)) | (ucontrol->value.enumerated.item[0] ? 0 : (1 << channel));
    35483256        if (ndata != data && snd_i2c_sendbytes(ice->pcf8574[0], &ndata, 1) != 1) {
    35493257                snd_i2c_unlock(ice->i2c);
    3550                 return -EREMOTE;
     3258                return -EIO;
    35513259        }
    35523260        snd_i2c_unlock(ice->i2c);
     
    35553263
    35563264static 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,
    35703270};
    35713271
    35723272static 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,
    35863278};
    35873279
     
    36103302        if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) {
    36113303                snd_i2c_unlock(ice->i2c);
    3612                 return -EREMOTE;
     3304                return -EIO;
    36133305        }
    36143306        snd_i2c_unlock(ice->i2c);
     
    36313323        if (snd_i2c_readbytes(ice->pcf8575, data, 2) != 2) {
    36323324                snd_i2c_unlock(ice->i2c);
    3633                 return -EREMOTE;
     3325                return -EIO;
    36343326        }
    36353327        ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7));
     
    36443336        if (change && snd_i2c_sendbytes(ice->pcf8575, data, 2) != 2) {
    36453337                snd_i2c_unlock(ice->i2c);
    3646                 return -EREMOTE;
     3338                return -EIO;
    36473339        }
    36483340        snd_i2c_unlock(ice->i2c);
     
    36503342}
    36513343
    3652 #ifdef TARGET_OS2
    36533344#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}
    36733353
    36743354static snd_kcontrol_new_t snd_ice1712_ews88d_controls[] __devinitdata = {
     
    36943374        if (snd_i2c_readbytes(ice->pcf8575, &byte, 1) != 1) {
    36953375                snd_i2c_unlock(ice->i2c);
    3696                 return -EREMOTE;
     3376                return -EIO;
    36973377        }
    36983378        snd_i2c_unlock(ice->i2c);
     
    37083388        if (snd_i2c_sendbytes(ice->pcf8575, bytes, 2) != 2) {
    37093389                snd_i2c_unlock(ice->i2c);
    3710                 return -EREMOTE;
     3390                return -EIO;
    37113391        }
    37123392        snd_i2c_unlock(ice->i2c);
     
    37613441
    37623442#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),\
    37703450}
    37713451
     
    41643844        /* second stage of initialization, analog parts and others */
    41653845        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 */
    41663851        case ICE1712_SUBDEVICE_DELTA66:
    41673852        case ICE1712_SUBDEVICE_DELTA44:
    41683853        case ICE1712_SUBDEVICE_AUDIOPHILE:
    41693854        case ICE1712_SUBDEVICE_EWX2496:
    4170         case ICE1712_SUBDEVICE_EWS88MT:
    41713855        case ICE1712_SUBDEVICE_DMX6FIRE:
    41723856                snd_ice1712_ak4524_init(ice);
     
    44084092      __hw_end:
    44094093        snd_ice1712_proc_done(ice);
    4410         synchronize_irq();
    4411         if (ice->irq)
     4094        if (ice->irq >= 0) {
     4095                synchronize_irq(ice->irq);
    44124096                free_irq(ice->irq, (void *) ice);
     4097        }
    44134098        if (ice->res_port) {
    44144099                release_resource(ice->res_port);
     
    44444129        ice1712_t *ice;
    44454130        int err;
    4446 #ifdef TARGET_OS2
    44474131        static snd_device_ops_t ops = {
    4448                 snd_ice1712_dev_free,0,0,0
     4132                .dev_free =     snd_ice1712_dev_free,
    44494133        };
    4450 #else
    4451         static snd_device_ops_t ops = {
    4452                 dev_free:       snd_ice1712_dev_free,
    4453         };
    4454 #endif
    44554134
    44564135        *r_ice1712 = NULL;
     
    44874166        pci_write_config_word(ice->pci, 0x42, 0x0006);
    44884167        snd_ice1712_proc_init(ice);
    4489         synchronize_irq();
     4168        synchronize_irq(pci->irq);
    44904169
    44914170        if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
     
    46664345}
    46674346
    4668 #ifdef TARGET_OS2
    46694347static struct pci_driver driver = {
    4670         0,0,"ICE1712",
    4671         snd_ice1712_ids,
    4672         snd_ice1712_probe,
    4673         snd_ice1712_remove,0,0
     4348        .name = "ICE1712",
     4349        .id_table = snd_ice1712_ids,
     4350        .probe = snd_ice1712_probe,
     4351        .remove = __devexit_p(snd_ice1712_remove),
    46744352};
    4675 #else
    4676 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 #endif
    46834353
    46844354static int __init alsa_card_ice1712_init(void)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c

    r206 r210  
    32723272
    32733273static 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,
    32793277};
    32803278static int have_joystick;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/korg1212/korg1212.c

    r207 r210  
    3030#include <sound/control.h>
    3131#include <sound/pcm.h>
     32#include <sound/pcm_params.h>
    3233#define SNDRV_GET_ID
    3334#include <sound/initval.h>
     
    11621163static snd_pcm_hardware_t snd_korg1212_playback_info =
    11631164{
    1164         info:                (SNDRV_PCM_INFO_MMAP |
     1165        .info =               (SNDRV_PCM_INFO_MMAP |
    11651166                              SNDRV_PCM_INFO_MMAP_VALID |
    11661167                              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 |
    11691170                              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,
    11801181};
    11811182
    11821183static snd_pcm_hardware_t snd_korg1212_capture_info =
    11831184{
    1184         info:                (SNDRV_PCM_INFO_MMAP |
     1185        .info =               (SNDRV_PCM_INFO_MMAP |
    11851186                              SNDRV_PCM_INFO_MMAP_VALID |
    11861187                              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 |
    11891190                              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,
    12001201};
    12011202
     
    12161217
    12171218static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = {
    1218         count: PERIOD_BYTES,
    1219         list: period_bytes,
    1220         mask: 0
     1219        .count = PERIOD_BYTES,
     1220        .list = period_bytes,
     1221        .mask = 0
    12211222};
    12221223
     
    15041505
    15051506static 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,
    15151516};
    15161517
    15171518static 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,
    15261527};
    15271528
     
    18031804#define MON_MIXER(ord,c_name)                                                                   \
    18041805        {                                                                                       \
    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,                                                           \
    18121813        },                                                                                      \
    18131814        {                                                                                       \
    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,                                                           \
    18211822        },                                                                                      \
    18221823        {                                                                                       \
    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,                                                           \
    18301831        }
    18311832
     
    18361837        MON_MIXER(4, "ADAT-5"), MON_MIXER(5, "ADAT-6"), MON_MIXER(6, "ADAT-7"), MON_MIXER(7, "ADAT-8"),
    18371838        {
    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,
    18441845        },
    18451846        {
    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,
    18521853        }
    18531854};
     
    23052306
    23062307static 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),
    23112312};
    23122313
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c

    r207 r210  
    3434#include <sound/control.h>
    3535#include <sound/pcm.h>
     36#include <sound/pcm_params.h>
    3637#include <sound/asoundef.h>
    3738#define SNDRV_GET_ID
     
    374375 * Digital output capabilites (S/PDIF)
    375376 */
    376 #ifdef TARGET_OS2
    377377static snd_pcm_hardware_t snd_rme96_playback_spdif_info =
    378378{
    379 /*      info:             */   (SNDRV_PCM_INFO_MMAP |
     379        .info =              (SNDRV_PCM_INFO_MMAP |
    380380                              SNDRV_PCM_INFO_MMAP_VALID |
    381381                              SNDRV_PCM_INFO_INTERLEAVED |
    382382                              SNDRV_PCM_INFO_PAUSE),
    383 /*      formats:          */   (SNDRV_PCM_FMTBIT_S16_LE |
     383        .formats =           (SNDRV_PCM_FMTBIT_S16_LE |
    384384                              SNDRV_PCM_FMTBIT_S32_LE),
    385 /*      rates:            */   (SNDRV_PCM_RATE_32000 |
     385        .rates =             (SNDRV_PCM_RATE_32000 |
    386386                              SNDRV_PCM_RATE_44100 |
    387387                              SNDRV_PCM_RATE_48000 |
     
    389389                              SNDRV_PCM_RATE_88200 |
    390390                              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,
    401401};
    402402
     
    406406static snd_pcm_hardware_t snd_rme96_capture_spdif_info =
    407407{
    408 /*      info:             */   (SNDRV_PCM_INFO_MMAP |
     408        .info =              (SNDRV_PCM_INFO_MMAP |
    409409                              SNDRV_PCM_INFO_MMAP_VALID |
    410410                              SNDRV_PCM_INFO_INTERLEAVED |
    411411                              SNDRV_PCM_INFO_PAUSE),
    412 /*      formats:          */   (SNDRV_PCM_FMTBIT_S16_LE |
     412        .formats =           (SNDRV_PCM_FMTBIT_S16_LE |
    413413                              SNDRV_PCM_FMTBIT_S32_LE),
    414 /*      rates:            */   (SNDRV_PCM_RATE_32000 |
     414        .rates =             (SNDRV_PCM_RATE_32000 |
    415415                              SNDRV_PCM_RATE_44100 |
    416416                              SNDRV_PCM_RATE_48000 |
     
    418418                              SNDRV_PCM_RATE_88200 |
    419419                              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,
    430430};
    431431
     
    435435static snd_pcm_hardware_t snd_rme96_playback_adat_info =
    436436{
    437 /*      info:             */   (SNDRV_PCM_INFO_MMAP |
     437        .info =              (SNDRV_PCM_INFO_MMAP |
    438438                              SNDRV_PCM_INFO_MMAP_VALID |
    439439                              SNDRV_PCM_INFO_INTERLEAVED |
    440440                              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 |
    443444                              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,
    454455};
    455456
     
    459460static snd_pcm_hardware_t snd_rme96_capture_adat_info =
    460461{
    461 /*      info:             */   (SNDRV_PCM_INFO_MMAP |
     462        .info =              (SNDRV_PCM_INFO_MMAP |
    462463                              SNDRV_PCM_INFO_MMAP_VALID |
    463464                              SNDRV_PCM_INFO_INTERLEAVED |
    464465                              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 |
    467469                              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,
    478480};
    479 #else
    480 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 #endif
    583481
    584482/*
     
    12531151#define PERIOD_BYTES sizeof(period_bytes) / sizeof(period_bytes[0])
    12541152
    1255 #ifdef TARGET_OS2
    12561153static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = {
    1257         PERIOD_BYTES,
    1258         period_bytes,
    1259         0
     1154        .count = PERIOD_BYTES,
     1155        .list = period_bytes,
     1156        .mask = 0
    12601157};
    1261 #else
    1262 static snd_pcm_hw_constraint_list_t hw_constraints_period_bytes = {
    1263         count: PERIOD_BYTES,
    1264         list: period_bytes,
    1265         mask: 0
    1266 };
    1267 #endif
    12681158
    12691159static int
     
    16041494}
    16051495
    1606 #ifdef TARGET_OS2
    16071496static 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,
    16181507};
    16191508
    16201509static 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,
    16311519};
    16321520
    16331521static 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,
    16441532};
    16451533
    16461534static 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,
    16561544};
    1657 #else
    1658 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 #endif
    17081545
    17091546static void
     
    24682305}
    24692306
    2470 #ifdef TARGET_OS2
    24712307static snd_kcontrol_new_t snd_rme96_controls[] = {
    24722308{
    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,0
     2309        .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
    24782314},
    24792315{
    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,0
     2316        .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
    24862322},
    24872323{
    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                         IEC958_AES0_NONAUDIO |
     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 |
    24942330                        IEC958_AES0_PROFESSIONAL |
    24952331                        IEC958_AES0_CON_EMPHASIS
    24962332},
    24972333{
    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                         IEC958_AES0_NONAUDIO |
     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 |
    25042340                        IEC958_AES0_PROFESSIONAL |
    25052341                        IEC958_AES0_PRO_EMPHASIS
    25062342},
    25072343{
    2508                   SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2509                   "Input Connector",0,0,0,
    2510                   snd_rme96_info_inputtype_control,
    2511                   snd_rme96_get_inputtype_control,
    2512                   snd_rme96_put_inputtype_control, 0
     2344        .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
    25132349},
    25142350{
    2515                   SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2516                    "Loopback Input",0,0,0,
    2517                    snd_rme96_info_loopback_control,
    2518                     snd_rme96_get_loopback_control,
    2519                     snd_rme96_put_loopback_control,0
     2351        .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
    25202356},
    25212357{
    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
    25342363},
    25352364{
    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,0
     2365        .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
    25412370},
    25422371{
    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
    25482384}
    25492385};
    2550 #else
    2551 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_put
    2558 },
    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_put
    2566 },
    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_EMPHASIS
    2576 },
    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_EMPHASIS
    2586 },
    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_control
    2593 },
    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_control
    2600 },
    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_control
    2607 },
    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_control
    2614 },
    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_control
    2621 },
    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_put
    2628 }
    2629 };
    2630 #endif
    26312386
    26322387static int
     
    27292484}
    27302485
    2731 #ifdef TARGET_OS2
    27322486static struct pci_driver driver = {
    2733         0,0,0, "RME Digi96",
    2734         snd_rme96_ids,
    2735         snd_rme96_probe,
    2736         snd_rme96_remove,0,0
     2487        .name = "RME Digi96",
     2488        .id_table = snd_rme96_ids,
     2489        .probe = snd_rme96_probe,
     2490        .remove = __devexit_p(snd_rme96_remove),
    27372491};
    2738 #else
    2739 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 #endif
    27462492
    27472493static int __init alsa_card_rme96_init(void)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c

    r207 r210  
    2626#include <linux/init.h>
    2727#include <linux/slab.h>
     28#include <linux/pci.h>
    2829#include <sound/core.h>
    2930#include <sound/control.h>
     
    4243static int snd_enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;  /* Enable this card */
    4344static int snd_precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */
     45static int snd_line_outs_monitor[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0}; /* Send all inputs/playback to line outs */
     46static int snd_force_firmware[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0}; /* Force firmware reload */
    4447
    4548MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     
    5558MODULE_PARM_DESC(snd_precise_ptr, "Enable precise pointer (doesn't work reliably).");
    5659MODULE_PARM_SYNTAX(snd_precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
     60MODULE_PARM(snd_line_outs_monitor,"1-" __MODULE_STRING(SNDRV_CARDS) "i");
     61MODULE_PARM_DESC(snd_line_outs_monitor, "Send all input and playback streams to line outs by default.");
     62MODULE_PARM_SYNTAX(snd_line_outs_monitor, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
     63MODULE_PARM(snd_force_firmware,"1-" __MODULE_STRING(SNDRV_CARDS) "i");
     64MODULE_PARM_DESC(snd_force_firmware, "Force a reload of the I/O box firmware");
     65MODULE_PARM_SYNTAX(snd_force_firmware, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    5766MODULE_AUTHOR("Paul Davis <pbd@op.net>");
    58 MODULE_DESCRIPTION("RME Hammerfall DDSP");
     67MODULE_DESCRIPTION("RME Hammerfall DSP");
    5968MODULE_LICENSE("GPL");
    6069MODULE_CLASSES("{sound}");
     
    474483                return -1;
    475484        }
    476        
    477485        hdsp_write (hdsp, HDSP_fifoData, ad);
    478486        hdsp->mixer_matrix[addr] = data;
     
    846854
    847855                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);
    852857                }
    853858        }
     
    948953                        hmidi->timer.data = (unsigned long) hmidi;
    949954                        hmidi->timer.expires = 1 + jiffies;
    950                         printk ("add timer from output trigger\n");
    951955                        add_timer(&hmidi->timer);
    952956                        hmidi->istimer++;
     
    954958        } else {
    955959                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);
    960961                }
    961962        }
     
    10221023snd_rawmidi_ops_t snd_hdsp_midi_output =
    10231024{
    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,
    10271028};
    10281029
    10291030snd_rawmidi_ops_t snd_hdsp_midi_input =
    10301031{
    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,
    10341035};
    10351036
     
    11661167
    11671168#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 }
    11711172
    11721173static unsigned int hdsp_spdif_in(hdsp_t *hdsp)
     
    12261227
    12271228#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 }
    12311232
    12321233static int hdsp_spdif_out(hdsp_t *hdsp)
     
    12841285
    12851286#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 }
    12891290
    12901291static int hdsp_sync_pref(hdsp_t *hdsp)
     
    13991400
    14001401#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 }
    14051406
    14061407static int snd_hdsp_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
     
    14451446
    14461447#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 }
    14501451
    14511452static int hdsp_line_out(hdsp_t *hdsp)
     
    15031504
    15041505#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 }
    15081509
    15091510static int snd_hdsp_info_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    15771578
    15781579#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 | \
    15811582                 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 }
    15841585
    15851586static int snd_hdsp_info_playback_mixer(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    16341635
    16351636#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 \
    16401641}
    16411642
     
    16571658
    16581659#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 \
    16631664}
    16641665
     
    16801681
    16811682#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 \
    16861687}
    16871688
     
    17031704
    17041705#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 \
    17091710}
    17101711
     
    17241725
    17251726#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 \
    17301731}
    17311732
     
    17461747static snd_kcontrol_new_t snd_hdsp_controls[] = {
    17471748{
    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,
    17531754},
    17541755{
    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,
    17611762},
    17621763{
    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 |
    17691770                        IEC958_AES0_PROFESSIONAL |
    17701771                        IEC958_AES0_CON_EMPHASIS,                                                                                             
    17711772},
    17721773{
    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 |
    17791780                        IEC958_AES0_PROFESSIONAL |
    17801781                        IEC958_AES0_PRO_EMPHASIS,
     
    21902191                hdsp_write_gain (hdsp, i, MINUS_INFINITY_GAIN);
    21912192
     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
    21922212        hdsp->passthru = 0;
    21932213
     
    25272547static snd_pcm_hardware_t snd_hdsp_playback_subinfo =
    25282548{
    2529         info:                   (SNDRV_PCM_INFO_MMAP |
     2549        .info =                 (SNDRV_PCM_INFO_MMAP |
    25302550                                 SNDRV_PCM_INFO_MMAP_VALID |
    25312551                                 SNDRV_PCM_INFO_NONINTERLEAVED |
    25322552                                 SNDRV_PCM_INFO_SYNC_START |
    25332553                                 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 |
    25362556                                 SNDRV_PCM_RATE_44100 |
    25372557                                 SNDRV_PCM_RATE_48000 |
     
    25392559                                 SNDRV_PCM_RATE_88200 |
    25402560                                 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,
    25512571};
    25522572
    25532573static snd_pcm_hardware_t snd_hdsp_capture_subinfo =
    25542574{
    2555         info:                   (SNDRV_PCM_INFO_MMAP |
     2575        .info =                 (SNDRV_PCM_INFO_MMAP |
    25562576                                 SNDRV_PCM_INFO_MMAP_VALID |
    25572577                                 SNDRV_PCM_INFO_NONINTERLEAVED |
    25582578                                 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 |
    25612581                                 SNDRV_PCM_RATE_44100 |
    25622582                                 SNDRV_PCM_RATE_48000 |
     
    25642584                                 SNDRV_PCM_RATE_88200 |
    25652585                                 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,
    25762596};
    25772597
     
    25812601
    25822602static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
    2583         count: PERIOD_SIZES,
    2584         list: period_sizes,
    2585         mask: 0
     2603        .count = PERIOD_SIZES,
     2604        .list = period_sizes,
     2605        .mask = 0
    25862606};
    25872607
     
    26082628                };
    26092629                return snd_interval_refine(c, &t);
    2610         } else if (r->max < 88200) {
     2630        } else if (r->max < 64000) {
    26112631                snd_interval_t t = {
    26122632                        min: hdsp->ss_channels,
     
    26272647        if (c->min >= hdsp->ss_channels) {
    26282648                snd_interval_t t = {
    2629                         min: 44100,
     2649                        min: 32000,
    26302650                        max: 48000,
    26312651                        integer: 1,
     
    26342654        } else if (c->max <= hdsp->ds_channels) {
    26352655                snd_interval_t t = {
    2636                         min: 88200,
     2656                        min: 64000,
    26372657                        max: 96000,
    26382658                        integer: 1,
     
    27662786
    27672787static 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,
    27772797};
    27782798
    27792799static 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,
    27882808};
    27892809
     
    28122832{
    28132833        int i;
    2814         int status_reg;
    28152834        u32 *firmware_ptr;
    28162835
     
    28302849        }
    28312850
    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
    28542855                hdsp_write (hdsp, HDSP_jtagReg, HDSP_PROGRAM);
    28552856                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                }
    28572861
    28582862                hdsp_write (hdsp, HDSP_jtagReg, HDSP_S_LOAD);
    28592863                hdsp_write (hdsp, HDSP_fifoData, 0);
    28602864
    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)) {
    28632866                        hdsp->type = Multiface;
    2864                         hdsp->card_name = "RME Hammerfall DSP (Multiface)";
    28652867                        hdsp_write (hdsp, HDSP_jtagReg, HDSP_VERSION_BIT);
    28662868                        hdsp_write (hdsp, HDSP_jtagReg, HDSP_S_LOAD);
    28672869                        hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT);
    28682870                } else {
    2869                         printk ("looks like a digiface\n");
    28702871                        hdsp->type = Digiface;
    2871                         hdsp->card_name = "RME Hammerfall DSP (Digiface)";
    28722872                }
    28732873
     
    28752875                hdsp_write (hdsp, HDSP_fifoData, 0);
    28762876               
    2877                 if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT) < 0) {
     2877                if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
    28782878                        snd_printk ("timeout waiting for download preparation\n");
    28792879                        return -EIO;
     
    28832883               
    28842884                if (hdsp->type == Digiface) {
    2885                         firmware_ptr = digiface_firmware;
     2885                        firmware_ptr = (u32 *) digiface_firmware;
    28862886                } else {
    2887                         firmware_ptr = multiface_firmware;
     2887                        firmware_ptr = (u32 *) multiface_firmware;
    28882888                }
    28892889               
     
    29012901                }
    29022902
    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        }
    29052927       
    29062928        snd_hdsp_flush_midi_input (hdsp, 0);
     
    30943116
    30953117static 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),
    31003122};
    31013123
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/rme9652.c

    r207 r210  
    524524                break;
    525525        default:
     526                spin_unlock_irq(&rme9652->lock);
    526527                return -EINVAL;
    527528        }
     
    876877}
    877878
    878 #ifdef TARGET_OS2
    879879#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 }
    891884
    892885static unsigned int rme9652_adat1_in(rme9652_t *rme9652)
     
    964957}
    965958
    966 #ifdef TARGET_OS2
    967959#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 }
    977963
    978964static unsigned int rme9652_spdif_in(rme9652_t *rme9652)
     
    10441030}
    10451031
    1046 #ifdef TARGET_OS2
    10471032#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 }
    10571036
    10581037static int rme9652_spdif_out(rme9652_t *rme9652)
     
    11211100}
    11221101
    1123 #ifdef TARGET_OS2
    11241102#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 }
    11341106
    11351107static int rme9652_sync_mode(rme9652_t *rme9652)
     
    12151187}
    12161188
    1217 #ifdef TARGET_OS2
    12181189#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 }
    12281193
    12291194static int rme9652_sync_pref(rme9652_t *rme9652)
     
    13701335}
    13711336
    1372 #ifdef TARGET_OS2
    13731337#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 }
    13851342
    13861343static int snd_rme9652_info_passthru(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
     
    14261383/* Read-only switches */
    14271384
    1428 #ifdef TARGET_OS2
    14291385#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 }
    14411390
    14421391static int snd_rme9652_info_spdif_rate(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    14601409}
    14611410
    1462 #ifdef TARGET_OS2
    14631411#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 }
    14751416
    14761417static int snd_rme9652_info_adat_sync(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    15041445}
    15051446
    1506 #ifdef TARGET_OS2
    15071447#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 }
    15191452
    15201453static int snd_rme9652_info_tc_valid(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    15961529
    15971530static 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,
    16051537},
    16061538{
    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,0
     1539        .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,
    16131545},
    16141546{
    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 |
    16571553                        IEC958_AES0_PROFESSIONAL |
    16581554                        IEC958_AES0_CON_EMPHASIS,                                                                                             
    16591555},
    16601556{
    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                         IEC958_AES0_PROFESSIONAL |
    1668                         IEC958_AES0_PRO_EMPHASIS,
     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,
    16691565},
    1670 #endif
    16711566RME9652_SPDIF_IN("IEC958 Input Connector", 0),
    16721567RME9652_SPDIF_OUT("IEC958 Output also on ADAT1", 0),
     
    16741569RME9652_SYNC_PREF("Preferred Sync Source", 0),
    16751570{
    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,
    16911577},
    16921578RME9652_SPDIF_RATE("IEC958 Sample Rate", 0),
     
    23742260}
    23752261
    2376 #ifdef TARGET_OS2
    23772262static snd_pcm_hardware_t snd_rme9652_playback_subinfo =
    23782263{
    2379 /*      info:             */    (SNDRV_PCM_INFO_MMAP |
     2264        .info =                 (SNDRV_PCM_INFO_MMAP |
    23802265                                 SNDRV_PCM_INFO_MMAP_VALID |
    23812266                                 SNDRV_PCM_INFO_NONINTERLEAVED |
    23822267                                 SNDRV_PCM_INFO_SYNC_START |
    23832268                                 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 |
    23862271                                 SNDRV_PCM_RATE_48000 |
    23872272                                 SNDRV_PCM_RATE_88200 |
    23882273                                 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,
    23992284};
    24002285
    24012286static snd_pcm_hardware_t snd_rme9652_capture_subinfo =
    24022287{
    2403 /*      info:             */    (SNDRV_PCM_INFO_MMAP |                           SNDRV_PCM_INFO_MMAP_VALID |
     2288        .info =                 (SNDRV_PCM_INFO_MMAP |
     2289                                 SNDRV_PCM_INFO_MMAP_VALID |
    24042290                                 SNDRV_PCM_INFO_NONINTERLEAVED |
    24052291                                 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 |
    24082294                                 SNDRV_PCM_RATE_48000 |
    24092295                                 SNDRV_PCM_RATE_88200 |
    24102296                                 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,
    24212307};
    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
     2309static 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
     2313static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
     2314        .count = PERIOD_SIZES,
     2315        .list = period_sizes,
     2316        .mask = 0
    24452317};
    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 #endif
    2470 
    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_OS2
    2476 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
    2477         PERIOD_SIZES,
    2478         period_sizes,
    2479         0
    2480 };
    2481 #else
    2482 static snd_pcm_hw_constraint_list_t hw_constraints_period_sizes = {
    2483         count: PERIOD_SIZES,
    2484         list: period_sizes,
    2485         mask: 0
    2486 };
    2487 #endif
    24882318
    24892319static int snd_rme9652_hw_rule_channels(snd_pcm_hw_params_t *params,
     
    26892519}
    26902520
    2691 #ifdef TARGET_OS2
    26922521static 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,
    27032531};
    27042532
    27052533static 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,
    27162542};
    2717 #else
    2718 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 #endif
    27412543
    27422544static int __init snd_rme9652_create_pcm(snd_card_t *card,
     
    29582760}
    29592761
    2960 #ifdef TARGET_OS2
    29612762static struct pci_driver driver = {
    2962         0, 0,"RME Digi9652 (Hammerfall)",
    2963         snd_rme9652_ids,
    2964         snd_rme9652_probe,
    2965         snd_rme9652_remove,0,0
     2763        .name ="RME Digi9652 (Hammerfall)",
     2764        .id_table = snd_rme9652_ids,
     2765        .probe = snd_rme9652_probe,
     2766        .remove = __devexit_p(snd_rme9652_remove),
    29662767};
    2967 #else
    2968 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 #endif
    29752768
    29762769static int __init alsa_card_hammerfall_init(void)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c

    r207 r210  
    776776}
    777777
    778 #ifdef TARGET_OS2
    779778static snd_pcm_hardware_t snd_sonicvibes_playback =
    780779{
    781 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     780        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    782781                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    783782                                 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,
    796795};
    797796
    798797static snd_pcm_hardware_t snd_sonicvibes_capture =
    799798{
    800 /*      info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     799        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    801800                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    802801                                 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,
    815814};
    816 #else
    817 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 #endif
    855815
    856816static int snd_sonicvibes_playback_open(snd_pcm_substream_t * substream)
     
    897857}
    898858
    899 
    900 #ifdef TARGET_OS2
    901859static 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,
    911868};
    912869
    913870static 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,
    923879};
    924 #else
    925 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 #endif
    947880
    948881static void snd_sonicvibes_pcm_free(snd_pcm_t *pcm)
     
    981914 */
    982915
    983 #ifdef TARGET_OS2
    984916#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 }
    994920
    995921static int snd_sonicvibes_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    1044970}
    1045971
    1046 #ifdef TARGET_OS2
    1047972#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) }
    1059977
    1060978static int snd_sonicvibes_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    11101028}
    11111029
    1112 #ifdef TARGET_OS2
    11131030#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) }
    11251035
    11261036static int snd_sonicvibes_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
     
    13651275        unsigned int dmaa, dmac;
    13661276        int err;
    1367 #ifdef TARGET_OS2
    13681277        static snd_device_ops_t ops = {
    1369                 snd_sonicvibes_dev_free,0,0,0
     1278                .dev_free =     snd_sonicvibes_dev_free,
    13701279        };
    1371 #else
    1372         static snd_device_ops_t ops = {
    1373                 dev_free:       snd_sonicvibes_dev_free,
    1374         };
    1375 #endif
    13761280
    13771281        *rsonic = NULL;
     
    16521556
    16531557static 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),
    16671562};
    16681563
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident.c

    r207 r210  
    187187
    188188static 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};
    195198
    196199static int __init alsa_card_trident_init(void)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_main.c

    r207 r210  
    2828 */
    2929
    30 #define __NO_VERSION__
    3130#include <sound/driver.h>
    3231#include <asm/io.h>
     
    16761675static snd_pcm_hardware_t snd_trident_playback =
    16771676{
    1678     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1677        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    16791678                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    16801679                                 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 |
    16831682                                                                 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,
    16951694};
    16961695
     
    17011700static snd_pcm_hardware_t snd_trident_capture =
    17021701{
    1703     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1702        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    17041703                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    17051704                                 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 |
    17081707                                                                 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,
    17201719};
    17211720
     
    17261725static snd_pcm_hardware_t snd_trident_foldback =
    17271726{
    1728     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1727        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    17291728                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    17301729                                 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,
    17441743};
    17451744
     
    17501749static snd_pcm_hardware_t snd_trident_spdif =
    17511750{
    1752     /*  info:             */    (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
     1751        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
    17531752                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
    17541753                                 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 |
    17581757                                                                 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,
    17691768};
    17701769
     
    20182017
    20192018static snd_pcm_ops_t snd_trident_playback_ops = {
    2020     snd_trident_playback_open,
    2021     snd_trident_playback_close,
    2022     snd_trident_ioctl,
    2023     snd_trident_hw_params,
    2024     snd_trident_hw_free,
    2025     snd_trident_playback_prepare,
    2026     snd_trident_trigger,
    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,
    20282027};
    20292028
     
    20412040
    20422041static snd_pcm_ops_t snd_trident_capture_ops = {
    2043     snd_trident_capture_open,
    2044     snd_trident_capture_close,
    2045     snd_trident_ioctl,
    2046     snd_trident_capture_hw_params,
    2047     snd_trident_hw_free,
    2048     snd_trident_capture_prepare,
    2049     snd_trident_trigger,
    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,
    20512050};
    20522051
    20532052static snd_pcm_ops_t snd_trident_si7018_capture_ops = {
    2054     snd_trident_capture_open,
    2055     snd_trident_capture_close,
    2056     snd_trident_ioctl,
    2057     snd_trident_si7018_capture_hw_params,
    2058     snd_trident_si7018_capture_hw_free,
    2059     snd_trident_si7018_capture_prepare,
    2060     snd_trident_trigger,
    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,
    20622061};
    20632062
    20642063static snd_pcm_ops_t snd_trident_foldback_ops = {
    2065     snd_trident_foldback_open,
    2066     snd_trident_foldback_close,
    2067     snd_trident_ioctl,
    2068     snd_trident_hw_params,
    2069     snd_trident_hw_free,
    2070     snd_trident_foldback_prepare,
    2071     snd_trident_trigger,
    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,
    20732072};
    20742073
     
    20862085
    20872086static snd_pcm_ops_t snd_trident_spdif_ops = {
    2088     snd_trident_spdif_open,
    2089     snd_trident_spdif_close,
    2090     snd_trident_ioctl,
    2091     snd_trident_spdif_hw_params,
    2092     snd_trident_hw_free,
    2093     snd_trident_spdif_prepare,
    2094     snd_trident_trigger,
    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,
    20962095};
    20972096
     
    23582357static snd_kcontrol_new_t snd_trident_spdif_control __devinitdata =
    23592358{
    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,
    23672365};
    23682366
     
    24212419static snd_kcontrol_new_t snd_trident_spdif_default __devinitdata =
    24222420{
    2423     SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2424     SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,
    2425     snd_trident_spdif_default_info,
    2426     snd_trident_spdif_default_get,
    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
    24282426};
    24292427
     
    24532451static snd_kcontrol_new_t snd_trident_spdif_mask __devinitdata =
    24542452{
    2455     SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    2456     SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),0,
    2457     SNDRV_CTL_ELEM_ACCESS_READ,0,
    2458     snd_trident_spdif_mask_info,
    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,
    24602458};
    24612459
     
    25142512static snd_kcontrol_new_t snd_trident_spdif_stream __devinitdata =
    25152513{
    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     snd_trident_spdif_stream_info,
    2520     snd_trident_spdif_stream_get,
    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
    25222520};
    25232521
     
    25712569static snd_kcontrol_new_t snd_trident_ac97_rear_control __devinitdata =
    25722570{
    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,
    25802577};
    25812578
     
    26282625static snd_kcontrol_new_t snd_trident_vol_music_control __devinitdata =
    26292626{
    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,
    26372633};
    26382634
     
    26402636static snd_kcontrol_new_t snd_trident_vol_wave_control __devinitdata =
    26412637{
    2642     SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    2643     "Wave Playback Volume",0,0,0,
    2644     snd_trident_vol_control_info,
    2645     snd_trident_vol_control_get,
    2646     snd_trident_vol_control_put,
    2647     0,
     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,
    26482644};
    26492645
     
    27052701static snd_kcontrol_new_t snd_trident_pcm_vol_control __devinitdata =
    27062702{
    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,
    27142709};
    27152710
     
    27672762static snd_kcontrol_new_t snd_trident_pcm_pan_control __devinitdata =
    27682763{
    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,
    27762770};
    27772771
     
    28212815static snd_kcontrol_new_t snd_trident_pcm_rvol_control __devinitdata =
    28222816{
    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,
    28302823};
    28312824
     
    28752868static snd_kcontrol_new_t snd_trident_pcm_cvol_control __devinitdata =
    28762869{
    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,
    28842876};
    28852877
     
    35243516#ifdef TARGET_OS2
    35253517    static snd_device_ops_t ops = {
    3526         snd_trident_dev_free,0,0,0
     3518                .dev_free =     snd_trident_dev_free,
    35273519    };
    35283520#endif
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_memory.c

    r106 r210  
    2424 */
    2525
    26 #define __NO_VERSION__
    2726#include <sound/driver.h>
    2827#include <asm/io.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci_main.c

    r207 r210  
    2525 */
    2626
    27 #define __NO_VERSION__
    2827#include <sound/driver.h>
    2928#include <asm/io.h>
     
    3231#include <linux/pci.h>
    3332#include <linux/slab.h>
     33#include <linux/vmalloc.h>
    3434#include <sound/core.h>
    3535#include <sound/control.h>
     
    785785static snd_pcm_hardware_t snd_ymfpci_playback =
    786786{
    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
     807static snd_pcm_hardware_t snd_ymfpci_capture =
     808{
     809        .info =                 (SNDRV_PCM_INFO_MMAP |
    788810                                 SNDRV_PCM_INFO_MMAP_VALID |
    789811                                 SNDRV_PCM_INFO_INTERLEAVED |
     
    791813                                 SNDRV_PCM_INFO_PAUSE |
    792814                                 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,
    827827};
    828828
     
    10531053
    10541054static snd_pcm_ops_t snd_ymfpci_playback_ops = {
    1055     snd_ymfpci_playback_open,
    1056     snd_ymfpci_playback_close,
    1057     snd_pcm_lib_ioctl,
    1058     snd_ymfpci_playback_hw_params,
    1059     snd_ymfpci_playback_hw_free,
    1060     snd_ymfpci_playback_prepare,
    1061     snd_ymfpci_playback_trigger,
    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,
    10631063};
    10641064
    10651065static snd_pcm_ops_t snd_ymfpci_capture_rec_ops = {
    1066     snd_ymfpci_capture_rec_open,
    1067     snd_ymfpci_capture_close,
    1068     snd_pcm_lib_ioctl,
    1069     snd_ymfpci_capture_hw_params,
    1070     snd_ymfpci_capture_hw_free,
    1071     snd_ymfpci_capture_prepare,
    1072     snd_ymfpci_capture_trigger,
    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,
    10741074};
    10751075
     
    11111111
    11121112static snd_pcm_ops_t snd_ymfpci_capture_ac97_ops = {
    1113     snd_ymfpci_capture_ac97_open,
    1114     snd_ymfpci_capture_close,
    1115     snd_pcm_lib_ioctl,
    1116     snd_ymfpci_capture_hw_params,
    1117     snd_ymfpci_capture_hw_free,
    1118     snd_ymfpci_capture_prepare,
    1119     snd_ymfpci_capture_trigger,
    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,
    11211121};
    11221122
     
    11581158
    11591159static snd_pcm_ops_t snd_ymfpci_playback_spdif_ops = {
    1160     snd_ymfpci_playback_spdif_open,
    1161     snd_ymfpci_playback_spdif_close,
    1162     snd_pcm_lib_ioctl,
    1163     snd_ymfpci_playback_hw_params,
    1164     snd_ymfpci_playback_hw_free,
    1165     snd_ymfpci_playback_prepare,
    1166     snd_ymfpci_playback_trigger,
    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,
    11681168};
    11691169
     
    12031203
    12041204static snd_pcm_ops_t snd_ymfpci_playback_4ch_ops = {
    1205     snd_ymfpci_playback_4ch_open,
    1206     snd_ymfpci_playback_4ch_close,
    1207     snd_pcm_lib_ioctl,
    1208     snd_ymfpci_playback_hw_params,
    1209     snd_ymfpci_playback_hw_free,
    1210     snd_ymfpci_playback_prepare,
    1211     snd_ymfpci_playback_trigger,
    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,
    12131213};
    12141214
     
    13161316{
    13171317        .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),
    13201320        .info =         snd_ymfpci_spdif_mask_info,
    13211321        .get =          snd_ymfpci_spdif_mask_get,
     
    13631363{
    13641364        .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),
    13671367        .info =         snd_ymfpci_spdif_stream_info,
    13681368        .get =          snd_ymfpci_spdif_stream_get,
     
    14341434  .private_value = ((reg) | ((shift) << 16)) }
    14351435
    1436 #if 0
    1437 #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 #endif
    14441436static int snd_ymfpci_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
    14451437{
Note: See TracChangeset for help on using the changeset viewer.