summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-01-30 13:42:00 +0100
committerMark Brown <broonie@kernel.org>2015-01-30 13:42:00 +0100
commit0635287a308d38bad334fe91ea5a69b597e0a583 (patch)
treec6058c581cf09d37eb5f3bae8e2a2417de84cc9b /drivers
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>
Diffstat (limited to 'drivers')
-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 {
void (*write_fn)(u32, void __iomem *);
};
+static void xspi_write32(u32 val, void __iomem *addr)
+{
+ iowrite32(val, addr);
+}
+
+static unsigned int xspi_read32(void __iomem *addr)
+{
+ return ioread32(addr);
+}
+
+static void xspi_write32_be(u32 val, void __iomem *addr)
+{
+ iowrite32be(val, addr);
+}
+
+static unsigned int xspi_read32_be(void __iomem *addr)
+{
+ return ioread32be(addr);
+}
+
static void xilinx_spi_tx(struct xilinx_spi *xspi)
{
if (!xspi->tx_ptr) {
@@ -388,15 +408,15 @@ static int xilinx_spi_probe(struct platform_device *pdev)
* Setup little endian helper functions first and try to use them
* and check if bit was correctly setup or not.
*/
- xspi->read_fn = ioread32;
- xspi->write_fn = iowrite32;
+ xspi->read_fn = xspi_read32;
+ xspi->write_fn = xspi_write32;
xspi->write_fn(XSPI_CR_LOOP, xspi->regs + XSPI_CR_OFFSET);
tmp = xspi->read_fn(xspi->regs + XSPI_CR_OFFSET);
tmp &= XSPI_CR_LOOP;
if (tmp != XSPI_CR_LOOP) {
- xspi->read_fn = ioread32be;
- xspi->write_fn = iowrite32be;
+ xspi->read_fn = xspi_read32_be;
+ xspi->write_fn = xspi_write32_be;
}
master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word);