aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngela Stegmaier2013-07-04 02:03:03 -0500
committerMisael Lopez Cruz2013-07-22 15:04:17 -0500
commit13b25a428ba2656d0d6ae2bd242a772e88850aba (patch)
tree93a5b96f5460a45ed48bc0090f21da7c65a7f1de
parent8acacc32551854816a4d0a68424fb63f0375e78e (diff)
downloadkernel-audio-13b25a428ba2656d0d6ae2bd242a772e88850aba.tar.gz
kernel-audio-13b25a428ba2656d0d6ae2bd242a772e88850aba.tar.xz
kernel-audio-13b25a428ba2656d0d6ae2bd242a772e88850aba.zip
ASoC: davinci-mcasp: Add support for using McASP DATA port
By default the CFG port is used for data transfer. It is desireable to use the DATA port so that the AFIFO can be used on DRA7XX. To enable DATA port usage, during the probe a check for an IORESOURCE_MEM named "dat" is done. If the resource is found, the data port will be used. If it is not found, the driver will fall back to using the cfg port. Change-Id: I42c3cc04621354ef1fd7546f9feff003cf6b38ce Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c22
-rw-r--r--sound/soc/davinci/davinci-mcasp.h3
2 files changed, 21 insertions, 4 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 3f569fc2b763..da38efba7213 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -881,7 +881,7 @@ static int davinci_hw_param(struct davinci_audio_dev *dev, int stream,
881 881
882 mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC); 882 mcasp_clr_bits(dev->base + DAVINCI_MCASP_ACLKXCTL_REG, TX_ASYNC);
883 883
884 if (dev->version == MCASP_VERSION_4) 884 if (dev->version == MCASP_VERSION_4 && !dev->dat_port)
885 busel = TXSEL; 885 busel = TXSEL;
886 886
887 /* bit stream is MSB first with no delay */ 887 /* bit stream is MSB first with no delay */
@@ -1279,7 +1279,7 @@ nodata:
1279 1279
1280static int davinci_mcasp_probe(struct platform_device *pdev) 1280static int davinci_mcasp_probe(struct platform_device *pdev)
1281{ 1281{
1282 struct resource *mem, *ioarea; 1282 struct resource *mem, *ioarea, *mem_dat;
1283 struct resource *tx_res, *rx_res; 1283 struct resource *tx_res, *rx_res;
1284 struct snd_platform_data *pdata; 1284 struct snd_platform_data *pdata;
1285 struct davinci_audio_dev *dev; 1285 struct davinci_audio_dev *dev;
@@ -1314,6 +1314,14 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1314 return -EBUSY; 1314 return -EBUSY;
1315 } 1315 }
1316 1316
1317 mem_dat = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dat");
1318 if (!mem_dat) {
1319 dev_info(&pdev->dev, "data port resource not defined, cfg port will be used\n");
1320 dev->dat_port = false;
1321 } else {
1322 dev->dat_port = true;
1323 }
1324
1317 pm_runtime_enable(&pdev->dev); 1325 pm_runtime_enable(&pdev->dev);
1318 1326
1319 dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); 1327 dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
@@ -1358,7 +1366,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1358 } 1366 }
1359 1367
1360 dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = dma_data; 1368 dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = dma_data;
1361 dma_data->port_addr = mem->start + DAVINCI_MCASP_TXBUF_REG; 1369 if (mem_dat)
1370 dma_data->port_addr = mem_dat->start;
1371 else
1372 dma_data->port_addr = mem->start + DAVINCI_MCASP_TXBUF_REG;
1362 dma_data->dma_req = tx_res->start; 1373 dma_data->dma_req = tx_res->start;
1363 1374
1364 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data), 1375 dma_data = devm_kzalloc(&pdev->dev, sizeof(*dma_data),
@@ -1369,7 +1380,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1369 } 1380 }
1370 1381
1371 dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = dma_data; 1382 dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = dma_data;
1372 dma_data->port_addr = mem->start + DAVINCI_MCASP_RXBUF_REG; 1383 if (mem_dat)
1384 dma_data->port_addr = mem_dat->start;
1385 else
1386 dma_data->port_addr = mem->start + DAVINCI_MCASP_RXBUF_REG;
1373 dma_data->dma_req = rx_res->start; 1387 dma_data->dma_req = rx_res->start;
1374 } else { 1388 } else {
1375 struct davinci_pcm_dma_params *dma_data; 1389 struct davinci_pcm_dma_params *dma_data;
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
index 38a205ea338d..48784954c83c 100644
--- a/sound/soc/davinci/davinci-mcasp.h
+++ b/sound/soc/davinci/davinci-mcasp.h
@@ -47,6 +47,9 @@ struct davinci_audio_dev {
47 /* McASP FIFO related */ 47 /* McASP FIFO related */
48 u8 txnumevt; 48 u8 txnumevt;
49 u8 rxnumevt; 49 u8 rxnumevt;
50
51 /* McASP port related */
52 bool dat_port;
50}; 53};
51 54
52#endif /* DAVINCI_MCASP_H */ 55#endif /* DAVINCI_MCASP_H */