diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2012-02-01 05:42:27 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-02-22 07:45:39 -0500 |
commit | e2b35f3dbfc080f15b72834d08f04f0269dbe9be (patch) | |
tree | fda60f8be147b57cf01155528dda33a9a99b0dab /sound/atmel | |
parent | 327e6970258618da810f72e86cf2a8b803927e14 (diff) |
dmaengine/dw_dmac: Fix dw_dmac user drivers to adapt to slave_config changes
There are few existing user drivers of dw_dmac. They will break as soon as we
remove unused fields from struct dw_dma_slave. This patch focuses to fix these
user drivers to use dma_slave_config() routine.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'sound/atmel')
-rw-r--r-- | sound/atmel/abdac.c | 18 | ||||
-rw-r--r-- | sound/atmel/ac97c.c | 41 |
2 files changed, 47 insertions, 12 deletions
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 4fa1dbd8ee83..f7c2bb08055d 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/types.h> | ||
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
20 | 21 | ||
21 | #include <sound/core.h> | 22 | #include <sound/core.h> |
@@ -467,15 +468,24 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev) | |||
467 | snd_card_set_dev(card, &pdev->dev); | 468 | snd_card_set_dev(card, &pdev->dev); |
468 | 469 | ||
469 | if (pdata->dws.dma_dev) { | 470 | if (pdata->dws.dma_dev) { |
470 | struct dw_dma_slave *dws = &pdata->dws; | ||
471 | dma_cap_mask_t mask; | 471 | dma_cap_mask_t mask; |
472 | 472 | ||
473 | dws->tx_reg = regs->start + DAC_DATA; | ||
474 | |||
475 | dma_cap_zero(mask); | 473 | dma_cap_zero(mask); |
476 | dma_cap_set(DMA_SLAVE, mask); | 474 | dma_cap_set(DMA_SLAVE, mask); |
477 | 475 | ||
478 | dac->dma.chan = dma_request_channel(mask, filter, dws); | 476 | dac->dma.chan = dma_request_channel(mask, filter, &pdata->dws); |
477 | if (dac->dma.chan) { | ||
478 | struct dma_slave_config dma_conf = { | ||
479 | .dst_addr = regs->start + DAC_DATA, | ||
480 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | ||
481 | .src_maxburst = 1, | ||
482 | .dst_maxburst = 1, | ||
483 | .direction = DMA_MEM_TO_DEV, | ||
484 | .device_fc = false, | ||
485 | }; | ||
486 | |||
487 | dmaengine_slave_config(dac->dma.chan, &dma_conf); | ||
488 | } | ||
479 | } | 489 | } |
480 | if (!pdata->dws.dma_dev || !dac->dma.chan) { | 490 | if (!pdata->dws.dma_dev || !dac->dma.chan) { |
481 | dev_dbg(&pdev->dev, "DMA not available\n"); | 491 | dev_dbg(&pdev->dev, "DMA not available\n"); |
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 61dade698358..115313ef54d6 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)); |