summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-topcliff-pch.c
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2014-02-19 10:36:08 +0100
committerMark Brown <broonie@linaro.org>2014-02-19 21:43:56 +0900
commit7611c7a5613f20ec2fb536c1d868d15045730bc0 (patch)
treea3905f23f2fa36fee4116c77c7b62e3466932ba6 /drivers/spi/spi-topcliff-pch.c
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
downloadlinux-7611c7a5613f20ec2fb536c1d868d15045730bc0.tar.bz2
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>
Diffstat (limited to 'drivers/spi/spi-topcliff-pch.c')
-rw-r--r--drivers/spi/spi-topcliff-pch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 2e7f38c7a961..3383008ce04d 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -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);