static int atmel_abdac_hw_free(struct snd_pcm_substream *substream) { struct atmel_abdac *dac = snd_pcm_substream_chip(substream); if (test_and_clear_bit(DMA_READY, &dac->flags)) dw_dma_cyclic_free(dac->dma.chan); return snd_pcm_lib_free_pages(substream); }
static int atmel_ac97c_capture_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); int retval; retval = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); if (cpu_is_at32ap7000()) { if (retval < 0) return retval; /* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */ if (retval == 1) if (test_and_clear_bit(DMA_RX_READY, &chip->flags)) dw_dma_cyclic_free(chip->dma.rx_chan); } /* Set restrictions to params. */ mutex_lock(&opened_mutex); chip->cur_rate = params_rate(hw_params); chip->cur_format = params_format(hw_params); mutex_unlock(&opened_mutex); return retval; }
static int atmel_ac97c_capture_hw_free(struct snd_pcm_substream *substream) { struct atmel_ac97c *chip = snd_pcm_substream_chip(substream); if (cpu_is_at32ap7000()) { if (test_and_clear_bit(DMA_RX_READY, &chip->flags)) dw_dma_cyclic_free(chip->dma.rx_chan); } return snd_pcm_lib_free_pages(substream); }
static int atmel_abdac_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct atmel_abdac *dac = snd_pcm_substream_chip(substream); int retval; retval = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); if (retval < 0) return retval; /* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */ if (retval == 1) if (test_and_clear_bit(DMA_READY, &dac->flags)) dw_dma_cyclic_free(dac->dma.chan); return retval; }