Commit 57512c64 authored by Troy Kisky's avatar Troy Kisky Committed by Mark Brown

ASoC: DaVinci: remove requirement that dma_params is 1st in structure

Remove requirement that dma_params is 1st in the structures
davinci_audio_dev and davinci_mcbsp_dev.
Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 357a1db9
...@@ -98,11 +98,6 @@ enum { ...@@ -98,11 +98,6 @@ enum {
}; };
struct davinci_mcbsp_dev { struct davinci_mcbsp_dev {
/*
* dma_params must be first because rtd->dai->cpu_dai->private_data
* is cast to a pointer of an array of struct davinci_pcm_dma_params in
* davinci_pcm_open.
*/
struct davinci_pcm_dma_params dma_params[2]; struct davinci_pcm_dma_params dma_params[2];
void __iomem *base; void __iomem *base;
#define MOD_DSP_A 0 #define MOD_DSP_A 0
...@@ -549,6 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -549,6 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start;
davinci_i2s_dai.private_data = dev; davinci_i2s_dai.private_data = dev;
davinci_i2s_dai.dma_data = dev->dma_params;
ret = snd_soc_register_dai(&davinci_i2s_dai); ret = snd_soc_register_dai(&davinci_i2s_dai);
if (ret != 0) if (ret != 0)
goto err_free_mem; goto err_free_mem;
......
...@@ -904,6 +904,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -904,6 +904,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dma_data->channel = res->start; dma_data->channel = res->start;
davinci_mcasp_dai[pdata->op_mode].private_data = dev; davinci_mcasp_dai[pdata->op_mode].private_data = dev;
davinci_mcasp_dai[pdata->op_mode].dma_data = dev->dma_params;
davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev; davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev;
ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]); ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]);
......
...@@ -39,11 +39,6 @@ enum { ...@@ -39,11 +39,6 @@ enum {
}; };
struct davinci_audio_dev { struct davinci_audio_dev {
/*
* dma_params must be first because rtd->dai->cpu_dai->private_data
* is cast to a pointer of an array of struct davinci_pcm_dma_params in
* davinci_pcm_open.
*/
struct davinci_pcm_dma_params dma_params[2]; struct davinci_pcm_dma_params dma_params[2];
void __iomem *base; void __iomem *base;
int sample_rate; int sample_rate;
......
...@@ -253,10 +253,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) ...@@ -253,10 +253,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
struct davinci_runtime_data *prtd; struct davinci_runtime_data *prtd;
int ret = 0; int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data; struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->dma_data;
struct davinci_pcm_dma_params *params = &pa[substream->stream]; struct davinci_pcm_dma_params *params;
if (!params) if (!pa)
return -ENODEV; return -ENODEV;
params = &pa[substream->stream];
snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
/* ensure that buffer size is a multiple of period size */ /* ensure that buffer size is a multiple of period size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment