diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-08-19 13:29:14 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-09-11 02:18:12 -0400 |
commit | 7e1e2f27c5508518e58e5cbb11e26cbb815f4c56 (patch) | |
tree | fbee764662f30cc35618446958488896be81ae0d | |
parent | 61c4319cb523a2346416cddaa7d4e2f9260c14d9 (diff) |
dmaengine: dw: convert dw_dma_slave to use explicit HS interfaces
Instead of exposing the possibility to set DMA registers CFG_HI and CFG_LO
strict user to provide handshake interfaces explicitly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 15 | ||||
-rw-r--r-- | drivers/dma/dw/core.c | 4 | ||||
-rw-r--r-- | include/linux/platform_data/dma-dw.h | 10 |
3 files changed, 11 insertions, 18 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index ec7be287a97e..37b75602adf6 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -1356,10 +1356,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data) | |||
1356 | goto fail; | 1356 | goto fail; |
1357 | 1357 | ||
1358 | slave->sdata.dma_dev = &dw_dmac0_device.dev; | 1358 | slave->sdata.dma_dev = &dw_dmac0_device.dev; |
1359 | slave->sdata.cfg_hi = (DWC_CFGH_SRC_PER(0) | 1359 | slave->sdata.src_id = 0; |
1360 | | DWC_CFGH_DST_PER(1)); | 1360 | slave->sdata.dst_id = 1; |
1361 | slave->sdata.cfg_lo &= ~(DWC_CFGL_HS_DST_POL | ||
1362 | | DWC_CFGL_HS_SRC_POL); | ||
1363 | slave->sdata.src_master = 1; | 1361 | slave->sdata.src_master = 1; |
1364 | slave->sdata.dst_master = 0; | 1362 | slave->sdata.dst_master = 0; |
1365 | 1363 | ||
@@ -2054,8 +2052,7 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data, | |||
2054 | /* Check if DMA slave interface for capture should be configured. */ | 2052 | /* Check if DMA slave interface for capture should be configured. */ |
2055 | if (flags & AC97C_CAPTURE) { | 2053 | if (flags & AC97C_CAPTURE) { |
2056 | rx_dws->dma_dev = &dw_dmac0_device.dev; | 2054 | rx_dws->dma_dev = &dw_dmac0_device.dev; |
2057 | rx_dws->cfg_hi = DWC_CFGH_SRC_PER(3); | 2055 | rx_dws->src_id = 3; |
2058 | rx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2059 | rx_dws->src_master = 0; | 2056 | rx_dws->src_master = 0; |
2060 | rx_dws->dst_master = 1; | 2057 | rx_dws->dst_master = 1; |
2061 | } | 2058 | } |
@@ -2063,8 +2060,7 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data, | |||
2063 | /* Check if DMA slave interface for playback should be configured. */ | 2060 | /* Check if DMA slave interface for playback should be configured. */ |
2064 | if (flags & AC97C_PLAYBACK) { | 2061 | if (flags & AC97C_PLAYBACK) { |
2065 | tx_dws->dma_dev = &dw_dmac0_device.dev; | 2062 | tx_dws->dma_dev = &dw_dmac0_device.dev; |
2066 | tx_dws->cfg_hi = DWC_CFGH_DST_PER(4); | 2063 | tx_dws->dst_id = 4; |
2067 | tx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2068 | tx_dws->src_master = 0; | 2064 | tx_dws->src_master = 0; |
2069 | tx_dws->dst_master = 1; | 2065 | tx_dws->dst_master = 1; |
2070 | } | 2066 | } |
@@ -2136,8 +2132,7 @@ at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data) | |||
2136 | dws = &data->dws; | 2132 | dws = &data->dws; |
2137 | 2133 | ||
2138 | dws->dma_dev = &dw_dmac0_device.dev; | 2134 | dws->dma_dev = &dw_dmac0_device.dev; |
2139 | dws->cfg_hi = DWC_CFGH_DST_PER(2); | 2135 | dws->dst_id = 2; |
2140 | dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2141 | dws->src_master = 0; | 2136 | dws->src_master = 0; |
2142 | dws->dst_master = 1; | 2137 | dws->dst_master = 1; |
2143 | 2138 | ||
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 1af731b83b3f..0a9c052d437c 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c | |||
@@ -155,8 +155,8 @@ static void dwc_initialize(struct dw_dma_chan *dwc) | |||
155 | */ | 155 | */ |
156 | BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev); | 156 | BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev); |
157 | 157 | ||
158 | cfghi = dws->cfg_hi; | 158 | cfghi |= DWC_CFGH_DST_PER(dws->dst_id); |
159 | cfglo |= dws->cfg_lo & ~DWC_CFGL_CH_PRIOR_MASK; | 159 | cfghi |= DWC_CFGH_SRC_PER(dws->src_id); |
160 | } else { | 160 | } else { |
161 | if (dwc->direction == DMA_MEM_TO_DEV) | 161 | if (dwc->direction == DMA_MEM_TO_DEV) |
162 | cfghi = DWC_CFGH_DST_PER(dwc->request_line); | 162 | cfghi = DWC_CFGH_DST_PER(dwc->request_line); |
diff --git a/include/linux/platform_data/dma-dw.h b/include/linux/platform_data/dma-dw.h index 68b4024184de..bc411a1bf8e7 100644 --- a/include/linux/platform_data/dma-dw.h +++ b/include/linux/platform_data/dma-dw.h | |||
@@ -17,17 +17,15 @@ | |||
17 | * struct dw_dma_slave - Controller-specific information about a slave | 17 | * struct dw_dma_slave - Controller-specific information about a slave |
18 | * | 18 | * |
19 | * @dma_dev: required DMA master device. Depricated. | 19 | * @dma_dev: required DMA master device. Depricated. |
20 | * @bus_id: name of this device channel, not just a device name since | 20 | * @src_id: src request line |
21 | * devices may have more than one channel e.g. "foo_tx" | 21 | * @dst_id: dst request line |
22 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
23 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
24 | * @src_master: src master for transfers on allocated channel. | 22 | * @src_master: src master for transfers on allocated channel. |
25 | * @dst_master: dest master for transfers on allocated channel. | 23 | * @dst_master: dest master for transfers on allocated channel. |
26 | */ | 24 | */ |
27 | struct dw_dma_slave { | 25 | struct dw_dma_slave { |
28 | struct device *dma_dev; | 26 | struct device *dma_dev; |
29 | u32 cfg_hi; | 27 | u8 src_id; |
30 | u32 cfg_lo; | 28 | u8 dst_id; |
31 | u8 src_master; | 29 | u8 src_master; |
32 | u8 dst_master; | 30 | u8 dst_master; |
33 | }; | 31 | }; |