Browse Source

ENGR00307835-2 ASoC: dmaengine: Add two function for dmaengine_pcm

Add check_xrun and device_reset for dmaengine_pcm

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
(cherry picked from commit 405588f31e)
isee-imx_3.14.28.y
Shengjiu Wang 7 years ago
committed by Nitin Garg
parent
commit
43541a8742
2 changed files with 17 additions and 8 deletions
  1. +12
    -0
      include/sound/dmaengine_pcm.h
  2. +5
    -8
      sound/core/pcm_dmaengine.c

+ 12
- 0
include/sound/dmaengine_pcm.h View File

@ -63,6 +63,8 @@ struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream)
* requesting the DMA channel.
* @chan_name: Custom channel name to use when requesting DMA channel.
* @fifo_size: FIFO size of the DAI controller in bytes
* @check_xrun: check if hardware xrun happen in the cpu dai.
* @device_reset: if xrun happened, then do cpu dai reset.
*/
struct snd_dmaengine_dai_dma_data {
dma_addr_t addr;
@ -72,6 +74,16 @@ struct snd_dmaengine_dai_dma_data {
void *filter_data;
const char *chan_name;
unsigned int fifo_size;
bool (*check_xrun)(struct snd_pcm_substream *substream);
void (*device_reset)(struct snd_pcm_substream *substream, bool stop);
};
struct dmaengine_pcm_runtime_data {
struct dma_chan *dma_chan;
dma_cookie_t cookie;
unsigned int pos;
dma_async_tx_callback callback;
};
void snd_dmaengine_pcm_set_config_from_dai_data(


+ 5
- 8
sound/core/pcm_dmaengine.c View File

@ -5,6 +5,7 @@
* Based on:
* imx-pcm-dma-mx2.c, Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
* mxs-pcm.c, Copyright (C) 2011 Freescale Semiconductor, Inc.
* imx-pcm-dma.c, Copyright (C) 2014 Freescale Semiconductor, Inc.
* ep93xx-pcm.c, Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
* Copyright (C) 2006 Applied Data Systems
*
@ -28,13 +29,6 @@
#include <sound/dmaengine_pcm.h>
struct dmaengine_pcm_runtime_data {
struct dma_chan *dma_chan;
dma_cookie_t cookie;
unsigned int pos;
};
static inline struct dmaengine_pcm_runtime_data *substream_to_prtd(
const struct snd_pcm_substream *substream)
{
@ -162,7 +156,10 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
if (!desc)
return -ENOMEM;
desc->callback = dmaengine_pcm_dma_complete;
if (prtd->callback)
desc->callback = prtd->callback;
else
desc->callback = dmaengine_pcm_dma_complete;
desc->callback_param = substream;
prtd->cookie = dmaengine_submit(desc);


Loading…
Cancel
Save