Skip to content

Commit 7e1e2f2

Browse files
andy-shevVinod Koul
authored andcommitted
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>
1 parent 61c4319 commit 7e1e2f2

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

arch/avr32/mach-at32ap/at32ap700x.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,10 +1356,8 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
13561356
goto fail;
13571357

13581358
slave->sdata.dma_dev = &dw_dmac0_device.dev;
1359-
slave->sdata.cfg_hi = (DWC_CFGH_SRC_PER(0)
1360-
| DWC_CFGH_DST_PER(1));
1361-
slave->sdata.cfg_lo &= ~(DWC_CFGL_HS_DST_POL
1362-
| DWC_CFGL_HS_SRC_POL);
1359+
slave->sdata.src_id = 0;
1360+
slave->sdata.dst_id = 1;
13631361
slave->sdata.src_master = 1;
13641362
slave->sdata.dst_master = 0;
13651363

@@ -2054,17 +2052,15 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data,
20542052
/* Check if DMA slave interface for capture should be configured. */
20552053
if (flags & AC97C_CAPTURE) {
20562054
rx_dws->dma_dev = &dw_dmac0_device.dev;
2057-
rx_dws->cfg_hi = DWC_CFGH_SRC_PER(3);
2058-
rx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
2055+
rx_dws->src_id = 3;
20592056
rx_dws->src_master = 0;
20602057
rx_dws->dst_master = 1;
20612058
}
20622059

20632060
/* Check if DMA slave interface for playback should be configured. */
20642061
if (flags & AC97C_PLAYBACK) {
20652062
tx_dws->dma_dev = &dw_dmac0_device.dev;
2066-
tx_dws->cfg_hi = DWC_CFGH_DST_PER(4);
2067-
tx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
2063+
tx_dws->dst_id = 4;
20682064
tx_dws->src_master = 0;
20692065
tx_dws->dst_master = 1;
20702066
}
@@ -2136,8 +2132,7 @@ at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data)
21362132
dws = &data->dws;
21372133

21382134
dws->dma_dev = &dw_dmac0_device.dev;
2139-
dws->cfg_hi = DWC_CFGH_DST_PER(2);
2140-
dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
2135+
dws->dst_id = 2;
21412136
dws->src_master = 0;
21422137
dws->dst_master = 1;
21432138

drivers/dma/dw/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
155155
*/
156156
BUG_ON(!dws->dma_dev || dws->dma_dev != dw->dma.dev);
157157

158-
cfghi = dws->cfg_hi;
159-
cfglo |= dws->cfg_lo & ~DWC_CFGL_CH_PRIOR_MASK;
158+
cfghi |= DWC_CFGH_DST_PER(dws->dst_id);
159+
cfghi |= DWC_CFGH_SRC_PER(dws->src_id);
160160
} else {
161161
if (dwc->direction == DMA_MEM_TO_DEV)
162162
cfghi = DWC_CFGH_DST_PER(dwc->request_line);

include/linux/platform_data/dma-dw.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717
* struct dw_dma_slave - Controller-specific information about a slave
1818
*
1919
* @dma_dev: required DMA master device. Depricated.
20-
* @bus_id: name of this device channel, not just a device name since
21-
* devices may have more than one channel e.g. "foo_tx"
22-
* @cfg_hi: Platform-specific initializer for the CFG_HI register
23-
* @cfg_lo: Platform-specific initializer for the CFG_LO register
20+
* @src_id: src request line
21+
* @dst_id: dst request line
2422
* @src_master: src master for transfers on allocated channel.
2523
* @dst_master: dest master for transfers on allocated channel.
2624
*/
2725
struct dw_dma_slave {
2826
struct device *dma_dev;
29-
u32 cfg_hi;
30-
u32 cfg_lo;
27+
u8 src_id;
28+
u8 dst_id;
3129
u8 src_master;
3230
u8 dst_master;
3331
};

0 commit comments

Comments
 (0)