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/pci
Files:
9 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • 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.