diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-09-10 10:11:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-14 14:48:16 -0400 |
commit | 158fcc4e050a75b609bbef1007cf7bf2a01ca043 (patch) | |
tree | 081ef46ba4c06d9a63a9e8dda8fed7d8808dfd1f | |
parent | a45fcea5b20f1dcc2abb08aa29ecb2feacae60f2 (diff) |
spi/bcm63xx: replace custom io accessors with standard ones
Replace all bcm_read* with (io)read. Due to this block following
system endianness, make sure we match that.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index c1364a8fa268..ef05387c1341 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -56,25 +56,33 @@ struct bcm63xx_spi { | |||
56 | static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs, | 56 | static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs, |
57 | unsigned int offset) | 57 | unsigned int offset) |
58 | { | 58 | { |
59 | return bcm_readb(bs->regs + bcm63xx_spireg(offset)); | 59 | return readb(bs->regs + bcm63xx_spireg(offset)); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs, | 62 | static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs, |
63 | unsigned int offset) | 63 | unsigned int offset) |
64 | { | 64 | { |
65 | return bcm_readw(bs->regs + bcm63xx_spireg(offset)); | 65 | #ifdef CONFIG_BIG_ENDIAN |
66 | return ioread16(bs->regs + bcm63xx_spireg(offset)); | ||
67 | #else | ||
68 | return readw(bs->regs + bcm63xx_spireg(offset)); | ||
69 | #endif | ||
66 | } | 70 | } |
67 | 71 | ||
68 | static inline void bcm_spi_writeb(struct bcm63xx_spi *bs, | 72 | static inline void bcm_spi_writeb(struct bcm63xx_spi *bs, |
69 | u8 value, unsigned int offset) | 73 | u8 value, unsigned int offset) |
70 | { | 74 | { |
71 | bcm_writeb(value, bs->regs + bcm63xx_spireg(offset)); | 75 | writeb(value, bs->regs + bcm63xx_spireg(offset)); |
72 | } | 76 | } |
73 | 77 | ||
74 | static inline void bcm_spi_writew(struct bcm63xx_spi *bs, | 78 | static inline void bcm_spi_writew(struct bcm63xx_spi *bs, |
75 | u16 value, unsigned int offset) | 79 | u16 value, unsigned int offset) |
76 | { | 80 | { |
77 | bcm_writew(value, bs->regs + bcm63xx_spireg(offset)); | 81 | #ifdef CONFIG_BIG_ENDIAN |
82 | iowrite16(value, bs->regs + bcm63xx_spireg(offset)); | ||
83 | #else | ||
84 | writew(value, bs->regs + bcm63xx_spireg(offset)); | ||
85 | #endif | ||
78 | } | 86 | } |
79 | 87 | ||
80 | static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = { | 88 | static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = { |