aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel/io_mappi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m32r/kernel/io_mappi.c')
-rw-r--r--arch/m32r/kernel/io_mappi.c74
1 files changed, 8 insertions, 66 deletions
diff --git a/arch/m32r/kernel/io_mappi.c b/arch/m32r/kernel/io_mappi.c
index 85688ffb52f9..78033165fb5c 100644
--- a/arch/m32r/kernel/io_mappi.c
+++ b/arch/m32r/kernel/io_mappi.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Typical I/O routines for Mappi board. 4 * Typical I/O routines for Mappi board.
5 * 5 *
6 * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
7 * Hitoshi Yamamoto 7 * Hitoshi Yamamoto
8 */ 8 */
9 9
10#include <linux/config.h> 10#include <linux/config.h>
@@ -130,57 +130,21 @@ unsigned long _inl(unsigned long port)
130 130
131unsigned char _inb_p(unsigned long port) 131unsigned char _inb_p(unsigned long port)
132{ 132{
133 unsigned char v; 133 unsigned char v = _inb(port);
134
135 if (port >= 0x300 && port < 0x320)
136 v = _ne_inb(PORT2ADDR_NE(port));
137 else
138#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
139 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
140 unsigned char b;
141 pcc_ioread(0, port, &b, sizeof(b), 1, 0);
142 return b;
143 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
144 unsigned char b;
145 pcc_ioread(1, port, &b, sizeof(b), 1, 0);
146 return b;
147 } else
148#endif
149 v = *(volatile unsigned char *)PORT2ADDR(port);
150
151 delay(); 134 delay();
152 return (v); 135 return (v);
153} 136}
154 137
155unsigned short _inw_p(unsigned long port) 138unsigned short _inw_p(unsigned long port)
156{ 139{
157 unsigned short v; 140 unsigned short v = _inw(port);
158
159 if (port >= 0x300 && port < 0x320)
160 v = _ne_inw(PORT2ADDR_NE(port));
161 else
162#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
163 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
164 unsigned short w;
165 pcc_ioread(0, port, &w, sizeof(w), 1, 0);
166 return w;
167 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
168 unsigned short w;
169 pcc_ioread(1, port, &w, sizeof(w), 1, 0);
170 return w;
171 } else
172#endif
173 v = *(volatile unsigned short *)PORT2ADDR(port);
174
175 delay(); 141 delay();
176 return (v); 142 return (v);
177} 143}
178 144
179unsigned long _inl_p(unsigned long port) 145unsigned long _inl_p(unsigned long port)
180{ 146{
181 unsigned long v; 147 unsigned long v = _inl(port);
182
183 v = *(volatile unsigned long *)PORT2ADDR(port);
184 delay(); 148 delay();
185 return (v); 149 return (v);
186} 150}
@@ -229,41 +193,19 @@ void _outl(unsigned long l, unsigned long port)
229 193
230void _outb_p(unsigned char b, unsigned long port) 194void _outb_p(unsigned char b, unsigned long port)
231{ 195{
232 if (port >= 0x300 && port < 0x320) 196 _outb(b, port);
233 _ne_outb(b, PORT2ADDR_NE(port));
234 else
235#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
236 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
237 pcc_iowrite(0, port, &b, sizeof(b), 1, 0);
238 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
239 pcc_iowrite(1, port, &b, sizeof(b), 1, 0);
240 } else
241#endif
242 *(volatile unsigned char *)PORT2ADDR(port) = b;
243
244 delay(); 197 delay();
245} 198}
246 199
247void _outw_p(unsigned short w, unsigned long port) 200void _outw_p(unsigned short w, unsigned long port)
248{ 201{
249 if (port >= 0x300 && port < 0x320) 202 _outw(w, port);
250 _ne_outw(w, PORT2ADDR_NE(port));
251 else
252#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_PCC)
253 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
254 pcc_iowrite(0, port, &w, sizeof(w), 1, 0);
255 } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) {
256 pcc_iowrite(1, port, &w, sizeof(w), 1, 0);
257 } else
258#endif
259 *(volatile unsigned short *)PORT2ADDR(port) = w;
260
261 delay(); 203 delay();
262} 204}
263 205
264void _outl_p(unsigned long l, unsigned long port) 206void _outl_p(unsigned long l, unsigned long port)
265{ 207{
266 *(volatile unsigned long *)PORT2ADDR(port) = l; 208 _outl(l, port);
267 delay(); 209 delay();
268} 210}
269 211