diff options
Diffstat (limited to 'sound/isa/ad1816a/ad1816a_lib.c')
-rw-r--r-- | sound/isa/ad1816a/ad1816a_lib.c | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c index 170409e26d03..89d11af33340 100644 --- a/sound/isa/ad1816a/ad1816a_lib.c +++ b/sound/isa/ad1816a/ad1816a_lib.c | |||
@@ -34,7 +34,7 @@ MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); | |||
34 | MODULE_DESCRIPTION("lowlevel code for Analog Devices AD1816A chip"); | 34 | MODULE_DESCRIPTION("lowlevel code for Analog Devices AD1816A chip"); |
35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
36 | 36 | ||
37 | static inline int snd_ad1816a_busy_wait(ad1816a_t *chip) | 37 | static inline int snd_ad1816a_busy_wait(struct snd_ad1816a *chip) |
38 | { | 38 | { |
39 | int timeout; | 39 | int timeout; |
40 | 40 | ||
@@ -46,34 +46,34 @@ static inline int snd_ad1816a_busy_wait(ad1816a_t *chip) | |||
46 | return -EBUSY; | 46 | return -EBUSY; |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline unsigned char snd_ad1816a_in(ad1816a_t *chip, unsigned char reg) | 49 | static inline unsigned char snd_ad1816a_in(struct snd_ad1816a *chip, unsigned char reg) |
50 | { | 50 | { |
51 | snd_ad1816a_busy_wait(chip); | 51 | snd_ad1816a_busy_wait(chip); |
52 | return inb(AD1816A_REG(reg)); | 52 | return inb(AD1816A_REG(reg)); |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline void snd_ad1816a_out(ad1816a_t *chip, unsigned char reg, | 55 | static inline void snd_ad1816a_out(struct snd_ad1816a *chip, unsigned char reg, |
56 | unsigned char value) | 56 | unsigned char value) |
57 | { | 57 | { |
58 | snd_ad1816a_busy_wait(chip); | 58 | snd_ad1816a_busy_wait(chip); |
59 | outb(value, AD1816A_REG(reg)); | 59 | outb(value, AD1816A_REG(reg)); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void snd_ad1816a_out_mask(ad1816a_t *chip, unsigned char reg, | 62 | static inline void snd_ad1816a_out_mask(struct snd_ad1816a *chip, unsigned char reg, |
63 | unsigned char mask, unsigned char value) | 63 | unsigned char mask, unsigned char value) |
64 | { | 64 | { |
65 | snd_ad1816a_out(chip, reg, | 65 | snd_ad1816a_out(chip, reg, |
66 | (value & mask) | (snd_ad1816a_in(chip, reg) & ~mask)); | 66 | (value & mask) | (snd_ad1816a_in(chip, reg) & ~mask)); |
67 | } | 67 | } |
68 | 68 | ||
69 | static unsigned short snd_ad1816a_read(ad1816a_t *chip, unsigned char reg) | 69 | static unsigned short snd_ad1816a_read(struct snd_ad1816a *chip, unsigned char reg) |
70 | { | 70 | { |
71 | snd_ad1816a_out(chip, AD1816A_INDIR_ADDR, reg & 0x3f); | 71 | snd_ad1816a_out(chip, AD1816A_INDIR_ADDR, reg & 0x3f); |
72 | return snd_ad1816a_in(chip, AD1816A_INDIR_DATA_LOW) | | 72 | return snd_ad1816a_in(chip, AD1816A_INDIR_DATA_LOW) | |
73 | (snd_ad1816a_in(chip, AD1816A_INDIR_DATA_HIGH) << 8); | 73 | (snd_ad1816a_in(chip, AD1816A_INDIR_DATA_HIGH) << 8); |
74 | } | 74 | } |
75 | 75 | ||
76 | static void snd_ad1816a_write(ad1816a_t *chip, unsigned char reg, | 76 | static void snd_ad1816a_write(struct snd_ad1816a *chip, unsigned char reg, |
77 | unsigned short value) | 77 | unsigned short value) |
78 | { | 78 | { |
79 | snd_ad1816a_out(chip, AD1816A_INDIR_ADDR, reg & 0x3f); | 79 | snd_ad1816a_out(chip, AD1816A_INDIR_ADDR, reg & 0x3f); |
@@ -81,7 +81,7 @@ static void snd_ad1816a_write(ad1816a_t *chip, unsigned char reg, | |||
81 | snd_ad1816a_out(chip, AD1816A_INDIR_DATA_HIGH, (value >> 8) & 0xff); | 81 | snd_ad1816a_out(chip, AD1816A_INDIR_DATA_HIGH, (value >> 8) & 0xff); |
82 | } | 82 | } |
83 | 83 | ||
84 | static void snd_ad1816a_write_mask(ad1816a_t *chip, unsigned char reg, | 84 | static void snd_ad1816a_write_mask(struct snd_ad1816a *chip, unsigned char reg, |
85 | unsigned short mask, unsigned short value) | 85 | unsigned short mask, unsigned short value) |
86 | { | 86 | { |
87 | snd_ad1816a_write(chip, reg, | 87 | snd_ad1816a_write(chip, reg, |
@@ -89,7 +89,7 @@ static void snd_ad1816a_write_mask(ad1816a_t *chip, unsigned char reg, | |||
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | static unsigned char snd_ad1816a_get_format(ad1816a_t *chip, | 92 | static unsigned char snd_ad1816a_get_format(struct snd_ad1816a *chip, |
93 | unsigned int format, int channels) | 93 | unsigned int format, int channels) |
94 | { | 94 | { |
95 | unsigned char retval = AD1816A_FMT_LINEAR_8; | 95 | unsigned char retval = AD1816A_FMT_LINEAR_8; |
@@ -110,7 +110,7 @@ static unsigned char snd_ad1816a_get_format(ad1816a_t *chip, | |||
110 | return (channels > 1) ? (retval | AD1816A_FMT_STEREO) : retval; | 110 | return (channels > 1) ? (retval | AD1816A_FMT_STEREO) : retval; |
111 | } | 111 | } |
112 | 112 | ||
113 | static int snd_ad1816a_open(ad1816a_t *chip, unsigned int mode) | 113 | static int snd_ad1816a_open(struct snd_ad1816a *chip, unsigned int mode) |
114 | { | 114 | { |
115 | unsigned long flags; | 115 | unsigned long flags; |
116 | 116 | ||
@@ -146,7 +146,7 @@ static int snd_ad1816a_open(ad1816a_t *chip, unsigned int mode) | |||
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | 148 | ||
149 | static void snd_ad1816a_close(ad1816a_t *chip, unsigned int mode) | 149 | static void snd_ad1816a_close(struct snd_ad1816a *chip, unsigned int mode) |
150 | { | 150 | { |
151 | unsigned long flags; | 151 | unsigned long flags; |
152 | 152 | ||
@@ -178,7 +178,7 @@ static void snd_ad1816a_close(ad1816a_t *chip, unsigned int mode) | |||
178 | } | 178 | } |
179 | 179 | ||
180 | 180 | ||
181 | static int snd_ad1816a_trigger(ad1816a_t *chip, unsigned char what, | 181 | static int snd_ad1816a_trigger(struct snd_ad1816a *chip, unsigned char what, |
182 | int channel, int cmd) | 182 | int channel, int cmd) |
183 | { | 183 | { |
184 | int error = 0; | 184 | int error = 0; |
@@ -204,36 +204,36 @@ static int snd_ad1816a_trigger(ad1816a_t *chip, unsigned char what, | |||
204 | return error; | 204 | return error; |
205 | } | 205 | } |
206 | 206 | ||
207 | static int snd_ad1816a_playback_trigger(snd_pcm_substream_t *substream, int cmd) | 207 | static int snd_ad1816a_playback_trigger(struct snd_pcm_substream *substream, int cmd) |
208 | { | 208 | { |
209 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 209 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
210 | return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE, | 210 | return snd_ad1816a_trigger(chip, AD1816A_PLAYBACK_ENABLE, |
211 | SNDRV_PCM_STREAM_PLAYBACK, cmd); | 211 | SNDRV_PCM_STREAM_PLAYBACK, cmd); |
212 | } | 212 | } |
213 | 213 | ||
214 | static int snd_ad1816a_capture_trigger(snd_pcm_substream_t *substream, int cmd) | 214 | static int snd_ad1816a_capture_trigger(struct snd_pcm_substream *substream, int cmd) |
215 | { | 215 | { |
216 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 216 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
217 | return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE, | 217 | return snd_ad1816a_trigger(chip, AD1816A_CAPTURE_ENABLE, |
218 | SNDRV_PCM_STREAM_CAPTURE, cmd); | 218 | SNDRV_PCM_STREAM_CAPTURE, cmd); |
219 | } | 219 | } |
220 | 220 | ||
221 | static int snd_ad1816a_hw_params(snd_pcm_substream_t * substream, | 221 | static int snd_ad1816a_hw_params(struct snd_pcm_substream *substream, |
222 | snd_pcm_hw_params_t * hw_params) | 222 | struct snd_pcm_hw_params *hw_params) |
223 | { | 223 | { |
224 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | 224 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
225 | } | 225 | } |
226 | 226 | ||
227 | static int snd_ad1816a_hw_free(snd_pcm_substream_t * substream) | 227 | static int snd_ad1816a_hw_free(struct snd_pcm_substream *substream) |
228 | { | 228 | { |
229 | return snd_pcm_lib_free_pages(substream); | 229 | return snd_pcm_lib_free_pages(substream); |
230 | } | 230 | } |
231 | 231 | ||
232 | static int snd_ad1816a_playback_prepare(snd_pcm_substream_t *substream) | 232 | static int snd_ad1816a_playback_prepare(struct snd_pcm_substream *substream) |
233 | { | 233 | { |
234 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 234 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
235 | unsigned long flags; | 235 | unsigned long flags; |
236 | snd_pcm_runtime_t *runtime = substream->runtime; | 236 | struct snd_pcm_runtime *runtime = substream->runtime; |
237 | unsigned int size, rate; | 237 | unsigned int size, rate; |
238 | 238 | ||
239 | spin_lock_irqsave(&chip->lock, flags); | 239 | spin_lock_irqsave(&chip->lock, flags); |
@@ -261,11 +261,11 @@ static int snd_ad1816a_playback_prepare(snd_pcm_substream_t *substream) | |||
261 | return 0; | 261 | return 0; |
262 | } | 262 | } |
263 | 263 | ||
264 | static int snd_ad1816a_capture_prepare(snd_pcm_substream_t *substream) | 264 | static int snd_ad1816a_capture_prepare(struct snd_pcm_substream *substream) |
265 | { | 265 | { |
266 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 266 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
267 | unsigned long flags; | 267 | unsigned long flags; |
268 | snd_pcm_runtime_t *runtime = substream->runtime; | 268 | struct snd_pcm_runtime *runtime = substream->runtime; |
269 | unsigned int size, rate; | 269 | unsigned int size, rate; |
270 | 270 | ||
271 | spin_lock_irqsave(&chip->lock, flags); | 271 | spin_lock_irqsave(&chip->lock, flags); |
@@ -294,9 +294,9 @@ static int snd_ad1816a_capture_prepare(snd_pcm_substream_t *substream) | |||
294 | } | 294 | } |
295 | 295 | ||
296 | 296 | ||
297 | static snd_pcm_uframes_t snd_ad1816a_playback_pointer(snd_pcm_substream_t *substream) | 297 | static snd_pcm_uframes_t snd_ad1816a_playback_pointer(struct snd_pcm_substream *substream) |
298 | { | 298 | { |
299 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 299 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
300 | size_t ptr; | 300 | size_t ptr; |
301 | if (!(chip->mode & AD1816A_MODE_PLAYBACK)) | 301 | if (!(chip->mode & AD1816A_MODE_PLAYBACK)) |
302 | return 0; | 302 | return 0; |
@@ -304,9 +304,9 @@ static snd_pcm_uframes_t snd_ad1816a_playback_pointer(snd_pcm_substream_t *subst | |||
304 | return bytes_to_frames(substream->runtime, ptr); | 304 | return bytes_to_frames(substream->runtime, ptr); |
305 | } | 305 | } |
306 | 306 | ||
307 | static snd_pcm_uframes_t snd_ad1816a_capture_pointer(snd_pcm_substream_t *substream) | 307 | static snd_pcm_uframes_t snd_ad1816a_capture_pointer(struct snd_pcm_substream *substream) |
308 | { | 308 | { |
309 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 309 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
310 | size_t ptr; | 310 | size_t ptr; |
311 | if (!(chip->mode & AD1816A_MODE_CAPTURE)) | 311 | if (!(chip->mode & AD1816A_MODE_CAPTURE)) |
312 | return 0; | 312 | return 0; |
@@ -317,7 +317,7 @@ static snd_pcm_uframes_t snd_ad1816a_capture_pointer(snd_pcm_substream_t *substr | |||
317 | 317 | ||
318 | static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 318 | static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
319 | { | 319 | { |
320 | ad1816a_t *chip = dev_id; | 320 | struct snd_ad1816a *chip = dev_id; |
321 | unsigned char status; | 321 | unsigned char status; |
322 | 322 | ||
323 | spin_lock(&chip->lock); | 323 | spin_lock(&chip->lock); |
@@ -340,7 +340,7 @@ static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs * | |||
340 | } | 340 | } |
341 | 341 | ||
342 | 342 | ||
343 | static snd_pcm_hardware_t snd_ad1816a_playback = { | 343 | static struct snd_pcm_hardware snd_ad1816a_playback = { |
344 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 344 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
345 | SNDRV_PCM_INFO_MMAP_VALID), | 345 | SNDRV_PCM_INFO_MMAP_VALID), |
346 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | | 346 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | |
@@ -359,7 +359,7 @@ static snd_pcm_hardware_t snd_ad1816a_playback = { | |||
359 | .fifo_size = 0, | 359 | .fifo_size = 0, |
360 | }; | 360 | }; |
361 | 361 | ||
362 | static snd_pcm_hardware_t snd_ad1816a_capture = { | 362 | static struct snd_pcm_hardware snd_ad1816a_capture = { |
363 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 363 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
364 | SNDRV_PCM_INFO_MMAP_VALID), | 364 | SNDRV_PCM_INFO_MMAP_VALID), |
365 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | | 365 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | |
@@ -379,32 +379,32 @@ static snd_pcm_hardware_t snd_ad1816a_capture = { | |||
379 | }; | 379 | }; |
380 | 380 | ||
381 | #if 0 /* not used now */ | 381 | #if 0 /* not used now */ |
382 | static int snd_ad1816a_timer_close(snd_timer_t *timer) | 382 | static int snd_ad1816a_timer_close(struct snd_timer *timer) |
383 | { | 383 | { |
384 | ad1816a_t *chip = snd_timer_chip(timer); | 384 | struct snd_ad1816a *chip = snd_timer_chip(timer); |
385 | snd_ad1816a_close(chip, AD1816A_MODE_TIMER); | 385 | snd_ad1816a_close(chip, AD1816A_MODE_TIMER); |
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | 388 | ||
389 | static int snd_ad1816a_timer_open(snd_timer_t *timer) | 389 | static int snd_ad1816a_timer_open(struct snd_timer *timer) |
390 | { | 390 | { |
391 | ad1816a_t *chip = snd_timer_chip(timer); | 391 | struct snd_ad1816a *chip = snd_timer_chip(timer); |
392 | snd_ad1816a_open(chip, AD1816A_MODE_TIMER); | 392 | snd_ad1816a_open(chip, AD1816A_MODE_TIMER); |
393 | return 0; | 393 | return 0; |
394 | } | 394 | } |
395 | 395 | ||
396 | static unsigned long snd_ad1816a_timer_resolution(snd_timer_t *timer) | 396 | static unsigned long snd_ad1816a_timer_resolution(struct snd_timer *timer) |
397 | { | 397 | { |
398 | snd_assert(timer != NULL, return 0); | 398 | snd_assert(timer != NULL, return 0); |
399 | 399 | ||
400 | return 10000; | 400 | return 10000; |
401 | } | 401 | } |
402 | 402 | ||
403 | static int snd_ad1816a_timer_start(snd_timer_t *timer) | 403 | static int snd_ad1816a_timer_start(struct snd_timer *timer) |
404 | { | 404 | { |
405 | unsigned short bits; | 405 | unsigned short bits; |
406 | unsigned long flags; | 406 | unsigned long flags; |
407 | ad1816a_t *chip = snd_timer_chip(timer); | 407 | struct snd_ad1816a *chip = snd_timer_chip(timer); |
408 | spin_lock_irqsave(&chip->lock, flags); | 408 | spin_lock_irqsave(&chip->lock, flags); |
409 | bits = snd_ad1816a_read(chip, AD1816A_INTERRUPT_ENABLE); | 409 | bits = snd_ad1816a_read(chip, AD1816A_INTERRUPT_ENABLE); |
410 | 410 | ||
@@ -419,10 +419,10 @@ static int snd_ad1816a_timer_start(snd_timer_t *timer) | |||
419 | return 0; | 419 | return 0; |
420 | } | 420 | } |
421 | 421 | ||
422 | static int snd_ad1816a_timer_stop(snd_timer_t *timer) | 422 | static int snd_ad1816a_timer_stop(struct snd_timer *timer) |
423 | { | 423 | { |
424 | unsigned long flags; | 424 | unsigned long flags; |
425 | ad1816a_t *chip = snd_timer_chip(timer); | 425 | struct snd_ad1816a *chip = snd_timer_chip(timer); |
426 | spin_lock_irqsave(&chip->lock, flags); | 426 | spin_lock_irqsave(&chip->lock, flags); |
427 | 427 | ||
428 | snd_ad1816a_write_mask(chip, AD1816A_INTERRUPT_ENABLE, | 428 | snd_ad1816a_write_mask(chip, AD1816A_INTERRUPT_ENABLE, |
@@ -432,7 +432,7 @@ static int snd_ad1816a_timer_stop(snd_timer_t *timer) | |||
432 | return 0; | 432 | return 0; |
433 | } | 433 | } |
434 | 434 | ||
435 | static struct _snd_timer_hardware snd_ad1816a_timer_table = { | 435 | static struct snd_timer_hardware snd_ad1816a_timer_table = { |
436 | .flags = SNDRV_TIMER_HW_AUTO, | 436 | .flags = SNDRV_TIMER_HW_AUTO, |
437 | .resolution = 10000, | 437 | .resolution = 10000, |
438 | .ticks = 65535, | 438 | .ticks = 65535, |
@@ -445,10 +445,10 @@ static struct _snd_timer_hardware snd_ad1816a_timer_table = { | |||
445 | #endif /* not used now */ | 445 | #endif /* not used now */ |
446 | 446 | ||
447 | 447 | ||
448 | static int snd_ad1816a_playback_open(snd_pcm_substream_t *substream) | 448 | static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream) |
449 | { | 449 | { |
450 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 450 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
451 | snd_pcm_runtime_t *runtime = substream->runtime; | 451 | struct snd_pcm_runtime *runtime = substream->runtime; |
452 | int error; | 452 | int error; |
453 | 453 | ||
454 | if ((error = snd_ad1816a_open(chip, AD1816A_MODE_PLAYBACK)) < 0) | 454 | if ((error = snd_ad1816a_open(chip, AD1816A_MODE_PLAYBACK)) < 0) |
@@ -461,10 +461,10 @@ static int snd_ad1816a_playback_open(snd_pcm_substream_t *substream) | |||
461 | return 0; | 461 | return 0; |
462 | } | 462 | } |
463 | 463 | ||
464 | static int snd_ad1816a_capture_open(snd_pcm_substream_t *substream) | 464 | static int snd_ad1816a_capture_open(struct snd_pcm_substream *substream) |
465 | { | 465 | { |
466 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 466 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
467 | snd_pcm_runtime_t *runtime = substream->runtime; | 467 | struct snd_pcm_runtime *runtime = substream->runtime; |
468 | int error; | 468 | int error; |
469 | 469 | ||
470 | if ((error = snd_ad1816a_open(chip, AD1816A_MODE_CAPTURE)) < 0) | 470 | if ((error = snd_ad1816a_open(chip, AD1816A_MODE_CAPTURE)) < 0) |
@@ -477,18 +477,18 @@ static int snd_ad1816a_capture_open(snd_pcm_substream_t *substream) | |||
477 | return 0; | 477 | return 0; |
478 | } | 478 | } |
479 | 479 | ||
480 | static int snd_ad1816a_playback_close(snd_pcm_substream_t *substream) | 480 | static int snd_ad1816a_playback_close(struct snd_pcm_substream *substream) |
481 | { | 481 | { |
482 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 482 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
483 | 483 | ||
484 | chip->playback_substream = NULL; | 484 | chip->playback_substream = NULL; |
485 | snd_ad1816a_close(chip, AD1816A_MODE_PLAYBACK); | 485 | snd_ad1816a_close(chip, AD1816A_MODE_PLAYBACK); |
486 | return 0; | 486 | return 0; |
487 | } | 487 | } |
488 | 488 | ||
489 | static int snd_ad1816a_capture_close(snd_pcm_substream_t *substream) | 489 | static int snd_ad1816a_capture_close(struct snd_pcm_substream *substream) |
490 | { | 490 | { |
491 | ad1816a_t *chip = snd_pcm_substream_chip(substream); | 491 | struct snd_ad1816a *chip = snd_pcm_substream_chip(substream); |
492 | 492 | ||
493 | chip->capture_substream = NULL; | 493 | chip->capture_substream = NULL; |
494 | snd_ad1816a_close(chip, AD1816A_MODE_CAPTURE); | 494 | snd_ad1816a_close(chip, AD1816A_MODE_CAPTURE); |
@@ -496,7 +496,7 @@ static int snd_ad1816a_capture_close(snd_pcm_substream_t *substream) | |||
496 | } | 496 | } |
497 | 497 | ||
498 | 498 | ||
499 | static void snd_ad1816a_init(ad1816a_t *chip) | 499 | static void snd_ad1816a_init(struct snd_ad1816a *chip) |
500 | { | 500 | { |
501 | unsigned long flags; | 501 | unsigned long flags; |
502 | 502 | ||
@@ -516,7 +516,7 @@ static void snd_ad1816a_init(ad1816a_t *chip) | |||
516 | spin_unlock_irqrestore(&chip->lock, flags); | 516 | spin_unlock_irqrestore(&chip->lock, flags); |
517 | } | 517 | } |
518 | 518 | ||
519 | static int snd_ad1816a_probe(ad1816a_t *chip) | 519 | static int snd_ad1816a_probe(struct snd_ad1816a *chip) |
520 | { | 520 | { |
521 | unsigned long flags; | 521 | unsigned long flags; |
522 | 522 | ||
@@ -540,7 +540,7 @@ static int snd_ad1816a_probe(ad1816a_t *chip) | |||
540 | return 0; | 540 | return 0; |
541 | } | 541 | } |
542 | 542 | ||
543 | static int snd_ad1816a_free(ad1816a_t *chip) | 543 | static int snd_ad1816a_free(struct snd_ad1816a *chip) |
544 | { | 544 | { |
545 | release_and_free_resource(chip->res_port); | 545 | release_and_free_resource(chip->res_port); |
546 | if (chip->irq >= 0) | 546 | if (chip->irq >= 0) |
@@ -557,13 +557,13 @@ static int snd_ad1816a_free(ad1816a_t *chip) | |||
557 | return 0; | 557 | return 0; |
558 | } | 558 | } |
559 | 559 | ||
560 | static int snd_ad1816a_dev_free(snd_device_t *device) | 560 | static int snd_ad1816a_dev_free(struct snd_device *device) |
561 | { | 561 | { |
562 | ad1816a_t *chip = device->device_data; | 562 | struct snd_ad1816a *chip = device->device_data; |
563 | return snd_ad1816a_free(chip); | 563 | return snd_ad1816a_free(chip); |
564 | } | 564 | } |
565 | 565 | ||
566 | static const char *snd_ad1816a_chip_id(ad1816a_t *chip) | 566 | static const char *snd_ad1816a_chip_id(struct snd_ad1816a *chip) |
567 | { | 567 | { |
568 | switch (chip->hardware) { | 568 | switch (chip->hardware) { |
569 | case AD1816A_HW_AD1816A: return "AD1816A"; | 569 | case AD1816A_HW_AD1816A: return "AD1816A"; |
@@ -576,15 +576,15 @@ static const char *snd_ad1816a_chip_id(ad1816a_t *chip) | |||
576 | } | 576 | } |
577 | } | 577 | } |
578 | 578 | ||
579 | int snd_ad1816a_create(snd_card_t *card, | 579 | int snd_ad1816a_create(struct snd_card *card, |
580 | unsigned long port, int irq, int dma1, int dma2, | 580 | unsigned long port, int irq, int dma1, int dma2, |
581 | ad1816a_t **rchip) | 581 | struct snd_ad1816a **rchip) |
582 | { | 582 | { |
583 | static snd_device_ops_t ops = { | 583 | static struct snd_device_ops ops = { |
584 | .dev_free = snd_ad1816a_dev_free, | 584 | .dev_free = snd_ad1816a_dev_free, |
585 | }; | 585 | }; |
586 | int error; | 586 | int error; |
587 | ad1816a_t *chip; | 587 | struct snd_ad1816a *chip; |
588 | 588 | ||
589 | *rchip = NULL; | 589 | *rchip = NULL; |
590 | 590 | ||
@@ -640,7 +640,7 @@ int snd_ad1816a_create(snd_card_t *card, | |||
640 | return 0; | 640 | return 0; |
641 | } | 641 | } |
642 | 642 | ||
643 | static snd_pcm_ops_t snd_ad1816a_playback_ops = { | 643 | static struct snd_pcm_ops snd_ad1816a_playback_ops = { |
644 | .open = snd_ad1816a_playback_open, | 644 | .open = snd_ad1816a_playback_open, |
645 | .close = snd_ad1816a_playback_close, | 645 | .close = snd_ad1816a_playback_close, |
646 | .ioctl = snd_pcm_lib_ioctl, | 646 | .ioctl = snd_pcm_lib_ioctl, |
@@ -651,7 +651,7 @@ static snd_pcm_ops_t snd_ad1816a_playback_ops = { | |||
651 | .pointer = snd_ad1816a_playback_pointer, | 651 | .pointer = snd_ad1816a_playback_pointer, |
652 | }; | 652 | }; |
653 | 653 | ||
654 | static snd_pcm_ops_t snd_ad1816a_capture_ops = { | 654 | static struct snd_pcm_ops snd_ad1816a_capture_ops = { |
655 | .open = snd_ad1816a_capture_open, | 655 | .open = snd_ad1816a_capture_open, |
656 | .close = snd_ad1816a_capture_close, | 656 | .close = snd_ad1816a_capture_close, |
657 | .ioctl = snd_pcm_lib_ioctl, | 657 | .ioctl = snd_pcm_lib_ioctl, |
@@ -662,10 +662,10 @@ static snd_pcm_ops_t snd_ad1816a_capture_ops = { | |||
662 | .pointer = snd_ad1816a_capture_pointer, | 662 | .pointer = snd_ad1816a_capture_pointer, |
663 | }; | 663 | }; |
664 | 664 | ||
665 | int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm) | 665 | int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm) |
666 | { | 666 | { |
667 | int error; | 667 | int error; |
668 | snd_pcm_t *pcm; | 668 | struct snd_pcm *pcm; |
669 | 669 | ||
670 | if ((error = snd_pcm_new(chip->card, "AD1816A", device, 1, 1, &pcm))) | 670 | if ((error = snd_pcm_new(chip->card, "AD1816A", device, 1, 1, &pcm))) |
671 | return error; | 671 | return error; |
@@ -690,16 +690,16 @@ int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm) | |||
690 | } | 690 | } |
691 | 691 | ||
692 | #if 0 /* not used now */ | 692 | #if 0 /* not used now */ |
693 | static void snd_ad1816a_timer_free(snd_timer_t *timer) | 693 | static void snd_ad1816a_timer_free(struct snd_timer *timer) |
694 | { | 694 | { |
695 | ad1816a_t *chip = timer->private_data; | 695 | struct snd_ad1816a *chip = timer->private_data; |
696 | chip->timer = NULL; | 696 | chip->timer = NULL; |
697 | } | 697 | } |
698 | 698 | ||
699 | int snd_ad1816a_timer(ad1816a_t *chip, int device, snd_timer_t **rtimer) | 699 | int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer) |
700 | { | 700 | { |
701 | snd_timer_t *timer; | 701 | struct snd_timer *timer; |
702 | snd_timer_id_t tid; | 702 | struct snd_timer_id tid; |
703 | int error; | 703 | int error; |
704 | 704 | ||
705 | tid.dev_class = SNDRV_TIMER_CLASS_CARD; | 705 | tid.dev_class = SNDRV_TIMER_CLASS_CARD; |
@@ -724,7 +724,7 @@ int snd_ad1816a_timer(ad1816a_t *chip, int device, snd_timer_t **rtimer) | |||
724 | * | 724 | * |
725 | */ | 725 | */ |
726 | 726 | ||
727 | static int snd_ad1816a_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 727 | static int snd_ad1816a_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
728 | { | 728 | { |
729 | static char *texts[8] = { | 729 | static char *texts[8] = { |
730 | "Line", "Mix", "CD", "Synth", "Video", | 730 | "Line", "Mix", "CD", "Synth", "Video", |
@@ -740,9 +740,9 @@ static int snd_ad1816a_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
740 | return 0; | 740 | return 0; |
741 | } | 741 | } |
742 | 742 | ||
743 | static int snd_ad1816a_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 743 | static int snd_ad1816a_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
744 | { | 744 | { |
745 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 745 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
746 | unsigned long flags; | 746 | unsigned long flags; |
747 | unsigned short val; | 747 | unsigned short val; |
748 | 748 | ||
@@ -754,9 +754,9 @@ static int snd_ad1816a_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
754 | return 0; | 754 | return 0; |
755 | } | 755 | } |
756 | 756 | ||
757 | static int snd_ad1816a_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 757 | static int snd_ad1816a_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
758 | { | 758 | { |
759 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 759 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
760 | unsigned long flags; | 760 | unsigned long flags; |
761 | unsigned short val; | 761 | unsigned short val; |
762 | int change; | 762 | int change; |
@@ -778,7 +778,7 @@ static int snd_ad1816a_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * | |||
778 | .get = snd_ad1816a_get_single, .put = snd_ad1816a_put_single, \ | 778 | .get = snd_ad1816a_get_single, .put = snd_ad1816a_put_single, \ |
779 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } | 779 | .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } |
780 | 780 | ||
781 | static int snd_ad1816a_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 781 | static int snd_ad1816a_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
782 | { | 782 | { |
783 | int mask = (kcontrol->private_value >> 16) & 0xff; | 783 | int mask = (kcontrol->private_value >> 16) & 0xff; |
784 | 784 | ||
@@ -789,9 +789,9 @@ static int snd_ad1816a_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
789 | return 0; | 789 | return 0; |
790 | } | 790 | } |
791 | 791 | ||
792 | static int snd_ad1816a_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 792 | static int snd_ad1816a_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
793 | { | 793 | { |
794 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 794 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
795 | unsigned long flags; | 795 | unsigned long flags; |
796 | int reg = kcontrol->private_value & 0xff; | 796 | int reg = kcontrol->private_value & 0xff; |
797 | int shift = (kcontrol->private_value >> 8) & 0xff; | 797 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -806,9 +806,9 @@ static int snd_ad1816a_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
806 | return 0; | 806 | return 0; |
807 | } | 807 | } |
808 | 808 | ||
809 | static int snd_ad1816a_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 809 | static int snd_ad1816a_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
810 | { | 810 | { |
811 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 811 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
812 | unsigned long flags; | 812 | unsigned long flags; |
813 | int reg = kcontrol->private_value & 0xff; | 813 | int reg = kcontrol->private_value & 0xff; |
814 | int shift = (kcontrol->private_value >> 8) & 0xff; | 814 | int shift = (kcontrol->private_value >> 8) & 0xff; |
@@ -835,7 +835,7 @@ static int snd_ad1816a_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
835 | .get = snd_ad1816a_get_double, .put = snd_ad1816a_put_double, \ | 835 | .get = snd_ad1816a_get_double, .put = snd_ad1816a_put_double, \ |
836 | .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } | 836 | .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } |
837 | 837 | ||
838 | static int snd_ad1816a_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 838 | static int snd_ad1816a_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
839 | { | 839 | { |
840 | int mask = (kcontrol->private_value >> 16) & 0xff; | 840 | int mask = (kcontrol->private_value >> 16) & 0xff; |
841 | 841 | ||
@@ -846,9 +846,9 @@ static int snd_ad1816a_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
846 | return 0; | 846 | return 0; |
847 | } | 847 | } |
848 | 848 | ||
849 | static int snd_ad1816a_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 849 | static int snd_ad1816a_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
850 | { | 850 | { |
851 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 851 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
852 | unsigned long flags; | 852 | unsigned long flags; |
853 | int reg = kcontrol->private_value & 0xff; | 853 | int reg = kcontrol->private_value & 0xff; |
854 | int shift_left = (kcontrol->private_value >> 8) & 0x0f; | 854 | int shift_left = (kcontrol->private_value >> 8) & 0x0f; |
@@ -869,9 +869,9 @@ static int snd_ad1816a_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
869 | return 0; | 869 | return 0; |
870 | } | 870 | } |
871 | 871 | ||
872 | static int snd_ad1816a_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 872 | static int snd_ad1816a_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
873 | { | 873 | { |
874 | ad1816a_t *chip = snd_kcontrol_chip(kcontrol); | 874 | struct snd_ad1816a *chip = snd_kcontrol_chip(kcontrol); |
875 | unsigned long flags; | 875 | unsigned long flags; |
876 | int reg = kcontrol->private_value & 0xff; | 876 | int reg = kcontrol->private_value & 0xff; |
877 | int shift_left = (kcontrol->private_value >> 8) & 0x0f; | 877 | int shift_left = (kcontrol->private_value >> 8) & 0x0f; |
@@ -898,7 +898,7 @@ static int snd_ad1816a_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
898 | return change; | 898 | return change; |
899 | } | 899 | } |
900 | 900 | ||
901 | static snd_kcontrol_new_t snd_ad1816a_controls[] = { | 901 | static struct snd_kcontrol_new snd_ad1816a_controls[] = { |
902 | AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1), | 902 | AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1), |
903 | AD1816A_DOUBLE("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1), | 903 | AD1816A_DOUBLE("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1), |
904 | AD1816A_DOUBLE("PCM Playback Switch", AD1816A_VOICE_ATT, 15, 7, 1, 1), | 904 | AD1816A_DOUBLE("PCM Playback Switch", AD1816A_VOICE_ATT, 15, 7, 1, 1), |
@@ -933,9 +933,9 @@ AD1816A_SINGLE("3D Control - Switch", AD1816A_3D_PHAT_CTRL, 15, 1, 1), | |||
933 | AD1816A_SINGLE("3D Control - Level", AD1816A_3D_PHAT_CTRL, 0, 15, 0), | 933 | AD1816A_SINGLE("3D Control - Level", AD1816A_3D_PHAT_CTRL, 0, 15, 0), |
934 | }; | 934 | }; |
935 | 935 | ||
936 | int snd_ad1816a_mixer(ad1816a_t *chip) | 936 | int snd_ad1816a_mixer(struct snd_ad1816a *chip) |
937 | { | 937 | { |
938 | snd_card_t *card; | 938 | struct snd_card *card; |
939 | unsigned int idx; | 939 | unsigned int idx; |
940 | int err; | 940 | int err; |
941 | 941 | ||