summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-xilinx.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-29 13:59:05 +0100
committerMark Brown <broonie@linaro.org>2013-08-29 13:59:05 +0100
commitb5f9a9d5113efe11a3b9dad600a6f833274da595 (patch)
tree6db5fb34a2d590086e25f7f682fecb5f43e6b283 /drivers/spi/spi-xilinx.c
parenta1216394e620d0dfbb03c712ae3210e7b77c9e11 (diff)
parent8d4d08ce8319ae26227c4dd558405963c14c2037 (diff)
Merge remote-tracking branch 'spi/topic/rspi' into spi-pdata
Conflicts: drivers/spi/spi-rspi.c
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 0bf1b2c457a1..08ea84a6eb32 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -232,6 +232,21 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi,
return 0;
}
+static int xilinx_spi_setup(struct spi_device *spi)
+{
+ /* always return 0, we can not check the number of bits.
+ * There are cases when SPI setup is called before any driver is
+ * there, in that case the SPI core defaults to 8 bits, which we
+ * do not support in some cases. But if we return an error, the
+ * SPI device would not be registered and no driver can get hold of it
+ * When the driver is there, it will call SPI setup again with the
+ * correct number of bits per transfer.
+ * If a driver setups with the wrong bit number, it will fail when
+ * it tries to do a transfer
+ */
+ return 0;
+}
+
static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi)
{
u8 sr;
@@ -376,6 +391,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
xspi->bitbang.chipselect = xilinx_spi_chipselect;
xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer;
xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
+ xspi->bitbang.master->setup = xilinx_spi_setup;
init_completion(&xspi->done);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);