aboutsummaryrefslogtreecommitdiffstats
path: root/sound/atmel/ac97c.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/atmel/ac97c.c')
-rw-r--r--sound/atmel/ac97c.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 61dade69835..115313ef54d 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -20,6 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/types.h>
23#include <linux/io.h> 24#include <linux/io.h>
24 25
25#include <sound/core.h> 26#include <sound/core.h>
@@ -1014,16 +1015,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
1014 1015
1015 if (cpu_is_at32ap7000()) { 1016 if (cpu_is_at32ap7000()) {
1016 if (pdata->rx_dws.dma_dev) { 1017 if (pdata->rx_dws.dma_dev) {
1017 struct dw_dma_slave *dws = &pdata->rx_dws;
1018 dma_cap_mask_t mask; 1018 dma_cap_mask_t mask;
1019 1019
1020 dws->rx_reg = regs->start + AC97C_CARHR + 2;
1021
1022 dma_cap_zero(mask); 1020 dma_cap_zero(mask);
1023 dma_cap_set(DMA_SLAVE, mask); 1021 dma_cap_set(DMA_SLAVE, mask);
1024 1022
1025 chip->dma.rx_chan = dma_request_channel(mask, filter, 1023 chip->dma.rx_chan = dma_request_channel(mask, filter,
1026 dws); 1024 &pdata->rx_dws);
1025 if (chip->dma.rx_chan) {
1026 struct dma_slave_config dma_conf = {
1027 .src_addr = regs->start + AC97C_CARHR +
1028 2,
1029 .src_addr_width =
1030 DMA_SLAVE_BUSWIDTH_2_BYTES,
1031 .src_maxburst = 1,
1032 .dst_maxburst = 1,
1033 .direction = DMA_DEV_TO_MEM,
1034 .device_fc = false,
1035 };
1036
1037 dmaengine_slave_config(chip->dma.rx_chan,
1038 &dma_conf);
1039 }
1027 1040
1028 dev_info(&chip->pdev->dev, "using %s for DMA RX\n", 1041 dev_info(&chip->pdev->dev, "using %s for DMA RX\n",
1029 dev_name(&chip->dma.rx_chan->dev->device)); 1042 dev_name(&chip->dma.rx_chan->dev->device));
@@ -1031,16 +1044,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
1031 } 1044 }
1032 1045
1033 if (pdata->tx_dws.dma_dev) { 1046 if (pdata->tx_dws.dma_dev) {
1034 struct dw_dma_slave *dws = &pdata->tx_dws;
1035 dma_cap_mask_t mask; 1047 dma_cap_mask_t mask;
1036 1048
1037 dws->tx_reg = regs->start + AC97C_CATHR + 2;
1038
1039 dma_cap_zero(mask); 1049 dma_cap_zero(mask);
1040 dma_cap_set(DMA_SLAVE, mask); 1050 dma_cap_set(DMA_SLAVE, mask);
1041 1051
1042 chip->dma.tx_chan = dma_request_channel(mask, filter, 1052 chip->dma.tx_chan = dma_request_channel(mask, filter,
1043 dws); 1053 &pdata->tx_dws);
1054 if (chip->dma.tx_chan) {
1055 struct dma_slave_config dma_conf = {
1056 .dst_addr = regs->start + AC97C_CATHR +
1057 2,
1058 .dst_addr_width =
1059 DMA_SLAVE_BUSWIDTH_2_BYTES,
1060 .src_maxburst = 1,
1061 .dst_maxburst = 1,
1062 .direction = DMA_MEM_TO_DEV,
1063 .device_fc = false,
1064 };
1065
1066 dmaengine_slave_config(chip->dma.tx_chan,
1067 &dma_conf);
1068 }
1044 1069
1045 dev_info(&chip->pdev->dev, "using %s for DMA TX\n", 1070 dev_info(&chip->pdev->dev, "using %s for DMA TX\n",
1046 dev_name(&chip->dma.tx_chan->dev->device)); 1071 dev_name(&chip->dma.tx_chan->dev->device));