aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-davinci.c6
-rw-r--r--drivers/spi/spi-fsl-spi.c4
-rw-r--r--drivers/spi/spi-imx.c12
-rw-r--r--include/linux/amba/pl022.h2
4 files changed, 16 insertions, 8 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 31bfba805cf4..9b2901feaf78 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -653,7 +653,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
653 dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n", 653 dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n",
654 rx_buf_count); 654 rx_buf_count);
655 if (t->tx_buf) 655 if (t->tx_buf)
656 dma_unmap_single(NULL, t->tx_dma, t->len, 656 dma_unmap_single(&spi->dev, t->tx_dma, t->len,
657 DMA_TO_DEVICE); 657 DMA_TO_DEVICE);
658 return -ENOMEM; 658 return -ENOMEM;
659 } 659 }
@@ -692,10 +692,10 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
692 if (spicfg->io_type == SPI_IO_TYPE_DMA) { 692 if (spicfg->io_type == SPI_IO_TYPE_DMA) {
693 693
694 if (t->tx_buf) 694 if (t->tx_buf)
695 dma_unmap_single(NULL, t->tx_dma, t->len, 695 dma_unmap_single(&spi->dev, t->tx_dma, t->len,
696 DMA_TO_DEVICE); 696 DMA_TO_DEVICE);
697 697
698 dma_unmap_single(NULL, t->rx_dma, rx_buf_count, 698 dma_unmap_single(&spi->dev, t->rx_dma, rx_buf_count,
699 DMA_FROM_DEVICE); 699 DMA_FROM_DEVICE);
700 700
701 clear_io_bits(dspi->base + SPIINT, SPIINT_DMA_REQ_EN); 701 clear_io_bits(dspi->base + SPIINT, SPIINT_DMA_REQ_EN);
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 24cacff57786..5f748c0d96bd 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -139,10 +139,12 @@ static void fsl_spi_change_mode(struct spi_device *spi)
139static void fsl_spi_chipselect(struct spi_device *spi, int value) 139static void fsl_spi_chipselect(struct spi_device *spi, int value)
140{ 140{
141 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); 141 struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
142 struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data; 142 struct fsl_spi_platform_data *pdata;
143 bool pol = spi->mode & SPI_CS_HIGH; 143 bool pol = spi->mode & SPI_CS_HIGH;
144 struct spi_mpc8xxx_cs *cs = spi->controller_state; 144 struct spi_mpc8xxx_cs *cs = spi->controller_state;
145 145
146 pdata = spi->dev.parent->parent->platform_data;
147
146 if (value == BITBANG_CS_INACTIVE) { 148 if (value == BITBANG_CS_INACTIVE) {
147 if (pdata->cs_control) 149 if (pdata->cs_control)
148 pdata->cs_control(spi, !pol); 150 pdata->cs_control(spi, !pol);
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 31054e3de4c1..570f22053be8 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -83,7 +83,7 @@ struct spi_imx_data {
83 struct spi_bitbang bitbang; 83 struct spi_bitbang bitbang;
84 84
85 struct completion xfer_done; 85 struct completion xfer_done;
86 void *base; 86 void __iomem *base;
87 int irq; 87 int irq;
88 struct clk *clk; 88 struct clk *clk;
89 unsigned long spi_clk; 89 unsigned long spi_clk;
@@ -766,8 +766,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
766 } 766 }
767 767
768 ret = of_property_read_u32(np, "fsl,spi-num-chipselects", &num_cs); 768 ret = of_property_read_u32(np, "fsl,spi-num-chipselects", &num_cs);
769 if (ret < 0) 769 if (ret < 0) {
770 num_cs = mxc_platform_info->num_chipselect; 770 if (mxc_platform_info)
771 num_cs = mxc_platform_info->num_chipselect;
772 else
773 return ret;
774 }
771 775
772 master = spi_alloc_master(&pdev->dev, 776 master = spi_alloc_master(&pdev->dev,
773 sizeof(struct spi_imx_data) + sizeof(int) * num_cs); 777 sizeof(struct spi_imx_data) + sizeof(int) * num_cs);
@@ -784,7 +788,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
784 788
785 for (i = 0; i < master->num_chipselect; i++) { 789 for (i = 0; i < master->num_chipselect; i++) {
786 int cs_gpio = of_get_named_gpio(np, "cs-gpios", i); 790 int cs_gpio = of_get_named_gpio(np, "cs-gpios", i);
787 if (cs_gpio < 0) 791 if (cs_gpio < 0 && mxc_platform_info)
788 cs_gpio = mxc_platform_info->chipselect[i]; 792 cs_gpio = mxc_platform_info->chipselect[i];
789 793
790 spi_imx->chipselect[i] = cs_gpio; 794 spi_imx->chipselect[i] = cs_gpio;
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index b8c51124ed19..76dd1b199a1b 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -25,6 +25,8 @@
25#ifndef _SSP_PL022_H 25#ifndef _SSP_PL022_H
26#define _SSP_PL022_H 26#define _SSP_PL022_H
27 27
28#include <linux/types.h>
29
28/** 30/**
29 * whether SSP is in loopback mode or not 31 * whether SSP is in loopback mode or not
30 */ 32 */