diff options
Diffstat (limited to 'drivers/spi/spi-pxa2xx-dma.c')
-rw-r--r-- | drivers/spi/spi-pxa2xx-dma.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index c41ff148a2b4..62a9297e96ac 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c | |||
@@ -157,7 +157,6 @@ static struct dma_async_tx_descriptor * | |||
157 | pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, | 157 | pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, |
158 | enum dma_transfer_direction dir) | 158 | enum dma_transfer_direction dir) |
159 | { | 159 | { |
160 | struct pxa2xx_spi_master *pdata = drv_data->master_info; | ||
161 | struct chip_data *chip = drv_data->cur_chip; | 160 | struct chip_data *chip = drv_data->cur_chip; |
162 | enum dma_slave_buswidth width; | 161 | enum dma_slave_buswidth width; |
163 | struct dma_slave_config cfg; | 162 | struct dma_slave_config cfg; |
@@ -184,7 +183,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, | |||
184 | cfg.dst_addr = drv_data->ssdr_physical; | 183 | cfg.dst_addr = drv_data->ssdr_physical; |
185 | cfg.dst_addr_width = width; | 184 | cfg.dst_addr_width = width; |
186 | cfg.dst_maxburst = chip->dma_burst_size; | 185 | cfg.dst_maxburst = chip->dma_burst_size; |
187 | cfg.slave_id = pdata->tx_slave_id; | ||
188 | 186 | ||
189 | sgt = &drv_data->tx_sgt; | 187 | sgt = &drv_data->tx_sgt; |
190 | nents = drv_data->tx_nents; | 188 | nents = drv_data->tx_nents; |
@@ -193,7 +191,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, | |||
193 | cfg.src_addr = drv_data->ssdr_physical; | 191 | cfg.src_addr = drv_data->ssdr_physical; |
194 | cfg.src_addr_width = width; | 192 | cfg.src_addr_width = width; |
195 | cfg.src_maxburst = chip->dma_burst_size; | 193 | cfg.src_maxburst = chip->dma_burst_size; |
196 | cfg.slave_id = pdata->rx_slave_id; | ||
197 | 194 | ||
198 | sgt = &drv_data->rx_sgt; | 195 | sgt = &drv_data->rx_sgt; |
199 | nents = drv_data->rx_nents; | 196 | nents = drv_data->rx_nents; |
@@ -210,14 +207,6 @@ pxa2xx_spi_dma_prepare_one(struct driver_data *drv_data, | |||
210 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 207 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
211 | } | 208 | } |
212 | 209 | ||
213 | static bool pxa2xx_spi_dma_filter(struct dma_chan *chan, void *param) | ||
214 | { | ||
215 | const struct pxa2xx_spi_master *pdata = param; | ||
216 | |||
217 | return chan->chan_id == pdata->tx_chan_id || | ||
218 | chan->chan_id == pdata->rx_chan_id; | ||
219 | } | ||
220 | |||
221 | bool pxa2xx_spi_dma_is_possible(size_t len) | 210 | bool pxa2xx_spi_dma_is_possible(size_t len) |
222 | { | 211 | { |
223 | return len <= MAX_DMA_LEN; | 212 | return len <= MAX_DMA_LEN; |
@@ -321,12 +310,12 @@ int pxa2xx_spi_dma_setup(struct driver_data *drv_data) | |||
321 | return -ENOMEM; | 310 | return -ENOMEM; |
322 | 311 | ||
323 | drv_data->tx_chan = dma_request_slave_channel_compat(mask, | 312 | drv_data->tx_chan = dma_request_slave_channel_compat(mask, |
324 | pxa2xx_spi_dma_filter, pdata, dev, "tx"); | 313 | pdata->dma_filter, pdata->tx_param, dev, "tx"); |
325 | if (!drv_data->tx_chan) | 314 | if (!drv_data->tx_chan) |
326 | return -ENODEV; | 315 | return -ENODEV; |
327 | 316 | ||
328 | drv_data->rx_chan = dma_request_slave_channel_compat(mask, | 317 | drv_data->rx_chan = dma_request_slave_channel_compat(mask, |
329 | pxa2xx_spi_dma_filter, pdata, dev, "rx"); | 318 | pdata->dma_filter, pdata->rx_param, dev, "rx"); |
330 | if (!drv_data->rx_chan) { | 319 | if (!drv_data->rx_chan) { |
331 | dma_release_channel(drv_data->tx_chan); | 320 | dma_release_channel(drv_data->tx_chan); |
332 | drv_data->tx_chan = NULL; | 321 | drv_data->tx_chan = NULL; |