25 #include <linux/sched.h>
32 #ifdef CONFIG_SND_DYNAMIC_MINORS
33 #define SNDRV_CARDS 32
38 #define CONFIG_SND_MAJOR 116
48 #define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000
51 #define SNDRV_DEV_TOPLEVEL ((__force snd_device_type_t) 0)
52 #define SNDRV_DEV_CONTROL ((__force snd_device_type_t) 1)
53 #define SNDRV_DEV_LOWLEVEL_PRE ((__force snd_device_type_t) 2)
54 #define SNDRV_DEV_LOWLEVEL_NORMAL ((__force snd_device_type_t) 0x1000)
55 #define SNDRV_DEV_PCM ((__force snd_device_type_t) 0x1001)
56 #define SNDRV_DEV_RAWMIDI ((__force snd_device_type_t) 0x1002)
57 #define SNDRV_DEV_TIMER ((__force snd_device_type_t) 0x1003)
58 #define SNDRV_DEV_SEQUENCER ((__force snd_device_type_t) 0x1004)
59 #define SNDRV_DEV_HWDEP ((__force snd_device_type_t) 0x1005)
60 #define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006)
61 #define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
62 #define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
63 #define SNDRV_DEV_JACK ((__force snd_device_type_t) 0x1009)
64 #define SNDRV_DEV_COMPRESS ((__force snd_device_type_t) 0x100A)
65 #define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
68 #define SNDRV_DEV_BUILD ((__force snd_device_state_t) 0)
69 #define SNDRV_DEV_REGISTERED ((__force snd_device_state_t) 1)
70 #define SNDRV_DEV_DISCONNECTED ((__force snd_device_state_t) 2)
73 #define SNDRV_DEV_CMD_PRE ((__force snd_device_cmd_t) 0)
74 #define SNDRV_DEV_CMD_NORMAL ((__force snd_device_cmd_t) 1)
75 #define SNDRV_DEV_CMD_POST ((__force snd_device_cmd_t) 2)
94 #define snd_device(n) list_entry(n, struct snd_device, list)
141 struct mutex power_lock;
145 #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
146 struct snd_mixer_oss *mixer_oss;
147 int mixer_oss_change_count;
164 return card->power_state;
169 card->power_state =
state;
178 #define snd_power_lock(card) do { (void)(card); } while (0)
179 #define snd_power_unlock(card) do { (void)(card); } while (0)
180 static inline int snd_power_wait(
struct snd_card *
card,
unsigned int state) {
return 0; }
181 #define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; })
182 #define snd_power_change_state(card, state) do { (void)(card); } while (0)
241 snd_card_get_device_link(card));
249 #ifdef CONFIG_SND_OSSEMUL
250 int snd_register_oss_device(
int type,
struct snd_card *card,
int dev,
253 int snd_unregister_oss_device(
int type,
struct snd_card *card,
int dev);
254 void *snd_lookup_oss_minor_data(
unsigned int minor,
int type);
262 #ifdef CONFIG_SND_OSSEMUL
263 int snd_minor_info_oss_init(
void);
264 int snd_minor_info_oss_done(
void);
266 static inline int snd_minor_info_oss_init(
void) {
return 0; }
267 static inline int snd_minor_info_oss_done(
void) {
return 0; }
279 #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
280 #define SND_MIXER_OSS_NOTIFY_REGISTER 0
281 #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
282 #define SND_MIXER_OSS_NOTIFY_FREE 2
302 #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr))
317 #ifdef CONFIG_ISA_DMA_API
318 #define DMA_MODE_NO_ENABLE 0x0100
338 #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
343 #define __snd_printk(level, file, line, format, args...) \
344 printk(format, ##args)
354 #define snd_printk(fmt, args...) \
355 __snd_printk(0, __FILE__, __LINE__, fmt, ##args)
357 #ifdef CONFIG_SND_DEBUG
365 #define snd_printd(fmt, args...) \
366 __snd_printk(1, __FILE__, __LINE__, fmt, ##args)
367 #define _snd_printd(level, fmt, args...) \
368 __snd_printk(level, __FILE__, __LINE__, fmt, ##args)
376 #define snd_BUG() WARN(1, "BUG?\n")
393 #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond))
397 #define snd_printd(fmt, args...) do { } while (0)
398 #define _snd_printd(level, fmt, args...) do { } while (0)
399 #define snd_BUG() do { } while (0)
400 static inline int __snd_bug_on(
int cond)
404 #define snd_BUG_ON(cond) __snd_bug_on(0 && (cond))
408 #ifdef CONFIG_SND_DEBUG_VERBOSE
416 #define snd_printdd(format, args...) \
417 __snd_printk(2, __FILE__, __LINE__, format, ##args)
419 #define snd_printdd(format, args...) do { } while (0)
423 #define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0))
426 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
427 #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev))
428 #define gameport_set_port_data(gp,r) ((gp)->port_data = (r))
429 #define gameport_get_port_data(gp) (gp)->port_data
434 struct snd_pci_quirk {
437 unsigned short subdevice_mask;
439 #ifdef CONFIG_SND_DEBUG_VERBOSE
444 #define _SND_PCI_QUIRK_ID_MASK(vend, mask, dev) \
445 .subvendor = (vend), .subdevice = (dev), .subdevice_mask = (mask)
446 #define _SND_PCI_QUIRK_ID(vend, dev) \
447 _SND_PCI_QUIRK_ID_MASK(vend, 0xffff, dev)
448 #define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)}
449 #ifdef CONFIG_SND_DEBUG_VERBOSE
450 #define SND_PCI_QUIRK(vend,dev,xname,val) \
451 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)}
452 #define SND_PCI_QUIRK_VENDOR(vend, xname, val) \
453 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val), .name = (xname)}
454 #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \
455 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \
456 .value = (val), .name = (xname)}
458 #define SND_PCI_QUIRK(vend,dev,xname,val) \
459 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
460 #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \
461 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)}
462 #define SND_PCI_QUIRK_VENDOR(vend, xname, val) \
463 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)}
466 const struct snd_pci_quirk *
467 snd_pci_quirk_lookup(
struct pci_dev *pci,
const struct snd_pci_quirk *
list);
469 const struct snd_pci_quirk *
471 const struct snd_pci_quirk *
list);