1 | /*
|
---|
2 | * Configuration header file for compilation of the ALSA driver
|
---|
3 | */
|
---|
4 |
|
---|
5 | #ifndef __ALSA_CONFIG_H__
|
---|
6 | #define __ALSA_CONFIG_H__
|
---|
7 |
|
---|
8 | #define inline __inline
|
---|
9 | #define INLINE inline
|
---|
10 | #define __attribute__
|
---|
11 |
|
---|
12 | #include <linux/version.h>
|
---|
13 | #include <linux/types.h>
|
---|
14 | #include <linux/fcntl.h>
|
---|
15 | #include <linux/signal.h>
|
---|
16 | #include <linux/kdev_t.h>
|
---|
17 | #include <linux/wait.h>
|
---|
18 | #include <linux/list.h>
|
---|
19 | #include <linux/init.h>
|
---|
20 | #include <linux/dcache.h>
|
---|
21 | #include <linux/vmalloc.h>
|
---|
22 | #include <linux/tqueue.h>
|
---|
23 | #include <linux/time.h>
|
---|
24 | #include <linux/timer.h>
|
---|
25 | #include <linux/stat.h>
|
---|
26 | #include <linux/major.h>
|
---|
27 | #include <linux/fs.h>
|
---|
28 | #include <linux/err.h>
|
---|
29 | #include <linux/byteorder/little_endian.h>
|
---|
30 | #include <asm/ioctl.h>
|
---|
31 | #include <asm/hardirq.h>
|
---|
32 | #include <asm/processor.h>
|
---|
33 | #include <asm/siginfo.h>
|
---|
34 | #include <dbgos2.h>
|
---|
35 | #include <limits.h>
|
---|
36 | #include <sys/cdefs.h>
|
---|
37 |
|
---|
38 | #ifndef __iomem
|
---|
39 | #define __iomem
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | typedef unsigned int fmode_t;
|
---|
43 |
|
---|
44 | #ifndef cond_resched
|
---|
45 | #define cond_resched() \
|
---|
46 | do { \
|
---|
47 | if (1) { \
|
---|
48 | set_current_state(TASK_RUNNING); \
|
---|
49 | schedule(); \
|
---|
50 | } \
|
---|
51 | } while (0)
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | /*
|
---|
55 | * ==========================================================================
|
---|
56 | */
|
---|
57 |
|
---|
58 | #ifdef ALSA_BUILD
|
---|
59 | #undef MODULE
|
---|
60 | #define MODULE
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | #include <linux/config.h>
|
---|
64 | #include <linux/version.h>
|
---|
65 |
|
---|
66 | #define IRQ_NONE (0) /*void*/
|
---|
67 | #define IRQ_HANDLED (1) /*void*/
|
---|
68 | #define IRQ_RETVAL(x) ((x) != 0) /*void*/
|
---|
69 | typedef int irqreturn_t;
|
---|
70 |
|
---|
71 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 3)
|
---|
72 | #error "This driver requires Linux 2.2.3 and higher."
|
---|
73 | #endif
|
---|
74 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0)
|
---|
75 | #define LINUX_2_2
|
---|
76 | #endif
|
---|
77 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1)
|
---|
78 | #define LINUX_2_3
|
---|
79 | #endif
|
---|
80 | #if defined(LINUX_2_3) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
|
---|
81 | #error "This code requires Linux 2.4.0-test1 and higher."
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | #ifdef ALSA_BUILD
|
---|
85 | #if defined(CONFIG_MODVERSIONS) && !defined(__GENKSYMS__) && !defined(__DEPEND__)
|
---|
86 | #define MODVERSIONS
|
---|
87 | #include <linux/modversions.h>
|
---|
88 | #include "sndversions.h"
|
---|
89 | #endif
|
---|
90 | #ifdef SNDRV_NO_MODVERS
|
---|
91 | #undef MODVERSIONS
|
---|
92 | #undef _set_ver
|
---|
93 | #endif
|
---|
94 | #endif /* ALSA_BUILD */
|
---|
95 |
|
---|
96 | #ifndef SNDRV_MAIN_OBJECT_FILE
|
---|
97 | #define __NO_VERSION__
|
---|
98 | #endif
|
---|
99 | #include <linux/module.h>
|
---|
100 |
|
---|
101 | #include <linux/utsname.h>
|
---|
102 | #include <linux/errno.h>
|
---|
103 | #include <linux/kernel.h>
|
---|
104 | #include <linux/sched.h>
|
---|
105 | #include <linux/malloc.h>
|
---|
106 | #include <linux/delay.h>
|
---|
107 |
|
---|
108 | #include <linux/ioport.h>
|
---|
109 |
|
---|
110 | #include <asm/io.h>
|
---|
111 | #include <asm/irq.h>
|
---|
112 | #include <asm/segment.h>
|
---|
113 | #include <asm/uaccess.h>
|
---|
114 | #include <asm/system.h>
|
---|
115 | #include <asm/string.h>
|
---|
116 |
|
---|
117 | #include <linux/pci.h>
|
---|
118 | #include <linux/interrupt.h>
|
---|
119 | #include <linux/pagemap.h>
|
---|
120 | #include <linux/fs.h>
|
---|
121 | #include <linux/fcntl.h>
|
---|
122 | #include <linux/vmalloc.h>
|
---|
123 | #include <linux/poll.h>
|
---|
124 | #include <linux/reboot.h>
|
---|
125 |
|
---|
126 | #ifdef LINUX_2_2
|
---|
127 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 18)
|
---|
128 | #include <linux/init.h>
|
---|
129 | #endif
|
---|
130 | #include "compat_22.h"
|
---|
131 | #endif
|
---|
132 | #ifdef LINUX_2_3
|
---|
133 | #include <linux/init.h>
|
---|
134 | #include <linux/pm.h>
|
---|
135 | #define PCI_GET_DRIVER_DATA(pci) pci->driver_data
|
---|
136 | #define PCI_SET_DRIVER_DATA(pci, data) pci->driver_data = data
|
---|
137 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3)
|
---|
138 | //#define pci_set_dma_mask(pci, mask) pci->dma_mask = mask
|
---|
139 | #endif
|
---|
140 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 7)
|
---|
141 | #define PCI_NEW_SUSPEND
|
---|
142 | #endif
|
---|
143 | #ifndef virt_to_page
|
---|
144 | #define virt_to_page(x) (&mem_map[MAP_NR(x)])
|
---|
145 | #endif
|
---|
146 | #define snd_request_region request_region
|
---|
147 | #ifndef rwlock_init
|
---|
148 | #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
|
---|
149 | #endif
|
---|
150 | #define snd_kill_fasync(fp, sig, band) kill_fasync(fp, sig, band)
|
---|
151 | #if defined(__i386__) || defined(__ppc__)
|
---|
152 | /*
|
---|
153 | * Here a dirty hack for 2.4 kernels.. See kernel/memory.c.
|
---|
154 | */
|
---|
155 | #define HACK_PCI_ALLOC_CONSISTENT
|
---|
156 | void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
|
---|
157 | dma_addr_t *dma_handle);
|
---|
158 | #undef pci_alloc_consistent
|
---|
159 | #define pci_alloc_consistent snd_pci_hack_alloc_consistent
|
---|
160 | #endif /* i386 or ppc */
|
---|
161 | #endif
|
---|
162 |
|
---|
163 | #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
|
---|
164 | #if (defined(CONFIG_ISAPNP_KERNEL) && defined(ALSA_BUILD)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 30) && !defined(ALSA_BUILD))
|
---|
165 | #include <linux/isapnp.h>
|
---|
166 | #define isapnp_dev pci_dev
|
---|
167 | #define isapnp_card pci_bus
|
---|
168 | #else
|
---|
169 | #include "isapnp.h"
|
---|
170 | #endif
|
---|
171 | #undef __ISAPNP__
|
---|
172 | #define __ISAPNP__
|
---|
173 | #endif
|
---|
174 |
|
---|
175 | #ifndef PCI_D0
|
---|
176 | #define PCI_D0 0
|
---|
177 | #define PCI_D1 1
|
---|
178 | #define PCI_D2 2
|
---|
179 | #define PCI_D3hot 3
|
---|
180 | #define PCI_D3cold 4
|
---|
181 | #define pci_choose_state(pci,state) ((state) ? PCI_D3hot : PCI_D0)
|
---|
182 | #endif
|
---|
183 |
|
---|
184 |
|
---|
185 | #include <sound/asound.h>
|
---|
186 | #include <sound/asoundef.h>
|
---|
187 |
|
---|
188 | /* wrapper for getnstimeofday()
|
---|
189 | * it's needed for recent 2.6 kernels, too, due to lack of EXPORT_SYMBOL
|
---|
190 | */
|
---|
191 | #define getnstimeofday(x) do { \
|
---|
192 | struct timeval __x; \
|
---|
193 | do_gettimeofday(&__x); \
|
---|
194 | (x)->tv_sec = __x.tv_sec; \
|
---|
195 | (x)->tv_nsec = __x.tv_usec * 1000; \
|
---|
196 | } while (0)
|
---|
197 |
|
---|
198 | struct work_struct {
|
---|
199 | unsigned long pending;
|
---|
200 | struct list_head entry;
|
---|
201 | void (*func)(void *);
|
---|
202 | void *data;
|
---|
203 | void *wq_data;
|
---|
204 | struct timer_list timer;
|
---|
205 | };
|
---|
206 |
|
---|
207 | struct delayed_work {
|
---|
208 | struct work_struct work;
|
---|
209 | };
|
---|
210 |
|
---|
211 | #define INIT_WORK(_work, _func, _data) \
|
---|
212 | do { \
|
---|
213 | (_work)->func = _func; \
|
---|
214 | (_work)->data = _data; \
|
---|
215 | init_timer(&(_work)->timer); \
|
---|
216 | } while (0)
|
---|
217 | #define __WORK_INITIALIZER(n, f, d) { \
|
---|
218 | .func = (f), \
|
---|
219 | .data = (d), \
|
---|
220 | }
|
---|
221 | #define DECLARE_WORK(n, f, d) \
|
---|
222 | struct work_struct n = __WORK_INITIALIZER(n, f, d)
|
---|
223 | int snd_compat_schedule_work(struct work_struct *work);
|
---|
224 | #define schedule_work(w) snd_compat_schedule_work(w)
|
---|
225 |
|
---|
226 | /* Name change */
|
---|
227 | typedef struct timeval snd_timestamp_t;
|
---|
228 | #ifndef TARGET_OS2
|
---|
229 | typedef enum sndrv_card_type snd_card_type;
|
---|
230 | #endif
|
---|
231 | typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t;
|
---|
232 | #ifndef TARGET_OS2
|
---|
233 | typedef enum sndrv_pcm_xrun snd_pcm_xrun_t;
|
---|
234 | #endif
|
---|
235 | #ifdef TARGET_OS2
|
---|
236 | //typedef struct snd_pcm_volume snd_pcm_volume_t;
|
---|
237 | #else
|
---|
238 | typedef enum sndrv_timer_global snd_timer_global_t;
|
---|
239 | #endif
|
---|
240 |
|
---|
241 | /* redefine INIT_WORK() */
|
---|
242 | static inline void snd_INIT_WORK(struct work_struct *w, void (*f)(struct work_struct *))
|
---|
243 | {
|
---|
244 | INIT_WORK(w, (void(*)(void*))(f), w);
|
---|
245 | }
|
---|
246 | #undef INIT_WORK
|
---|
247 | #define INIT_WORK(w,f) snd_INIT_WORK(w,f)
|
---|
248 |
|
---|
249 | #ifdef CONFIG_SND_DEBUG_MEMORY
|
---|
250 | void *snd_wrapper_kmalloc(size_t, int);
|
---|
251 | #undef kmalloc
|
---|
252 | void snd_wrapper_kfree(const void *);
|
---|
253 | #undef kfree
|
---|
254 | void *snd_wrapper_vmalloc(size_t);
|
---|
255 | #undef vmalloc
|
---|
256 | void snd_wrapper_vfree(void *);
|
---|
257 | #undef vfree
|
---|
258 | #endif
|
---|
259 |
|
---|
260 | #if defined(__alpha__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 14)
|
---|
261 | #undef writeb
|
---|
262 | #define writeb(v, a) do { __writeb((v),(a)); mb(); } while(0)
|
---|
263 | #undef writew
|
---|
264 | #define writew(v, a) do {__writew((v),(a)); mb(); } while(0)
|
---|
265 | #undef writel
|
---|
266 | #define writel(v, a) do {__writel((v),(a)); mb(); } while(0)
|
---|
267 | #undef writeq
|
---|
268 | #define writeq(v, a) do {__writeq((v),(a)); mb(); } while(0)
|
---|
269 | #endif
|
---|
270 |
|
---|
271 | /* do we have virt_to_bus? */
|
---|
272 | #if defined(CONFIG_SPARC64)
|
---|
273 | #undef HAVE_VIRT_TO_BUS
|
---|
274 | #else
|
---|
275 | #define HAVE_VIRT_TO_BUS 1
|
---|
276 | #endif
|
---|
277 |
|
---|
278 | /*
|
---|
279 | * ==========================================================================
|
---|
280 | */
|
---|
281 |
|
---|
282 | extern int this_module[64];
|
---|
283 | #define THIS_MODULE (void *)&this_module[0]
|
---|
284 | #define MODULE_GENERIC_TABLE(gtype,name)
|
---|
285 | #define MODULE_DEVICE_TABLE(type,name)
|
---|
286 | #define CONFIG_PROC_FS
|
---|
287 | #define CONFIG_PM
|
---|
288 | #define PCI_NEW_SUSPEND
|
---|
289 | #define CONFIG_PCI
|
---|
290 | #define CONFIG_HAS_DMA
|
---|
291 | #define CONFIG_SND_SEQUENCER
|
---|
292 | #define CONFIG_SND_OSSEMUL
|
---|
293 | #define CONFIG_SND_PCM_OSS
|
---|
294 | #define SNDRV_LITTLE_ENDIAN
|
---|
295 | #define EXPORT_SYMBOL(a)
|
---|
296 | #define CONFIG_SOUND
|
---|
297 | #define ATTRIBUTE_UNUSED
|
---|
298 | #define CONFIG_SND_HDA_CODEC_REALTEK
|
---|
299 | #define CONFIG_SND_HDA_CODEC_CMEDIA
|
---|
300 | #define CONFIG_SND_HDA_CODEC_ANALOG
|
---|
301 | #define CONFIG_SND_HDA_CODEC_SIGMATEL
|
---|
302 | #define CONFIG_SND_HDA_CODEC_SI3054
|
---|
303 | #define CONFIG_SND_HDA_CODEC_ATIHDMI
|
---|
304 | #define CONFIG_SND_HDA_CODEC_CONEXANT
|
---|
305 | #define CONFIG_SND_HDA_CODEC_VIA
|
---|
306 | #define CONFIG_SND_HDA_GENERIC
|
---|
307 | /*#define CONFIG_SND_HDA_HWDEP*/
|
---|
308 | #define CONFIG_PM
|
---|
309 | #define CONFIG_HAVE_PCI_DEV_PRESENT
|
---|
310 | #define CONFIG_SND_DEBUG_DETECT
|
---|
311 | #define CONFIG_SYSFS_DEPRECATED
|
---|
312 | #undef interrupt
|
---|
313 |
|
---|
314 | #define fops_get(x) (x)
|
---|
315 | #define fops_put(x) do { ; } while (0)
|
---|
316 | #define __builtin_return_address(a) 0
|
---|
317 | #define SetPageReserved(a) a
|
---|
318 | #define ClearPageReserved(a) a
|
---|
319 | #define set_current_state(a)
|
---|
320 | #define try_inc_mod_count(x) ++(*(unsigned long *)x)
|
---|
321 | #define try_module_get(x) try_inc_mod_count(x)
|
---|
322 | static inline void module_put(struct module *module)
|
---|
323 | {
|
---|
324 | if (module)
|
---|
325 | do {} while(0);
|
---|
326 | }
|
---|
327 |
|
---|
328 | #define rwlock_init(x) *(x) = RW_LOCK_UNLOCKED;
|
---|
329 |
|
---|
330 | #define suser() 1
|
---|
331 |
|
---|
332 | #define snd_kill_fasync(fp, sig, band) kill_fasync(*(fp), sig, band)
|
---|
333 |
|
---|
334 |
|
---|
335 | //what's this??
|
---|
336 | #define capable(a) 1
|
---|
337 | #define CAP_SYS_ADMIN 0
|
---|
338 |
|
---|
339 | #define BITS_PER_LONG 32
|
---|
340 |
|
---|
341 | #ifndef bitmap_member
|
---|
342 | #define bitmap_member(name,bits) \
|
---|
343 | unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG]
|
---|
344 | #endif
|
---|
345 |
|
---|
346 | #ifndef snd_card_set_dev
|
---|
347 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
|
---|
348 | #endif
|
---|
349 |
|
---|
350 | /* for easier backward-porting */
|
---|
351 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
|
---|
352 | #ifndef gameport_set_dev_parent
|
---|
353 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev))
|
---|
354 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r))
|
---|
355 | #define gameport_get_port_data(gp) (gp)->port_data
|
---|
356 | #endif
|
---|
357 | #endif
|
---|
358 |
|
---|
359 | /* misc.c */
|
---|
360 | struct resource;
|
---|
361 | void release_and_free_resource(struct resource *res);
|
---|
362 |
|
---|
363 | #include "typedefs.h"
|
---|
364 | #define container_of(ptr, type, member) \
|
---|
365 | ( (type *)( (char *)ptr - offsetof(type,member) ) )
|
---|
366 | _WCRTLINK extern int snprintf( char *__buf, size_t __bufsize,
|
---|
367 | const char *__fmt, ... );
|
---|
368 | #define offsetof(__typ,__id) ((size_t)&(((__typ*)0)->__id))
|
---|
369 | #define list_for_each_entry(itemptr, headptr, struct_listmember_name, container_type) \
|
---|
370 | for (itemptr=(container_type *) \
|
---|
371 | (((char *)((headptr)->next))-offsetof(container_type, struct_listmember_name)); \
|
---|
372 | &(itemptr->struct_listmember_name)!=(headptr); \
|
---|
373 | itemptr=(container_type *) \
|
---|
374 | (((char *)(itemptr->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)))
|
---|
375 |
|
---|
376 | #define list_for_each_entry_safe(itemptr, n, headptr, struct_listmember_name, container_type) \
|
---|
377 | for (itemptr=(container_type *) \
|
---|
378 | (((char *)((headptr)->next))-offsetof(container_type, struct_listmember_name)), \
|
---|
379 | n=(container_type *) \
|
---|
380 | (((char *)(itemptr->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)); \
|
---|
381 | &(itemptr->struct_listmember_name)!=(headptr); \
|
---|
382 | itemptr=n, \
|
---|
383 | n=(container_type *) \
|
---|
384 | (((char *)(n->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)))
|
---|
385 | #define flush_scheduled_work()
|
---|
386 |
|
---|
387 | /* schedule_timeout_[un]interruptible() wrappers */
|
---|
388 | #include <linux/sched.h>
|
---|
389 | #define schedule_timeout_interruptible(x) \
|
---|
390 | set_current_state(TASK_INTERRUPTIBLE); \
|
---|
391 | schedule_timeout(x);
|
---|
392 |
|
---|
393 | #define schedule_timeout_uninterruptible(x) \
|
---|
394 | set_current_state(TASK_UNINTERRUPTIBLE); \
|
---|
395 | schedule_timeout(x);
|
---|
396 |
|
---|
397 |
|
---|
398 | /* pm_message_t type */
|
---|
399 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)
|
---|
400 | #include <linux/pm.h>
|
---|
401 | #ifndef PMSG_FREEZE
|
---|
402 | typedef u32 pm_message_t;
|
---|
403 | #define PMSG_FREEZE 3
|
---|
404 | #define PMSG_SUSPEND 3
|
---|
405 | #define PMSG_ON 0
|
---|
406 | #endif
|
---|
407 | #endif
|
---|
408 |
|
---|
409 | #ifndef imajor
|
---|
410 | #define imajor(x) major((x)->i_rdev)
|
---|
411 | #endif
|
---|
412 |
|
---|
413 | #ifndef __nocast
|
---|
414 | #define __nocast
|
---|
415 | #endif
|
---|
416 |
|
---|
417 | #ifndef CONFIG_HAVE_KZALLOC
|
---|
418 | void *snd_compat_kzalloc(size_t n, unsigned int __nocast gfp_flags);
|
---|
419 | #define kzalloc(s,f) snd_compat_kzalloc(s,f)
|
---|
420 | #endif
|
---|
421 |
|
---|
422 | static inline struct proc_dir_entry *PDE(const struct inode *inode)
|
---|
423 | {
|
---|
424 | return (struct proc_dir_entry *) inode->u.generic_ip;
|
---|
425 | }
|
---|
426 |
|
---|
427 | #ifndef CONFIG_HAVE_KSTRDUP
|
---|
428 | char *snd_compat_kstrdup(const char *s, unsigned int __nocast gfp_flags);
|
---|
429 | #define kstrdup(s,f) snd_compat_kstrdup(s,f)
|
---|
430 | #endif
|
---|
431 |
|
---|
432 | #ifndef CONFIG_HAVE_KCALLOC
|
---|
433 | void *snd_compat_kcalloc(size_t n, size_t size, unsigned int __nocast gfp_flags);
|
---|
434 | #define kcalloc(n,s,f) snd_compat_kcalloc(n,s,f)
|
---|
435 | #endif
|
---|
436 |
|
---|
437 | struct workqueue_struct *snd_compat_create_workqueue(const char *name);
|
---|
438 | #define create_workqueue(name) snd_compat_create_workqueue((name))
|
---|
439 | void snd_compat_destroy_workqueue(struct workqueue_struct *wq);
|
---|
440 | #define destroy_workqueue(wq) snd_compat_destroy_workqueue((wq))
|
---|
441 | int snd_compat_queue_work(struct workqueue_struct *wq, struct work_struct *work);
|
---|
442 | #define queue_work(wq, work) snd_compat_queue_work((wq), (work))
|
---|
443 |
|
---|
444 | #ifndef BUG_ON
|
---|
445 | #define BUG_ON(x) /* nothing */
|
---|
446 | #endif
|
---|
447 | #define MODULE_ALIAS_CHARDEV_MAJOR(x)
|
---|
448 | typedef unsigned gfp_t;
|
---|
449 |
|
---|
450 | #ifndef __devexit_p
|
---|
451 | #define __devexit_p(x) x
|
---|
452 | #endif
|
---|
453 |
|
---|
454 | #define printk_ratelimit() 1
|
---|
455 | #define __builtin_expect(x, expected_value) (x)
|
---|
456 | #define likely(x) __builtin_expect((x),1)
|
---|
457 | #define unlikely(x) __builtin_expect((x),0)
|
---|
458 |
|
---|
459 | #define smp_mb__after_clear_bit()
|
---|
460 | int snd_compat_devfs_mk_dir(const char *dir, ...);
|
---|
461 | #define devfs_mk_dir snd_compat_devfs_mk_dir
|
---|
462 | int snd_compat_devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...);
|
---|
463 | #define devfs_mk_cdev snd_compat_devfs_mk_cdev
|
---|
464 | void snd_compat_devfs_remove(const char *fmt, ...);
|
---|
465 | #define devfs_remove snd_compat_devfs_remove
|
---|
466 | #define SINGLE_DEPTH_NESTING 1
|
---|
467 |
|
---|
468 | struct iovec {
|
---|
469 | char *iov_base; /* Base address. */
|
---|
470 | #ifdef __32BIT__
|
---|
471 | size_t iov_len; /* Length. */
|
---|
472 | #else
|
---|
473 | long iov_len; /* Length. */
|
---|
474 | #endif
|
---|
475 | };
|
---|
476 | #define SEEK_SET 0
|
---|
477 | #define SEEK_CUR 1
|
---|
478 | #define SEEK_END 2
|
---|
479 |
|
---|
480 | #ifndef IRQF_SHARED
|
---|
481 | #include <linux/signal.h>
|
---|
482 | #define IRQF_SHARED SA_SHIRQ
|
---|
483 | #define IRQF_DISABLED SA_INTERRUPT
|
---|
484 | #define IRQF_SAMPLE_RANDOM SA_SAMPLE_RANDOM
|
---|
485 | #define IRQF_PERCPU SA_PERCPU
|
---|
486 | #ifdef SA_PROBEIRQ
|
---|
487 | #define IRQF_PROBE_SHARED SA_PROBEIRQ
|
---|
488 | #else
|
---|
489 | #define IRQF_PROBE_SHARED 0 /* dummy */
|
---|
490 | #endif
|
---|
491 | #endif /* IRQ_SHARED */
|
---|
492 |
|
---|
493 | #ifndef MODULE_FIRMWARE
|
---|
494 | #define MODULE_FIRMWARE(x)
|
---|
495 | #endif
|
---|
496 |
|
---|
497 | typedef irqreturn_t (*snd_irq_handler_t)(int, void *);
|
---|
498 | #define irq_handler_t snd_irq_handler_t
|
---|
499 | #undef irq_handler_t
|
---|
500 | #define irq_handler_t snd_irq_handler_t
|
---|
501 | int request_irq(unsigned int, irq_handler_t handler,
|
---|
502 | unsigned long, const char *, void *);
|
---|
503 |
|
---|
504 | #ifndef MODULE_ALIAS
|
---|
505 | #define MODULE_ALIAS(x)
|
---|
506 | #define MODULE_ALIAS_CHARDEV_MAJOR(x)
|
---|
507 | #endif
|
---|
508 |
|
---|
509 | #ifndef cpu_relax
|
---|
510 | #define cpu_relax()
|
---|
511 | #endif
|
---|
512 |
|
---|
513 | #ifndef roundup
|
---|
514 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
|
---|
515 | #endif
|
---|
516 |
|
---|
517 | /*
|
---|
518 | * lockdep macros
|
---|
519 | */
|
---|
520 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
|
---|
521 | #define lockdep_set_class(lock, key) do { (void)(key); } while (0)
|
---|
522 | #define down_read_nested(sem, subclass) down_read(sem)
|
---|
523 | #define down_write_nested(sem, subclass) down_write(sem)
|
---|
524 | #define down_read_non_owner(sem) down_read(sem)
|
---|
525 | #define up_read_non_owner(sem) up_read(sem)
|
---|
526 | #define spin_lock_nested(lock, x) spin_lock(lock)
|
---|
527 | #define spin_lock_irqsave_nested(lock, f, x) spin_lock_irqsave(lock, f)
|
---|
528 | #endif
|
---|
529 |
|
---|
530 | /* msleep */
|
---|
531 | #ifndef CONFIG_HAVE_MSLEEP
|
---|
532 | void snd_compat_msleep(unsigned int msecs);
|
---|
533 | #define msleep snd_compat_msleep
|
---|
534 | #endif
|
---|
535 |
|
---|
536 | #define do_posix_clock_monotonic_gettime getnstimeofday
|
---|
537 |
|
---|
538 | static inline unsigned char snd_pci_revision(struct pci_dev *pci)
|
---|
539 | {
|
---|
540 | unsigned char rev;
|
---|
541 | pci_read_config_byte(pci, PCI_REVISION_ID, &rev);
|
---|
542 | return rev;
|
---|
543 | }
|
---|
544 |
|
---|
545 | #ifndef ALIGN
|
---|
546 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
|
---|
547 | #endif
|
---|
548 |
|
---|
549 | /* pci_intx() wrapper */
|
---|
550 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
|
---|
551 | #ifdef CONFIG_PCI
|
---|
552 | #undef pci_intx
|
---|
553 | #define pci_intx(pci,x)
|
---|
554 | #endif
|
---|
555 | #endif
|
---|
556 |
|
---|
557 | /* MSI */
|
---|
558 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
|
---|
559 | static inline int snd_pci_enable_msi(struct pci_dev *dev) { return -1; }
|
---|
560 | #undef pci_enable_msi
|
---|
561 | #define pci_enable_msi(dev) snd_pci_enable_msi(dev)
|
---|
562 | #undef pci_disable_msi
|
---|
563 | #define pci_disable_msi(dev)
|
---|
564 | #endif
|
---|
565 |
|
---|
566 | /**
|
---|
567 | * list_move_tail - delete from one list and add as another's tail
|
---|
568 | * @list: the entry to move
|
---|
569 | * @head: the head that will follow our entry
|
---|
570 | */
|
---|
571 | static inline void list_move_tail(struct list_head *list,
|
---|
572 | struct list_head *head)
|
---|
573 | {
|
---|
574 | __list_del(list->prev, list->next);
|
---|
575 | list_add_tail(list, head);
|
---|
576 | }
|
---|
577 |
|
---|
578 | #define assert(a)
|
---|
579 |
|
---|
580 | #ifndef fastcall
|
---|
581 | #define fastcall
|
---|
582 | #endif
|
---|
583 |
|
---|
584 | /* dump_stack hack */
|
---|
585 | #ifndef CONFIG_HAVE_DUMP_STACK
|
---|
586 | #undef dump_stack
|
---|
587 | #define dump_stack()
|
---|
588 | #endif
|
---|
589 |
|
---|
590 | #define pci_dev_present(x) snd_pci_dev_present(x)
|
---|
591 |
|
---|
592 | /* definitions for functions in pci_iomap_compat.c */
|
---|
593 | #ifndef fastcall
|
---|
594 | #define fastcall
|
---|
595 | #endif
|
---|
596 |
|
---|
597 | unsigned int fastcall ioread8(void __iomem *addr);
|
---|
598 | unsigned int fastcall ioread16(void __iomem *addr);
|
---|
599 | unsigned int fastcall ioread32(void __iomem *addr);
|
---|
600 | void fastcall iowrite8(u8 val, void __iomem *addr);
|
---|
601 | void fastcall iowrite16(u16 val, void __iomem *addr);
|
---|
602 | void fastcall iowrite32(u32 val, void __iomem *addr);
|
---|
603 | void __iomem *ioport_map(unsigned long port, unsigned int nr);
|
---|
604 | void ioport_unmap(void __iomem *addr);
|
---|
605 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen);
|
---|
606 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr);
|
---|
607 |
|
---|
608 | #ifndef upper_32_bits
|
---|
609 | #define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
|
---|
610 | #endif
|
---|
611 |
|
---|
612 | #ifdef __SMP__
|
---|
613 | #define smp_mb() mb()
|
---|
614 | #define smp_rmb() rmb()
|
---|
615 | #define smp_wmb() wmb()
|
---|
616 | #else
|
---|
617 | #define smp_mb() barrier()
|
---|
618 | #define smp_rmb() barrier()
|
---|
619 | #define smp_wmb() barrier()
|
---|
620 | #endif
|
---|
621 |
|
---|
622 | #define GFP_DMA32 0 /* driver must check for 32-bit address */
|
---|
623 | #define __GFP_COMP 0
|
---|
624 | #define __GFP_NOWARN 0
|
---|
625 | #define __GFP_NORETRY 0
|
---|
626 |
|
---|
627 | #define page_to_pfn(page) (page_to_phys(page) >> PAGE_SHIFT)
|
---|
628 | typedef __u32 __le32;
|
---|
629 |
|
---|
630 | /*
|
---|
631 | * pci_ioremap_bar() wrapper
|
---|
632 | */
|
---|
633 | #ifdef CONFIG_PCI
|
---|
634 | #ifndef CONFIG_HAVE_PCI_IOREMAP_BAR
|
---|
635 | extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
|
---|
636 | #include <linux/pci.h>
|
---|
637 | static inline void *pci_ioremap_bar(struct pci_dev *pdev, int bar)
|
---|
638 | {
|
---|
639 | #if 0
|
---|
640 | return ioremap_nocache(pci_resource_start(pdev, bar),
|
---|
641 | pci_resource_len(pdev, bar));
|
---|
642 | #else
|
---|
643 | return __ioremap(pci_resource_start(pdev, bar),
|
---|
644 | pci_resource_len(pdev, bar),0x010);
|
---|
645 | #endif
|
---|
646 | }
|
---|
647 | #endif
|
---|
648 | #endif
|
---|
649 |
|
---|
650 | #endif //__ALSA_CONFIG_H__
|
---|