diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 07:59:38 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:43 -0500 |
commit | 877211f5e1b1196179ba1290e8e1a3dc00427c55 (patch) | |
tree | 9964e0e46043cee6c76a614ac35ab982faba7f99 /include/sound | |
parent | 24c1f93188b4438c7f30df5b4cd78340cdb28daf (diff) |
[ALSA] Remove xxx_t typedefs: PCM
Modules: PCM Midlevel
Remove xxx_t typedefs from the core PCM codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/pcm-indirect.h | 28 | ||||
-rw-r--r-- | include/sound/pcm.h | 477 | ||||
-rw-r--r-- | include/sound/pcm_params.h | 86 |
3 files changed, 284 insertions, 307 deletions
diff --git a/include/sound/pcm-indirect.h b/include/sound/pcm-indirect.h index 31fa7a54508a..7003d7702e26 100644 --- a/include/sound/pcm-indirect.h +++ b/include/sound/pcm-indirect.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <sound/pcm.h> | 25 | #include <sound/pcm.h> |
26 | 26 | ||
27 | typedef struct sndrv_pcm_indirect { | 27 | struct snd_pcm_indirect { |
28 | unsigned int hw_buffer_size; /* Byte size of hardware buffer */ | 28 | unsigned int hw_buffer_size; /* Byte size of hardware buffer */ |
29 | unsigned int hw_queue_size; /* Max queue size of hw buffer (0 = buffer size) */ | 29 | unsigned int hw_queue_size; /* Max queue size of hw buffer (0 = buffer size) */ |
30 | unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */ | 30 | unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */ |
@@ -35,20 +35,20 @@ typedef struct sndrv_pcm_indirect { | |||
35 | unsigned int sw_io; /* Current software pointer in bytes */ | 35 | unsigned int sw_io; /* Current software pointer in bytes */ |
36 | int sw_ready; /* Bytes ready to be transferred to/from hw */ | 36 | int sw_ready; /* Bytes ready to be transferred to/from hw */ |
37 | snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */ | 37 | snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */ |
38 | } snd_pcm_indirect_t; | 38 | }; |
39 | 39 | ||
40 | typedef void (*snd_pcm_indirect_copy_t)(snd_pcm_substream_t *substream, | 40 | typedef void (*snd_pcm_indirect_copy_t)(struct snd_pcm_substream *substream, |
41 | snd_pcm_indirect_t *rec, size_t bytes); | 41 | struct snd_pcm_indirect *rec, size_t bytes); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * helper function for playback ack callback | 44 | * helper function for playback ack callback |
45 | */ | 45 | */ |
46 | static inline void | 46 | static inline void |
47 | snd_pcm_indirect_playback_transfer(snd_pcm_substream_t *substream, | 47 | snd_pcm_indirect_playback_transfer(struct snd_pcm_substream *substream, |
48 | snd_pcm_indirect_t *rec, | 48 | struct snd_pcm_indirect *rec, |
49 | snd_pcm_indirect_copy_t copy) | 49 | snd_pcm_indirect_copy_t copy) |
50 | { | 50 | { |
51 | snd_pcm_runtime_t *runtime = substream->runtime; | 51 | struct snd_pcm_runtime *runtime = substream->runtime; |
52 | snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; | 52 | snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; |
53 | snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; | 53 | snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; |
54 | int qsize; | 54 | int qsize; |
@@ -89,8 +89,8 @@ snd_pcm_indirect_playback_transfer(snd_pcm_substream_t *substream, | |||
89 | * ptr = current byte pointer | 89 | * ptr = current byte pointer |
90 | */ | 90 | */ |
91 | static inline snd_pcm_uframes_t | 91 | static inline snd_pcm_uframes_t |
92 | snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream, | 92 | snd_pcm_indirect_playback_pointer(struct snd_pcm_substream *substream, |
93 | snd_pcm_indirect_t *rec, unsigned int ptr) | 93 | struct snd_pcm_indirect *rec, unsigned int ptr) |
94 | { | 94 | { |
95 | int bytes = ptr - rec->hw_io; | 95 | int bytes = ptr - rec->hw_io; |
96 | if (bytes < 0) | 96 | if (bytes < 0) |
@@ -110,11 +110,11 @@ snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream, | |||
110 | * helper function for capture ack callback | 110 | * helper function for capture ack callback |
111 | */ | 111 | */ |
112 | static inline void | 112 | static inline void |
113 | snd_pcm_indirect_capture_transfer(snd_pcm_substream_t *substream, | 113 | snd_pcm_indirect_capture_transfer(struct snd_pcm_substream *substream, |
114 | snd_pcm_indirect_t *rec, | 114 | struct snd_pcm_indirect *rec, |
115 | snd_pcm_indirect_copy_t copy) | 115 | snd_pcm_indirect_copy_t copy) |
116 | { | 116 | { |
117 | snd_pcm_runtime_t *runtime = substream->runtime; | 117 | struct snd_pcm_runtime *runtime = substream->runtime; |
118 | snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; | 118 | snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; |
119 | snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; | 119 | snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; |
120 | 120 | ||
@@ -154,8 +154,8 @@ snd_pcm_indirect_capture_transfer(snd_pcm_substream_t *substream, | |||
154 | * ptr = current byte pointer | 154 | * ptr = current byte pointer |
155 | */ | 155 | */ |
156 | static inline snd_pcm_uframes_t | 156 | static inline snd_pcm_uframes_t |
157 | snd_pcm_indirect_capture_pointer(snd_pcm_substream_t *substream, | 157 | snd_pcm_indirect_capture_pointer(struct snd_pcm_substream *substream, |
158 | snd_pcm_indirect_t *rec, unsigned int ptr) | 158 | struct snd_pcm_indirect *rec, unsigned int ptr) |
159 | { | 159 | { |
160 | int qsize; | 160 | int qsize; |
161 | int bytes = ptr - rec->hw_io; | 161 | int bytes = ptr - rec->hw_io; |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index acc4fa9d5abe..7e77c0add80a 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -28,36 +28,9 @@ | |||
28 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
29 | #include <linux/bitops.h> | 29 | #include <linux/bitops.h> |
30 | 30 | ||
31 | typedef sndrv_pcm_uframes_t snd_pcm_uframes_t; | ||
32 | typedef sndrv_pcm_sframes_t snd_pcm_sframes_t; | ||
33 | typedef enum sndrv_pcm_class snd_pcm_class_t; | ||
34 | typedef enum sndrv_pcm_subclass snd_pcm_subclass_t; | ||
35 | typedef enum sndrv_pcm_stream snd_pcm_stream_t; | ||
36 | typedef enum sndrv_pcm_access snd_pcm_access_t; | ||
37 | typedef enum sndrv_pcm_format snd_pcm_format_t; | ||
38 | typedef enum sndrv_pcm_subformat snd_pcm_subformat_t; | ||
39 | typedef enum sndrv_pcm_state snd_pcm_state_t; | ||
40 | typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t; | ||
41 | typedef struct sndrv_pcm_info snd_pcm_info_t; | ||
42 | typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t; | ||
43 | typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t; | ||
44 | typedef enum sndrv_pcm_start snd_pcm_start_t; | ||
45 | typedef enum sndrv_pcm_xrun snd_pcm_xrun_t; | ||
46 | typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t; | ||
47 | typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t; | ||
48 | typedef struct sndrv_pcm_channel_info snd_pcm_channel_info_t; | ||
49 | typedef struct sndrv_pcm_status snd_pcm_status_t; | ||
50 | typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t; | ||
51 | typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t; | ||
52 | typedef struct sndrv_mask snd_mask_t; | ||
53 | typedef struct snd_sg_buf snd_pcm_sgbuf_t; | ||
54 | |||
55 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) | 31 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) |
56 | #define snd_pcm_chip(pcm) ((pcm)->private_data) | 32 | #define snd_pcm_chip(pcm) ((pcm)->private_data) |
57 | 33 | ||
58 | typedef struct _snd_pcm_file snd_pcm_file_t; | ||
59 | typedef struct _snd_pcm_runtime snd_pcm_runtime_t; | ||
60 | |||
61 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 34 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
62 | #include "pcm_oss.h" | 35 | #include "pcm_oss.h" |
63 | #endif | 36 | #endif |
@@ -66,7 +39,7 @@ typedef struct _snd_pcm_runtime snd_pcm_runtime_t; | |||
66 | * Hardware (lowlevel) section | 39 | * Hardware (lowlevel) section |
67 | */ | 40 | */ |
68 | 41 | ||
69 | typedef struct _snd_pcm_hardware { | 42 | struct snd_pcm_hardware { |
70 | unsigned int info; /* SNDRV_PCM_INFO_* */ | 43 | unsigned int info; /* SNDRV_PCM_INFO_* */ |
71 | u64 formats; /* SNDRV_PCM_FMTBIT_* */ | 44 | u64 formats; /* SNDRV_PCM_FMTBIT_* */ |
72 | unsigned int rates; /* SNDRV_PCM_RATE_* */ | 45 | unsigned int rates; /* SNDRV_PCM_RATE_* */ |
@@ -80,26 +53,29 @@ typedef struct _snd_pcm_hardware { | |||
80 | unsigned int periods_min; /* min # of periods */ | 53 | unsigned int periods_min; /* min # of periods */ |
81 | unsigned int periods_max; /* max # of periods */ | 54 | unsigned int periods_max; /* max # of periods */ |
82 | size_t fifo_size; /* fifo size in bytes */ | 55 | size_t fifo_size; /* fifo size in bytes */ |
83 | } snd_pcm_hardware_t; | 56 | }; |
84 | 57 | ||
85 | typedef struct _snd_pcm_ops { | 58 | struct snd_pcm_ops { |
86 | int (*open)(snd_pcm_substream_t *substream); | 59 | int (*open)(struct snd_pcm_substream *substream); |
87 | int (*close)(snd_pcm_substream_t *substream); | 60 | int (*close)(struct snd_pcm_substream *substream); |
88 | int (*ioctl)(snd_pcm_substream_t * substream, | 61 | int (*ioctl)(struct snd_pcm_substream * substream, |
89 | unsigned int cmd, void *arg); | 62 | unsigned int cmd, void *arg); |
90 | int (*hw_params)(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * params); | 63 | int (*hw_params)(struct snd_pcm_substream *substream, |
91 | int (*hw_free)(snd_pcm_substream_t *substream); | 64 | struct snd_pcm_hw_params *params); |
92 | int (*prepare)(snd_pcm_substream_t * substream); | 65 | int (*hw_free)(struct snd_pcm_substream *substream); |
93 | int (*trigger)(snd_pcm_substream_t * substream, int cmd); | 66 | int (*prepare)(struct snd_pcm_substream *substream); |
94 | snd_pcm_uframes_t (*pointer)(snd_pcm_substream_t * substream); | 67 | int (*trigger)(struct snd_pcm_substream *substream, int cmd); |
95 | int (*copy)(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t pos, | 68 | snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); |
69 | int (*copy)(struct snd_pcm_substream *substream, int channel, | ||
70 | snd_pcm_uframes_t pos, | ||
96 | void __user *buf, snd_pcm_uframes_t count); | 71 | void __user *buf, snd_pcm_uframes_t count); |
97 | int (*silence)(snd_pcm_substream_t *substream, int channel, | 72 | int (*silence)(struct snd_pcm_substream *substream, int channel, |
98 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count); | 73 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count); |
99 | struct page *(*page)(snd_pcm_substream_t *substream, unsigned long offset); | 74 | struct page *(*page)(struct snd_pcm_substream *substream, |
100 | int (*mmap)(snd_pcm_substream_t *substream, struct vm_area_struct *vma); | 75 | unsigned long offset); |
101 | int (*ack)(snd_pcm_substream_t *substream); | 76 | int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); |
102 | } snd_pcm_ops_t; | 77 | int (*ack)(struct snd_pcm_substream *substream); |
78 | }; | ||
103 | 79 | ||
104 | /* | 80 | /* |
105 | * | 81 | * |
@@ -212,17 +188,16 @@ typedef struct _snd_pcm_ops { | |||
212 | #define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE | 188 | #define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE |
213 | #endif | 189 | #endif |
214 | 190 | ||
215 | struct _snd_pcm_file { | 191 | struct snd_pcm_file { |
216 | snd_pcm_substream_t * substream; | 192 | struct snd_pcm_substream *substream; |
217 | struct _snd_pcm_file * next; | 193 | struct snd_pcm_file *next; |
218 | }; | 194 | }; |
219 | 195 | ||
220 | typedef struct _snd_pcm_hw_rule snd_pcm_hw_rule_t; | 196 | struct snd_pcm_hw_rule; |
197 | typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params, | ||
198 | struct snd_pcm_hw_rule *rule); | ||
221 | 199 | ||
222 | typedef int (*snd_pcm_hw_rule_func_t)(snd_pcm_hw_params_t *params, | 200 | struct snd_pcm_hw_rule { |
223 | snd_pcm_hw_rule_t *rule); | ||
224 | |||
225 | struct _snd_pcm_hw_rule { | ||
226 | unsigned int cond; | 201 | unsigned int cond; |
227 | snd_pcm_hw_rule_func_t func; | 202 | snd_pcm_hw_rule_func_t func; |
228 | int var; | 203 | int var; |
@@ -230,57 +205,57 @@ struct _snd_pcm_hw_rule { | |||
230 | void *private; | 205 | void *private; |
231 | }; | 206 | }; |
232 | 207 | ||
233 | typedef struct _snd_pcm_hw_constraints { | 208 | struct snd_pcm_hw_constraints { |
234 | snd_mask_t masks[SNDRV_PCM_HW_PARAM_LAST_MASK - | 209 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - |
235 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; | 210 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; |
236 | snd_interval_t intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - | 211 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - |
237 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; | 212 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; |
238 | unsigned int rules_num; | 213 | unsigned int rules_num; |
239 | unsigned int rules_all; | 214 | unsigned int rules_all; |
240 | snd_pcm_hw_rule_t *rules; | 215 | struct snd_pcm_hw_rule *rules; |
241 | } snd_pcm_hw_constraints_t; | 216 | }; |
242 | 217 | ||
243 | static inline snd_mask_t *constrs_mask(snd_pcm_hw_constraints_t *constrs, | 218 | static inline struct snd_mask *constrs_mask(struct snd_pcm_hw_constraints *constrs, |
244 | snd_pcm_hw_param_t var) | 219 | snd_pcm_hw_param_t var) |
245 | { | 220 | { |
246 | return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; | 221 | return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; |
247 | } | 222 | } |
248 | 223 | ||
249 | static inline snd_interval_t *constrs_interval(snd_pcm_hw_constraints_t *constrs, | 224 | static inline struct snd_interval *constrs_interval(struct snd_pcm_hw_constraints *constrs, |
250 | snd_pcm_hw_param_t var) | 225 | snd_pcm_hw_param_t var) |
251 | { | 226 | { |
252 | return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; | 227 | return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; |
253 | } | 228 | } |
254 | 229 | ||
255 | typedef struct { | 230 | struct snd_ratnum { |
256 | unsigned int num; | 231 | unsigned int num; |
257 | unsigned int den_min, den_max, den_step; | 232 | unsigned int den_min, den_max, den_step; |
258 | } ratnum_t; | 233 | }; |
259 | 234 | ||
260 | typedef struct { | 235 | struct snd_ratden { |
261 | unsigned int num_min, num_max, num_step; | 236 | unsigned int num_min, num_max, num_step; |
262 | unsigned int den; | 237 | unsigned int den; |
263 | } ratden_t; | 238 | }; |
264 | 239 | ||
265 | typedef struct { | 240 | struct snd_pcm_hw_constraint_ratnums { |
266 | int nrats; | 241 | int nrats; |
267 | ratnum_t *rats; | 242 | struct snd_ratnum *rats; |
268 | } snd_pcm_hw_constraint_ratnums_t; | 243 | }; |
269 | 244 | ||
270 | typedef struct { | 245 | struct snd_pcm_hw_constraint_ratdens { |
271 | int nrats; | 246 | int nrats; |
272 | ratden_t *rats; | 247 | struct snd_ratden *rats; |
273 | } snd_pcm_hw_constraint_ratdens_t; | 248 | }; |
274 | 249 | ||
275 | typedef struct { | 250 | struct snd_pcm_hw_constraint_list { |
276 | unsigned int count; | 251 | unsigned int count; |
277 | unsigned int *list; | 252 | unsigned int *list; |
278 | unsigned int mask; | 253 | unsigned int mask; |
279 | } snd_pcm_hw_constraint_list_t; | 254 | }; |
280 | 255 | ||
281 | struct _snd_pcm_runtime { | 256 | struct snd_pcm_runtime { |
282 | /* -- Status -- */ | 257 | /* -- Status -- */ |
283 | snd_pcm_substream_t *trigger_master; | 258 | struct snd_pcm_substream *trigger_master; |
284 | struct timespec trigger_tstamp; /* trigger timestamp */ | 259 | struct timespec trigger_tstamp; /* trigger timestamp */ |
285 | int overrange; | 260 | int overrange; |
286 | snd_pcm_uframes_t avail_max; | 261 | snd_pcm_uframes_t avail_max; |
@@ -306,7 +281,7 @@ struct _snd_pcm_runtime { | |||
306 | unsigned int rate_den; | 281 | unsigned int rate_den; |
307 | 282 | ||
308 | /* -- SW params -- */ | 283 | /* -- SW params -- */ |
309 | snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ | 284 | int tstamp_mode; /* mmap timestamp is updated */ |
310 | unsigned int period_step; | 285 | unsigned int period_step; |
311 | unsigned int sleep_min; /* min ticks to sleep */ | 286 | unsigned int sleep_min; /* min ticks to sleep */ |
312 | snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ | 287 | snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ |
@@ -320,11 +295,11 @@ struct _snd_pcm_runtime { | |||
320 | snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ | 295 | snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ |
321 | snd_pcm_uframes_t silence_filled; /* size filled with silence */ | 296 | snd_pcm_uframes_t silence_filled; /* size filled with silence */ |
322 | 297 | ||
323 | snd_pcm_sync_id_t sync; /* hardware synchronization ID */ | 298 | union snd_pcm_sync_id sync; /* hardware synchronization ID */ |
324 | 299 | ||
325 | /* -- mmap -- */ | 300 | /* -- mmap -- */ |
326 | volatile snd_pcm_mmap_status_t *status; | 301 | volatile struct snd_pcm_mmap_status *status; |
327 | volatile snd_pcm_mmap_control_t *control; | 302 | volatile struct snd_pcm_mmap_control *control; |
328 | atomic_t mmap_count; | 303 | atomic_t mmap_count; |
329 | 304 | ||
330 | /* -- locking / scheduling -- */ | 305 | /* -- locking / scheduling -- */ |
@@ -334,15 +309,15 @@ struct _snd_pcm_runtime { | |||
334 | 309 | ||
335 | /* -- private section -- */ | 310 | /* -- private section -- */ |
336 | void *private_data; | 311 | void *private_data; |
337 | void (*private_free)(snd_pcm_runtime_t *runtime); | 312 | void (*private_free)(struct snd_pcm_runtime *runtime); |
338 | 313 | ||
339 | /* -- hardware description -- */ | 314 | /* -- hardware description -- */ |
340 | snd_pcm_hardware_t hw; | 315 | struct snd_pcm_hardware hw; |
341 | snd_pcm_hw_constraints_t hw_constraints; | 316 | struct snd_pcm_hw_constraints hw_constraints; |
342 | 317 | ||
343 | /* -- interrupt callbacks -- */ | 318 | /* -- interrupt callbacks -- */ |
344 | void (*transfer_ack_begin)(snd_pcm_substream_t *substream); | 319 | void (*transfer_ack_begin)(struct snd_pcm_substream *substream); |
345 | void (*transfer_ack_end)(snd_pcm_substream_t *substream); | 320 | void (*transfer_ack_end)(struct snd_pcm_substream *substream); |
346 | 321 | ||
347 | /* -- timer -- */ | 322 | /* -- timer -- */ |
348 | unsigned int timer_resolution; /* timer resolution */ | 323 | unsigned int timer_resolution; /* timer resolution */ |
@@ -356,19 +331,19 @@ struct _snd_pcm_runtime { | |||
356 | 331 | ||
357 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 332 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
358 | /* -- OSS things -- */ | 333 | /* -- OSS things -- */ |
359 | snd_pcm_oss_runtime_t oss; | 334 | struct snd_pcm_oss_runtime oss; |
360 | #endif | 335 | #endif |
361 | }; | 336 | }; |
362 | 337 | ||
363 | typedef struct _snd_pcm_group { /* keep linked substreams */ | 338 | struct snd_pcm_group { /* keep linked substreams */ |
364 | spinlock_t lock; | 339 | spinlock_t lock; |
365 | struct list_head substreams; | 340 | struct list_head substreams; |
366 | int count; | 341 | int count; |
367 | } snd_pcm_group_t; | 342 | }; |
368 | 343 | ||
369 | struct _snd_pcm_substream { | 344 | struct snd_pcm_substream { |
370 | snd_pcm_t *pcm; | 345 | struct snd_pcm *pcm; |
371 | snd_pcm_str_t *pstr; | 346 | struct snd_pcm_str *pstr; |
372 | void *private_data; /* copied from pcm->private_data */ | 347 | void *private_data; /* copied from pcm->private_data */ |
373 | int number; | 348 | int number; |
374 | char name[32]; /* substream name */ | 349 | char name[32]; /* substream name */ |
@@ -378,32 +353,32 @@ struct _snd_pcm_substream { | |||
378 | unsigned int dma_buf_id; | 353 | unsigned int dma_buf_id; |
379 | size_t dma_max; | 354 | size_t dma_max; |
380 | /* -- hardware operations -- */ | 355 | /* -- hardware operations -- */ |
381 | snd_pcm_ops_t *ops; | 356 | struct snd_pcm_ops *ops; |
382 | /* -- runtime information -- */ | 357 | /* -- runtime information -- */ |
383 | snd_pcm_runtime_t *runtime; | 358 | struct snd_pcm_runtime *runtime; |
384 | /* -- timer section -- */ | 359 | /* -- timer section -- */ |
385 | snd_timer_t *timer; /* timer */ | 360 | struct snd_timer *timer; /* timer */ |
386 | unsigned timer_running: 1; /* time is running */ | 361 | unsigned timer_running: 1; /* time is running */ |
387 | spinlock_t timer_lock; | 362 | spinlock_t timer_lock; |
388 | /* -- next substream -- */ | 363 | /* -- next substream -- */ |
389 | snd_pcm_substream_t *next; | 364 | struct snd_pcm_substream *next; |
390 | /* -- linked substreams -- */ | 365 | /* -- linked substreams -- */ |
391 | struct list_head link_list; /* linked list member */ | 366 | struct list_head link_list; /* linked list member */ |
392 | snd_pcm_group_t self_group; /* fake group for non linked substream (with substream lock inside) */ | 367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ |
393 | snd_pcm_group_t *group; /* pointer to current group */ | 368 | struct snd_pcm_group *group; /* pointer to current group */ |
394 | /* -- assigned files -- */ | 369 | /* -- assigned files -- */ |
395 | snd_pcm_file_t *file; | 370 | struct snd_pcm_file *file; |
396 | struct file *ffile; | 371 | struct file *ffile; |
397 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 372 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
398 | /* -- OSS things -- */ | 373 | /* -- OSS things -- */ |
399 | snd_pcm_oss_substream_t oss; | 374 | struct snd_pcm_oss_substream oss; |
400 | #endif | 375 | #endif |
401 | snd_info_entry_t *proc_root; | 376 | struct snd_info_entry *proc_root; |
402 | snd_info_entry_t *proc_info_entry; | 377 | struct snd_info_entry *proc_info_entry; |
403 | snd_info_entry_t *proc_hw_params_entry; | 378 | struct snd_info_entry *proc_hw_params_entry; |
404 | snd_info_entry_t *proc_sw_params_entry; | 379 | struct snd_info_entry *proc_sw_params_entry; |
405 | snd_info_entry_t *proc_status_entry; | 380 | struct snd_info_entry *proc_status_entry; |
406 | snd_info_entry_t *proc_prealloc_entry; | 381 | struct snd_info_entry *proc_prealloc_entry; |
407 | /* misc flags */ | 382 | /* misc flags */ |
408 | unsigned int no_mmap_ctrl: 1; | 383 | unsigned int no_mmap_ctrl: 1; |
409 | }; | 384 | }; |
@@ -415,65 +390,65 @@ struct _snd_pcm_substream { | |||
415 | #endif | 390 | #endif |
416 | 391 | ||
417 | 392 | ||
418 | struct _snd_pcm_str { | 393 | struct snd_pcm_str { |
419 | int stream; /* stream (direction) */ | 394 | int stream; /* stream (direction) */ |
420 | snd_pcm_t *pcm; | 395 | struct snd_pcm *pcm; |
421 | /* -- substreams -- */ | 396 | /* -- substreams -- */ |
422 | unsigned int substream_count; | 397 | unsigned int substream_count; |
423 | unsigned int substream_opened; | 398 | unsigned int substream_opened; |
424 | snd_pcm_substream_t *substream; | 399 | struct snd_pcm_substream *substream; |
425 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 400 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
426 | /* -- OSS things -- */ | 401 | /* -- OSS things -- */ |
427 | snd_pcm_oss_stream_t oss; | 402 | struct snd_pcm_oss_stream oss; |
428 | #endif | 403 | #endif |
429 | snd_pcm_file_t *files; | 404 | struct snd_pcm_file *files; |
430 | snd_minor_t *reg; | 405 | struct snd_minor *reg; |
431 | snd_info_entry_t *proc_root; | 406 | struct snd_info_entry *proc_root; |
432 | snd_info_entry_t *proc_info_entry; | 407 | struct snd_info_entry *proc_info_entry; |
433 | #ifdef CONFIG_SND_DEBUG | 408 | #ifdef CONFIG_SND_DEBUG |
434 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ | 409 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ |
435 | snd_info_entry_t *proc_xrun_debug_entry; | 410 | struct snd_info_entry *proc_xrun_debug_entry; |
436 | #endif | 411 | #endif |
437 | }; | 412 | }; |
438 | 413 | ||
439 | struct _snd_pcm { | 414 | struct snd_pcm { |
440 | snd_card_t *card; | 415 | struct snd_card *card; |
441 | unsigned int device; /* device number */ | 416 | unsigned int device; /* device number */ |
442 | unsigned int info_flags; | 417 | unsigned int info_flags; |
443 | unsigned short dev_class; | 418 | unsigned short dev_class; |
444 | unsigned short dev_subclass; | 419 | unsigned short dev_subclass; |
445 | char id[64]; | 420 | char id[64]; |
446 | char name[80]; | 421 | char name[80]; |
447 | snd_pcm_str_t streams[2]; | 422 | struct snd_pcm_str streams[2]; |
448 | struct semaphore open_mutex; | 423 | struct semaphore open_mutex; |
449 | wait_queue_head_t open_wait; | 424 | wait_queue_head_t open_wait; |
450 | void *private_data; | 425 | void *private_data; |
451 | void (*private_free) (snd_pcm_t *pcm); | 426 | void (*private_free) (struct snd_pcm *pcm); |
452 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 427 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
453 | snd_pcm_oss_t oss; | 428 | struct snd_pcm_oss oss; |
454 | #endif | 429 | #endif |
455 | }; | 430 | }; |
456 | 431 | ||
457 | typedef struct _snd_pcm_notify { | 432 | struct snd_pcm_notify { |
458 | int (*n_register) (snd_pcm_t * pcm); | 433 | int (*n_register) (struct snd_pcm * pcm); |
459 | int (*n_disconnect) (snd_pcm_t * pcm); | 434 | int (*n_disconnect) (struct snd_pcm * pcm); |
460 | int (*n_unregister) (snd_pcm_t * pcm); | 435 | int (*n_unregister) (struct snd_pcm * pcm); |
461 | struct list_head list; | 436 | struct list_head list; |
462 | } snd_pcm_notify_t; | 437 | }; |
463 | 438 | ||
464 | /* | 439 | /* |
465 | * Registering | 440 | * Registering |
466 | */ | 441 | */ |
467 | 442 | ||
468 | extern snd_pcm_t *snd_pcm_devices[]; | 443 | extern struct snd_pcm *snd_pcm_devices[]; |
469 | extern snd_minor_t snd_pcm_reg[2]; | 444 | extern struct snd_minor snd_pcm_reg[2]; |
470 | 445 | ||
471 | int snd_pcm_new(snd_card_t * card, char *id, int device, | 446 | int snd_pcm_new(struct snd_card *card, char *id, int device, |
472 | int playback_count, int capture_count, | 447 | int playback_count, int capture_count, |
473 | snd_pcm_t **rpcm); | 448 | struct snd_pcm **rpcm); |
474 | int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count); | 449 | int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count); |
475 | 450 | ||
476 | int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); | 451 | int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree); |
477 | 452 | ||
478 | /* | 453 | /* |
479 | * Native I/O | 454 | * Native I/O |
@@ -481,24 +456,26 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); | |||
481 | 456 | ||
482 | extern rwlock_t snd_pcm_link_rwlock; | 457 | extern rwlock_t snd_pcm_link_rwlock; |
483 | 458 | ||
484 | int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info); | 459 | int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info); |
485 | int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user *info); | 460 | int snd_pcm_info_user(struct snd_pcm_substream *substream, |
486 | int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status); | 461 | struct snd_pcm_info __user *info); |
487 | int snd_pcm_prepare(snd_pcm_substream_t *substream); | 462 | int snd_pcm_status(struct snd_pcm_substream *substream, |
488 | int snd_pcm_start(snd_pcm_substream_t *substream); | 463 | struct snd_pcm_status *status); |
489 | int snd_pcm_stop(snd_pcm_substream_t *substream, int status); | 464 | int snd_pcm_prepare(struct snd_pcm_substream *substream); |
490 | int snd_pcm_drain_done(snd_pcm_substream_t *substream); | 465 | int snd_pcm_start(struct snd_pcm_substream *substream); |
466 | int snd_pcm_stop(struct snd_pcm_substream *substream, int status); | ||
467 | int snd_pcm_drain_done(struct snd_pcm_substream *substream); | ||
491 | #ifdef CONFIG_PM | 468 | #ifdef CONFIG_PM |
492 | int snd_pcm_suspend(snd_pcm_substream_t *substream); | 469 | int snd_pcm_suspend(struct snd_pcm_substream *substream); |
493 | int snd_pcm_suspend_all(snd_pcm_t *pcm); | 470 | int snd_pcm_suspend_all(struct snd_pcm *pcm); |
494 | #endif | 471 | #endif |
495 | int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 472 | int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
496 | int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 473 | int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
497 | int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); | 474 | int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
498 | int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream); | 475 | int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream); |
499 | void snd_pcm_release_substream(snd_pcm_substream_t *substream); | 476 | void snd_pcm_release_substream(struct snd_pcm_substream *substream); |
500 | void snd_pcm_vma_notify_data(void *client, void *data); | 477 | void snd_pcm_vma_notify_data(void *client, void *data); |
501 | int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file, struct vm_area_struct *area); | 478 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
502 | 479 | ||
503 | #if BITS_PER_LONG >= 64 | 480 | #if BITS_PER_LONG >= 64 |
504 | 481 | ||
@@ -578,30 +555,30 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | |||
578 | * PCM library | 555 | * PCM library |
579 | */ | 556 | */ |
580 | 557 | ||
581 | static inline int snd_pcm_stream_linked(snd_pcm_substream_t *substream) | 558 | static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream) |
582 | { | 559 | { |
583 | return substream->group != &substream->self_group; | 560 | return substream->group != &substream->self_group; |
584 | } | 561 | } |
585 | 562 | ||
586 | static inline void snd_pcm_stream_lock(snd_pcm_substream_t *substream) | 563 | static inline void snd_pcm_stream_lock(struct snd_pcm_substream *substream) |
587 | { | 564 | { |
588 | read_lock(&snd_pcm_link_rwlock); | 565 | read_lock(&snd_pcm_link_rwlock); |
589 | spin_lock(&substream->self_group.lock); | 566 | spin_lock(&substream->self_group.lock); |
590 | } | 567 | } |
591 | 568 | ||
592 | static inline void snd_pcm_stream_unlock(snd_pcm_substream_t *substream) | 569 | static inline void snd_pcm_stream_unlock(struct snd_pcm_substream *substream) |
593 | { | 570 | { |
594 | spin_unlock(&substream->self_group.lock); | 571 | spin_unlock(&substream->self_group.lock); |
595 | read_unlock(&snd_pcm_link_rwlock); | 572 | read_unlock(&snd_pcm_link_rwlock); |
596 | } | 573 | } |
597 | 574 | ||
598 | static inline void snd_pcm_stream_lock_irq(snd_pcm_substream_t *substream) | 575 | static inline void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream) |
599 | { | 576 | { |
600 | read_lock_irq(&snd_pcm_link_rwlock); | 577 | read_lock_irq(&snd_pcm_link_rwlock); |
601 | spin_lock(&substream->self_group.lock); | 578 | spin_lock(&substream->self_group.lock); |
602 | } | 579 | } |
603 | 580 | ||
604 | static inline void snd_pcm_stream_unlock_irq(snd_pcm_substream_t *substream) | 581 | static inline void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream) |
605 | { | 582 | { |
606 | spin_unlock(&substream->self_group.lock); | 583 | spin_unlock(&substream->self_group.lock); |
607 | read_unlock_irq(&snd_pcm_link_rwlock); | 584 | read_unlock_irq(&snd_pcm_link_rwlock); |
@@ -623,56 +600,56 @@ do { \ | |||
623 | list_for_each(pos, &substream->group->substreams) | 600 | list_for_each(pos, &substream->group->substreams) |
624 | 601 | ||
625 | #define snd_pcm_group_substream_entry(pos) \ | 602 | #define snd_pcm_group_substream_entry(pos) \ |
626 | list_entry(pos, snd_pcm_substream_t, link_list) | 603 | list_entry(pos, struct snd_pcm_substream, link_list) |
627 | 604 | ||
628 | static inline int snd_pcm_running(snd_pcm_substream_t *substream) | 605 | static inline int snd_pcm_running(struct snd_pcm_substream *substream) |
629 | { | 606 | { |
630 | return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || | 607 | return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || |
631 | (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && | 608 | (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && |
632 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); | 609 | substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); |
633 | } | 610 | } |
634 | 611 | ||
635 | static inline ssize_t bytes_to_samples(snd_pcm_runtime_t *runtime, ssize_t size) | 612 | static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size) |
636 | { | 613 | { |
637 | return size * 8 / runtime->sample_bits; | 614 | return size * 8 / runtime->sample_bits; |
638 | } | 615 | } |
639 | 616 | ||
640 | static inline snd_pcm_sframes_t bytes_to_frames(snd_pcm_runtime_t *runtime, ssize_t size) | 617 | static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size) |
641 | { | 618 | { |
642 | return size * 8 / runtime->frame_bits; | 619 | return size * 8 / runtime->frame_bits; |
643 | } | 620 | } |
644 | 621 | ||
645 | static inline ssize_t samples_to_bytes(snd_pcm_runtime_t *runtime, ssize_t size) | 622 | static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size) |
646 | { | 623 | { |
647 | return size * runtime->sample_bits / 8; | 624 | return size * runtime->sample_bits / 8; |
648 | } | 625 | } |
649 | 626 | ||
650 | static inline ssize_t frames_to_bytes(snd_pcm_runtime_t *runtime, snd_pcm_sframes_t size) | 627 | static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size) |
651 | { | 628 | { |
652 | return size * runtime->frame_bits / 8; | 629 | return size * runtime->frame_bits / 8; |
653 | } | 630 | } |
654 | 631 | ||
655 | static inline int frame_aligned(snd_pcm_runtime_t *runtime, ssize_t bytes) | 632 | static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes) |
656 | { | 633 | { |
657 | return bytes % runtime->byte_align == 0; | 634 | return bytes % runtime->byte_align == 0; |
658 | } | 635 | } |
659 | 636 | ||
660 | static inline size_t snd_pcm_lib_buffer_bytes(snd_pcm_substream_t *substream) | 637 | static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream) |
661 | { | 638 | { |
662 | snd_pcm_runtime_t *runtime = substream->runtime; | 639 | struct snd_pcm_runtime *runtime = substream->runtime; |
663 | return frames_to_bytes(runtime, runtime->buffer_size); | 640 | return frames_to_bytes(runtime, runtime->buffer_size); |
664 | } | 641 | } |
665 | 642 | ||
666 | static inline size_t snd_pcm_lib_period_bytes(snd_pcm_substream_t *substream) | 643 | static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream) |
667 | { | 644 | { |
668 | snd_pcm_runtime_t *runtime = substream->runtime; | 645 | struct snd_pcm_runtime *runtime = substream->runtime; |
669 | return frames_to_bytes(runtime, runtime->period_size); | 646 | return frames_to_bytes(runtime, runtime->period_size); |
670 | } | 647 | } |
671 | 648 | ||
672 | /* | 649 | /* |
673 | * result is: 0 ... (boundary - 1) | 650 | * result is: 0 ... (boundary - 1) |
674 | */ | 651 | */ |
675 | static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtime) | 652 | static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime) |
676 | { | 653 | { |
677 | snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; | 654 | snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; |
678 | if (avail < 0) | 655 | if (avail < 0) |
@@ -685,7 +662,7 @@ static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtim | |||
685 | /* | 662 | /* |
686 | * result is: 0 ... (boundary - 1) | 663 | * result is: 0 ... (boundary - 1) |
687 | */ | 664 | */ |
688 | static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime) | 665 | static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime) |
689 | { | 666 | { |
690 | snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; | 667 | snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; |
691 | if (avail < 0) | 668 | if (avail < 0) |
@@ -693,12 +670,12 @@ static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime | |||
693 | return avail; | 670 | return avail; |
694 | } | 671 | } |
695 | 672 | ||
696 | static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(snd_pcm_runtime_t *runtime) | 673 | static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime) |
697 | { | 674 | { |
698 | return runtime->buffer_size - snd_pcm_playback_avail(runtime); | 675 | return runtime->buffer_size - snd_pcm_playback_avail(runtime); |
699 | } | 676 | } |
700 | 677 | ||
701 | static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runtime) | 678 | static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime) |
702 | { | 679 | { |
703 | return runtime->buffer_size - snd_pcm_capture_avail(runtime); | 680 | return runtime->buffer_size - snd_pcm_capture_avail(runtime); |
704 | } | 681 | } |
@@ -711,9 +688,9 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt | |||
711 | * | 688 | * |
712 | * Returns non-zero if available, or zero if not. | 689 | * Returns non-zero if available, or zero if not. |
713 | */ | 690 | */ |
714 | static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) | 691 | static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream) |
715 | { | 692 | { |
716 | snd_pcm_runtime_t *runtime = substream->runtime; | 693 | struct snd_pcm_runtime *runtime = substream->runtime; |
717 | return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; | 694 | return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; |
718 | } | 695 | } |
719 | 696 | ||
@@ -725,9 +702,9 @@ static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) | |||
725 | * | 702 | * |
726 | * Returns non-zero if available, or zero if not. | 703 | * Returns non-zero if available, or zero if not. |
727 | */ | 704 | */ |
728 | static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) | 705 | static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream) |
729 | { | 706 | { |
730 | snd_pcm_runtime_t *runtime = substream->runtime; | 707 | struct snd_pcm_runtime *runtime = substream->runtime; |
731 | return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; | 708 | return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; |
732 | } | 709 | } |
733 | 710 | ||
@@ -740,9 +717,9 @@ static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) | |||
740 | * | 717 | * |
741 | * Returns non-zero if exists, or zero if not. | 718 | * Returns non-zero if exists, or zero if not. |
742 | */ | 719 | */ |
743 | static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) | 720 | static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream) |
744 | { | 721 | { |
745 | snd_pcm_runtime_t *runtime = substream->runtime; | 722 | struct snd_pcm_runtime *runtime = substream->runtime; |
746 | 723 | ||
747 | if (runtime->stop_threshold >= runtime->boundary) | 724 | if (runtime->stop_threshold >= runtime->boundary) |
748 | return 1; | 725 | return 1; |
@@ -757,9 +734,9 @@ static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) | |||
757 | * | 734 | * |
758 | * Returns non-zero if empty, or zero if not. | 735 | * Returns non-zero if empty, or zero if not. |
759 | */ | 736 | */ |
760 | static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) | 737 | static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream) |
761 | { | 738 | { |
762 | snd_pcm_runtime_t *runtime = substream->runtime; | 739 | struct snd_pcm_runtime *runtime = substream->runtime; |
763 | return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; | 740 | return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; |
764 | } | 741 | } |
765 | 742 | ||
@@ -771,14 +748,14 @@ static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) | |||
771 | * | 748 | * |
772 | * Returns non-zero if empty, or zero if not. | 749 | * Returns non-zero if empty, or zero if not. |
773 | */ | 750 | */ |
774 | static inline int snd_pcm_capture_empty(snd_pcm_substream_t *substream) | 751 | static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream) |
775 | { | 752 | { |
776 | snd_pcm_runtime_t *runtime = substream->runtime; | 753 | struct snd_pcm_runtime *runtime = substream->runtime; |
777 | return snd_pcm_capture_avail(runtime) == 0; | 754 | return snd_pcm_capture_avail(runtime) == 0; |
778 | } | 755 | } |
779 | 756 | ||
780 | static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream, | 757 | static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream, |
781 | snd_pcm_substream_t *master) | 758 | struct snd_pcm_substream *master) |
782 | { | 759 | { |
783 | substream->runtime->trigger_master = master; | 760 | substream->runtime->trigger_master = master; |
784 | } | 761 | } |
@@ -795,28 +772,28 @@ static inline int hw_is_interval(int var) | |||
795 | var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; | 772 | var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; |
796 | } | 773 | } |
797 | 774 | ||
798 | static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params, | 775 | static inline struct snd_mask *hw_param_mask(struct snd_pcm_hw_params *params, |
799 | snd_pcm_hw_param_t var) | 776 | snd_pcm_hw_param_t var) |
800 | { | 777 | { |
801 | return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; | 778 | return ¶ms->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; |
802 | } | 779 | } |
803 | 780 | ||
804 | static inline snd_interval_t *hw_param_interval(snd_pcm_hw_params_t *params, | 781 | static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *params, |
805 | snd_pcm_hw_param_t var) | 782 | snd_pcm_hw_param_t var) |
806 | { | 783 | { |
807 | return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; | 784 | return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; |
808 | } | 785 | } |
809 | 786 | ||
810 | static inline const snd_mask_t *hw_param_mask_c(const snd_pcm_hw_params_t *params, | 787 | static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params, |
811 | snd_pcm_hw_param_t var) | 788 | snd_pcm_hw_param_t var) |
812 | { | 789 | { |
813 | return (const snd_mask_t *)hw_param_mask((snd_pcm_hw_params_t*) params, var); | 790 | return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var); |
814 | } | 791 | } |
815 | 792 | ||
816 | static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_t *params, | 793 | static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params, |
817 | snd_pcm_hw_param_t var) | 794 | snd_pcm_hw_param_t var) |
818 | { | 795 | { |
819 | return (const snd_interval_t *)hw_param_interval((snd_pcm_hw_params_t*) params, var); | 796 | return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var); |
820 | } | 797 | } |
821 | 798 | ||
822 | #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) | 799 | #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) |
@@ -832,66 +809,66 @@ static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_ | |||
832 | #define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min | 809 | #define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min |
833 | 810 | ||
834 | 811 | ||
835 | int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v); | 812 | int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); |
836 | void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); | 813 | void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); |
837 | void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); | 814 | void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); |
838 | void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, | 815 | void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b, |
839 | unsigned int k, snd_interval_t *c); | 816 | unsigned int k, struct snd_interval *c); |
840 | void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, | 817 | void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, |
841 | const snd_interval_t *b, snd_interval_t *c); | 818 | const struct snd_interval *b, struct snd_interval *c); |
842 | int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask); | 819 | int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask); |
843 | int snd_interval_ratnum(snd_interval_t *i, | 820 | int snd_interval_ratnum(struct snd_interval *i, |
844 | unsigned int rats_count, ratnum_t *rats, | 821 | unsigned int rats_count, struct snd_ratnum *rats, |
845 | unsigned int *nump, unsigned int *denp); | 822 | unsigned int *nump, unsigned int *denp); |
846 | 823 | ||
847 | void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); | 824 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); |
848 | void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); | 825 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); |
849 | int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, | 826 | int snd_pcm_hw_param_near(struct snd_pcm_substream *substream, |
850 | snd_pcm_hw_params_t *params, | 827 | struct snd_pcm_hw_params *params, |
851 | snd_pcm_hw_param_t var, | 828 | snd_pcm_hw_param_t var, |
852 | unsigned int val, int *dir); | 829 | unsigned int val, int *dir); |
853 | int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, | 830 | int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, |
854 | snd_pcm_hw_params_t *params, | 831 | struct snd_pcm_hw_params *params, |
855 | snd_pcm_hw_param_t var, | 832 | snd_pcm_hw_param_t var, |
856 | unsigned int val, int dir); | 833 | unsigned int val, int dir); |
857 | int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 834 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
858 | 835 | ||
859 | int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 836 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
860 | 837 | ||
861 | int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); | 838 | int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream); |
862 | int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); | 839 | int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream); |
863 | 840 | ||
864 | int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 841 | int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
865 | u_int32_t mask); | 842 | u_int32_t mask); |
866 | int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 843 | int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
867 | u_int64_t mask); | 844 | u_int64_t mask); |
868 | int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, | 845 | int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, |
869 | unsigned int min, unsigned int max); | 846 | unsigned int min, unsigned int max); |
870 | int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var); | 847 | int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var); |
871 | int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, | 848 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
872 | unsigned int cond, | 849 | unsigned int cond, |
873 | snd_pcm_hw_param_t var, | 850 | snd_pcm_hw_param_t var, |
874 | snd_pcm_hw_constraint_list_t *l); | 851 | struct snd_pcm_hw_constraint_list *l); |
875 | int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, | 852 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
876 | unsigned int cond, | 853 | unsigned int cond, |
877 | snd_pcm_hw_param_t var, | 854 | snd_pcm_hw_param_t var, |
878 | snd_pcm_hw_constraint_ratnums_t *r); | 855 | struct snd_pcm_hw_constraint_ratnums *r); |
879 | int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, | 856 | int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime, |
880 | unsigned int cond, | 857 | unsigned int cond, |
881 | snd_pcm_hw_param_t var, | 858 | snd_pcm_hw_param_t var, |
882 | snd_pcm_hw_constraint_ratdens_t *r); | 859 | struct snd_pcm_hw_constraint_ratdens *r); |
883 | int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, | 860 | int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime, |
884 | unsigned int cond, | 861 | unsigned int cond, |
885 | unsigned int width, | 862 | unsigned int width, |
886 | unsigned int msbits); | 863 | unsigned int msbits); |
887 | int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, | 864 | int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, |
888 | unsigned int cond, | 865 | unsigned int cond, |
889 | snd_pcm_hw_param_t var, | 866 | snd_pcm_hw_param_t var, |
890 | unsigned long step); | 867 | unsigned long step); |
891 | int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, | 868 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
892 | unsigned int cond, | 869 | unsigned int cond, |
893 | snd_pcm_hw_param_t var); | 870 | snd_pcm_hw_param_t var); |
894 | int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, | 871 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, |
895 | unsigned int cond, | 872 | unsigned int cond, |
896 | int var, | 873 | int var, |
897 | snd_pcm_hw_rule_func_t func, void *private, | 874 | snd_pcm_hw_rule_func_t func, void *private, |
@@ -925,37 +902,37 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int | |||
925 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 902 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); |
926 | const char *snd_pcm_format_name(snd_pcm_format_t format); | 903 | const char *snd_pcm_format_name(snd_pcm_format_t format); |
927 | 904 | ||
928 | void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops); | 905 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); |
929 | void snd_pcm_set_sync(snd_pcm_substream_t * substream); | 906 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |
930 | int snd_pcm_lib_interleave_len(snd_pcm_substream_t *substream); | 907 | int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); |
931 | int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, | 908 | int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, |
932 | unsigned int cmd, void *arg); | 909 | unsigned int cmd, void *arg); |
933 | int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream); | 910 | int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); |
934 | int snd_pcm_playback_xrun_check(snd_pcm_substream_t *substream); | 911 | int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); |
935 | int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream); | 912 | int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); |
936 | int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream); | 913 | int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream); |
937 | int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream); | 914 | int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream); |
938 | void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr); | 915 | void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr); |
939 | void snd_pcm_tick_prepare(snd_pcm_substream_t *substream); | 916 | void snd_pcm_tick_prepare(struct snd_pcm_substream *substream); |
940 | void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks); | 917 | void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks); |
941 | void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream); | 918 | void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream); |
942 | void snd_pcm_period_elapsed(snd_pcm_substream_t *substream); | 919 | void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); |
943 | snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, | 920 | snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, |
944 | const void __user *buf, | 921 | const void __user *buf, |
945 | snd_pcm_uframes_t frames); | 922 | snd_pcm_uframes_t frames); |
946 | snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, | 923 | snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, |
947 | void __user *buf, snd_pcm_uframes_t frames); | 924 | void __user *buf, snd_pcm_uframes_t frames); |
948 | snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, | 925 | snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream, |
949 | void __user **bufs, snd_pcm_uframes_t frames); | 926 | void __user **bufs, snd_pcm_uframes_t frames); |
950 | snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, | 927 | snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, |
951 | void __user **bufs, snd_pcm_uframes_t frames); | 928 | void __user **bufs, snd_pcm_uframes_t frames); |
952 | 929 | ||
953 | int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime); | 930 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); |
954 | 931 | ||
955 | static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, | 932 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, |
956 | struct snd_dma_buffer *bufp) | 933 | struct snd_dma_buffer *bufp) |
957 | { | 934 | { |
958 | snd_pcm_runtime_t *runtime = substream->runtime; | 935 | struct snd_pcm_runtime *runtime = substream->runtime; |
959 | if (bufp) { | 936 | if (bufp) { |
960 | runtime->dma_buffer_p = bufp; | 937 | runtime->dma_buffer_p = bufp; |
961 | runtime->dma_area = bufp->area; | 938 | runtime->dma_area = bufp->area; |
@@ -973,47 +950,47 @@ static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, | |||
973 | * Timer interface | 950 | * Timer interface |
974 | */ | 951 | */ |
975 | 952 | ||
976 | void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream); | 953 | void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream); |
977 | void snd_pcm_timer_init(snd_pcm_substream_t * substream); | 954 | void snd_pcm_timer_init(struct snd_pcm_substream *substream); |
978 | void snd_pcm_timer_done(snd_pcm_substream_t * substream); | 955 | void snd_pcm_timer_done(struct snd_pcm_substream *substream); |
979 | 956 | ||
980 | /* | 957 | /* |
981 | * Memory | 958 | * Memory |
982 | */ | 959 | */ |
983 | 960 | ||
984 | int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream); | 961 | int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream); |
985 | int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm); | 962 | int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm); |
986 | int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, | 963 | int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, |
987 | int type, struct device *data, | 964 | int type, struct device *data, |
988 | size_t size, size_t max); | 965 | size_t size, size_t max); |
989 | int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm, | 966 | int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, |
990 | int type, void *data, | 967 | int type, void *data, |
991 | size_t size, size_t max); | 968 | size_t size, size_t max); |
992 | int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size); | 969 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
993 | int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream); | 970 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
994 | 971 | ||
995 | #define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) | 972 | #define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) |
996 | #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) | 973 | #define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) |
997 | #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) | 974 | #define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) |
998 | struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); | 975 | struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset); |
999 | 976 | ||
1000 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 977 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
1001 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 978 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
1002 | { | 979 | { |
1003 | snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; | 980 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
1004 | atomic_inc(&substream->runtime->mmap_count); | 981 | atomic_inc(&substream->runtime->mmap_count); |
1005 | } | 982 | } |
1006 | 983 | ||
1007 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | 984 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) |
1008 | { | 985 | { |
1009 | snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; | 986 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
1010 | atomic_dec(&substream->runtime->mmap_count); | 987 | atomic_dec(&substream->runtime->mmap_count); |
1011 | } | 988 | } |
1012 | 989 | ||
1013 | /* mmap for io-memory area */ | 990 | /* mmap for io-memory area */ |
1014 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 991 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
1015 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 992 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
1016 | int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct *area); | 993 | int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area); |
1017 | #else | 994 | #else |
1018 | #define SNDRV_PCM_INFO_MMAP_IOMEM 0 | 995 | #define SNDRV_PCM_INFO_MMAP_IOMEM 0 |
1019 | #define snd_pcm_lib_mmap_iomem NULL | 996 | #define snd_pcm_lib_mmap_iomem NULL |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 60b0e92e26f3..fb18aef77341 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -22,17 +22,17 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | extern int snd_pcm_hw_param_mask(snd_pcm_substream_t *pcm, snd_pcm_hw_params_t *params, | 25 | extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, |
26 | snd_pcm_hw_param_t var, const snd_mask_t *val); | 26 | snd_pcm_hw_param_t var, const struct snd_mask *val); |
27 | extern unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, | 27 | extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, |
28 | snd_pcm_hw_param_t var, int *dir); | 28 | snd_pcm_hw_param_t var, int *dir); |
29 | extern unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, | 29 | extern unsigned int snd_pcm_hw_param_value_max(const 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(snd_pcm_hw_params_t *params, | 31 | extern int _snd_pcm_hw_param_min(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, unsigned int val, int dir); |
33 | extern int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, | 33 | extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params, |
34 | snd_pcm_hw_param_t var); | 34 | snd_pcm_hw_param_t var); |
35 | extern int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, | 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); | 36 | snd_pcm_hw_param_t var, unsigned int val, int dir); |
37 | 37 | ||
38 | /* To share the same code we have alsa-lib */ | 38 | /* To share the same code we have alsa-lib */ |
@@ -71,20 +71,20 @@ INLINE unsigned int ld2(u_int32_t v) | |||
71 | 71 | ||
72 | INLINE size_t snd_mask_sizeof(void) | 72 | INLINE size_t snd_mask_sizeof(void) |
73 | { | 73 | { |
74 | return sizeof(snd_mask_t); | 74 | return sizeof(struct snd_mask); |
75 | } | 75 | } |
76 | 76 | ||
77 | INLINE void snd_mask_none(snd_mask_t *mask) | 77 | INLINE void snd_mask_none(struct snd_mask *mask) |
78 | { | 78 | { |
79 | memset(mask, 0, sizeof(*mask)); | 79 | memset(mask, 0, sizeof(*mask)); |
80 | } | 80 | } |
81 | 81 | ||
82 | INLINE void snd_mask_any(snd_mask_t *mask) | 82 | INLINE void snd_mask_any(struct snd_mask *mask) |
83 | { | 83 | { |
84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
85 | } | 85 | } |
86 | 86 | ||
87 | INLINE int snd_mask_empty(const snd_mask_t *mask) | 87 | INLINE int snd_mask_empty(const struct snd_mask *mask) |
88 | { | 88 | { |
89 | int i; | 89 | int i; |
90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
@@ -93,7 +93,7 @@ INLINE int snd_mask_empty(const snd_mask_t *mask) | |||
93 | return 1; | 93 | return 1; |
94 | } | 94 | } |
95 | 95 | ||
96 | INLINE unsigned int snd_mask_min(const snd_mask_t *mask) | 96 | INLINE unsigned int snd_mask_min(const struct snd_mask *mask) |
97 | { | 97 | { |
98 | int i; | 98 | int i; |
99 | assert(!snd_mask_empty(mask)); | 99 | assert(!snd_mask_empty(mask)); |
@@ -104,7 +104,7 @@ INLINE unsigned int snd_mask_min(const snd_mask_t *mask) | |||
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
106 | 106 | ||
107 | INLINE unsigned int snd_mask_max(const snd_mask_t *mask) | 107 | INLINE unsigned int snd_mask_max(const struct snd_mask *mask) |
108 | { | 108 | { |
109 | int i; | 109 | int i; |
110 | assert(!snd_mask_empty(mask)); | 110 | assert(!snd_mask_empty(mask)); |
@@ -115,19 +115,19 @@ INLINE unsigned int snd_mask_max(const snd_mask_t *mask) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | INLINE void snd_mask_set(snd_mask_t *mask, unsigned int val) | 118 | INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) |
119 | { | 119 | { |
120 | assert(val <= SNDRV_MASK_BITS); | 120 | assert(val <= SNDRV_MASK_BITS); |
121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); | 121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); |
122 | } | 122 | } |
123 | 123 | ||
124 | INLINE void snd_mask_reset(snd_mask_t *mask, unsigned int val) | 124 | INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) |
125 | { | 125 | { |
126 | assert(val <= SNDRV_MASK_BITS); | 126 | assert(val <= SNDRV_MASK_BITS); |
127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); | 127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); |
128 | } | 128 | } |
129 | 129 | ||
130 | INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int to) | 130 | INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) |
131 | { | 131 | { |
132 | unsigned int i; | 132 | unsigned int i; |
133 | assert(to <= SNDRV_MASK_BITS && from <= to); | 133 | assert(to <= SNDRV_MASK_BITS && from <= to); |
@@ -135,7 +135,7 @@ INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int | |||
135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); | 135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); |
136 | } | 136 | } |
137 | 137 | ||
138 | INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned int to) | 138 | INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) |
139 | { | 139 | { |
140 | unsigned int i; | 140 | unsigned int i; |
141 | assert(to <= SNDRV_MASK_BITS && from <= to); | 141 | assert(to <= SNDRV_MASK_BITS && from <= to); |
@@ -143,7 +143,7 @@ INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned i | |||
143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); | 143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); |
144 | } | 144 | } |
145 | 145 | ||
146 | INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val) | 146 | INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) |
147 | { | 147 | { |
148 | unsigned int v; | 148 | unsigned int v; |
149 | assert(val <= SNDRV_MASK_BITS); | 149 | assert(val <= SNDRV_MASK_BITS); |
@@ -152,30 +152,30 @@ INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val) | |||
152 | mask->bits[MASK_OFS(val)] = v; | 152 | mask->bits[MASK_OFS(val)] = v; |
153 | } | 153 | } |
154 | 154 | ||
155 | INLINE void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v) | 155 | INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) |
156 | { | 156 | { |
157 | int i; | 157 | int i; |
158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
159 | mask->bits[i] &= v->bits[i]; | 159 | mask->bits[i] &= v->bits[i]; |
160 | } | 160 | } |
161 | 161 | ||
162 | INLINE int snd_mask_eq(const snd_mask_t *mask, const snd_mask_t *v) | 162 | INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) |
163 | { | 163 | { |
164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
165 | } | 165 | } |
166 | 166 | ||
167 | INLINE void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v) | 167 | INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) |
168 | { | 168 | { |
169 | *mask = *v; | 169 | *mask = *v; |
170 | } | 170 | } |
171 | 171 | ||
172 | INLINE int snd_mask_test(const snd_mask_t *mask, unsigned int val) | 172 | INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) |
173 | { | 173 | { |
174 | assert(val <= SNDRV_MASK_BITS); | 174 | assert(val <= SNDRV_MASK_BITS); |
175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
176 | } | 176 | } |
177 | 177 | ||
178 | INLINE int snd_mask_single(const snd_mask_t *mask) | 178 | INLINE int snd_mask_single(const struct snd_mask *mask) |
179 | { | 179 | { |
180 | int i, c = 0; | 180 | int i, c = 0; |
181 | assert(!snd_mask_empty(mask)); | 181 | assert(!snd_mask_empty(mask)); |
@@ -191,9 +191,9 @@ INLINE int snd_mask_single(const snd_mask_t *mask) | |||
191 | return 1; | 191 | return 1; |
192 | } | 192 | } |
193 | 193 | ||
194 | INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v) | 194 | INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) |
195 | { | 195 | { |
196 | snd_mask_t old; | 196 | struct snd_mask old; |
197 | assert(!snd_mask_empty(mask)); | 197 | assert(!snd_mask_empty(mask)); |
198 | snd_mask_copy(&old, mask); | 198 | snd_mask_copy(&old, mask); |
199 | snd_mask_intersect(mask, v); | 199 | snd_mask_intersect(mask, v); |
@@ -202,7 +202,7 @@ INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v) | |||
202 | return !snd_mask_eq(mask, &old); | 202 | return !snd_mask_eq(mask, &old); |
203 | } | 203 | } |
204 | 204 | ||
205 | INLINE int snd_mask_refine_first(snd_mask_t *mask) | 205 | INLINE int snd_mask_refine_first(struct snd_mask *mask) |
206 | { | 206 | { |
207 | assert(!snd_mask_empty(mask)); | 207 | assert(!snd_mask_empty(mask)); |
208 | if (snd_mask_single(mask)) | 208 | if (snd_mask_single(mask)) |
@@ -211,7 +211,7 @@ INLINE int snd_mask_refine_first(snd_mask_t *mask) | |||
211 | return 1; | 211 | return 1; |
212 | } | 212 | } |
213 | 213 | ||
214 | INLINE int snd_mask_refine_last(snd_mask_t *mask) | 214 | INLINE int snd_mask_refine_last(struct snd_mask *mask) |
215 | { | 215 | { |
216 | assert(!snd_mask_empty(mask)); | 216 | assert(!snd_mask_empty(mask)); |
217 | if (snd_mask_single(mask)) | 217 | if (snd_mask_single(mask)) |
@@ -220,7 +220,7 @@ INLINE int snd_mask_refine_last(snd_mask_t *mask) | |||
220 | return 1; | 220 | return 1; |
221 | } | 221 | } |
222 | 222 | ||
223 | INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val) | 223 | INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) |
224 | { | 224 | { |
225 | assert(!snd_mask_empty(mask)); | 225 | assert(!snd_mask_empty(mask)); |
226 | if (snd_mask_min(mask) >= val) | 226 | if (snd_mask_min(mask) >= val) |
@@ -231,7 +231,7 @@ INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val) | |||
231 | return 1; | 231 | return 1; |
232 | } | 232 | } |
233 | 233 | ||
234 | INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val) | 234 | INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) |
235 | { | 235 | { |
236 | assert(!snd_mask_empty(mask)); | 236 | assert(!snd_mask_empty(mask)); |
237 | if (snd_mask_max(mask) <= val) | 237 | if (snd_mask_max(mask) <= val) |
@@ -242,7 +242,7 @@ INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val) | |||
242 | return 1; | 242 | return 1; |
243 | } | 243 | } |
244 | 244 | ||
245 | INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val) | 245 | INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) |
246 | { | 246 | { |
247 | int changed; | 247 | int changed; |
248 | assert(!snd_mask_empty(mask)); | 248 | assert(!snd_mask_empty(mask)); |
@@ -253,13 +253,13 @@ INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val) | |||
253 | return changed; | 253 | return changed; |
254 | } | 254 | } |
255 | 255 | ||
256 | INLINE int snd_mask_value(const snd_mask_t *mask) | 256 | INLINE int snd_mask_value(const struct snd_mask *mask) |
257 | { | 257 | { |
258 | assert(!snd_mask_empty(mask)); | 258 | assert(!snd_mask_empty(mask)); |
259 | return snd_mask_min(mask); | 259 | return snd_mask_min(mask); |
260 | } | 260 | } |
261 | 261 | ||
262 | INLINE void snd_interval_any(snd_interval_t *i) | 262 | INLINE void snd_interval_any(struct snd_interval *i) |
263 | { | 263 | { |
264 | i->min = 0; | 264 | i->min = 0; |
265 | i->openmin = 0; | 265 | i->openmin = 0; |
@@ -269,42 +269,42 @@ INLINE void snd_interval_any(snd_interval_t *i) | |||
269 | i->empty = 0; | 269 | i->empty = 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | INLINE void snd_interval_none(snd_interval_t *i) | 272 | INLINE void snd_interval_none(struct snd_interval *i) |
273 | { | 273 | { |
274 | i->empty = 1; | 274 | i->empty = 1; |
275 | } | 275 | } |
276 | 276 | ||
277 | INLINE int snd_interval_checkempty(const snd_interval_t *i) | 277 | INLINE int snd_interval_checkempty(const struct snd_interval *i) |
278 | { | 278 | { |
279 | return (i->min > i->max || | 279 | return (i->min > i->max || |
280 | (i->min == i->max && (i->openmin || i->openmax))); | 280 | (i->min == i->max && (i->openmin || i->openmax))); |
281 | } | 281 | } |
282 | 282 | ||
283 | INLINE int snd_interval_empty(const snd_interval_t *i) | 283 | INLINE int snd_interval_empty(const struct snd_interval *i) |
284 | { | 284 | { |
285 | return i->empty; | 285 | return i->empty; |
286 | } | 286 | } |
287 | 287 | ||
288 | INLINE int snd_interval_single(const snd_interval_t *i) | 288 | INLINE int snd_interval_single(const struct snd_interval *i) |
289 | { | 289 | { |
290 | assert(!snd_interval_empty(i)); | 290 | assert(!snd_interval_empty(i)); |
291 | return (i->min == i->max || | 291 | return (i->min == i->max || |
292 | (i->min + 1 == i->max && i->openmax)); | 292 | (i->min + 1 == i->max && i->openmax)); |
293 | } | 293 | } |
294 | 294 | ||
295 | INLINE int snd_interval_value(const snd_interval_t *i) | 295 | INLINE int snd_interval_value(const struct snd_interval *i) |
296 | { | 296 | { |
297 | assert(snd_interval_single(i)); | 297 | assert(snd_interval_single(i)); |
298 | return i->min; | 298 | return i->min; |
299 | } | 299 | } |
300 | 300 | ||
301 | INLINE int snd_interval_min(const snd_interval_t *i) | 301 | INLINE int snd_interval_min(const struct snd_interval *i) |
302 | { | 302 | { |
303 | assert(!snd_interval_empty(i)); | 303 | assert(!snd_interval_empty(i)); |
304 | return i->min; | 304 | return i->min; |
305 | } | 305 | } |
306 | 306 | ||
307 | INLINE int snd_interval_max(const snd_interval_t *i) | 307 | INLINE int snd_interval_max(const struct snd_interval *i) |
308 | { | 308 | { |
309 | unsigned int v; | 309 | unsigned int v; |
310 | assert(!snd_interval_empty(i)); | 310 | assert(!snd_interval_empty(i)); |
@@ -314,18 +314,18 @@ INLINE int snd_interval_max(const snd_interval_t *i) | |||
314 | return v; | 314 | return v; |
315 | } | 315 | } |
316 | 316 | ||
317 | INLINE int snd_interval_test(const snd_interval_t *i, unsigned int val) | 317 | INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) |
318 | { | 318 | { |
319 | return !((i->min > val || (i->min == val && i->openmin) || | 319 | return !((i->min > val || (i->min == val && i->openmin) || |
320 | i->max < val || (i->max == val && i->openmax))); | 320 | i->max < val || (i->max == val && i->openmax))); |
321 | } | 321 | } |
322 | 322 | ||
323 | INLINE void snd_interval_copy(snd_interval_t *d, const snd_interval_t *s) | 323 | INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) |
324 | { | 324 | { |
325 | *d = *s; | 325 | *d = *s; |
326 | } | 326 | } |
327 | 327 | ||
328 | INLINE int snd_interval_setinteger(snd_interval_t *i) | 328 | INLINE int snd_interval_setinteger(struct snd_interval *i) |
329 | { | 329 | { |
330 | if (i->integer) | 330 | if (i->integer) |
331 | return 0; | 331 | return 0; |
@@ -335,7 +335,7 @@ INLINE int snd_interval_setinteger(snd_interval_t *i) | |||
335 | return 1; | 335 | return 1; |
336 | } | 336 | } |
337 | 337 | ||
338 | INLINE int snd_interval_eq(const snd_interval_t *i1, const snd_interval_t *i2) | 338 | INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) |
339 | { | 339 | { |
340 | if (i1->empty) | 340 | if (i1->empty) |
341 | return i2->empty; | 341 | return i2->empty; |