ASoC: DaVinci: remove requirement that dma_params is 1st in structure
authorTroy Kisky <troy.kisky@boundarydevices.com>
Mon, 16 Nov 2009 23:52:31 +0000 (16:52 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 18 Nov 2009 13:35:06 +0000 (13:35 +0000)
Remove requirement that dma_params is 1st in the structures
davinci_audio_dev and davinci_mcbsp_dev.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/davinci/davinci-i2s.c
sound/soc/davinci/davinci-mcasp.c
sound/soc/davinci/davinci-mcasp.h
sound/soc/davinci/davinci-pcm.c

index 2ab809359c08a487a8bb4c75a1a631b228de697d..d336786683b4e8a86658fb975d919321968ed40f 100644 (file)
@@ -98,11 +98,6 @@ enum {
 };
 
 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];
        void __iomem                    *base;
 #define MOD_DSP_A      0
@@ -549,6 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
        dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start;
 
        davinci_i2s_dai.private_data = dev;
+       davinci_i2s_dai.dma_data = dev->dma_params;
        ret = snd_soc_register_dai(&davinci_i2s_dai);
        if (ret != 0)
                goto err_free_mem;
index 50ad0519a8fab1de0f6d3860b1ab7c6e8d223bbd..0a302e1080d9ec06553d77dfb12125b4fcece380 100644 (file)
@@ -904,6 +904,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 
        dma_data->channel = res->start;
        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;
        ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]);
 
index 9d179cc88f7b84a9614753c0af34aef28a16c74d..582c9249ef09b4cb0a4a53222ab7dd4b323a58cb 100644 (file)
@@ -39,11 +39,6 @@ enum {
 };
 
 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];
        void __iomem *base;
        int sample_rate;
index fb10f1d63fdbe9653744b705922a2dbac912cf4b..187ee965bf0b05d329e829586c467b97fd3dadaa 100644 (file)
@@ -253,10 +253,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
        struct davinci_runtime_data *prtd;
        int ret = 0;
        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 *params = &pa[substream->stream];
-       if (!params)
+       struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->dma_data;
+       struct davinci_pcm_dma_params *params;
+       if (!pa)
                return -ENODEV;
+       params = &pa[substream->stream];
 
        snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
        /* ensure that buffer size is a multiple of period size */