Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180891
b: refs/heads/master
c: 9778214
h: refs/heads/master
i:
  180889: 0dd675c
  180887: c5f7e20
v: v3
  • Loading branch information
Paul Mundt authored and Grant Likely committed Jan 20, 2010
1 parent 94016c2 commit a2e112f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4d4ecfe788b4141d8c90cfc3ac2831f620f5c1b
refs/heads/master: 9778214990af88ec6720bd771d7fc0fa1b140b02
28 changes: 24 additions & 4 deletions trunk/drivers/spi/xilinx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ struct xilinx_spi {
void (*rx_fn) (struct xilinx_spi *);
};

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 xspi_tx8(struct xilinx_spi *xspi)
{
xspi->write_fn(*xspi->tx_ptr, xspi->regs + XSPI_TXD_OFFSET);
Expand Down Expand Up @@ -374,11 +394,11 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem,
xspi->mem = *mem;
xspi->irq = irq;
if (pdata->little_endian) {
xspi->read_fn = ioread32;
xspi->write_fn = iowrite32;
xspi->read_fn = xspi_read32;
xspi->write_fn = xspi_write32;
} else {
xspi->read_fn = ioread32be;
xspi->write_fn = iowrite32be;
xspi->read_fn = xspi_read32_be;
xspi->write_fn = xspi_write32_be;
}
xspi->bits_per_word = pdata->bits_per_word;
if (xspi->bits_per_word == 8) {
Expand Down

0 comments on commit a2e112f

Please sign in to comment.