aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-01-30 07:42:00 -0500
committerMark Brown <broonie@kernel.org>2015-01-30 07:42:00 -0500
commit0635287a308d38bad334fe91ea5a69b597e0a583 (patch)
treec6058c581cf09d37eb5f3bae8e2a2417de84cc9b
parenteb25f16c6f446936932f41f3ff811fbdc285bbc4 (diff)
spi: Revert "spi/xilinx: Remove iowrite/ioread wrappers"
This reverts commit 99082eab63449f9dfa83d5157fa6d78bfc1b04d7 since it breaks the build due to differing implementations of iowrite() and ioread(). Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-xilinx.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 2ca55f6b5158..d1901d578823 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -95,6 +95,26 @@ struct xilinx_spi {
95 void (*write_fn)(u32, void __iomem *); 95 void (*write_fn)(u32, void __iomem *);
96}; 96};
97 97
98static void xspi_write32(u32 val, void __iomem *addr)
99{
100 iowrite32(val, addr);
101}
102
103static unsigned int xspi_read32(void __iomem *addr)
104{
105 return ioread32(addr);
106}
107
108static void xspi_write32_be(u32 val, void __iomem *addr)
109{
110 iowrite32be(val, addr);
111}
112
113static unsigned int xspi_read32_be(void __iomem *addr)
114{
115 return ioread32be(addr);
116}
117
98static void xilinx_spi_tx(struct xilinx_spi *xspi) 118static void xilinx_spi_tx(struct xilinx_spi *xspi)
99{ 119{
100 if (!xspi->tx_ptr) { 120 if (!xspi->tx_ptr) {
@@ -388,15 +408,15 @@ static int xilinx_spi_probe(struct platform_device *pdev)
388 * Setup little endian helper functions first and try to use them 408 * Setup little endian helper functions first and try to use them
389 * and check if bit was correctly setup or not. 409 * and check if bit was correctly setup or not.
390 */ 410 */
391 xspi->read_fn = ioread32; 411 xspi->read_fn = xspi_read32;
392 xspi->write_fn = iowrite32; 412 xspi->write_fn = xspi_write32;
393 413
394 xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET); 414 xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET);
395 tmp = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET); 415 tmp = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET);
396 tmp &= XSPI_CR_LOOP; 416 tmp &= XSPI_CR_LOOP;
397 if (tmp != XSPI_CR_LOOP) { 417 if (tmp != XSPI_CR_LOOP) {
398 xspi->read_fn = ioread32be; 418 xspi->read_fn = xspi_read32_be;
399 xspi->write_fn = iowrite32be; 419 xspi->write_fn = xspi_write32_be;
400 } 420 }
401 421
402 master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word); 422 master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word);