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

Merged to Alsa 0.9.0rc3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.