Changeset 210 for GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
- Timestamp:
- Jul 13, 2007, 4:47:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
r207 r210 776 776 } 777 777 778 #ifdef TARGET_OS2779 778 static snd_pcm_hardware_t snd_sonicvibes_playback = 780 779 { 781 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |780 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 782 781 SNDRV_PCM_INFO_BLOCK_TRANSFER | 783 782 SNDRV_PCM_INFO_MMAP_VALID), 784 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,785 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,786 /* rate_min: */4000,787 /* rate_max: */48000,788 /* channels_min: */1,789 /* channels_max: */2,790 /* buffer_bytes_max: */(128*1024),791 /* period_bytes_min: */32,792 /* period_bytes_max: */(128*1024),793 /* periods_min: */1,794 /* periods_max: */1024,795 /* fifo_size: */0,783 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 784 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 785 .rate_min = 4000, 786 .rate_max = 48000, 787 .channels_min = 1, 788 .channels_max = 2, 789 .buffer_bytes_max = (128*1024), 790 .period_bytes_min = 32, 791 .period_bytes_max = (128*1024), 792 .periods_min = 1, 793 .periods_max = 1024, 794 .fifo_size = 0, 796 795 }; 797 796 798 797 static snd_pcm_hardware_t snd_sonicvibes_capture = 799 798 { 800 /* info: */(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |799 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 801 800 SNDRV_PCM_INFO_BLOCK_TRANSFER | 802 801 SNDRV_PCM_INFO_MMAP_VALID), 803 /* formats: */SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,804 /* rates: */SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,805 /* rate_min: */4000,806 /* rate_max: */48000,807 /* channels_min: */1,808 /* channels_max: */2,809 /* buffer_bytes_max: */(128*1024),810 /* period_bytes_min: */32,811 /* period_bytes_max: */(128*1024),812 /* periods_min: */1,813 /* periods_max: */1024,814 /* fifo_size: */0,802 .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, 803 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 804 .rate_min = 4000, 805 .rate_max = 48000, 806 .channels_min = 1, 807 .channels_max = 2, 808 .buffer_bytes_max = (128*1024), 809 .period_bytes_min = 32, 810 .period_bytes_max = (128*1024), 811 .periods_min = 1, 812 .periods_max = 1024, 813 .fifo_size = 0, 815 814 }; 816 #else817 static snd_pcm_hardware_t snd_sonicvibes_playback =818 {819 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |820 SNDRV_PCM_INFO_BLOCK_TRANSFER |821 SNDRV_PCM_INFO_MMAP_VALID),822 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,823 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,824 rate_min: 4000,825 rate_max: 48000,826 channels_min: 1,827 channels_max: 2,828 buffer_bytes_max: (128*1024),829 period_bytes_min: 32,830 period_bytes_max: (128*1024),831 periods_min: 1,832 periods_max: 1024,833 fifo_size: 0,834 };835 836 static snd_pcm_hardware_t snd_sonicvibes_capture =837 {838 info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |839 SNDRV_PCM_INFO_BLOCK_TRANSFER |840 SNDRV_PCM_INFO_MMAP_VALID),841 formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,842 rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,843 rate_min: 4000,844 rate_max: 48000,845 channels_min: 1,846 channels_max: 2,847 buffer_bytes_max: (128*1024),848 period_bytes_min: 32,849 period_bytes_max: (128*1024),850 periods_min: 1,851 periods_max: 1024,852 fifo_size: 0,853 };854 #endif855 815 856 816 static int snd_sonicvibes_playback_open(snd_pcm_substream_t * substream) … … 897 857 } 898 858 899 900 #ifdef TARGET_OS2901 859 static snd_pcm_ops_t snd_sonicvibes_playback_ops = { 902 /* open: */ snd_sonicvibes_playback_open, 903 /* close: */ snd_sonicvibes_playback_close, 904 /* ioctl: */ snd_pcm_lib_ioctl, 905 /* hw_params:*/ snd_sonicvibes_hw_params, 906 /* hw_free: */ snd_sonicvibes_hw_free, 907 /* prepare: */ snd_sonicvibes_playback_prepare, 908 /* trigger: */ snd_sonicvibes_playback_trigger, 909 /* pointer: */ snd_sonicvibes_playback_pointer, 910 0, 0 860 .open = snd_sonicvibes_playback_open, 861 .close = snd_sonicvibes_playback_close, 862 .ioctl = snd_pcm_lib_ioctl, 863 .hw_params = snd_sonicvibes_hw_params, 864 .hw_free = snd_sonicvibes_hw_free, 865 .prepare = snd_sonicvibes_playback_prepare, 866 .trigger = snd_sonicvibes_playback_trigger, 867 .pointer = snd_sonicvibes_playback_pointer, 911 868 }; 912 869 913 870 static snd_pcm_ops_t snd_sonicvibes_capture_ops = { 914 /* open: */ snd_sonicvibes_capture_open, 915 /* close: */ snd_sonicvibes_capture_close, 916 /* ioctl: */ snd_pcm_lib_ioctl, 917 /* hw_params:*/ snd_sonicvibes_hw_params, 918 /* hw_free: */ snd_sonicvibes_hw_free, 919 /* prepare: */ snd_sonicvibes_capture_prepare, 920 /* trigger: */ snd_sonicvibes_capture_trigger, 921 /* pointer: */ snd_sonicvibes_capture_pointer, 922 0, 0 871 .open = snd_sonicvibes_capture_open, 872 .close = snd_sonicvibes_capture_close, 873 .ioctl = snd_pcm_lib_ioctl, 874 .hw_params = snd_sonicvibes_hw_params, 875 .hw_free = snd_sonicvibes_hw_free, 876 .prepare = snd_sonicvibes_capture_prepare, 877 .trigger = snd_sonicvibes_capture_trigger, 878 .pointer = snd_sonicvibes_capture_pointer, 923 879 }; 924 #else925 static snd_pcm_ops_t snd_sonicvibes_playback_ops = {926 open: snd_sonicvibes_playback_open,927 close: snd_sonicvibes_playback_close,928 ioctl: snd_pcm_lib_ioctl,929 hw_params: snd_sonicvibes_hw_params,930 hw_free: snd_sonicvibes_hw_free,931 prepare: snd_sonicvibes_playback_prepare,932 trigger: snd_sonicvibes_playback_trigger,933 pointer: snd_sonicvibes_playback_pointer,934 };935 936 static snd_pcm_ops_t snd_sonicvibes_capture_ops = {937 open: snd_sonicvibes_capture_open,938 close: snd_sonicvibes_capture_close,939 ioctl: snd_pcm_lib_ioctl,940 hw_params: snd_sonicvibes_hw_params,941 hw_free: snd_sonicvibes_hw_free,942 prepare: snd_sonicvibes_capture_prepare,943 trigger: snd_sonicvibes_capture_trigger,944 pointer: snd_sonicvibes_capture_pointer,945 };946 #endif947 880 948 881 static void snd_sonicvibes_pcm_free(snd_pcm_t *pcm) … … 981 914 */ 982 915 983 #ifdef TARGET_OS2984 916 #define SONICVIBES_MUX(xname, xindex) \ 985 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 986 0, 0,snd_sonicvibes_info_mux, \ 987 snd_sonicvibes_get_mux, snd_sonicvibes_put_mux, 0} 988 #else 989 #define SONICVIBES_MUX(xname, xindex) \ 990 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 991 info: snd_sonicvibes_info_mux, \ 992 get: snd_sonicvibes_get_mux, put: snd_sonicvibes_put_mux } 993 #endif 917 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 918 .info = snd_sonicvibes_info_mux, \ 919 .get = snd_sonicvibes_get_mux, .put = snd_sonicvibes_put_mux } 994 920 995 921 static int snd_sonicvibes_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1044 970 } 1045 971 1046 #ifdef TARGET_OS21047 972 #define SONICVIBES_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1048 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1049 0, 0, snd_sonicvibes_info_single, \ 1050 snd_sonicvibes_get_single, snd_sonicvibes_put_single, \ 1051 reg | (shift << 8) | (mask << 16) | (invert << 24) } 1052 #else 1053 #define SONICVIBES_SINGLE(xname, xindex, reg, shift, mask, invert) \ 1054 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1055 info: snd_sonicvibes_info_single, \ 1056 get: snd_sonicvibes_get_single, put: snd_sonicvibes_put_single, \ 1057 private_value: reg | (shift << 8) | (mask << 16) | (invert << 24) } 1058 #endif 973 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 974 .info = snd_sonicvibes_info_single, \ 975 .get = snd_sonicvibes_get_single, .put = snd_sonicvibes_put_single, \ 976 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 1059 977 1060 978 static int snd_sonicvibes_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1110 1028 } 1111 1029 1112 #ifdef TARGET_OS21113 1030 #define SONICVIBES_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1114 { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, xindex, \ 1115 0, 0, snd_sonicvibes_info_double, \ 1116 snd_sonicvibes_get_double, snd_sonicvibes_put_double, \ 1117 left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1118 #else 1119 #define SONICVIBES_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 1120 { iface: SNDRV_CTL_ELEM_IFACE_MIXER, name: xname, index: xindex, \ 1121 info: snd_sonicvibes_info_double, \ 1122 get: snd_sonicvibes_get_double, put: snd_sonicvibes_put_double, \ 1123 private_value: left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1124 #endif 1031 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1032 .info = snd_sonicvibes_info_double, \ 1033 .get = snd_sonicvibes_get_double, .put = snd_sonicvibes_put_double, \ 1034 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 1125 1035 1126 1036 static int snd_sonicvibes_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1365 1275 unsigned int dmaa, dmac; 1366 1276 int err; 1367 #ifdef TARGET_OS21368 1277 static snd_device_ops_t ops = { 1369 snd_sonicvibes_dev_free,0,0,01278 .dev_free = snd_sonicvibes_dev_free, 1370 1279 }; 1371 #else1372 static snd_device_ops_t ops = {1373 dev_free: snd_sonicvibes_dev_free,1374 };1375 #endif1376 1280 1377 1281 *rsonic = NULL; … … 1652 1556 1653 1557 static struct pci_driver driver = { 1654 #ifdef TARGET_OS2 1655 0, 0, 0, 1656 "S3 SonicVibes", 1657 snd_sonic_ids, 1658 snd_sonic_probe, 1659 snd_sonic_remove, 1660 0, 0 1661 #else 1662 name: "S3 SonicVibes", 1663 id_table: snd_sonic_ids, 1664 probe: snd_sonic_probe, 1665 remove: __devexit_p(snd_sonic_remove), 1666 #endif 1558 .name = "S3 SonicVibes", 1559 .id_table = snd_sonic_ids, 1560 .probe = snd_sonic_probe, 1561 .remove = __devexit_p(snd_sonic_remove), 1667 1562 }; 1668 1563
Note:
See TracChangeset
for help on using the changeset viewer.