diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 08:41:41 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 13:07:53 -0400 |
| commit | 816724e65c72a90a44fbad0ef0b59b186c85fa90 (patch) | |
| tree | 421fa29aedff988e392f92780637553e275d37a0 /include/sound | |
| parent | 70ac4385a13f78bc478f26d317511893741b05bd (diff) | |
| parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) | |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:
fs/nfs/inode.c
fs/super.c
Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch
'VFS: Permit filesystem to override root dentry on mount'
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/ac97_codec.h | 1 | ||||
| -rw-r--r-- | include/sound/asequencer.h | 4 | ||||
| -rw-r--r-- | include/sound/asound.h | 2 | ||||
| -rw-r--r-- | include/sound/core.h | 3 | ||||
| -rw-r--r-- | include/sound/emu10k1.h | 2 | ||||
| -rw-r--r-- | include/sound/info.h | 11 | ||||
| -rw-r--r-- | include/sound/mpu401.h | 14 | ||||
| -rw-r--r-- | include/sound/pcm.h | 19 | ||||
| -rw-r--r-- | include/sound/pcm_params.h | 125 | ||||
| -rw-r--r-- | include/sound/rawmidi.h | 3 | ||||
| -rw-r--r-- | include/sound/version.h | 4 |
11 files changed, 85 insertions, 103 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index b45a73712748..446afc3ea27f 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
| @@ -378,6 +378,7 @@ | |||
| 378 | #define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ | 378 | #define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ |
| 379 | #define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ | 379 | #define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ |
| 380 | #define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ | 380 | #define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ |
| 381 | #define AC97_HAS_NO_AUX (1<<18) /* no standard AC97 AUX volume and mute */ | ||
| 381 | 382 | ||
| 382 | /* rates indexes */ | 383 | /* rates indexes */ |
| 383 | #define AC97_RATES_FRONT_DAC 0 | 384 | #define AC97_RATES_FRONT_DAC 0 |
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h index 6691e4aa4ea7..3f2f4042a20d 100644 --- a/include/sound/asequencer.h +++ b/include/sound/asequencer.h | |||
| @@ -605,6 +605,10 @@ struct snd_seq_remove_events { | |||
| 605 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ | 605 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ |
| 606 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ | 606 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ |
| 607 | /*...*/ | 607 | /*...*/ |
| 608 | #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */ | ||
| 609 | #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */ | ||
| 610 | #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */ | ||
| 611 | #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */ | ||
| 608 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ | 612 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ |
| 609 | 613 | ||
| 610 | /* misc. conditioning flags */ | 614 | /* misc. conditioning flags */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 9cc021c7ee11..41885f48ad91 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -137,7 +137,7 @@ enum { | |||
| 137 | * * | 137 | * * |
| 138 | *****************************************************************************/ | 138 | *****************************************************************************/ |
| 139 | 139 | ||
| 140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) | 140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8) |
| 141 | 141 | ||
| 142 | typedef unsigned long snd_pcm_uframes_t; | 142 | typedef unsigned long snd_pcm_uframes_t; |
| 143 | typedef signed long snd_pcm_sframes_t; | 143 | typedef signed long snd_pcm_sframes_t; |
diff --git a/include/sound/core.h b/include/sound/core.h index 5135147f20e8..5d184be0ff72 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -233,9 +233,8 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size | |||
| 233 | 233 | ||
| 234 | /* init.c */ | 234 | /* init.c */ |
| 235 | 235 | ||
| 236 | extern unsigned int snd_cards_lock; | ||
| 237 | extern struct snd_card *snd_cards[SNDRV_CARDS]; | 236 | extern struct snd_card *snd_cards[SNDRV_CARDS]; |
| 238 | extern rwlock_t snd_card_rwlock; | 237 | int snd_card_locked(int card); |
| 239 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | 238 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) |
| 240 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 | 239 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 |
| 241 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 | 240 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 186e00ad9e79..884bbf54cd36 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
| @@ -245,6 +245,7 @@ | |||
| 245 | #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ | 245 | #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ |
| 246 | #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ | 246 | #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ |
| 247 | #define A_IOCFG_ENABLE_DIGITAL 0x0004 | 247 | #define A_IOCFG_ENABLE_DIGITAL 0x0004 |
| 248 | #define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080 | ||
| 248 | #define A_IOCFG_UNKNOWN_20 0x0020 | 249 | #define A_IOCFG_UNKNOWN_20 0x0020 |
| 249 | #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ | 250 | #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ |
| 250 | #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ | 251 | #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ |
| @@ -1065,6 +1066,7 @@ struct snd_emu_chip_details { | |||
| 1065 | unsigned char emu1212m; /* EMU 1212m card */ | 1066 | unsigned char emu1212m; /* EMU 1212m card */ |
| 1066 | unsigned char spi_dac; /* SPI interface for DAC */ | 1067 | unsigned char spi_dac; /* SPI interface for DAC */ |
| 1067 | unsigned char i2c_adc; /* I2C interface for ADC */ | 1068 | unsigned char i2c_adc; /* I2C interface for ADC */ |
| 1069 | unsigned char adc_1361t; /* Use Philips 1361T ADC */ | ||
| 1068 | const char *driver; | 1070 | const char *driver; |
| 1069 | const char *name; | 1071 | const char *name; |
| 1070 | const char *id; /* for backward compatibility - can be NULL if not needed */ | 1072 | const char *id; /* for backward compatibility - can be NULL if not needed */ |
diff --git a/include/sound/info.h b/include/sound/info.h index f23d8381c216..74f6996769c7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -27,9 +27,9 @@ | |||
| 27 | /* buffer for information */ | 27 | /* buffer for information */ |
| 28 | struct snd_info_buffer { | 28 | struct snd_info_buffer { |
| 29 | char *buffer; /* pointer to begin of buffer */ | 29 | char *buffer; /* pointer to begin of buffer */ |
| 30 | char *curr; /* current position in buffer */ | 30 | unsigned int curr; /* current position in buffer */ |
| 31 | unsigned long size; /* current size */ | 31 | unsigned int size; /* current size */ |
| 32 | unsigned long len; /* total length of buffer */ | 32 | unsigned int len; /* total length of buffer */ |
| 33 | int stop; /* stop flag */ | 33 | int stop; /* stop flag */ |
| 34 | int error; /* error code */ | 34 | int error; /* error code */ |
| 35 | }; | 35 | }; |
| @@ -40,8 +40,6 @@ struct snd_info_buffer { | |||
| 40 | struct snd_info_entry; | 40 | struct snd_info_entry; |
| 41 | 41 | ||
| 42 | struct snd_info_entry_text { | 42 | struct snd_info_entry_text { |
| 43 | unsigned long read_size; | ||
| 44 | unsigned long write_size; | ||
| 45 | void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); | 43 | void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); |
| 46 | void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); | 44 | void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); |
| 47 | }; | 45 | }; |
| @@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e | |||
| 132 | 130 | ||
| 133 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry, | 131 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry, |
| 134 | void *private_data, | 132 | void *private_data, |
| 135 | long read_size, | ||
| 136 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) | 133 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) |
| 137 | { | 134 | { |
| 138 | entry->private_data = private_data; | 135 | entry->private_data = private_data; |
| 139 | entry->c.text.read_size = read_size; | ||
| 140 | entry->c.text.read = read; | 136 | entry->c.text.read = read; |
| 141 | } | 137 | } |
| 142 | 138 | ||
| @@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name, | |||
| 167 | struct snd_info_entry **entryp) { return -EINVAL; } | 163 | struct snd_info_entry **entryp) { return -EINVAL; } |
| 168 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), | 164 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), |
| 169 | void *private_data, | 165 | void *private_data, |
| 170 | long read_size, | ||
| 171 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} | 166 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} |
| 172 | 167 | ||
| 173 | static inline int snd_info_check_reserved_words(const char *str) { return 1; } | 168 | static inline int snd_info_check_reserved_words(const char *str) { return 1; } |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 8e97ace78f16..ac504321ea56 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
| @@ -45,6 +45,12 @@ | |||
| 45 | #define MPU401_HW_PC98II 18 /* Roland PC98II */ | 45 | #define MPU401_HW_PC98II 18 /* Roland PC98II */ |
| 46 | #define MPU401_HW_AUREAL 19 /* Aureal Vortex */ | 46 | #define MPU401_HW_AUREAL 19 /* Aureal Vortex */ |
| 47 | 47 | ||
| 48 | #define MPU401_INFO_INPUT (1 << 0) /* input stream */ | ||
| 49 | #define MPU401_INFO_OUTPUT (1 << 1) /* output stream */ | ||
| 50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ | ||
| 51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ | ||
| 52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ | ||
| 53 | |||
| 48 | #define MPU401_MODE_BIT_INPUT 0 | 54 | #define MPU401_MODE_BIT_INPUT 0 |
| 49 | #define MPU401_MODE_BIT_OUTPUT 1 | 55 | #define MPU401_MODE_BIT_OUTPUT 1 |
| 50 | #define MPU401_MODE_BIT_INPUT_TRIGGER 2 | 56 | #define MPU401_MODE_BIT_INPUT_TRIGGER 2 |
| @@ -62,6 +68,7 @@ struct snd_mpu401 { | |||
| 62 | struct snd_rawmidi *rmidi; | 68 | struct snd_rawmidi *rmidi; |
| 63 | 69 | ||
| 64 | unsigned short hardware; /* MPU401_HW_XXXX */ | 70 | unsigned short hardware; /* MPU401_HW_XXXX */ |
| 71 | unsigned int info_flags; /* MPU401_INFO_XXX */ | ||
| 65 | unsigned long port; /* base port of MPU-401 chip */ | 72 | unsigned long port; /* base port of MPU-401 chip */ |
| 66 | unsigned long cport; /* port + 1 (usually) */ | 73 | unsigned long cport; /* port + 1 (usually) */ |
| 67 | struct resource *res; /* port resource */ | 74 | struct resource *res; /* port resource */ |
| @@ -99,13 +106,16 @@ struct snd_mpu401 { | |||
| 99 | 106 | ||
| 100 | */ | 107 | */ |
| 101 | 108 | ||
| 102 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 109 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, |
| 110 | struct pt_regs *regs); | ||
| 111 | irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id, | ||
| 112 | struct pt_regs *regs); | ||
| 103 | 113 | ||
| 104 | int snd_mpu401_uart_new(struct snd_card *card, | 114 | int snd_mpu401_uart_new(struct snd_card *card, |
| 105 | int device, | 115 | int device, |
| 106 | unsigned short hardware, | 116 | unsigned short hardware, |
| 107 | unsigned long port, | 117 | unsigned long port, |
| 108 | int integrated, | 118 | unsigned int info_flags, |
| 109 | int irq, | 119 | int irq, |
| 110 | int irq_flags, | 120 | int irq_flags, |
| 111 | struct snd_rawmidi ** rrawmidi); | 121 | struct snd_rawmidi ** rrawmidi); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 373425895faa..f84d84993a31 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -300,7 +300,6 @@ struct snd_pcm_runtime { | |||
| 300 | /* -- mmap -- */ | 300 | /* -- mmap -- */ |
| 301 | volatile struct snd_pcm_mmap_status *status; | 301 | volatile struct snd_pcm_mmap_status *status; |
| 302 | volatile struct snd_pcm_mmap_control *control; | 302 | volatile struct snd_pcm_mmap_control *control; |
| 303 | atomic_t mmap_count; | ||
| 304 | 303 | ||
| 305 | /* -- locking / scheduling -- */ | 304 | /* -- locking / scheduling -- */ |
| 306 | wait_queue_head_t sleep; | 305 | wait_queue_head_t sleep; |
| @@ -368,7 +367,9 @@ struct snd_pcm_substream { | |||
| 368 | struct snd_pcm_group *group; /* pointer to current group */ | 367 | struct snd_pcm_group *group; /* pointer to current group */ |
| 369 | /* -- assigned files -- */ | 368 | /* -- assigned files -- */ |
| 370 | void *file; | 369 | void *file; |
| 371 | struct file *ffile; | 370 | int ref_count; |
| 371 | atomic_t mmap_count; | ||
| 372 | unsigned int f_flags; | ||
| 372 | void (*pcm_release)(struct snd_pcm_substream *); | 373 | void (*pcm_release)(struct snd_pcm_substream *); |
| 373 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 374 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
| 374 | /* -- OSS things -- */ | 375 | /* -- OSS things -- */ |
| @@ -387,7 +388,7 @@ struct snd_pcm_substream { | |||
| 387 | unsigned int hw_opened: 1; | 388 | unsigned int hw_opened: 1; |
| 388 | }; | 389 | }; |
| 389 | 390 | ||
| 390 | #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) | 391 | #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) |
| 391 | 392 | ||
| 392 | 393 | ||
| 393 | struct snd_pcm_str { | 394 | struct snd_pcm_str { |
| @@ -825,14 +826,6 @@ int snd_interval_ratnum(struct snd_interval *i, | |||
| 825 | 826 | ||
| 826 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); | 827 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); |
| 827 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); | 828 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); |
| 828 | int snd_pcm_hw_param_near(struct snd_pcm_substream *substream, | ||
| 829 | struct snd_pcm_hw_params *params, | ||
| 830 | snd_pcm_hw_param_t var, | ||
| 831 | unsigned int val, int *dir); | ||
| 832 | int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, | ||
| 833 | struct snd_pcm_hw_params *params, | ||
| 834 | snd_pcm_hw_param_t var, | ||
| 835 | unsigned int val, int dir); | ||
| 836 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); | 829 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
| 837 | 830 | ||
| 838 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); | 831 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
| @@ -979,13 +972,13 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigne | |||
| 979 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 972 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
| 980 | { | 973 | { |
| 981 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; | 974 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
| 982 | atomic_inc(&substream->runtime->mmap_count); | 975 | atomic_inc(&substream->mmap_count); |
| 983 | } | 976 | } |
| 984 | 977 | ||
| 985 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | 978 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) |
| 986 | { | 979 | { |
| 987 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; | 980 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
| 988 | atomic_dec(&substream->runtime->mmap_count); | 981 | atomic_dec(&substream->mmap_count); |
| 989 | } | 982 | } |
| 990 | 983 | ||
| 991 | /* mmap for io-memory area */ | 984 | /* mmap for io-memory area */ |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index fb18aef77341..85cf1cf4f31a 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
| @@ -22,29 +22,21 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, | 25 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, |
| 26 | snd_pcm_hw_param_t var, const struct snd_mask *val); | 26 | struct snd_pcm_hw_params *params, |
| 27 | extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, | 27 | snd_pcm_hw_param_t var, int *dir); |
| 28 | snd_pcm_hw_param_t var, int *dir); | 28 | int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, |
| 29 | extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, | 29 | struct snd_pcm_hw_params *params, |
| 30 | snd_pcm_hw_param_t var, int *dir); | 30 | snd_pcm_hw_param_t var, int *dir); |
| 31 | extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, | 31 | int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, |
| 32 | snd_pcm_hw_param_t var, unsigned int val, int dir); | 32 | snd_pcm_hw_param_t var, int *dir); |
| 33 | extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params, | ||
| 34 | snd_pcm_hw_param_t var); | ||
| 35 | extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params, | ||
| 36 | snd_pcm_hw_param_t var, unsigned int val, int dir); | ||
| 37 | |||
| 38 | /* To share the same code we have alsa-lib */ | ||
| 39 | #define INLINE static inline | ||
| 40 | #define assert(a) (void)(a) | ||
| 41 | 33 | ||
| 42 | #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ | 34 | #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ |
| 43 | #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) | 35 | #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) |
| 44 | #define MASK_OFS(i) ((i) >> 5) | 36 | #define MASK_OFS(i) ((i) >> 5) |
| 45 | #define MASK_BIT(i) (1U << ((i) & 31)) | 37 | #define MASK_BIT(i) (1U << ((i) & 31)) |
| 46 | 38 | ||
| 47 | INLINE unsigned int ld2(u_int32_t v) | 39 | static inline unsigned int ld2(u_int32_t v) |
| 48 | { | 40 | { |
| 49 | unsigned r = 0; | 41 | unsigned r = 0; |
| 50 | 42 | ||
| @@ -69,22 +61,22 @@ INLINE unsigned int ld2(u_int32_t v) | |||
| 69 | return r; | 61 | return r; |
| 70 | } | 62 | } |
| 71 | 63 | ||
| 72 | INLINE size_t snd_mask_sizeof(void) | 64 | static inline size_t snd_mask_sizeof(void) |
| 73 | { | 65 | { |
| 74 | return sizeof(struct snd_mask); | 66 | return sizeof(struct snd_mask); |
| 75 | } | 67 | } |
| 76 | 68 | ||
| 77 | INLINE void snd_mask_none(struct snd_mask *mask) | 69 | static inline void snd_mask_none(struct snd_mask *mask) |
| 78 | { | 70 | { |
| 79 | memset(mask, 0, sizeof(*mask)); | 71 | memset(mask, 0, sizeof(*mask)); |
| 80 | } | 72 | } |
| 81 | 73 | ||
| 82 | INLINE void snd_mask_any(struct snd_mask *mask) | 74 | static inline void snd_mask_any(struct snd_mask *mask) |
| 83 | { | 75 | { |
| 84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 76 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
| 85 | } | 77 | } |
| 86 | 78 | ||
| 87 | INLINE int snd_mask_empty(const struct snd_mask *mask) | 79 | static inline int snd_mask_empty(const struct snd_mask *mask) |
| 88 | { | 80 | { |
| 89 | int i; | 81 | int i; |
| 90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 82 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
| @@ -93,10 +85,9 @@ INLINE int snd_mask_empty(const struct snd_mask *mask) | |||
| 93 | return 1; | 85 | return 1; |
| 94 | } | 86 | } |
| 95 | 87 | ||
| 96 | INLINE unsigned int snd_mask_min(const struct snd_mask *mask) | 88 | static inline unsigned int snd_mask_min(const struct snd_mask *mask) |
| 97 | { | 89 | { |
| 98 | int i; | 90 | int i; |
| 99 | assert(!snd_mask_empty(mask)); | ||
| 100 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { | 91 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { |
| 101 | if (mask->bits[i]) | 92 | if (mask->bits[i]) |
| 102 | return ffs(mask->bits[i]) - 1 + (i << 5); | 93 | return ffs(mask->bits[i]) - 1 + (i << 5); |
| @@ -104,10 +95,9 @@ INLINE unsigned int snd_mask_min(const struct snd_mask *mask) | |||
| 104 | return 0; | 95 | return 0; |
| 105 | } | 96 | } |
| 106 | 97 | ||
| 107 | INLINE unsigned int snd_mask_max(const struct snd_mask *mask) | 98 | static inline unsigned int snd_mask_max(const struct snd_mask *mask) |
| 108 | { | 99 | { |
| 109 | int i; | 100 | int i; |
| 110 | assert(!snd_mask_empty(mask)); | ||
| 111 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { | 101 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { |
| 112 | if (mask->bits[i]) | 102 | if (mask->bits[i]) |
| 113 | return ld2(mask->bits[i]) + (i << 5); | 103 | return ld2(mask->bits[i]) + (i << 5); |
| @@ -115,70 +105,68 @@ INLINE unsigned int snd_mask_max(const struct snd_mask *mask) | |||
| 115 | return 0; | 105 | return 0; |
| 116 | } | 106 | } |
| 117 | 107 | ||
| 118 | INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) | 108 | static inline void snd_mask_set(struct snd_mask *mask, unsigned int val) |
| 119 | { | 109 | { |
| 120 | assert(val <= SNDRV_MASK_BITS); | ||
| 121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); | 110 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); |
| 122 | } | 111 | } |
| 123 | 112 | ||
| 124 | INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) | 113 | static inline void snd_mask_reset(struct snd_mask *mask, unsigned int val) |
| 125 | { | 114 | { |
| 126 | assert(val <= SNDRV_MASK_BITS); | ||
| 127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); | 115 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); |
| 128 | } | 116 | } |
| 129 | 117 | ||
| 130 | INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) | 118 | static inline void snd_mask_set_range(struct snd_mask *mask, |
| 119 | unsigned int from, unsigned int to) | ||
| 131 | { | 120 | { |
| 132 | unsigned int i; | 121 | unsigned int i; |
| 133 | assert(to <= SNDRV_MASK_BITS && from <= to); | ||
| 134 | for (i = from; i <= to; i++) | 122 | for (i = from; i <= to; i++) |
| 135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); | 123 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); |
| 136 | } | 124 | } |
| 137 | 125 | ||
| 138 | INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) | 126 | static inline void snd_mask_reset_range(struct snd_mask *mask, |
| 127 | unsigned int from, unsigned int to) | ||
| 139 | { | 128 | { |
| 140 | unsigned int i; | 129 | unsigned int i; |
| 141 | assert(to <= SNDRV_MASK_BITS && from <= to); | ||
| 142 | for (i = from; i <= to; i++) | 130 | for (i = from; i <= to; i++) |
| 143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); | 131 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); |
| 144 | } | 132 | } |
| 145 | 133 | ||
| 146 | INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) | 134 | static inline void snd_mask_leave(struct snd_mask *mask, unsigned int val) |
| 147 | { | 135 | { |
| 148 | unsigned int v; | 136 | unsigned int v; |
| 149 | assert(val <= SNDRV_MASK_BITS); | ||
| 150 | v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 137 | v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
| 151 | snd_mask_none(mask); | 138 | snd_mask_none(mask); |
| 152 | mask->bits[MASK_OFS(val)] = v; | 139 | mask->bits[MASK_OFS(val)] = v; |
| 153 | } | 140 | } |
| 154 | 141 | ||
| 155 | INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) | 142 | static inline void snd_mask_intersect(struct snd_mask *mask, |
| 143 | const struct snd_mask *v) | ||
| 156 | { | 144 | { |
| 157 | int i; | 145 | int i; |
| 158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 146 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
| 159 | mask->bits[i] &= v->bits[i]; | 147 | mask->bits[i] &= v->bits[i]; |
| 160 | } | 148 | } |
| 161 | 149 | ||
| 162 | INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) | 150 | static inline int snd_mask_eq(const struct snd_mask *mask, |
| 151 | const struct snd_mask *v) | ||
| 163 | { | 152 | { |
| 164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 153 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
| 165 | } | 154 | } |
| 166 | 155 | ||
| 167 | INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) | 156 | static inline void snd_mask_copy(struct snd_mask *mask, |
| 157 | const struct snd_mask *v) | ||
| 168 | { | 158 | { |
| 169 | *mask = *v; | 159 | *mask = *v; |
| 170 | } | 160 | } |
| 171 | 161 | ||
| 172 | INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) | 162 | static inline int snd_mask_test(const struct snd_mask *mask, unsigned int val) |
| 173 | { | 163 | { |
| 174 | assert(val <= SNDRV_MASK_BITS); | ||
| 175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 164 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
| 176 | } | 165 | } |
| 177 | 166 | ||
| 178 | INLINE int snd_mask_single(const struct snd_mask *mask) | 167 | static inline int snd_mask_single(const struct snd_mask *mask) |
| 179 | { | 168 | { |
| 180 | int i, c = 0; | 169 | int i, c = 0; |
| 181 | assert(!snd_mask_empty(mask)); | ||
| 182 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { | 170 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { |
| 183 | if (! mask->bits[i]) | 171 | if (! mask->bits[i]) |
| 184 | continue; | 172 | continue; |
| @@ -191,10 +179,10 @@ INLINE int snd_mask_single(const struct snd_mask *mask) | |||
| 191 | return 1; | 179 | return 1; |
| 192 | } | 180 | } |
| 193 | 181 | ||
| 194 | INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) | 182 | static inline int snd_mask_refine(struct snd_mask *mask, |
| 183 | const struct snd_mask *v) | ||
| 195 | { | 184 | { |
| 196 | struct snd_mask old; | 185 | struct snd_mask old; |
| 197 | assert(!snd_mask_empty(mask)); | ||
| 198 | snd_mask_copy(&old, mask); | 186 | snd_mask_copy(&old, mask); |
| 199 | snd_mask_intersect(mask, v); | 187 | snd_mask_intersect(mask, v); |
| 200 | if (snd_mask_empty(mask)) | 188 | if (snd_mask_empty(mask)) |
| @@ -202,27 +190,24 @@ INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) | |||
| 202 | return !snd_mask_eq(mask, &old); | 190 | return !snd_mask_eq(mask, &old); |
| 203 | } | 191 | } |
| 204 | 192 | ||
| 205 | INLINE int snd_mask_refine_first(struct snd_mask *mask) | 193 | static inline int snd_mask_refine_first(struct snd_mask *mask) |
| 206 | { | 194 | { |
| 207 | assert(!snd_mask_empty(mask)); | ||
| 208 | if (snd_mask_single(mask)) | 195 | if (snd_mask_single(mask)) |
| 209 | return 0; | 196 | return 0; |
| 210 | snd_mask_leave(mask, snd_mask_min(mask)); | 197 | snd_mask_leave(mask, snd_mask_min(mask)); |
| 211 | return 1; | 198 | return 1; |
| 212 | } | 199 | } |
| 213 | 200 | ||
| 214 | INLINE int snd_mask_refine_last(struct snd_mask *mask) | 201 | static inline int snd_mask_refine_last(struct snd_mask *mask) |
| 215 | { | 202 | { |
| 216 | assert(!snd_mask_empty(mask)); | ||
| 217 | if (snd_mask_single(mask)) | 203 | if (snd_mask_single(mask)) |
| 218 | return 0; | 204 | return 0; |
| 219 | snd_mask_leave(mask, snd_mask_max(mask)); | 205 | snd_mask_leave(mask, snd_mask_max(mask)); |
| 220 | return 1; | 206 | return 1; |
| 221 | } | 207 | } |
| 222 | 208 | ||
| 223 | INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) | 209 | static inline int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) |
| 224 | { | 210 | { |
| 225 | assert(!snd_mask_empty(mask)); | ||
| 226 | if (snd_mask_min(mask) >= val) | 211 | if (snd_mask_min(mask) >= val) |
| 227 | return 0; | 212 | return 0; |
| 228 | snd_mask_reset_range(mask, 0, val - 1); | 213 | snd_mask_reset_range(mask, 0, val - 1); |
| @@ -231,9 +216,8 @@ INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) | |||
| 231 | return 1; | 216 | return 1; |
| 232 | } | 217 | } |
| 233 | 218 | ||
| 234 | INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) | 219 | static inline int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) |
| 235 | { | 220 | { |
| 236 | assert(!snd_mask_empty(mask)); | ||
| 237 | if (snd_mask_max(mask) <= val) | 221 | if (snd_mask_max(mask) <= val) |
| 238 | return 0; | 222 | return 0; |
| 239 | snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); | 223 | snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); |
| @@ -242,10 +226,9 @@ INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) | |||
| 242 | return 1; | 226 | return 1; |
| 243 | } | 227 | } |
| 244 | 228 | ||
| 245 | INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) | 229 | static inline int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) |
| 246 | { | 230 | { |
| 247 | int changed; | 231 | int changed; |
| 248 | assert(!snd_mask_empty(mask)); | ||
| 249 | changed = !snd_mask_single(mask); | 232 | changed = !snd_mask_single(mask); |
| 250 | snd_mask_leave(mask, val); | 233 | snd_mask_leave(mask, val); |
| 251 | if (snd_mask_empty(mask)) | 234 | if (snd_mask_empty(mask)) |
| @@ -253,13 +236,12 @@ INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) | |||
| 253 | return changed; | 236 | return changed; |
| 254 | } | 237 | } |
| 255 | 238 | ||
| 256 | INLINE int snd_mask_value(const struct snd_mask *mask) | 239 | static inline int snd_mask_value(const struct snd_mask *mask) |
| 257 | { | 240 | { |
| 258 | assert(!snd_mask_empty(mask)); | ||
| 259 | return snd_mask_min(mask); | 241 | return snd_mask_min(mask); |
| 260 | } | 242 | } |
| 261 | 243 | ||
| 262 | INLINE void snd_interval_any(struct snd_interval *i) | 244 | static inline void snd_interval_any(struct snd_interval *i) |
| 263 | { | 245 | { |
| 264 | i->min = 0; | 246 | i->min = 0; |
| 265 | i->openmin = 0; | 247 | i->openmin = 0; |
| @@ -269,63 +251,59 @@ INLINE void snd_interval_any(struct snd_interval *i) | |||
| 269 | i->empty = 0; | 251 | i->empty = 0; |
| 270 | } | 252 | } |
| 271 | 253 | ||
| 272 | INLINE void snd_interval_none(struct snd_interval *i) | 254 | static inline void snd_interval_none(struct snd_interval *i) |
| 273 | { | 255 | { |
| 274 | i->empty = 1; | 256 | i->empty = 1; |
| 275 | } | 257 | } |
| 276 | 258 | ||
| 277 | INLINE int snd_interval_checkempty(const struct snd_interval *i) | 259 | static inline int snd_interval_checkempty(const struct snd_interval *i) |
| 278 | { | 260 | { |
| 279 | return (i->min > i->max || | 261 | return (i->min > i->max || |
| 280 | (i->min == i->max && (i->openmin || i->openmax))); | 262 | (i->min == i->max && (i->openmin || i->openmax))); |
| 281 | } | 263 | } |
| 282 | 264 | ||
| 283 | INLINE int snd_interval_empty(const struct snd_interval *i) | 265 | static inline int snd_interval_empty(const struct snd_interval *i) |
| 284 | { | 266 | { |
| 285 | return i->empty; | 267 | return i->empty; |
| 286 | } | 268 | } |
| 287 | 269 | ||
| 288 | INLINE int snd_interval_single(const struct snd_interval *i) | 270 | static inline int snd_interval_single(const struct snd_interval *i) |
| 289 | { | 271 | { |
| 290 | assert(!snd_interval_empty(i)); | ||
| 291 | return (i->min == i->max || | 272 | return (i->min == i->max || |
| 292 | (i->min + 1 == i->max && i->openmax)); | 273 | (i->min + 1 == i->max && i->openmax)); |
| 293 | } | 274 | } |
| 294 | 275 | ||
| 295 | INLINE int snd_interval_value(const struct snd_interval *i) | 276 | static inline int snd_interval_value(const struct snd_interval *i) |
| 296 | { | 277 | { |
| 297 | assert(snd_interval_single(i)); | ||
| 298 | return i->min; | 278 | return i->min; |
| 299 | } | 279 | } |
| 300 | 280 | ||
| 301 | INLINE int snd_interval_min(const struct snd_interval *i) | 281 | static inline int snd_interval_min(const struct snd_interval *i) |
| 302 | { | 282 | { |
| 303 | assert(!snd_interval_empty(i)); | ||
| 304 | return i->min; | 283 | return i->min; |
| 305 | } | 284 | } |
| 306 | 285 | ||
| 307 | INLINE int snd_interval_max(const struct snd_interval *i) | 286 | static inline int snd_interval_max(const struct snd_interval *i) |
| 308 | { | 287 | { |
| 309 | unsigned int v; | 288 | unsigned int v; |
| 310 | assert(!snd_interval_empty(i)); | ||
| 311 | v = i->max; | 289 | v = i->max; |
| 312 | if (i->openmax) | 290 | if (i->openmax) |
| 313 | v--; | 291 | v--; |
| 314 | return v; | 292 | return v; |
| 315 | } | 293 | } |
| 316 | 294 | ||
| 317 | INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) | 295 | static inline int snd_interval_test(const struct snd_interval *i, unsigned int val) |
| 318 | { | 296 | { |
| 319 | return !((i->min > val || (i->min == val && i->openmin) || | 297 | return !((i->min > val || (i->min == val && i->openmin) || |
| 320 | i->max < val || (i->max == val && i->openmax))); | 298 | i->max < val || (i->max == val && i->openmax))); |
| 321 | } | 299 | } |
| 322 | 300 | ||
| 323 | INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) | 301 | static inline void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) |
| 324 | { | 302 | { |
| 325 | *d = *s; | 303 | *d = *s; |
| 326 | } | 304 | } |
| 327 | 305 | ||
| 328 | INLINE int snd_interval_setinteger(struct snd_interval *i) | 306 | static inline int snd_interval_setinteger(struct snd_interval *i) |
| 329 | { | 307 | { |
| 330 | if (i->integer) | 308 | if (i->integer) |
| 331 | return 0; | 309 | return 0; |
| @@ -335,7 +313,7 @@ INLINE int snd_interval_setinteger(struct snd_interval *i) | |||
| 335 | return 1; | 313 | return 1; |
| 336 | } | 314 | } |
| 337 | 315 | ||
| 338 | INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) | 316 | static inline int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) |
| 339 | { | 317 | { |
| 340 | if (i1->empty) | 318 | if (i1->empty) |
| 341 | return i2->empty; | 319 | return i2->empty; |
| @@ -359,8 +337,5 @@ static inline unsigned int sub(unsigned int a, unsigned int b) | |||
| 359 | return 0; | 337 | return 0; |
| 360 | } | 338 | } |
| 361 | 339 | ||
| 362 | #undef INLINE | ||
| 363 | #undef assert | ||
| 364 | |||
| 365 | #endif /* __SOUND_PCM_PARAMS_H */ | 340 | #endif /* __SOUND_PCM_PARAMS_H */ |
| 366 | 341 | ||
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 584e73dd4793..7dbcd10fa215 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | struct snd_rawmidi; | 47 | struct snd_rawmidi; |
| 48 | struct snd_rawmidi_substream; | 48 | struct snd_rawmidi_substream; |
| 49 | struct snd_seq_port_info; | ||
| 49 | 50 | ||
| 50 | struct snd_rawmidi_ops { | 51 | struct snd_rawmidi_ops { |
| 51 | int (*open) (struct snd_rawmidi_substream * substream); | 52 | int (*open) (struct snd_rawmidi_substream * substream); |
| @@ -57,6 +58,8 @@ struct snd_rawmidi_ops { | |||
| 57 | struct snd_rawmidi_global_ops { | 58 | struct snd_rawmidi_global_ops { |
| 58 | int (*dev_register) (struct snd_rawmidi * rmidi); | 59 | int (*dev_register) (struct snd_rawmidi * rmidi); |
| 59 | int (*dev_unregister) (struct snd_rawmidi * rmidi); | 60 | int (*dev_unregister) (struct snd_rawmidi * rmidi); |
| 61 | void (*get_port_info)(struct snd_rawmidi *rmidi, int number, | ||
| 62 | struct snd_seq_port_info *info); | ||
| 60 | }; | 63 | }; |
| 61 | 64 | ||
| 62 | struct snd_rawmidi_runtime { | 65 | struct snd_rawmidi_runtime { |
diff --git a/include/sound/version.h b/include/sound/version.h index 4f0e65808cf1..2ee849d0e198 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h. Generated by configure. */ | 1 | /* include/version.h. Generated by configure. */ |
| 2 | #define CONFIG_SND_VERSION "1.0.11rc4" | 2 | #define CONFIG_SND_VERSION "1.0.12rc1" |
| 3 | #define CONFIG_SND_DATE " (Wed Mar 22 10:27:24 2006 UTC)" | 3 | #define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)" |
