summaryrefslogtreecommitdiffstats
path: root/sound/mips
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-09-02 04:26:08 -0400
committerTakashi Iwai <tiwai@suse.de>2018-09-04 06:13:46 -0400
commitd873d5ea89e39e3224ec873a00414b6861507cac (patch)
treeb4ceb95b0a4d072911d9a0278e672e69c545a17c /sound/mips
parentb81e7732ce86eb4b2a7804e1210007f8fcbdb7dd (diff)
ALSA: mips: Cleanup indirect PCM helper usages
We shouldn't set up the indirect PCM parameters at trigger but they should be set at prepare. Also, remove a useless debug message, too. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/mips')
-rw-r--r--sound/mips/hal2.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c
index 2bd1cb7489ff..a4ed54aeaf1d 100644
--- a/sound/mips/hal2.c
+++ b/sound/mips/hal2.c
@@ -564,6 +564,8 @@ static int hal2_playback_prepare(struct snd_pcm_substream *substream)
564 dac->sample_rate = hal2_compute_rate(dac, runtime->rate); 564 dac->sample_rate = hal2_compute_rate(dac, runtime->rate);
565 memset(&dac->pcm_indirect, 0, sizeof(dac->pcm_indirect)); 565 memset(&dac->pcm_indirect, 0, sizeof(dac->pcm_indirect));
566 dac->pcm_indirect.hw_buffer_size = H2_BUF_SIZE; 566 dac->pcm_indirect.hw_buffer_size = H2_BUF_SIZE;
567 dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
568 dac->pcm_indirect.hw_io = dac->buffer_dma;
567 dac->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); 569 dac->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
568 dac->substream = substream; 570 dac->substream = substream;
569 hal2_setup_dac(hal2); 571 hal2_setup_dac(hal2);
@@ -576,8 +578,6 @@ static int hal2_playback_trigger(struct snd_pcm_substream *substream, int cmd)
576 578
577 switch (cmd) { 579 switch (cmd) {
578 case SNDRV_PCM_TRIGGER_START: 580 case SNDRV_PCM_TRIGGER_START:
579 hal2->dac.pcm_indirect.hw_io = hal2->dac.buffer_dma;
580 hal2->dac.pcm_indirect.hw_data = 0;
581 hal2_start_dac(hal2); 581 hal2_start_dac(hal2);
582 break; 582 break;
583 case SNDRV_PCM_TRIGGER_STOP: 583 case SNDRV_PCM_TRIGGER_STOP:
@@ -615,7 +615,6 @@ static int hal2_playback_ack(struct snd_pcm_substream *substream)
615 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); 615 struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
616 struct hal2_codec *dac = &hal2->dac; 616 struct hal2_codec *dac = &hal2->dac;
617 617
618 dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
619 return snd_pcm_indirect_playback_transfer(substream, 618 return snd_pcm_indirect_playback_transfer(substream,
620 &dac->pcm_indirect, 619 &dac->pcm_indirect,
621 hal2_playback_transfer); 620 hal2_playback_transfer);
@@ -655,6 +654,7 @@ static int hal2_capture_prepare(struct snd_pcm_substream *substream)
655 memset(&adc->pcm_indirect, 0, sizeof(adc->pcm_indirect)); 654 memset(&adc->pcm_indirect, 0, sizeof(adc->pcm_indirect));
656 adc->pcm_indirect.hw_buffer_size = H2_BUF_SIZE; 655 adc->pcm_indirect.hw_buffer_size = H2_BUF_SIZE;
657 adc->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2; 656 adc->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
657 adc->pcm_indirect.hw_io = adc->buffer_dma;
658 adc->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); 658 adc->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
659 adc->substream = substream; 659 adc->substream = substream;
660 hal2_setup_adc(hal2); 660 hal2_setup_adc(hal2);
@@ -667,9 +667,6 @@ static int hal2_capture_trigger(struct snd_pcm_substream *substream, int cmd)
667 667
668 switch (cmd) { 668 switch (cmd) {
669 case SNDRV_PCM_TRIGGER_START: 669 case SNDRV_PCM_TRIGGER_START:
670 hal2->adc.pcm_indirect.hw_io = hal2->adc.buffer_dma;
671 hal2->adc.pcm_indirect.hw_data = 0;
672 printk(KERN_DEBUG "buffer_dma %x\n", hal2->adc.buffer_dma);
673 hal2_start_adc(hal2); 670 hal2_start_adc(hal2);
674 break; 671 break;
675 case SNDRV_PCM_TRIGGER_STOP: 672 case SNDRV_PCM_TRIGGER_STOP: