Changeset 94
- Timestamp:
- May 5, 2007, 6:58:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/include/sound/driver.h
r93 r94 1 #ifndef __ DRIVER_H2 #define __ DRIVER_H1 #ifndef __SOUND_DRIVER_H 2 #define __SOUND_DRIVER_H 3 3 4 4 /* … … 19 19 * You should have received a copy of the GNU General Public License 20 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 22 * 23 23 */ … … 27 27 #endif 28 28 29 #include <linux/config.h> 30 #include <linux/version.h> 31 29 32 #define SNDRV_CARDS 8 /* number of supported soundcards - don't change - minor numbers */ 30 33 … … 36 39 #undef CONFIG_SND_DEBUG_MEMORY 37 40 #endif 41 42 #ifdef ALSA_BUILD 43 #include "adriver.h" 44 #endif 45 46 #include <linux/module.h> 38 47 39 48 #ifndef __iomem … … 51 60 #endif 52 61 53 /*54 * ==========================================================================55 */56 57 #ifdef ALSA_BUILD58 #undef MODULE59 #define MODULE60 #endif61 62 #include <linux/config.h>63 #include <linux/version.h>64 65 62 #define IRQ_NONE (0) /*void*/ 66 63 #define IRQ_HANDLED (1) /*void*/ 67 64 #define IRQ_RETVAL(x) ((x) != 0) /*void*/ 68 65 typedef int irqreturn_t; 69 70 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 3)71 #error "This driver requires Linux 2.2.3 and higher."72 #endif73 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0)74 #define LINUX_2_275 #endif76 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1)77 #define LINUX_2_378 #endif79 #if defined(LINUX_2_3) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)80 #error "This code requires Linux 2.4.0-test1 and higher."81 #endif82 83 #ifdef ALSA_BUILD84 #if defined(CONFIG_MODVERSIONS) && !defined(__GENKSYMS__) && !defined(__DEPEND__)85 #define MODVERSIONS86 #include <linux/modversions.h>87 #include "sndversions.h"88 #endif89 #ifdef SNDRV_NO_MODVERS90 #undef MODVERSIONS91 #undef _set_ver92 #endif93 #endif /* ALSA_BUILD */94 95 #ifndef SNDRV_MAIN_OBJECT_FILE96 #define __NO_VERSION__97 #endif98 #include <linux/module.h>99 100 #include <linux/utsname.h>101 #include <linux/errno.h>102 #include <linux/kernel.h>103 #include <linux/sched.h>104 #include <linux/slab.h>105 #include <linux/delay.h>106 #include <linux/bitops.h>107 108 #include <linux/ioport.h>109 110 #include <asm/io.h>111 #include <asm/irq.h>112 #include <asm/dma.h>113 #include <asm/segment.h>114 #include <asm/uaccess.h>115 #include <asm/system.h>116 #include <asm/string.h>117 118 #ifdef CONFIG_PCI119 #include <linux/pci.h>120 #endif121 #include <linux/interrupt.h>122 #include <linux/pagemap.h>123 #include <linux/fs.h>124 #include <linux/fcntl.h>125 #include <linux/vmalloc.h>126 #include <linux/proc_fs.h>127 #include <linux/poll.h>128 #include <linux/reboot.h>129 130 #ifdef LINUX_2_2131 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 18)132 #include <linux/init.h>133 #endif134 #include "compat_22.h"135 #endif /* LINUX_2_2 */136 137 #ifdef LINUX_2_3138 #include <linux/init.h>139 #include <linux/pm.h>140 #define PCI_GET_DRIVER_DATA(pci) pci->driver_data141 #define PCI_SET_DRIVER_DATA(pci, data) pci->driver_data = data142 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3)143 #define pci_set_dma_mask(pci, mask) pci->dma_mask = mask144 #endif145 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 7)146 #define PCI_NEW_SUSPEND147 #endif148 #ifndef virt_to_page149 #define virt_to_page(x) (&mem_map[MAP_NR(x)])150 #endif151 #define snd_request_region request_region152 #ifndef rwlock_init153 #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)154 #endif155 #define snd_kill_fasync(fp, sig, band) kill_fasync(fp, sig, band)156 #if defined(__i386__) || defined(__ppc__)157 /*158 * Here a dirty hack for 2.4 kernels.. See kernel/memory.c.159 */160 #define HACK_PCI_ALLOC_CONSISTENT161 void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,162 dma_addr_t *dma_handle);163 #undef pci_alloc_consistent164 #define pci_alloc_consistent snd_pci_hack_alloc_consistent165 #endif /* i386 or ppc */166 #ifndef list_for_each_safe167 #define list_for_each_safe(pos, n, head) \168 for (pos = (head)->next, n = pos->next; pos != (head); pos = n, n = pos->next)169 #endif170 #endif171 172 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))173 #if (defined(CONFIG_ISAPNP_KERNEL) && defined(ALSA_BUILD)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 30) && !defined(ALSA_BUILD))174 #include <linux/isapnp.h>175 #define isapnp_dev pci_dev176 #define isapnp_card pci_bus177 #else178 #include "isapnp.h"179 #endif180 #undef __ISAPNP__181 #define __ISAPNP__182 #endif183 184 #ifndef MODULE_LICENSE185 #define MODULE_LICENSE(license)186 66 #ifndef PCI_D0 187 67 #define PCI_D0 0 … … 192 72 #define pci_choose_state(pci,state) ((state) ? PCI_D3hot : PCI_D0) 193 73 #endif 194 195 196 #include <sound/asound.h>197 #include <sound/asoundef.h>198 74 199 75 /* wrapper for getnstimeofday() … … 231 107 #define schedule_work(w) snd_compat_schedule_work(w) 232 108 233 /* Typedef's */ 234 typedef struct timeval snd_timestamp_t; 235 #ifndef TARGET_OS2 236 typedef enum sndrv_card_type snd_card_type; 237 #endif 238 typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t; 239 #ifndef TARGET_OS2 240 typedef enum sndrv_pcm_start snd_pcm_start_t; 241 typedef enum sndrv_pcm_xrun snd_pcm_xrun_t; 242 #endif 243 #ifdef TARGET_OS2 244 typedef struct snd_pcm_volume snd_pcm_volume_t; 245 #else 246 typedef enum sndrv_timer_global snd_timer_global_t; 247 #endif 109 /* 110 * ========================================================================== 111 */ 112 113 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) 114 #if defined(__i386__) || defined(__ppc__) 115 /* 116 * Here a dirty hack for 2.4 kernels.. See kernel/memory.c. 117 */ 118 #define HACK_PCI_ALLOC_CONSISTENT 119 #include <linux/pci.h> 120 void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size, 121 dma_addr_t *dma_handle); 122 #undef pci_alloc_consistent 123 #define pci_alloc_consistent snd_pci_hack_alloc_consistent 124 #endif /* i386 or ppc */ 125 #endif /* 2.4.0 */ 248 126 249 127 #ifdef CONFIG_SND_DEBUG_MEMORY 128 #include <linux/slab.h> 129 #include <linux/vmalloc.h> 250 130 void *snd_wrapper_kmalloc(size_t, int); 251 131 #undef kmalloc … … 257 137 #undef vfree 258 138 #endif 139 #ifdef TARGET_OS2 140 typedef struct snd_pcm_volume snd_pcm_volume_t; 141 #endif 142 143 #include "sndmagic.h" 259 144 260 145 #ifdef TARGET_OS2 … … 262 147 #define snd_leave_user(a) 263 148 #define dec_mod_count(a) (*(unsigned long *)a)-- 264 265 #else266 static inline mm_segment_t snd_enter_user(void)267 {268 mm_segment_t fs = get_fs();269 set_fs(get_ds());270 return fs;271 }272 static inline void snd_leave_user(mm_segment_t fs)273 {274 set_fs(fs);275 }276 static inline void dec_mod_count(struct module *module)277 {278 if (module)279 __MOD_DEC_USE_COUNT(module);280 }281 #endif282 283 #if defined(__alpha__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 14)284 #undef writeb285 #define writeb(v, a) do { __writeb((v),(a)); mb(); } while(0)286 #undef writew287 #define writew(v, a) do {__writew((v),(a)); mb(); } while(0)288 #undef writel289 #define writel(v, a) do {__writel((v),(a)); mb(); } while(0)290 #undef writeq291 #define writeq(v, a) do {__writeq((v),(a)); mb(); } while(0)292 #endif293 294 /* do we have virt_to_bus? */295 #if defined(CONFIG_SPARC64)296 #undef HAVE_VIRT_TO_BUS297 #else298 #define HAVE_VIRT_TO_BUS 1299 149 #endif 300 150
Note:
See TracChangeset
for help on using the changeset viewer.