diff options
author | Sekhar Nori <nsekhar@ti.com> | 2010-07-19 03:01:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-07-20 04:57:20 -0400 |
commit | 48519f0ae03bc7e86b3dc93e56f1334d53803770 (patch) | |
tree | 7a2825b052267b6c74f320f375d5820ee66954fe | |
parent | 5c519767b6ec0e54e5c868c0fceebba968f88374 (diff) |
ASoC: davinci: let platform data define edma queue numbers
Currently the EDMA queue to be used by for servicing ASP through
internal RAM is fixed to EDMAQ_0 and that to service internal RAM
from external RAM is fixed to EDMAQ_1.
This may not be the desirable configuration on all platforms. For
example, on DM365, queue 0 has large fifo size and is more suitable
for video transfers. Having audio and video transfers on the same
queue may lead to starvation on audio side.
platform data as defined currently passes a queue number to the driver
but that remains unused inside the driver.
Fix this by defining one queue each for ASP and RAM transfers in the
platform data and using it inside the driver.
Since EDMAQ_0 maps to 0, thats the queue that will be used if
the asp queue number is not initialized. None of the platforms
currently utilize ping-pong transfers through internal RAM so that
functionality remains unchanged too.
This patch has been tested on DM644x and OMAP-L138 EVMs.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | arch/arm/mach-davinci/board-da830-evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-dm646x-evm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/asp.h | 3 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 10 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 6 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.h | 3 |
8 files changed, 25 insertions, 10 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 212d97084bd7..bc384d3561da 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -208,7 +208,7 @@ static struct snd_platform_data da830_evm_snd_data = { | |||
208 | .num_serializer = ARRAY_SIZE(da830_iis_serializer_direction), | 208 | .num_serializer = ARRAY_SIZE(da830_iis_serializer_direction), |
209 | .tdm_slots = 2, | 209 | .tdm_slots = 2, |
210 | .serial_dir = da830_iis_serializer_direction, | 210 | .serial_dir = da830_iis_serializer_direction, |
211 | .eventq_no = EVENTQ_0, | 211 | .asp_chan_q = EVENTQ_0, |
212 | .version = MCASP_VERSION_2, | 212 | .version = MCASP_VERSION_2, |
213 | .txnumevt = 1, | 213 | .txnumevt = 1, |
214 | .rxnumevt = 1, | 214 | .rxnumevt = 1, |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 2ec3095ffb7b..d4ec18d0b4a4 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -342,7 +342,7 @@ static struct snd_platform_data da850_evm_snd_data = { | |||
342 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), | 342 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), |
343 | .tdm_slots = 2, | 343 | .tdm_slots = 2, |
344 | .serial_dir = da850_iis_serializer_direction, | 344 | .serial_dir = da850_iis_serializer_direction, |
345 | .eventq_no = EVENTQ_1, | 345 | .asp_chan_q = EVENTQ_1, |
346 | .version = MCASP_VERSION_2, | 346 | .version = MCASP_VERSION_2, |
347 | .txnumevt = 1, | 347 | .txnumevt = 1, |
348 | .rxnumevt = 1, | 348 | .rxnumevt = 1, |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 6d8889342c9f..87521f2d69c7 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -323,7 +323,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = { | |||
323 | .num_serializer = ARRAY_SIZE(dm646x_iis_serializer_direction), | 323 | .num_serializer = ARRAY_SIZE(dm646x_iis_serializer_direction), |
324 | .tdm_slots = 2, | 324 | .tdm_slots = 2, |
325 | .serial_dir = dm646x_iis_serializer_direction, | 325 | .serial_dir = dm646x_iis_serializer_direction, |
326 | .eventq_no = EVENTQ_0, | 326 | .asp_chan_q = EVENTQ_0, |
327 | }, | 327 | }, |
328 | { | 328 | { |
329 | .tx_dma_offset = 0x400, | 329 | .tx_dma_offset = 0x400, |
@@ -332,7 +332,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = { | |||
332 | .num_serializer = ARRAY_SIZE(dm646x_dit_serializer_direction), | 332 | .num_serializer = ARRAY_SIZE(dm646x_dit_serializer_direction), |
333 | .tdm_slots = 32, | 333 | .tdm_slots = 32, |
334 | .serial_dir = dm646x_dit_serializer_direction, | 334 | .serial_dir = dm646x_dit_serializer_direction, |
335 | .eventq_no = EVENTQ_0, | 335 | .asp_chan_q = EVENTQ_0, |
336 | }, | 336 | }, |
337 | }; | 337 | }; |
338 | 338 | ||
diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h index b12c69edeea5..9aa240909a2c 100644 --- a/arch/arm/mach-davinci/include/mach/asp.h +++ b/arch/arm/mach-davinci/include/mach/asp.h | |||
@@ -52,7 +52,8 @@ | |||
52 | struct snd_platform_data { | 52 | struct snd_platform_data { |
53 | u32 tx_dma_offset; | 53 | u32 tx_dma_offset; |
54 | u32 rx_dma_offset; | 54 | u32 rx_dma_offset; |
55 | enum dma_event_q eventq_no; /* event queue number */ | 55 | enum dma_event_q asp_chan_q; /* event queue number for ASP channel */ |
56 | enum dma_event_q ram_chan_q; /* event queue number for RAM channel */ | ||
56 | unsigned int codec_fmt; | 57 | unsigned int codec_fmt; |
57 | /* | 58 | /* |
58 | * Allowing this is more efficient and eliminates left and right swaps | 59 | * Allowing this is more efficient and eliminates left and right swaps |
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index b251bc9a9812..9e8932abf158 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -648,6 +648,8 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
648 | struct snd_platform_data *pdata = pdev->dev.platform_data; | 648 | struct snd_platform_data *pdata = pdev->dev.platform_data; |
649 | struct davinci_mcbsp_dev *dev; | 649 | struct davinci_mcbsp_dev *dev; |
650 | struct resource *mem, *ioarea, *res; | 650 | struct resource *mem, *ioarea, *res; |
651 | enum dma_event_q asp_chan_q = EVENTQ_0; | ||
652 | enum dma_event_q ram_chan_q = EVENTQ_1; | ||
651 | int ret; | 653 | int ret; |
652 | 654 | ||
653 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 655 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -676,7 +678,15 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
676 | pdata->sram_size_capture; | 678 | pdata->sram_size_capture; |
677 | dev->clk_input_pin = pdata->clk_input_pin; | 679 | dev->clk_input_pin = pdata->clk_input_pin; |
678 | dev->i2s_accurate_sck = pdata->i2s_accurate_sck; | 680 | dev->i2s_accurate_sck = pdata->i2s_accurate_sck; |
681 | asp_chan_q = pdata->asp_chan_q; | ||
682 | ram_chan_q = pdata->ram_chan_q; | ||
679 | } | 683 | } |
684 | |||
685 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].asp_chan_q = asp_chan_q; | ||
686 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].ram_chan_q = ram_chan_q; | ||
687 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].asp_chan_q = asp_chan_q; | ||
688 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].ram_chan_q = ram_chan_q; | ||
689 | |||
680 | dev->clk = clk_get(&pdev->dev, NULL); | 690 | dev->clk = clk_get(&pdev->dev, NULL); |
681 | if (IS_ERR(dev->clk)) { | 691 | if (IS_ERR(dev->clk)) { |
682 | ret = -ENODEV; | 692 | ret = -ENODEV; |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index d3955096d872..b24720894af6 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -890,7 +890,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
890 | dev->rxnumevt = pdata->rxnumevt; | 890 | dev->rxnumevt = pdata->rxnumevt; |
891 | 891 | ||
892 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]; | 892 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]; |
893 | dma_data->eventq_no = pdata->eventq_no; | 893 | dma_data->asp_chan_q = pdata->asp_chan_q; |
894 | dma_data->ram_chan_q = pdata->ram_chan_q; | ||
894 | dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset + | 895 | dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset + |
895 | io_v2p(dev->base)); | 896 | io_v2p(dev->base)); |
896 | 897 | ||
@@ -904,7 +905,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
904 | dma_data->channel = res->start; | 905 | dma_data->channel = res->start; |
905 | 906 | ||
906 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]; | 907 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]; |
907 | dma_data->eventq_no = pdata->eventq_no; | 908 | dma_data->asp_chan_q = pdata->asp_chan_q; |
909 | dma_data->ram_chan_q = pdata->ram_chan_q; | ||
908 | dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset + | 910 | dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset + |
909 | io_v2p(dev->base)); | 911 | io_v2p(dev->base)); |
910 | 912 | ||
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index def454e42fcb..a7124116d2e0 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -381,7 +381,7 @@ static int request_ping_pong(struct snd_pcm_substream *substream, | |||
381 | /* Request ram master channel */ | 381 | /* Request ram master channel */ |
382 | link = prtd->ram_channel = edma_alloc_channel(EDMA_CHANNEL_ANY, | 382 | link = prtd->ram_channel = edma_alloc_channel(EDMA_CHANNEL_ANY, |
383 | davinci_pcm_dma_irq, substream, | 383 | davinci_pcm_dma_irq, substream, |
384 | EVENTQ_1); | 384 | prtd->params->ram_chan_q); |
385 | if (link < 0) | 385 | if (link < 0) |
386 | goto exit1; | 386 | goto exit1; |
387 | 387 | ||
@@ -477,7 +477,8 @@ static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) | |||
477 | 477 | ||
478 | /* Request asp master DMA channel */ | 478 | /* Request asp master DMA channel */ |
479 | link = prtd->asp_channel = edma_alloc_channel(params->channel, | 479 | link = prtd->asp_channel = edma_alloc_channel(params->channel, |
480 | davinci_pcm_dma_irq, substream, EVENTQ_0); | 480 | davinci_pcm_dma_irq, substream, |
481 | prtd->params->asp_chan_q); | ||
481 | if (link < 0) | 482 | if (link < 0) |
482 | goto exit1; | 483 | goto exit1; |
483 | 484 | ||
diff --git a/sound/soc/davinci/davinci-pcm.h b/sound/soc/davinci/davinci-pcm.h index 0764944cf10f..b799a02333d8 100644 --- a/sound/soc/davinci/davinci-pcm.h +++ b/sound/soc/davinci/davinci-pcm.h | |||
@@ -21,7 +21,8 @@ struct davinci_pcm_dma_params { | |||
21 | unsigned short acnt; | 21 | unsigned short acnt; |
22 | dma_addr_t dma_addr; /* device physical address for DMA */ | 22 | dma_addr_t dma_addr; /* device physical address for DMA */ |
23 | unsigned sram_size; | 23 | unsigned sram_size; |
24 | enum dma_event_q eventq_no; /* event queue number */ | 24 | enum dma_event_q asp_chan_q; /* event queue number for ASP channel */ |
25 | enum dma_event_q ram_chan_q; /* event queue number for RAM channel */ | ||
25 | unsigned char data_type; /* xfer data type */ | 26 | unsigned char data_type; /* xfer data type */ |
26 | unsigned char convert_mono_stereo; | 27 | unsigned char convert_mono_stereo; |
27 | unsigned int fifo_level; | 28 | unsigned int fifo_level; |