diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-25 18:38:03 -0500 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-25 18:38:03 -0500 | 
| commit | d7930c9ef9cc67044f5ddaac54d06ca22645a012 (patch) | |
| tree | 32ec9ed98a7b5ff659de11886492b18abd421069 /drivers/spi/xilinx_spi.c | |
| parent | b6d97026561a6ed6eed58428633a6bb4e1b78c57 (diff) | |
| parent | 4f4517c45f325ba511458465430a52864a5d0d30 (diff) | |
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6: (31 commits)
  spi: Correct SPI clock frequency setting in spi_mpc8xxx
  spi/spi_s3c64xx.c: Fix continuation line formats
  spi/dw_spi: Fix dw_spi_mmio to depend on HAVE_CLK
  spi/dw_spi: Allow dw_spi.c to be a module
  spi/dw_spi: mmio code style fixups
  Memory-mapped dw_spi driver
  spi/dw_spi: fix missing export of dw_spi_remove_host
  spi/dw_spi: conditional transfer mode changes
  spi/dw_spi: remove conditional from 'poll_transfer'.
  spi/dw_spi: fixed a spelling typo in a warning message.
  spi/dw_spi: add return value to empty mrst_spi_debugfs_init()
  spi/dw_spi: enable platform specific chipselect.
  spi/dw_spi: add a FIFO depth detection
  spi/dw_spi: fix __init/__devinit section mismatch
  spi: xilinx_spi: Fix up I/O routine wrapping bogosity.
  spi/spi_imx: add device information by switching pr_debug() to dev_dbg()
  spi: update MSIOF includes
  spi/dw_spi: refine the IRQ mode working flow
  spi/dw_spi: add a missed dw_spi_remove_host() in exit sequence
  spi/dw_spi: bug fix in wait_till_not_busy()
  ...
Diffstat (limited to 'drivers/spi/xilinx_spi.c')
| -rw-r--r-- | drivers/spi/xilinx_spi.c | 28 | 
1 files changed, 24 insertions, 4 deletions
| diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 9f386379c169..1b47363cb73f 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
| @@ -93,6 +93,26 @@ struct xilinx_spi { | |||
| 93 | void (*rx_fn) (struct xilinx_spi *); | 93 | void (*rx_fn) (struct xilinx_spi *); | 
| 94 | }; | 94 | }; | 
| 95 | 95 | ||
| 96 | static void xspi_write32(u32 val, void __iomem *addr) | ||
| 97 | { | ||
| 98 | iowrite32(val, addr); | ||
| 99 | } | ||
| 100 | |||
| 101 | static unsigned int xspi_read32(void __iomem *addr) | ||
| 102 | { | ||
| 103 | return ioread32(addr); | ||
| 104 | } | ||
| 105 | |||
| 106 | static void xspi_write32_be(u32 val, void __iomem *addr) | ||
| 107 | { | ||
| 108 | iowrite32be(val, addr); | ||
| 109 | } | ||
| 110 | |||
| 111 | static unsigned int xspi_read32_be(void __iomem *addr) | ||
| 112 | { | ||
| 113 | return ioread32be(addr); | ||
| 114 | } | ||
| 115 | |||
| 96 | static void xspi_tx8(struct xilinx_spi *xspi) | 116 | static void xspi_tx8(struct xilinx_spi *xspi) | 
| 97 | { | 117 | { | 
| 98 | xspi->write_fn(*xspi->tx_ptr, xspi->regs + XSPI_TXD_OFFSET); | 118 | xspi->write_fn(*xspi->tx_ptr, xspi->regs + XSPI_TXD_OFFSET); | 
| @@ -374,11 +394,11 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem, | |||
| 374 | xspi->mem = *mem; | 394 | xspi->mem = *mem; | 
| 375 | xspi->irq = irq; | 395 | xspi->irq = irq; | 
| 376 | if (pdata->little_endian) { | 396 | if (pdata->little_endian) { | 
| 377 | xspi->read_fn = ioread32; | 397 | xspi->read_fn = xspi_read32; | 
| 378 | xspi->write_fn = iowrite32; | 398 | xspi->write_fn = xspi_write32; | 
| 379 | } else { | 399 | } else { | 
| 380 | xspi->read_fn = ioread32be; | 400 | xspi->read_fn = xspi_read32_be; | 
| 381 | xspi->write_fn = iowrite32be; | 401 | xspi->write_fn = xspi_write32_be; | 
| 382 | } | 402 | } | 
| 383 | xspi->bits_per_word = pdata->bits_per_word; | 403 | xspi->bits_per_word = pdata->bits_per_word; | 
| 384 | if (xspi->bits_per_word == 8) { | 404 | if (xspi->bits_per_word == 8) { | 
