Skip to content

Commit 35dbc0e

Browse files
vapierarndb
authored andcommitted
asm-generic/io.h: allow people to override individual funcs
For the Blackfin port, we can use much of the asm-generic/io.h header, but we still need to declare some of our own versions of functions. Like the __raw_read* and in/out "string" helpers. So let people do this easily for many of these funcs. Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent d852a6a commit 35dbc0e

File tree

1 file changed

+26
-0
lines changed
  • include/asm-generic

1 file changed

+26
-0
lines changed

include/asm-generic/io.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#include <asm-generic/iomap.h>
2020
#endif
2121

22+
#ifndef mmiowb
2223
#define mmiowb() do {} while (0)
24+
#endif
2325

2426
/*****************************************************************************/
2527
/*
@@ -28,39 +30,51 @@
2830
* differently. On the simple architectures, we just read/write the
2931
* memory location directly.
3032
*/
33+
#ifndef __raw_readb
3134
static inline u8 __raw_readb(const volatile void __iomem *addr)
3235
{
3336
return *(const volatile u8 __force *) addr;
3437
}
38+
#endif
3539

40+
#ifndef __raw_readw
3641
static inline u16 __raw_readw(const volatile void __iomem *addr)
3742
{
3843
return *(const volatile u16 __force *) addr;
3944
}
45+
#endif
4046

47+
#ifndef __raw_readl
4148
static inline u32 __raw_readl(const volatile void __iomem *addr)
4249
{
4350
return *(const volatile u32 __force *) addr;
4451
}
52+
#endif
4553

4654
#define readb __raw_readb
4755
#define readw(addr) __le16_to_cpu(__raw_readw(addr))
4856
#define readl(addr) __le32_to_cpu(__raw_readl(addr))
4957

58+
#ifndef __raw_writeb
5059
static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
5160
{
5261
*(volatile u8 __force *) addr = b;
5362
}
63+
#endif
5464

65+
#ifndef __raw_writew
5566
static inline void __raw_writew(u16 b, volatile void __iomem *addr)
5667
{
5768
*(volatile u16 __force *) addr = b;
5869
}
70+
#endif
5971

72+
#ifndef __raw_writel
6073
static inline void __raw_writel(u32 b, volatile void __iomem *addr)
6174
{
6275
*(volatile u32 __force *) addr = b;
6376
}
77+
#endif
6478

6579
#define writeb __raw_writeb
6680
#define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr)
@@ -122,6 +136,7 @@ static inline void outl(u32 b, unsigned long addr)
122136
#define outw_p(x, addr) outw((x), (addr))
123137
#define outl_p(x, addr) outl((x), (addr))
124138

139+
#ifndef insb
125140
static inline void insb(unsigned long addr, void *buffer, int count)
126141
{
127142
if (count) {
@@ -132,7 +147,9 @@ static inline void insb(unsigned long addr, void *buffer, int count)
132147
} while (--count);
133148
}
134149
}
150+
#endif
135151

152+
#ifndef insw
136153
static inline void insw(unsigned long addr, void *buffer, int count)
137154
{
138155
if (count) {
@@ -143,7 +160,9 @@ static inline void insw(unsigned long addr, void *buffer, int count)
143160
} while (--count);
144161
}
145162
}
163+
#endif
146164

165+
#ifndef insl
147166
static inline void insl(unsigned long addr, void *buffer, int count)
148167
{
149168
if (count) {
@@ -154,7 +173,9 @@ static inline void insl(unsigned long addr, void *buffer, int count)
154173
} while (--count);
155174
}
156175
}
176+
#endif
157177

178+
#ifndef outsb
158179
static inline void outsb(unsigned long addr, const void *buffer, int count)
159180
{
160181
if (count) {
@@ -164,7 +185,9 @@ static inline void outsb(unsigned long addr, const void *buffer, int count)
164185
} while (--count);
165186
}
166187
}
188+
#endif
167189

190+
#ifndef outsw
168191
static inline void outsw(unsigned long addr, const void *buffer, int count)
169192
{
170193
if (count) {
@@ -174,7 +197,9 @@ static inline void outsw(unsigned long addr, const void *buffer, int count)
174197
} while (--count);
175198
}
176199
}
200+
#endif
177201

202+
#ifndef outsl
178203
static inline void outsl(unsigned long addr, const void *buffer, int count)
179204
{
180205
if (count) {
@@ -184,6 +209,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
184209
} while (--count);
185210
}
186211
}
212+
#endif
187213

188214
#ifndef CONFIG_GENERIC_IOMAP
189215
#define ioread8(addr) readb(addr)

0 commit comments

Comments
 (0)