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 <vapier@gentoo.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by Mike Frysinger and committed by Arnd Bergmann 35dbc0e0 d852a6af

+26
+26
include/asm-generic/io.h
··· 19 19 #include <asm-generic/iomap.h> 20 20 #endif 21 21 22 + #ifndef mmiowb 22 23 #define mmiowb() do {} while (0) 24 + #endif 23 25 24 26 /*****************************************************************************/ 25 27 /* ··· 30 28 * differently. On the simple architectures, we just read/write the 31 29 * memory location directly. 32 30 */ 31 + #ifndef __raw_readb 33 32 static inline u8 __raw_readb(const volatile void __iomem *addr) 34 33 { 35 34 return *(const volatile u8 __force *) addr; 36 35 } 36 + #endif 37 37 38 + #ifndef __raw_readw 38 39 static inline u16 __raw_readw(const volatile void __iomem *addr) 39 40 { 40 41 return *(const volatile u16 __force *) addr; 41 42 } 43 + #endif 42 44 45 + #ifndef __raw_readl 43 46 static inline u32 __raw_readl(const volatile void __iomem *addr) 44 47 { 45 48 return *(const volatile u32 __force *) addr; 46 49 } 50 + #endif 47 51 48 52 #define readb __raw_readb 49 53 #define readw(addr) __le16_to_cpu(__raw_readw(addr)) 50 54 #define readl(addr) __le32_to_cpu(__raw_readl(addr)) 51 55 56 + #ifndef __raw_writeb 52 57 static inline void __raw_writeb(u8 b, volatile void __iomem *addr) 53 58 { 54 59 *(volatile u8 __force *) addr = b; 55 60 } 61 + #endif 56 62 63 + #ifndef __raw_writew 57 64 static inline void __raw_writew(u16 b, volatile void __iomem *addr) 58 65 { 59 66 *(volatile u16 __force *) addr = b; 60 67 } 68 + #endif 61 69 70 + #ifndef __raw_writel 62 71 static inline void __raw_writel(u32 b, volatile void __iomem *addr) 63 72 { 64 73 *(volatile u32 __force *) addr = b; 65 74 } 75 + #endif 66 76 67 77 #define writeb __raw_writeb 68 78 #define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr) ··· 136 122 #define outw_p(x, addr) outw((x), (addr)) 137 123 #define outl_p(x, addr) outl((x), (addr)) 138 124 125 + #ifndef insb 139 126 static inline void insb(unsigned long addr, void *buffer, int count) 140 127 { 141 128 if (count) { ··· 147 132 } while (--count); 148 133 } 149 134 } 135 + #endif 150 136 137 + #ifndef insw 151 138 static inline void insw(unsigned long addr, void *buffer, int count) 152 139 { 153 140 if (count) { ··· 160 143 } while (--count); 161 144 } 162 145 } 146 + #endif 163 147 148 + #ifndef insl 164 149 static inline void insl(unsigned long addr, void *buffer, int count) 165 150 { 166 151 if (count) { ··· 173 154 } while (--count); 174 155 } 175 156 } 157 + #endif 176 158 159 + #ifndef outsb 177 160 static inline void outsb(unsigned long addr, const void *buffer, int count) 178 161 { 179 162 if (count) { ··· 185 164 } while (--count); 186 165 } 187 166 } 167 + #endif 188 168 169 + #ifndef outsw 189 170 static inline void outsw(unsigned long addr, const void *buffer, int count) 190 171 { 191 172 if (count) { ··· 197 174 } while (--count); 198 175 } 199 176 } 177 + #endif 200 178 179 + #ifndef outsl 201 180 static inline void outsl(unsigned long addr, const void *buffer, int count) 202 181 { 203 182 if (count) { ··· 209 184 } while (--count); 210 185 } 211 186 } 187 + #endif 212 188 213 189 #ifndef CONFIG_GENERIC_IOMAP 214 190 #define ioread8(addr) readb(addr)