diff options
-rw-r--r-- | drivers/spi/spi-altera.c | 12 | ||||
-rw-r--r-- | drivers/spi/spi-nuc900.c | 13 | ||||
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-xilinx.c | 16 |
4 files changed, 44 insertions, 0 deletions
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c index 8a6bb37910da..81b9adb6e766 100644 --- a/drivers/spi/spi-altera.c +++ b/drivers/spi/spi-altera.c | |||
@@ -103,6 +103,16 @@ static void altera_spi_chipsel(struct spi_device *spi, int value) | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | static int altera_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | static int altera_spi_setup(struct spi_device *spi) | ||
112 | { | ||
113 | return 0; | ||
114 | } | ||
115 | |||
106 | static inline unsigned int hw_txbyte(struct altera_spi *hw, int count) | 116 | static inline unsigned int hw_txbyte(struct altera_spi *hw, int count) |
107 | { | 117 | { |
108 | if (hw->tx) { | 118 | if (hw->tx) { |
@@ -221,6 +231,7 @@ static int altera_spi_probe(struct platform_device *pdev) | |||
221 | master->bus_num = pdev->id; | 231 | master->bus_num = pdev->id; |
222 | master->num_chipselect = 16; | 232 | master->num_chipselect = 16; |
223 | master->mode_bits = SPI_CS_HIGH; | 233 | master->mode_bits = SPI_CS_HIGH; |
234 | master->setup = altera_spi_setup; | ||
224 | 235 | ||
225 | hw = spi_master_get_devdata(master); | 236 | hw = spi_master_get_devdata(master); |
226 | platform_set_drvdata(pdev, hw); | 237 | platform_set_drvdata(pdev, hw); |
@@ -229,6 +240,7 @@ static int altera_spi_probe(struct platform_device *pdev) | |||
229 | hw->bitbang.master = spi_master_get(master); | 240 | hw->bitbang.master = spi_master_get(master); |
230 | if (!hw->bitbang.master) | 241 | if (!hw->bitbang.master) |
231 | return err; | 242 | return err; |
243 | hw->bitbang.setup_transfer = altera_spi_setupxfer; | ||
232 | hw->bitbang.chipselect = altera_spi_chipsel; | 244 | hw->bitbang.chipselect = altera_spi_chipsel; |
233 | hw->bitbang.txrx_bufs = altera_spi_txrx; | 245 | hw->bitbang.txrx_bufs = altera_spi_txrx; |
234 | 246 | ||
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c index 2ad3d74ac021..150d85453c27 100644 --- a/drivers/spi/spi-nuc900.c +++ b/drivers/spi/spi-nuc900.c | |||
@@ -174,6 +174,17 @@ static void nuc900_spi_gobusy(struct nuc900_spi *hw) | |||
174 | spin_unlock_irqrestore(&hw->lock, flags); | 174 | spin_unlock_irqrestore(&hw->lock, flags); |
175 | } | 175 | } |
176 | 176 | ||
177 | static int nuc900_spi_setupxfer(struct spi_device *spi, | ||
178 | struct spi_transfer *t) | ||
179 | { | ||
180 | return 0; | ||
181 | } | ||
182 | |||
183 | static int nuc900_spi_setup(struct spi_device *spi) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | |||
177 | static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count) | 188 | static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count) |
178 | { | 189 | { |
179 | return hw->tx ? hw->tx[count] : 0; | 190 | return hw->tx ? hw->tx[count] : 0; |
@@ -366,8 +377,10 @@ static int nuc900_spi_probe(struct platform_device *pdev) | |||
366 | master->num_chipselect = hw->pdata->num_cs; | 377 | master->num_chipselect = hw->pdata->num_cs; |
367 | master->bus_num = hw->pdata->bus_num; | 378 | master->bus_num = hw->pdata->bus_num; |
368 | hw->bitbang.master = hw->master; | 379 | hw->bitbang.master = hw->master; |
380 | hw->bitbang.setup_transfer = nuc900_spi_setupxfer; | ||
369 | hw->bitbang.chipselect = nuc900_spi_chipsel; | 381 | hw->bitbang.chipselect = nuc900_spi_chipsel; |
370 | hw->bitbang.txrx_bufs = nuc900_spi_txrx; | 382 | hw->bitbang.txrx_bufs = nuc900_spi_txrx; |
383 | hw->bitbang.master->setup = nuc900_spi_setup; | ||
371 | 384 | ||
372 | hw->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 385 | hw->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
373 | if (hw->res == NULL) { | 386 | if (hw->res == NULL) { |
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index eb53df27e7ea..63e2070c6c14 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -434,6 +434,9 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) | |||
434 | dma_cap_mask_t mask; | 434 | dma_cap_mask_t mask; |
435 | int ret; | 435 | int ret; |
436 | 436 | ||
437 | if (is_polling(sdd)) | ||
438 | return 0; | ||
439 | |||
437 | dma_cap_zero(mask); | 440 | dma_cap_zero(mask); |
438 | dma_cap_set(DMA_SLAVE, mask); | 441 | dma_cap_set(DMA_SLAVE, mask); |
439 | 442 | ||
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index fb56fcfdf65e..09a942852593 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -233,6 +233,21 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi, | |||
233 | return 0; | 233 | return 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | static int xilinx_spi_setup(struct spi_device *spi) | ||
237 | { | ||
238 | /* always return 0, we can not check the number of bits. | ||
239 | * There are cases when SPI setup is called before any driver is | ||
240 | * there, in that case the SPI core defaults to 8 bits, which we | ||
241 | * do not support in some cases. But if we return an error, the | ||
242 | * SPI device would not be registered and no driver can get hold of it | ||
243 | * When the driver is there, it will call SPI setup again with the | ||
244 | * correct number of bits per transfer. | ||
245 | * If a driver setups with the wrong bit number, it will fail when | ||
246 | * it tries to do a transfer | ||
247 | */ | ||
248 | return 0; | ||
249 | } | ||
250 | |||
236 | static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi) | 251 | static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi) |
237 | { | 252 | { |
238 | u8 sr; | 253 | u8 sr; |
@@ -360,6 +375,7 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem, | |||
360 | xspi->bitbang.chipselect = xilinx_spi_chipselect; | 375 | xspi->bitbang.chipselect = xilinx_spi_chipselect; |
361 | xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer; | 376 | xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer; |
362 | xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs; | 377 | xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs; |
378 | xspi->bitbang.master->setup = xilinx_spi_setup; | ||
363 | init_completion(&xspi->done); | 379 | init_completion(&xspi->done); |
364 | 380 | ||
365 | if (!request_mem_region(mem->start, resource_size(mem), | 381 | if (!request_mem_region(mem->start, resource_size(mem), |