aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-avr32/io.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 2fc8f111dce9..eec47500fa66 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -76,6 +76,39 @@ static inline unsigned int readl(const volatile void __iomem *addr)
76#define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l) 76#define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l)
77#define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l) 77#define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l)
78 78
79
80/*
81 * io{read,write}{8,16,32} macros in both le (for PCI style consumers) and native be
82 */
83#ifndef ioread8
84
85#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; })
86
87#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; })
88#define ioread16be(p) ({ unsigned int __v = be16_to_cpu(__raw_readw(p)); __v; })
89
90#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; })
91#define ioread32be(p) ({ unsigned int __v = be32_to_cpu(__raw_readl(p)); __v; })
92
93#define iowrite8(v,p) __raw_writeb(v, p)
94
95#define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p)
96#define iowrite16be(v,p) __raw_writew(cpu_to_be16(v), p)
97
98#define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p)
99#define iowrite32be(v,p) __raw_writel(cpu_to_be32(v), p)
100
101#define ioread8_rep(p,d,c) __raw_readsb(p,d,c)
102#define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
103#define ioread32_rep(p,d,c) __raw_readsl(p,d,c)
104
105#define iowrite8_rep(p,s,c) __raw_writesb(p,s,c)
106#define iowrite16_rep(p,s,c) __raw_writesw(p,s,c)
107#define iowrite32_rep(p,s,c) __raw_writesl(p,s,c)
108
109#endif
110
111
79/* 112/*
80 * These two are only here because ALSA _thinks_ it needs them... 113 * These two are only here because ALSA _thinks_ it needs them...
81 */ 114 */