]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: mips: Cleanup indirect PCM helper usages
authorTakashi Iwai <tiwai@suse.de>
Sun, 2 Sep 2018 08:26:08 +0000 (10:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 10:13:46 +0000 (12:13 +0200)
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>
sound/mips/hal2.c

index 2bd1cb7489ff3ea8dfb4e3ab8ad89cb9d553f8e5..a4ed54aeaf1de60ccb9f9b3c4ffb179d6de73277 100644 (file)
@@ -564,6 +564,8 @@ static int hal2_playback_prepare(struct snd_pcm_substream *substream)
        dac->sample_rate = hal2_compute_rate(dac, runtime->rate);
        memset(&dac->pcm_indirect, 0, sizeof(dac->pcm_indirect));
        dac->pcm_indirect.hw_buffer_size = H2_BUF_SIZE;
+       dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
+       dac->pcm_indirect.hw_io = dac->buffer_dma;
        dac->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
        dac->substream = substream;
        hal2_setup_dac(hal2);
@@ -576,8 +578,6 @@ static int hal2_playback_trigger(struct snd_pcm_substream *substream, int cmd)
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
-               hal2->dac.pcm_indirect.hw_io = hal2->dac.buffer_dma;
-               hal2->dac.pcm_indirect.hw_data = 0;
                hal2_start_dac(hal2);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
@@ -615,7 +615,6 @@ static int hal2_playback_ack(struct snd_pcm_substream *substream)
        struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
        struct hal2_codec *dac = &hal2->dac;
 
-       dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
        return snd_pcm_indirect_playback_transfer(substream,
                                                  &dac->pcm_indirect,
                                                  hal2_playback_transfer);
@@ -655,6 +654,7 @@ static int hal2_capture_prepare(struct snd_pcm_substream *substream)
        memset(&adc->pcm_indirect, 0, sizeof(adc->pcm_indirect));
        adc->pcm_indirect.hw_buffer_size = H2_BUF_SIZE;
        adc->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2;
+       adc->pcm_indirect.hw_io = adc->buffer_dma;
        adc->pcm_indirect.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
        adc->substream = substream;
        hal2_setup_adc(hal2);
@@ -667,9 +667,6 @@ static int hal2_capture_trigger(struct snd_pcm_substream *substream, int cmd)
 
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
-               hal2->adc.pcm_indirect.hw_io = hal2->adc.buffer_dma;
-               hal2->adc.pcm_indirect.hw_data = 0;
-               printk(KERN_DEBUG "buffer_dma %x\n", hal2->adc.buffer_dma);
                hal2_start_adc(hal2);
                break;
        case SNDRV_PCM_TRIGGER_STOP: