summaryrefslogtreecommitdiff
path: root/sound/soc/samsung/pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-19 18:23:15 +0400
committerMark Brown <broonie@linaro.org>2013-12-12 04:28:57 +0400
commit3688569e8173e84cd95d98f158245e17bca4f593 (patch)
tree7f163d739333a2249ef7155d17a7cc00fdea814d /sound/soc/samsung/pcm.c
parentbeaec3aab661e450511b8d84f079e47a4145dfb7 (diff)
downloadlinux-3688569e8173e84cd95d98f158245e17bca4f593.tar.xz
ASoC: samsung: Provide helper for DMA init
In preparation for using the dmaengine helpers in ASoC rather than the dmaengine wrappers for the Samsung API wrap the configuration of dma_data. The dmaengine code expects different data to that used by the legacy API. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/samsung/pcm.c')
-rw-r--r--sound/soc/samsung/pcm.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index e54256fc4b2c..6a5e4bf6ac96 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -275,7 +275,6 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(rtd->cpu_dai);
- struct s3c_dma_params *dma_data;
void __iomem *regs = pcm->regs;
struct clk *clk;
int sclk_div, sync_div;
@@ -284,13 +283,6 @@ static int s3c_pcm_hw_params(struct snd_pcm_substream *substream,
dev_dbg(pcm->dev, "Entered %s\n", __func__);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- dma_data = pcm->dma_playback;
- else
- dma_data = pcm->dma_capture;
-
- snd_soc_dai_set_dma_data(rtd->cpu_dai, substream, dma_data);
-
/* Strictly check for sample size */
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
@@ -461,10 +453,20 @@ static const struct snd_soc_dai_ops s3c_pcm_dai_ops = {
.set_fmt = s3c_pcm_set_fmt,
};
+static int s3c_pcm_dai_probe(struct snd_soc_dai *dai)
+{
+ struct s3c_pcm_info *pcm = snd_soc_dai_get_drvdata(dai);
+
+ snd_soc_dai_init_dma_data(dai, pcm->dma_playback, pcm->dma_capture);
+
+ return 0;
+}
+
#define S3C_PCM_RATES SNDRV_PCM_RATE_8000_96000
#define S3C_PCM_DAI_DECLARE \
.symmetric_rates = 1, \
+ .probe = s3c_pcm_dai_probe, \
.ops = &s3c_pcm_dai_ops, \
.playback = { \
.channels_min = 2, \