diff options
Diffstat (limited to 'sound/pci/pcxhr/pcxhr.c')
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index d97413484ae9..f7f6a687f033 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
@@ -638,22 +638,22 @@ static void pcxhr_trigger_tasklet(unsigned long arg) | |||
638 | static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) | 638 | static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) |
639 | { | 639 | { |
640 | struct pcxhr_stream *stream; | 640 | struct pcxhr_stream *stream; |
641 | struct list_head *pos; | ||
642 | struct snd_pcm_substream *s; | 641 | struct snd_pcm_substream *s; |
643 | int i; | ||
644 | 642 | ||
645 | switch (cmd) { | 643 | switch (cmd) { |
646 | case SNDRV_PCM_TRIGGER_START: | 644 | case SNDRV_PCM_TRIGGER_START: |
647 | snd_printdd("SNDRV_PCM_TRIGGER_START\n"); | 645 | snd_printdd("SNDRV_PCM_TRIGGER_START\n"); |
648 | i = 0; | 646 | if (snd_pcm_stream_linked(subs)) { |
649 | snd_pcm_group_for_each(pos, subs) { | 647 | struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); |
650 | s = snd_pcm_group_substream_entry(pos); | 648 | snd_pcm_group_for_each_entry(s, subs) { |
651 | stream = s->runtime->private_data; | 649 | stream = s->runtime->private_data; |
652 | stream->status = PCXHR_STREAM_STATUS_SCHEDULE_RUN; | 650 | stream->status = |
653 | snd_pcm_trigger_done(s, subs); | 651 | PCXHR_STREAM_STATUS_SCHEDULE_RUN; |
654 | i++; | 652 | snd_pcm_trigger_done(s, subs); |
655 | } | 653 | } |
656 | if (i==1) { | 654 | tasklet_hi_schedule(&chip->mgr->trigger_taskq); |
655 | } else { | ||
656 | stream = subs->runtime->private_data; | ||
657 | snd_printdd("Only one Substream %c %d\n", | 657 | snd_printdd("Only one Substream %c %d\n", |
658 | stream->pipe->is_capture ? 'C' : 'P', | 658 | stream->pipe->is_capture ? 'C' : 'P', |
659 | stream->pipe->first_audio); | 659 | stream->pipe->first_audio); |
@@ -665,15 +665,11 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) | |||
665 | if (pcxhr_set_stream_state(stream)) | 665 | if (pcxhr_set_stream_state(stream)) |
666 | return -EINVAL; | 666 | return -EINVAL; |
667 | stream->status = PCXHR_STREAM_STATUS_RUNNING; | 667 | stream->status = PCXHR_STREAM_STATUS_RUNNING; |
668 | } else { | ||
669 | struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); | ||
670 | tasklet_hi_schedule(&chip->mgr->trigger_taskq); | ||
671 | } | 668 | } |
672 | break; | 669 | break; |
673 | case SNDRV_PCM_TRIGGER_STOP: | 670 | case SNDRV_PCM_TRIGGER_STOP: |
674 | snd_printdd("SNDRV_PCM_TRIGGER_STOP\n"); | 671 | snd_printdd("SNDRV_PCM_TRIGGER_STOP\n"); |
675 | snd_pcm_group_for_each(pos, subs) { | 672 | snd_pcm_group_for_each_entry(s, subs) { |
676 | s = snd_pcm_group_substream_entry(pos); | ||
677 | stream = s->runtime->private_data; | 673 | stream = s->runtime->private_data; |
678 | stream->status = PCXHR_STREAM_STATUS_SCHEDULE_STOP; | 674 | stream->status = PCXHR_STREAM_STATUS_SCHEDULE_STOP; |
679 | if (pcxhr_set_stream_state(stream)) | 675 | if (pcxhr_set_stream_state(stream)) |