mirror of https://gitee.com/openkylin/linux.git
spi/topcliff-pch: Fix DMA channel
bus_num might be asigned dynamically to e.g. 32766. In this case the calculated DMA channel based on SPI bus number is bogus. Use SPI channel number instead for calculation. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
38dbfb59d1
commit
7611c7a561
|
@ -915,7 +915,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
|
|||
/* Set Tx DMA */
|
||||
param = &dma->param_tx;
|
||||
param->dma_dev = &dma_dev->dev;
|
||||
param->chan_id = data->master->bus_num * 2; /* Tx = 0, 2 */
|
||||
param->chan_id = data->ch * 2; /* Tx = 0, 2 */;
|
||||
param->tx_reg = data->io_base_addr + PCH_SPDWR;
|
||||
param->width = width;
|
||||
chan = dma_request_channel(mask, pch_spi_filter, param);
|
||||
|
@ -930,7 +930,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
|
|||
/* Set Rx DMA */
|
||||
param = &dma->param_rx;
|
||||
param->dma_dev = &dma_dev->dev;
|
||||
param->chan_id = data->master->bus_num * 2 + 1; /* Rx = Tx + 1 */
|
||||
param->chan_id = data->ch * 2 + 1; /* Rx = Tx + 1 */;
|
||||
param->rx_reg = data->io_base_addr + PCH_SPDRR;
|
||||
param->width = width;
|
||||
chan = dma_request_channel(mask, pch_spi_filter, param);
|
||||
|
|
Loading…
Reference in New Issue