20
20
#define RX_BUSY 0
21
21
#define TX_BUSY 1
22
22
23
- static struct dw_dma_slave mid_dma_tx = { .dst_id = 1 };
24
- static struct dw_dma_slave mid_dma_rx = { .src_id = 0 };
25
-
26
23
static bool mid_spi_dma_chan_filter (struct dma_chan * chan , void * param )
27
24
{
28
25
struct dw_dma_slave * s = param ;
@@ -36,9 +33,11 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param)
36
33
37
34
static int mid_spi_dma_init_mfld (struct device * dev , struct dw_spi * dws )
38
35
{
36
+ struct dw_dma_slave slave = {
37
+ .src_id = 0 ,
38
+ .dst_id = 0
39
+ };
39
40
struct pci_dev * dma_dev ;
40
- struct dw_dma_slave * tx = dws -> dma_tx ;
41
- struct dw_dma_slave * rx = dws -> dma_rx ;
42
41
dma_cap_mask_t mask ;
43
42
44
43
/*
@@ -53,14 +52,14 @@ static int mid_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
53
52
dma_cap_set (DMA_SLAVE , mask );
54
53
55
54
/* 1. Init rx channel */
56
- rx -> dma_dev = & dma_dev -> dev ;
57
- dws -> rxchan = dma_request_channel (mask , mid_spi_dma_chan_filter , rx );
55
+ slave . dma_dev = & dma_dev -> dev ;
56
+ dws -> rxchan = dma_request_channel (mask , mid_spi_dma_chan_filter , & slave );
58
57
if (!dws -> rxchan )
59
58
goto err_exit ;
60
59
61
60
/* 2. Init tx channel */
62
- tx -> dma_dev = & dma_dev -> dev ;
63
- dws -> txchan = dma_request_channel (mask , mid_spi_dma_chan_filter , tx );
61
+ slave . dst_id = 1 ;
62
+ dws -> txchan = dma_request_channel (mask , mid_spi_dma_chan_filter , & slave );
64
63
if (!dws -> txchan )
65
64
goto free_rxchan ;
66
65
@@ -317,8 +316,6 @@ static const struct dw_spi_dma_ops mfld_dma_ops = {
317
316
318
317
static void dw_spi_mid_setup_dma_mfld (struct dw_spi * dws )
319
318
{
320
- dws -> dma_tx = & mid_dma_tx ;
321
- dws -> dma_rx = & mid_dma_rx ;
322
319
dws -> dma_ops = & mfld_dma_ops ;
323
320
}
324
321
0 commit comments