diff options
| -rw-r--r-- | sound/pci/asihpi/asihpi.c | 100 |
1 files changed, 47 insertions, 53 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index c90d77ad681..f53a31e939c 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
| @@ -22,21 +22,6 @@ | |||
| 22 | * for any purpose including commercial applications. | 22 | * for any purpose including commercial applications. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | /* >0: print Hw params, timer vars. >1: print stream write/copy sizes */ | ||
| 26 | #define REALLY_VERBOSE_LOGGING 0 | ||
| 27 | |||
| 28 | #if REALLY_VERBOSE_LOGGING | ||
| 29 | #define VPRINTK1 snd_printd | ||
| 30 | #else | ||
| 31 | #define VPRINTK1(...) | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #if REALLY_VERBOSE_LOGGING > 1 | ||
| 35 | #define VPRINTK2 snd_printd | ||
| 36 | #else | ||
| 37 | #define VPRINTK2(...) | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #include "hpi_internal.h" | 25 | #include "hpi_internal.h" |
| 41 | #include "hpimsginit.h" | 26 | #include "hpimsginit.h" |
| 42 | #include "hpioctl.h" | 27 | #include "hpioctl.h" |
| @@ -57,11 +42,25 @@ | |||
| 57 | #include <sound/tlv.h> | 42 | #include <sound/tlv.h> |
| 58 | #include <sound/hwdep.h> | 43 | #include <sound/hwdep.h> |
| 59 | 44 | ||
| 60 | |||
| 61 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
| 62 | MODULE_AUTHOR("AudioScience inc. <support@audioscience.com>"); | 46 | MODULE_AUTHOR("AudioScience inc. <support@audioscience.com>"); |
| 63 | MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx"); | 47 | MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx"); |
| 64 | 48 | ||
| 49 | #if defined CONFIG_SND_DEBUG_VERBOSE | ||
| 50 | /** | ||
| 51 | * snd_printddd - very verbose debug printk | ||
| 52 | * @format: format string | ||
| 53 | * | ||
| 54 | * Works like snd_printk() for debugging purposes. | ||
| 55 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. | ||
| 56 | * Must set snd module debug parameter to 3 to enable at runtime. | ||
| 57 | */ | ||
| 58 | #define snd_printddd(format, args...) \ | ||
| 59 | __snd_printk(3, __FILE__, __LINE__, format, ##args) | ||
| 60 | #else | ||
| 61 | #define snd_printddd(format, args...) do { } while (0) | ||
| 62 | #endif | ||
| 63 | |||
| 65 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* index 0-MAX */ | 64 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* index 0-MAX */ |
| 66 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 65 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
| 67 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 66 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
| @@ -289,7 +288,6 @@ static u16 handle_error(u16 err, int line, char *filename) | |||
| 289 | #define hpi_handle_error(x) handle_error(x, __LINE__, __FILE__) | 288 | #define hpi_handle_error(x) handle_error(x, __LINE__, __FILE__) |
| 290 | 289 | ||
| 291 | /***************************** GENERAL PCM ****************/ | 290 | /***************************** GENERAL PCM ****************/ |
| 292 | #if REALLY_VERBOSE_LOGGING | ||
| 293 | static void print_hwparams(struct snd_pcm_hw_params *p) | 291 | static void print_hwparams(struct snd_pcm_hw_params *p) |
| 294 | { | 292 | { |
| 295 | snd_printd("HWPARAMS \n"); | 293 | snd_printd("HWPARAMS \n"); |
| @@ -304,9 +302,6 @@ static void print_hwparams(struct snd_pcm_hw_params *p) | |||
| 304 | snd_printd("periods %d \n", params_periods(p)); | 302 | snd_printd("periods %d \n", params_periods(p)); |
| 305 | snd_printd("buffer_size %d \n", params_buffer_size(p)); | 303 | snd_printd("buffer_size %d \n", params_buffer_size(p)); |
| 306 | } | 304 | } |
| 307 | #else | ||
| 308 | #define print_hwparams(x) | ||
| 309 | #endif | ||
| 310 | 305 | ||
| 311 | static snd_pcm_format_t hpi_to_alsa_formats[] = { | 306 | static snd_pcm_format_t hpi_to_alsa_formats[] = { |
| 312 | -1, /* INVALID */ | 307 | -1, /* INVALID */ |
| @@ -464,7 +459,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
| 464 | if (err) | 459 | if (err) |
| 465 | return err; | 460 | return err; |
| 466 | 461 | ||
| 467 | VPRINTK1(KERN_INFO "format %d, %d chans, %d_hz\n", | 462 | snd_printdd("format %d, %d chans, %d_hz\n", |
| 468 | format, params_channels(params), | 463 | format, params_channels(params), |
| 469 | params_rate(params)); | 464 | params_rate(params)); |
| 470 | 465 | ||
| @@ -487,13 +482,12 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
| 487 | err = hpi_stream_host_buffer_attach(dpcm->h_stream, | 482 | err = hpi_stream_host_buffer_attach(dpcm->h_stream, |
| 488 | params_buffer_bytes(params), runtime->dma_addr); | 483 | params_buffer_bytes(params), runtime->dma_addr); |
| 489 | if (err == 0) { | 484 | if (err == 0) { |
| 490 | VPRINTK1(KERN_INFO | 485 | snd_printdd( |
| 491 | "stream_host_buffer_attach succeeded %u %lu\n", | 486 | "stream_host_buffer_attach succeeded %u %lu\n", |
| 492 | params_buffer_bytes(params), | 487 | params_buffer_bytes(params), |
| 493 | (unsigned long)runtime->dma_addr); | 488 | (unsigned long)runtime->dma_addr); |
| 494 | } else { | 489 | } else { |
| 495 | snd_printd(KERN_INFO | 490 | snd_printd("stream_host_buffer_attach error %d\n", |
| 496 | "stream_host_buffer_attach error %d\n", | ||
| 497 | err); | 491 | err); |
| 498 | return -ENOMEM; | 492 | return -ENOMEM; |
| 499 | } | 493 | } |
| @@ -502,7 +496,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
| 502 | &dpcm->hpi_buffer_attached, | 496 | &dpcm->hpi_buffer_attached, |
| 503 | NULL, NULL, NULL); | 497 | NULL, NULL, NULL); |
| 504 | 498 | ||
| 505 | VPRINTK1(KERN_INFO "stream_host_buffer_attach status 0x%x\n", | 499 | snd_printdd("stream_host_buffer_attach status 0x%x\n", |
| 506 | dpcm->hpi_buffer_attached); | 500 | dpcm->hpi_buffer_attached); |
| 507 | } | 501 | } |
| 508 | bytes_per_sec = params_rate(params) * params_channels(params); | 502 | bytes_per_sec = params_rate(params) * params_channels(params); |
| @@ -515,7 +509,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, | |||
| 515 | dpcm->bytes_per_sec = bytes_per_sec; | 509 | dpcm->bytes_per_sec = bytes_per_sec; |
| 516 | dpcm->buffer_bytes = params_buffer_bytes(params); | 510 | dpcm->buffer_bytes = params_buffer_bytes(params); |
| 517 | dpcm->period_bytes = params_period_bytes(params); | 511 | dpcm->period_bytes = params_period_bytes(params); |
| 518 | VPRINTK1(KERN_INFO "buffer_bytes=%d, period_bytes=%d, bps=%d\n", | 512 | snd_printdd("buffer_bytes=%d, period_bytes=%d, bps=%d\n", |
| 519 | dpcm->buffer_bytes, dpcm->period_bytes, bytes_per_sec); | 513 | dpcm->buffer_bytes, dpcm->period_bytes, bytes_per_sec); |
| 520 | 514 | ||
| 521 | return 0; | 515 | return 0; |
| @@ -571,7 +565,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 571 | struct snd_pcm_substream *s; | 565 | struct snd_pcm_substream *s; |
| 572 | u16 e; | 566 | u16 e; |
| 573 | 567 | ||
| 574 | VPRINTK1(KERN_INFO "%c%d trigger\n", | 568 | snd_printdd("%c%d trigger\n", |
| 575 | SCHR(substream->stream), substream->number); | 569 | SCHR(substream->stream), substream->number); |
| 576 | switch (cmd) { | 570 | switch (cmd) { |
| 577 | case SNDRV_PCM_TRIGGER_START: | 571 | case SNDRV_PCM_TRIGGER_START: |
| @@ -595,7 +589,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 595 | * data?? | 589 | * data?? |
| 596 | */ | 590 | */ |
| 597 | unsigned int preload = ds->period_bytes * 1; | 591 | unsigned int preload = ds->period_bytes * 1; |
| 598 | VPRINTK2(KERN_INFO "%d preload x%x\n", s->number, preload); | 592 | snd_printddd("%d preload x%x\n", s->number, preload); |
| 599 | hpi_handle_error(hpi_outstream_write_buf( | 593 | hpi_handle_error(hpi_outstream_write_buf( |
| 600 | ds->h_stream, | 594 | ds->h_stream, |
| 601 | &runtime->dma_area[0], | 595 | &runtime->dma_area[0], |
| @@ -605,7 +599,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 605 | } | 599 | } |
| 606 | 600 | ||
| 607 | if (card->support_grouping) { | 601 | if (card->support_grouping) { |
| 608 | VPRINTK1(KERN_INFO "\t%c%d group\n", | 602 | snd_printdd("\t%c%d group\n", |
| 609 | SCHR(s->stream), | 603 | SCHR(s->stream), |
| 610 | s->number); | 604 | s->number); |
| 611 | e = hpi_stream_group_add( | 605 | e = hpi_stream_group_add( |
| @@ -620,7 +614,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 620 | } else | 614 | } else |
| 621 | break; | 615 | break; |
| 622 | } | 616 | } |
| 623 | VPRINTK1(KERN_INFO "start\n"); | 617 | snd_printdd("start\n"); |
| 624 | /* start the master stream */ | 618 | /* start the master stream */ |
| 625 | snd_card_asihpi_pcm_timer_start(substream); | 619 | snd_card_asihpi_pcm_timer_start(substream); |
| 626 | if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || | 620 | if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || |
| @@ -642,14 +636,14 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 642 | s->runtime->status->state = SNDRV_PCM_STATE_SETUP; | 636 | s->runtime->status->state = SNDRV_PCM_STATE_SETUP; |
| 643 | 637 | ||
| 644 | if (card->support_grouping) { | 638 | if (card->support_grouping) { |
| 645 | VPRINTK1(KERN_INFO "\t%c%d group\n", | 639 | snd_printdd("\t%c%d group\n", |
| 646 | SCHR(s->stream), | 640 | SCHR(s->stream), |
| 647 | s->number); | 641 | s->number); |
| 648 | snd_pcm_trigger_done(s, substream); | 642 | snd_pcm_trigger_done(s, substream); |
| 649 | } else | 643 | } else |
| 650 | break; | 644 | break; |
| 651 | } | 645 | } |
| 652 | VPRINTK1(KERN_INFO "stop\n"); | 646 | snd_printdd("stop\n"); |
| 653 | 647 | ||
| 654 | /* _prepare and _hwparams reset the stream */ | 648 | /* _prepare and _hwparams reset the stream */ |
| 655 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); | 649 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); |
| @@ -662,12 +656,12 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
| 662 | break; | 656 | break; |
| 663 | 657 | ||
| 664 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 658 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
| 665 | VPRINTK1(KERN_INFO "pause release\n"); | 659 | snd_printdd("pause release\n"); |
| 666 | hpi_handle_error(hpi_stream_start(dpcm->h_stream)); | 660 | hpi_handle_error(hpi_stream_start(dpcm->h_stream)); |
| 667 | snd_card_asihpi_pcm_timer_start(substream); | 661 | snd_card_asihpi_pcm_timer_start(substream); |
| 668 | break; | 662 | break; |
| 669 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 663 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
| 670 | VPRINTK1(KERN_INFO "pause\n"); | 664 | snd_printdd("pause\n"); |
| 671 | snd_card_asihpi_pcm_timer_stop(substream); | 665 | snd_card_asihpi_pcm_timer_stop(substream); |
| 672 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); | 666 | hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); |
| 673 | break; | 667 | break; |
| @@ -739,7 +733,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 739 | u16 state; | 733 | u16 state; |
| 740 | u32 buffer_size, bytes_avail, samples_played, on_card_bytes; | 734 | u32 buffer_size, bytes_avail, samples_played, on_card_bytes; |
| 741 | 735 | ||
| 742 | VPRINTK1(KERN_INFO "%c%d snd_card_asihpi_timer_function\n", | 736 | snd_printdd("%c%d snd_card_asihpi_timer_function\n", |
| 743 | SCHR(substream->stream), substream->number); | 737 | SCHR(substream->stream), substream->number); |
| 744 | 738 | ||
| 745 | /* find minimum newdata and buffer pos in group */ | 739 | /* find minimum newdata and buffer pos in group */ |
| @@ -768,10 +762,10 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 768 | if ((bytes_avail == 0) && | 762 | if ((bytes_avail == 0) && |
| 769 | (on_card_bytes < ds->pcm_buf_host_rw_ofs)) { | 763 | (on_card_bytes < ds->pcm_buf_host_rw_ofs)) { |
| 770 | hpi_handle_error(hpi_stream_start(ds->h_stream)); | 764 | hpi_handle_error(hpi_stream_start(ds->h_stream)); |
| 771 | VPRINTK1(KERN_INFO "P%d start\n", s->number); | 765 | snd_printdd("P%d start\n", s->number); |
| 772 | } | 766 | } |
| 773 | } else if (state == HPI_STATE_DRAINED) { | 767 | } else if (state == HPI_STATE_DRAINED) { |
| 774 | VPRINTK1(KERN_WARNING "P%d drained\n", | 768 | snd_printd(KERN_WARNING "P%d drained\n", |
| 775 | s->number); | 769 | s->number); |
| 776 | /*snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN); | 770 | /*snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN); |
| 777 | continue; */ | 771 | continue; */ |
| @@ -792,13 +786,13 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 792 | newdata); | 786 | newdata); |
| 793 | } | 787 | } |
| 794 | 788 | ||
| 795 | VPRINTK1(KERN_INFO "PB timer hw_ptr x%04lX, appl_ptr x%04lX\n", | 789 | snd_printdd("hw_ptr x%04lX, appl_ptr x%04lX\n", |
| 796 | (unsigned long)frames_to_bytes(runtime, | 790 | (unsigned long)frames_to_bytes(runtime, |
| 797 | runtime->status->hw_ptr), | 791 | runtime->status->hw_ptr), |
| 798 | (unsigned long)frames_to_bytes(runtime, | 792 | (unsigned long)frames_to_bytes(runtime, |
| 799 | runtime->control->appl_ptr)); | 793 | runtime->control->appl_ptr)); |
| 800 | 794 | ||
| 801 | VPRINTK1(KERN_INFO "%d %c%d S=%d, rw=%04X, dma=x%04X, left=x%04X," | 795 | snd_printdd("%d %c%d S=%d, rw=%04X, dma=x%04X, left=x%04X," |
| 802 | " aux=x%04X space=x%04X\n", | 796 | " aux=x%04X space=x%04X\n", |
| 803 | loops, SCHR(s->stream), s->number, | 797 | loops, SCHR(s->stream), s->number, |
| 804 | state, ds->pcm_buf_host_rw_ofs, pcm_buf_dma_ofs, (int)bytes_avail, | 798 | state, ds->pcm_buf_host_rw_ofs, pcm_buf_dma_ofs, (int)bytes_avail, |
| @@ -820,7 +814,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 820 | 814 | ||
| 821 | next_jiffies = max(next_jiffies, 1U); | 815 | next_jiffies = max(next_jiffies, 1U); |
| 822 | dpcm->timer.expires = jiffies + next_jiffies; | 816 | dpcm->timer.expires = jiffies + next_jiffies; |
| 823 | VPRINTK1(KERN_INFO "jif %d buf pos x%04X newdata x%04X xfer x%04X\n", | 817 | snd_printdd("jif %d buf pos x%04X newdata x%04X xfer x%04X\n", |
| 824 | next_jiffies, pcm_buf_dma_ofs, newdata, xfercount); | 818 | next_jiffies, pcm_buf_dma_ofs, newdata, xfercount); |
| 825 | 819 | ||
| 826 | snd_pcm_group_for_each_entry(s, substream) { | 820 | snd_pcm_group_for_each_entry(s, substream) { |
| @@ -835,7 +829,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 835 | if (xfercount && (on_card_bytes <= ds->period_bytes)) { | 829 | if (xfercount && (on_card_bytes <= ds->period_bytes)) { |
| 836 | if (card->support_mmap) { | 830 | if (card->support_mmap) { |
| 837 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 831 | if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
| 838 | VPRINTK2(KERN_INFO "P%d write x%04x\n", | 832 | snd_printddd("P%d write x%04x\n", |
| 839 | s->number, | 833 | s->number, |
| 840 | ds->period_bytes); | 834 | ds->period_bytes); |
| 841 | hpi_handle_error( | 835 | hpi_handle_error( |
| @@ -846,7 +840,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 846 | xfercount, | 840 | xfercount, |
| 847 | &ds->format)); | 841 | &ds->format)); |
| 848 | } else { | 842 | } else { |
| 849 | VPRINTK2(KERN_INFO "C%d read x%04x\n", | 843 | snd_printddd("C%d read x%04x\n", |
| 850 | s->number, | 844 | s->number, |
| 851 | xfercount); | 845 | xfercount); |
| 852 | hpi_handle_error( | 846 | hpi_handle_error( |
| @@ -869,7 +863,7 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
| 869 | static int snd_card_asihpi_playback_ioctl(struct snd_pcm_substream *substream, | 863 | static int snd_card_asihpi_playback_ioctl(struct snd_pcm_substream *substream, |
| 870 | unsigned int cmd, void *arg) | 864 | unsigned int cmd, void *arg) |
| 871 | { | 865 | { |
| 872 | /* snd_printd(KERN_INFO "Playback ioctl %d\n", cmd); */ | 866 | snd_printdd(KERN_INFO "Playback ioctl %d\n", cmd); |
| 873 | return snd_pcm_lib_ioctl(substream, cmd, arg); | 867 | return snd_pcm_lib_ioctl(substream, cmd, arg); |
| 874 | } | 868 | } |
| 875 | 869 | ||
| @@ -879,7 +873,7 @@ static int snd_card_asihpi_playback_prepare(struct snd_pcm_substream * | |||
| 879 | struct snd_pcm_runtime *runtime = substream->runtime; | 873 | struct snd_pcm_runtime *runtime = substream->runtime; |
| 880 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; | 874 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; |
| 881 | 875 | ||
| 882 | VPRINTK1(KERN_INFO "playback prepare %d\n", substream->number); | 876 | snd_printdd("playback prepare %d\n", substream->number); |
| 883 | 877 | ||
| 884 | hpi_handle_error(hpi_outstream_reset(dpcm->h_stream)); | 878 | hpi_handle_error(hpi_outstream_reset(dpcm->h_stream)); |
| 885 | dpcm->pcm_buf_host_rw_ofs = 0; | 879 | dpcm->pcm_buf_host_rw_ofs = 0; |
| @@ -896,7 +890,7 @@ snd_card_asihpi_playback_pointer(struct snd_pcm_substream *substream) | |||
| 896 | snd_pcm_uframes_t ptr; | 890 | snd_pcm_uframes_t ptr; |
| 897 | 891 | ||
| 898 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); | 892 | ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); |
| 899 | /* VPRINTK2(KERN_INFO "playback_pointer=x%04lx\n", (unsigned long)ptr); */ | 893 | snd_printddd("playback_pointer=x%04lx\n", (unsigned long)ptr); |
| 900 | return ptr; | 894 | return ptr; |
| 901 | } | 895 | } |
| 902 | 896 | ||
| @@ -1018,7 +1012,7 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream) | |||
| 1018 | 1012 | ||
| 1019 | snd_pcm_set_sync(substream); | 1013 | snd_pcm_set_sync(substream); |
| 1020 | 1014 | ||
| 1021 | VPRINTK1(KERN_INFO "playback open\n"); | 1015 | snd_printdd("playback open\n"); |
| 1022 | 1016 | ||
| 1023 | return 0; | 1017 | return 0; |
| 1024 | } | 1018 | } |
| @@ -1029,7 +1023,7 @@ static int snd_card_asihpi_playback_close(struct snd_pcm_substream *substream) | |||
| 1029 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; | 1023 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; |
| 1030 | 1024 | ||
| 1031 | hpi_handle_error(hpi_outstream_close(dpcm->h_stream)); | 1025 | hpi_handle_error(hpi_outstream_close(dpcm->h_stream)); |
| 1032 | VPRINTK1(KERN_INFO "playback close\n"); | 1026 | snd_printdd("playback close\n"); |
| 1033 | 1027 | ||
| 1034 | return 0; | 1028 | return 0; |
| 1035 | } | 1029 | } |
| @@ -1049,7 +1043,7 @@ static int snd_card_asihpi_playback_copy(struct snd_pcm_substream *substream, | |||
| 1049 | if (copy_from_user(runtime->dma_area, src, len)) | 1043 | if (copy_from_user(runtime->dma_area, src, len)) |
| 1050 | return -EFAULT; | 1044 | return -EFAULT; |
| 1051 | 1045 | ||
| 1052 | VPRINTK2(KERN_DEBUG "playback copy%d %u bytes\n", | 1046 | snd_printddd("playback copy%d %u bytes\n", |
| 1053 | substream->number, len); | 1047 | substream->number, len); |
| 1054 | 1048 | ||
| 1055 | hpi_handle_error(hpi_outstream_write_buf(dpcm->h_stream, | 1049 | hpi_handle_error(hpi_outstream_write_buf(dpcm->h_stream, |
| @@ -1104,7 +1098,7 @@ snd_card_asihpi_capture_pointer(struct snd_pcm_substream *substream) | |||
| 1104 | struct snd_pcm_runtime *runtime = substream->runtime; | 1098 | struct snd_pcm_runtime *runtime = substream->runtime; |
| 1105 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; | 1099 | struct snd_card_asihpi_pcm *dpcm = runtime->private_data; |
| 1106 | 1100 | ||
| 1107 | VPRINTK2(KERN_INFO "capture pointer %d=%d\n", | 1101 | snd_printddd("capture pointer %d=%d\n", |
| 1108 | substream->number, dpcm->pcm_buf_dma_ofs); | 1102 | substream->number, dpcm->pcm_buf_dma_ofs); |
| 1109 | /* NOTE Unlike playback can't use actual samples_played | 1103 | /* NOTE Unlike playback can't use actual samples_played |
| 1110 | for the capture position, because those samples aren't yet in | 1104 | for the capture position, because those samples aren't yet in |
| @@ -1129,7 +1123,7 @@ static int snd_card_asihpi_capture_prepare(struct snd_pcm_substream *substream) | |||
| 1129 | dpcm->pcm_buf_dma_ofs = 0; | 1123 | dpcm->pcm_buf_dma_ofs = 0; |
| 1130 | dpcm->pcm_buf_elapsed_dma_ofs = 0; | 1124 | dpcm->pcm_buf_elapsed_dma_ofs = 0; |
| 1131 | 1125 | ||
| 1132 | VPRINTK1("Capture Prepare %d\n", substream->number); | 1126 | snd_printdd("Capture Prepare %d\n", substream->number); |
| 1133 | return 0; | 1127 | return 0; |
| 1134 | } | 1128 | } |
| 1135 | 1129 | ||
| @@ -1192,7 +1186,7 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream) | |||
| 1192 | if (dpcm == NULL) | 1186 | if (dpcm == NULL) |
| 1193 | return -ENOMEM; | 1187 | return -ENOMEM; |
| 1194 | 1188 | ||
| 1195 | VPRINTK1("hpi_instream_open adapter %d stream %d\n", | 1189 | snd_printdd("capture open adapter %d stream %d\n", |
| 1196 | card->adapter_index, substream->number); | 1190 | card->adapter_index, substream->number); |
| 1197 | 1191 | ||
| 1198 | err = hpi_handle_error( | 1192 | err = hpi_handle_error( |
| @@ -1262,7 +1256,7 @@ static int snd_card_asihpi_capture_copy(struct snd_pcm_substream *substream, | |||
| 1262 | 1256 | ||
| 1263 | len = frames_to_bytes(runtime, count); | 1257 | len = frames_to_bytes(runtime, count); |
| 1264 | 1258 | ||
| 1265 | VPRINTK2(KERN_INFO "capture copy%d %d bytes\n", substream->number, len); | 1259 | snd_printddd("capture copy%d %d bytes\n", substream->number, len); |
| 1266 | hpi_handle_error(hpi_instream_read_buf(dpcm->h_stream, | 1260 | hpi_handle_error(hpi_instream_read_buf(dpcm->h_stream, |
| 1267 | runtime->dma_area, len)); | 1261 | runtime->dma_area, len)); |
| 1268 | 1262 | ||
| @@ -2906,7 +2900,6 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
| 2906 | asihpi->support_mrx | 2900 | asihpi->support_mrx |
| 2907 | ); | 2901 | ); |
| 2908 | 2902 | ||
| 2909 | |||
| 2910 | err = snd_card_asihpi_pcm_new(asihpi, 0, pcm_substreams); | 2903 | err = snd_card_asihpi_pcm_new(asihpi, 0, pcm_substreams); |
| 2911 | if (err < 0) { | 2904 | if (err < 0) { |
| 2912 | snd_printk(KERN_ERR "pcm_new failed\n"); | 2905 | snd_printk(KERN_ERR "pcm_new failed\n"); |
| @@ -2941,6 +2934,7 @@ static int __devinit snd_asihpi_probe(struct pci_dev *pci_dev, | |||
| 2941 | sprintf(card->longname, "%s %i", | 2934 | sprintf(card->longname, "%s %i", |
| 2942 | card->shortname, asihpi->adapter_index); | 2935 | card->shortname, asihpi->adapter_index); |
| 2943 | err = snd_card_register(card); | 2936 | err = snd_card_register(card); |
| 2937 | |||
| 2944 | if (!err) { | 2938 | if (!err) { |
| 2945 | hpi_card->snd_card_asihpi = card; | 2939 | hpi_card->snd_card_asihpi = card; |
| 2946 | dev++; | 2940 | dev++; |
