aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-xilinx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-15 18:43:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-15 18:43:51 -0400
commitf5f28b894b14fb8d23b0d03d0f77e9a0ec7946b3 (patch)
tree24ebf4030dd7c5eb6e822aff46c6392b6d86cb8f /drivers/spi/spi-xilinx.c
parent47188d39b5deeebf41f87a02af1b3935866364cf (diff)
parent70f092a58520b26ef6222ae1b42bd08732fdf6b9 (diff)
Merge tag 'spi-v3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A couple of things missed during the v3.11 work here: - The spi-bitbang core requires a setup() function even if it does nothing which caused breakage when some empty setup functions were removed after their contents were factored out into the core. While this is clearly silly and will be fixed for v3.12 for now we just restore the functions. - A missing case handled in the s3c64xx driver" * tag 'spi-v3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: revert master->setup function removal for altera and nuc900 spi/xilinx: Revert master->setup function removal spi: s3c64xx: add missing check for polling mode
Diffstat (limited to 'drivers/spi/spi-xilinx.c')
-rw-r--r--drivers/spi/spi-xilinx.c16
1 files changed, 16 insertions, 0 deletions
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
236static 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
236static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi) 251static 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),