diff options
-rw-r--r-- | sound/pci/als300.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 9acd88ab93a4..fc1043a79007 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c | |||
@@ -87,19 +87,8 @@ | |||
87 | #define PLAYBACK_BLOCK_COUNTER 0x9A | 87 | #define PLAYBACK_BLOCK_COUNTER 0x9A |
88 | #define RECORD_BLOCK_COUNTER 0x9B | 88 | #define RECORD_BLOCK_COUNTER 0x9B |
89 | 89 | ||
90 | #define DEBUG_CALLS 0 | ||
91 | #define DEBUG_PLAY_REC 0 | 90 | #define DEBUG_PLAY_REC 0 |
92 | 91 | ||
93 | #if DEBUG_CALLS | ||
94 | #define snd_als300_dbgcalls(format, args...) printk(KERN_DEBUG format, ##args) | ||
95 | #define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __func__) | ||
96 | #define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __func__) | ||
97 | #else | ||
98 | #define snd_als300_dbgcalls(format, args...) | ||
99 | #define snd_als300_dbgcallenter() | ||
100 | #define snd_als300_dbgcallleave() | ||
101 | #endif | ||
102 | |||
103 | #if DEBUG_PLAY_REC | 92 | #if DEBUG_PLAY_REC |
104 | #define snd_als300_dbgplay(format, args...) printk(KERN_ERR format, ##args) | 93 | #define snd_als300_dbgplay(format, args...) printk(KERN_ERR format, ##args) |
105 | #else | 94 | #else |
@@ -177,7 +166,6 @@ static inline void snd_als300_gcr_write(unsigned long port, | |||
177 | static void snd_als300_set_irq_flag(struct snd_als300 *chip, int cmd) | 166 | static void snd_als300_set_irq_flag(struct snd_als300 *chip, int cmd) |
178 | { | 167 | { |
179 | u32 tmp = snd_als300_gcr_read(chip->port, MISC_CONTROL); | 168 | u32 tmp = snd_als300_gcr_read(chip->port, MISC_CONTROL); |
180 | snd_als300_dbgcallenter(); | ||
181 | 169 | ||
182 | /* boolean XOR check, since old vs. new hardware have | 170 | /* boolean XOR check, since old vs. new hardware have |
183 | directly reversed bit setting for ENABLE and DISABLE. | 171 | directly reversed bit setting for ENABLE and DISABLE. |
@@ -188,19 +176,16 @@ static void snd_als300_set_irq_flag(struct snd_als300 *chip, int cmd) | |||
188 | else | 176 | else |
189 | tmp &= ~IRQ_SET_BIT; | 177 | tmp &= ~IRQ_SET_BIT; |
190 | snd_als300_gcr_write(chip->port, MISC_CONTROL, tmp); | 178 | snd_als300_gcr_write(chip->port, MISC_CONTROL, tmp); |
191 | snd_als300_dbgcallleave(); | ||
192 | } | 179 | } |
193 | 180 | ||
194 | static int snd_als300_free(struct snd_als300 *chip) | 181 | static int snd_als300_free(struct snd_als300 *chip) |
195 | { | 182 | { |
196 | snd_als300_dbgcallenter(); | ||
197 | snd_als300_set_irq_flag(chip, IRQ_DISABLE); | 183 | snd_als300_set_irq_flag(chip, IRQ_DISABLE); |
198 | if (chip->irq >= 0) | 184 | if (chip->irq >= 0) |
199 | free_irq(chip->irq, chip); | 185 | free_irq(chip->irq, chip); |
200 | pci_release_regions(chip->pci); | 186 | pci_release_regions(chip->pci); |
201 | pci_disable_device(chip->pci); | 187 | pci_disable_device(chip->pci); |
202 | kfree(chip); | 188 | kfree(chip); |
203 | snd_als300_dbgcallleave(); | ||
204 | return 0; | 189 | return 0; |
205 | } | 190 | } |
206 | 191 | ||
@@ -280,9 +265,7 @@ static irqreturn_t snd_als300plus_interrupt(int irq, void *dev_id) | |||
280 | 265 | ||
281 | static void snd_als300_remove(struct pci_dev *pci) | 266 | static void snd_als300_remove(struct pci_dev *pci) |
282 | { | 267 | { |
283 | snd_als300_dbgcallenter(); | ||
284 | snd_card_free(pci_get_drvdata(pci)); | 268 | snd_card_free(pci_get_drvdata(pci)); |
285 | snd_als300_dbgcallleave(); | ||
286 | } | 269 | } |
287 | 270 | ||
288 | static unsigned short snd_als300_ac97_read(struct snd_ac97 *ac97, | 271 | static unsigned short snd_als300_ac97_read(struct snd_ac97 *ac97, |
@@ -330,14 +313,12 @@ static int snd_als300_ac97(struct snd_als300 *chip) | |||
330 | .read = snd_als300_ac97_read, | 313 | .read = snd_als300_ac97_read, |
331 | }; | 314 | }; |
332 | 315 | ||
333 | snd_als300_dbgcallenter(); | ||
334 | if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus)) < 0) | 316 | if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus)) < 0) |
335 | return err; | 317 | return err; |
336 | 318 | ||
337 | memset(&ac97, 0, sizeof(ac97)); | 319 | memset(&ac97, 0, sizeof(ac97)); |
338 | ac97.private_data = chip; | 320 | ac97.private_data = chip; |
339 | 321 | ||
340 | snd_als300_dbgcallleave(); | ||
341 | return snd_ac97_mixer(bus, &ac97, &chip->ac97); | 322 | return snd_ac97_mixer(bus, &ac97, &chip->ac97); |
342 | } | 323 | } |
343 | 324 | ||
@@ -395,13 +376,11 @@ static int snd_als300_playback_open(struct snd_pcm_substream *substream) | |||
395 | 376 | ||
396 | if (!data) | 377 | if (!data) |
397 | return -ENOMEM; | 378 | return -ENOMEM; |
398 | snd_als300_dbgcallenter(); | ||
399 | chip->playback_substream = substream; | 379 | chip->playback_substream = substream; |
400 | runtime->hw = snd_als300_playback_hw; | 380 | runtime->hw = snd_als300_playback_hw; |
401 | runtime->private_data = data; | 381 | runtime->private_data = data; |
402 | data->control_register = PLAYBACK_CONTROL; | 382 | data->control_register = PLAYBACK_CONTROL; |
403 | data->block_counter_register = PLAYBACK_BLOCK_COUNTER; | 383 | data->block_counter_register = PLAYBACK_BLOCK_COUNTER; |
404 | snd_als300_dbgcallleave(); | ||
405 | return 0; | 384 | return 0; |
406 | } | 385 | } |
407 | 386 | ||
@@ -411,11 +390,9 @@ static int snd_als300_playback_close(struct snd_pcm_substream *substream) | |||
411 | struct snd_als300_substream_data *data; | 390 | struct snd_als300_substream_data *data; |
412 | 391 | ||
413 | data = substream->runtime->private_data; | 392 | data = substream->runtime->private_data; |
414 | snd_als300_dbgcallenter(); | ||
415 | kfree(data); | 393 | kfree(data); |
416 | chip->playback_substream = NULL; | 394 | chip->playback_substream = NULL; |
417 | snd_pcm_lib_free_pages(substream); | 395 | snd_pcm_lib_free_pages(substream); |
418 | snd_als300_dbgcallleave(); | ||
419 | return 0; | 396 | return 0; |
420 | } | 397 | } |
421 | 398 | ||
@@ -428,13 +405,11 @@ static int snd_als300_capture_open(struct snd_pcm_substream *substream) | |||
428 | 405 | ||
429 | if (!data) | 406 | if (!data) |
430 | return -ENOMEM; | 407 | return -ENOMEM; |
431 | snd_als300_dbgcallenter(); | ||
432 | chip->capture_substream = substream; | 408 | chip->capture_substream = substream; |
433 | runtime->hw = snd_als300_capture_hw; | 409 | runtime->hw = snd_als300_capture_hw; |
434 | runtime->private_data = data; | 410 | runtime->private_data = data; |
435 | data->control_register = RECORD_CONTROL; | 411 | data->control_register = RECORD_CONTROL; |
436 | data->block_counter_register = RECORD_BLOCK_COUNTER; | 412 | data->block_counter_register = RECORD_BLOCK_COUNTER; |
437 | snd_als300_dbgcallleave(); | ||
438 | return 0; | 413 | return 0; |
439 | } | 414 | } |
440 | 415 | ||
@@ -444,11 +419,9 @@ static int snd_als300_capture_close(struct snd_pcm_substream *substream) | |||
444 | struct snd_als300_substream_data *data; | 419 | struct snd_als300_substream_data *data; |
445 | 420 | ||
446 | data = substream->runtime->private_data; | 421 | data = substream->runtime->private_data; |
447 | snd_als300_dbgcallenter(); | ||
448 | kfree(data); | 422 | kfree(data); |
449 | chip->capture_substream = NULL; | 423 | chip->capture_substream = NULL; |
450 | snd_pcm_lib_free_pages(substream); | 424 | snd_pcm_lib_free_pages(substream); |
451 | snd_als300_dbgcallleave(); | ||
452 | return 0; | 425 | return 0; |
453 | } | 426 | } |
454 | 427 | ||
@@ -472,7 +445,6 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream) | |||
472 | unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); | 445 | unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); |
473 | unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); | 446 | unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); |
474 | 447 | ||
475 | snd_als300_dbgcallenter(); | ||
476 | spin_lock_irq(&chip->reg_lock); | 448 | spin_lock_irq(&chip->reg_lock); |
477 | tmp = snd_als300_gcr_read(chip->port, PLAYBACK_CONTROL); | 449 | tmp = snd_als300_gcr_read(chip->port, PLAYBACK_CONTROL); |
478 | tmp &= ~TRANSFER_START; | 450 | tmp &= ~TRANSFER_START; |
@@ -491,7 +463,6 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream) | |||
491 | snd_als300_gcr_write(chip->port, PLAYBACK_END, | 463 | snd_als300_gcr_write(chip->port, PLAYBACK_END, |
492 | runtime->dma_addr + buffer_bytes - 1); | 464 | runtime->dma_addr + buffer_bytes - 1); |
493 | spin_unlock_irq(&chip->reg_lock); | 465 | spin_unlock_irq(&chip->reg_lock); |
494 | snd_als300_dbgcallleave(); | ||
495 | return 0; | 466 | return 0; |
496 | } | 467 | } |
497 | 468 | ||
@@ -503,7 +474,6 @@ static int snd_als300_capture_prepare(struct snd_pcm_substream *substream) | |||
503 | unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); | 474 | unsigned short period_bytes = snd_pcm_lib_period_bytes(substream); |
504 | unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); | 475 | unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream); |
505 | 476 | ||
506 | snd_als300_dbgcallenter(); | ||
507 | spin_lock_irq(&chip->reg_lock); | 477 | spin_lock_irq(&chip->reg_lock); |
508 | tmp = snd_als300_gcr_read(chip->port, RECORD_CONTROL); | 478 | tmp = snd_als300_gcr_read(chip->port, RECORD_CONTROL); |
509 | tmp &= ~TRANSFER_START; | 479 | tmp &= ~TRANSFER_START; |
@@ -522,7 +492,6 @@ static int snd_als300_capture_prepare(struct snd_pcm_substream *substream) | |||
522 | snd_als300_gcr_write(chip->port, RECORD_END, | 492 | snd_als300_gcr_write(chip->port, RECORD_END, |
523 | runtime->dma_addr + buffer_bytes - 1); | 493 | runtime->dma_addr + buffer_bytes - 1); |
524 | spin_unlock_irq(&chip->reg_lock); | 494 | spin_unlock_irq(&chip->reg_lock); |
525 | snd_als300_dbgcallleave(); | ||
526 | return 0; | 495 | return 0; |
527 | } | 496 | } |
528 | 497 | ||
@@ -537,7 +506,6 @@ static int snd_als300_trigger(struct snd_pcm_substream *substream, int cmd) | |||
537 | data = substream->runtime->private_data; | 506 | data = substream->runtime->private_data; |
538 | reg = data->control_register; | 507 | reg = data->control_register; |
539 | 508 | ||
540 | snd_als300_dbgcallenter(); | ||
541 | spin_lock(&chip->reg_lock); | 509 | spin_lock(&chip->reg_lock); |
542 | switch (cmd) { | 510 | switch (cmd) { |
543 | case SNDRV_PCM_TRIGGER_START: | 511 | case SNDRV_PCM_TRIGGER_START: |
@@ -568,7 +536,6 @@ static int snd_als300_trigger(struct snd_pcm_substream *substream, int cmd) | |||
568 | ret = -EINVAL; | 536 | ret = -EINVAL; |
569 | } | 537 | } |
570 | spin_unlock(&chip->reg_lock); | 538 | spin_unlock(&chip->reg_lock); |
571 | snd_als300_dbgcallleave(); | ||
572 | return ret; | 539 | return ret; |
573 | } | 540 | } |
574 | 541 | ||
@@ -582,7 +549,6 @@ static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream) | |||
582 | data = substream->runtime->private_data; | 549 | data = substream->runtime->private_data; |
583 | period_bytes = snd_pcm_lib_period_bytes(substream); | 550 | period_bytes = snd_pcm_lib_period_bytes(substream); |
584 | 551 | ||
585 | snd_als300_dbgcallenter(); | ||
586 | spin_lock(&chip->reg_lock); | 552 | spin_lock(&chip->reg_lock); |
587 | current_ptr = (u16) snd_als300_gcr_read(chip->port, | 553 | current_ptr = (u16) snd_als300_gcr_read(chip->port, |
588 | data->block_counter_register) + 4; | 554 | data->block_counter_register) + 4; |
@@ -595,7 +561,6 @@ static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream) | |||
595 | if (data->period_flipflop == 0) | 561 | if (data->period_flipflop == 0) |
596 | current_ptr += period_bytes; | 562 | current_ptr += period_bytes; |
597 | snd_als300_dbgplay("Pointer (bytes): %d\n", current_ptr); | 563 | snd_als300_dbgplay("Pointer (bytes): %d\n", current_ptr); |
598 | snd_als300_dbgcallleave(); | ||
599 | return bytes_to_frames(substream->runtime, current_ptr); | 564 | return bytes_to_frames(substream->runtime, current_ptr); |
600 | } | 565 | } |
601 | 566 | ||
@@ -626,7 +591,6 @@ static int snd_als300_new_pcm(struct snd_als300 *chip) | |||
626 | struct snd_pcm *pcm; | 591 | struct snd_pcm *pcm; |
627 | int err; | 592 | int err; |
628 | 593 | ||
629 | snd_als300_dbgcallenter(); | ||
630 | err = snd_pcm_new(chip->card, "ALS300", 0, 1, 1, &pcm); | 594 | err = snd_pcm_new(chip->card, "ALS300", 0, 1, 1, &pcm); |
631 | if (err < 0) | 595 | if (err < 0) |
632 | return err; | 596 | return err; |
@@ -643,7 +607,6 @@ static int snd_als300_new_pcm(struct snd_als300 *chip) | |||
643 | /* pre-allocation of buffers */ | 607 | /* pre-allocation of buffers */ |
644 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 608 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
645 | snd_dma_pci_data(chip->pci), 64*1024, 64*1024); | 609 | snd_dma_pci_data(chip->pci), 64*1024, 64*1024); |
646 | snd_als300_dbgcallleave(); | ||
647 | return 0; | 610 | return 0; |
648 | } | 611 | } |
649 | 612 | ||
@@ -652,7 +615,6 @@ static void snd_als300_init(struct snd_als300 *chip) | |||
652 | unsigned long flags; | 615 | unsigned long flags; |
653 | u32 tmp; | 616 | u32 tmp; |
654 | 617 | ||
655 | snd_als300_dbgcallenter(); | ||
656 | spin_lock_irqsave(&chip->reg_lock, flags); | 618 | spin_lock_irqsave(&chip->reg_lock, flags); |
657 | chip->revision = (snd_als300_gcr_read(chip->port, MISC_CONTROL) >> 16) | 619 | chip->revision = (snd_als300_gcr_read(chip->port, MISC_CONTROL) >> 16) |
658 | & 0x0000000F; | 620 | & 0x0000000F; |
@@ -679,7 +641,6 @@ static void snd_als300_init(struct snd_als300 *chip) | |||
679 | snd_als300_gcr_write(chip->port, PLAYBACK_CONTROL, | 641 | snd_als300_gcr_write(chip->port, PLAYBACK_CONTROL, |
680 | tmp & ~TRANSFER_START); | 642 | tmp & ~TRANSFER_START); |
681 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 643 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
682 | snd_als300_dbgcallleave(); | ||
683 | } | 644 | } |
684 | 645 | ||
685 | static int snd_als300_create(struct snd_card *card, | 646 | static int snd_als300_create(struct snd_card *card, |
@@ -695,7 +656,6 @@ static int snd_als300_create(struct snd_card *card, | |||
695 | }; | 656 | }; |
696 | *rchip = NULL; | 657 | *rchip = NULL; |
697 | 658 | ||
698 | snd_als300_dbgcallenter(); | ||
699 | if ((err = pci_enable_device(pci)) < 0) | 659 | if ((err = pci_enable_device(pci)) < 0) |
700 | return err; | 660 | return err; |
701 | 661 | ||
@@ -762,7 +722,6 @@ static int snd_als300_create(struct snd_card *card, | |||
762 | } | 722 | } |
763 | 723 | ||
764 | *rchip = chip; | 724 | *rchip = chip; |
765 | snd_als300_dbgcallleave(); | ||
766 | return 0; | 725 | return 0; |
767 | } | 726 | } |
768 | 727 | ||