static void audio_buffdone(void *data) { struct snd_pcm_substream *substream = data; struct runtime_data *prtd; pr_debug("Entered %s\n", __func__); if (!substream) return; prtd = substream->runtime->private_data; if (prtd->state & ST_RUNNING) { snd_pcm_period_elapsed(substream); if (!samsung_dma_has_circular()) { spin_lock(&prtd->lock); prtd->dma_loaded--; if (!samsung_dma_has_infiniteloop()) dma_enqueue(substream); spin_unlock(&prtd->lock); } } }
static void audio_buffdone(struct s3c2410_dma_chan *channel, void *dev_id, int size, enum s3c2410_dma_buffresult result) { struct snd_pcm_substream *substream = dev_id; struct runtime_data *prtd; pr_debug("Entered %s\n", __func__); if (result == S3C2410_RES_ABORT || result == S3C2410_RES_ERR) return; prtd = substream->runtime->private_data; snd_pcm_period_elapsed(substream); spin_lock(&prtd->lock); if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) { prtd->dma_loaded--; if (!s3c_dma_has_infiniteloop()) dma_enqueue(substream); } spin_unlock(&prtd->lock); }
static int dma_prepare(struct snd_pcm_substream *substream) { struct runtime_data *prtd = substream->runtime->private_data; int ret = 0; pr_debug("Entered %s\n", __func__); if (!prtd->params) return 0; prtd->params->ops->flush(prtd->params->ch); prtd->dma_loaded = 0; prtd->dma_pos = prtd->dma_start; dma_enqueue(substream); return ret; }
static int dma_prepare(struct snd_pcm_substream *substream) { struct runtime_data *prtd = substream->runtime->private_data; int ret = 0; pr_debug("Entered %s\n", __func__); /* return if this is a bufferless transfer e.g. * codec <--> BT codec or GSM modem -- lg FIXME */ if (!prtd->params) return 0; /* flush the DMA channel */ prtd->params->ops->flush(prtd->params->ch); prtd->dma_loaded = 0; prtd->dma_pos = prtd->dma_start; /* enqueue dma buffers */ dma_enqueue(substream); return ret; }
static void audio_buffdone(void *data) { struct snd_pcm_substream *substream = data; struct runtime_data *prtd = substream->runtime->private_data; pr_debug("Entered %s\n", __func__); if (prtd->state & ST_RUNNING) { prtd->dma_pos += prtd->dma_period; if (prtd->dma_pos >= prtd->dma_end) prtd->dma_pos = prtd->dma_start; if (substream) snd_pcm_period_elapsed(substream); spin_lock(&prtd->lock); if (!samsung_dma_has_circular()) { prtd->dma_loaded--; dma_enqueue(substream); } spin_unlock(&prtd->lock); } }
static int dma_prepare(struct snd_pcm_substream *substream) { struct runtime_data *prtd = substream->runtime->private_data; int ret = 0; pr_debug("Entered %s\n", __func__); /* return if this is a bufferless transfer e.g. * codec <--> BT codec or GSM modem -- lg FIXME */ if (!prtd->params) return 0; /* channel needs configuring for mem=>device, increment memory addr, * sync to pclk, half-word transfers to the IIS-FIFO. */ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { s3c2410_dma_devconfig(prtd->params->channel, S3C2410_DMASRC_MEM, prtd->params->dma_addr); } else { s3c2410_dma_devconfig(prtd->params->channel, S3C2410_DMASRC_HW, prtd->params->dma_addr); } s3c2410_dma_config(prtd->params->channel, prtd->params->dma_size); /* flush the DMA channel */ s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH); prtd->dma_loaded = 0; prtd->dma_pos = prtd->dma_start; /* enqueue dma buffers */ dma_enqueue(substream); return ret; }
/** * sw_dma_enqueue - add buf to list * @dma_hdl: dma handle * @src_addr: buffer src phys addr * @dst_addr: buffer dst phys addr * @byte_cnt: buffer byte cnt * * Returns 0 if sucess, otherwise failed */ u32 sw_dma_enqueue(dma_hdl_t dma_hdl, u32 src_addr, u32 dst_addr, u32 byte_cnt) { BUG_ON(unlikely(!dma_handle_is_valid(dma_hdl))); return dma_enqueue(dma_hdl, src_addr, dst_addr, byte_cnt); }