aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/se/7206/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/se/7206/io.c')
-rw-r--r--arch/sh/boards/se/7206/io.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/arch/sh/boards/se/7206/io.c b/arch/sh/boards/se/7206/io.c
index b557273e0cbe..1308e618e044 100644
--- a/arch/sh/boards/se/7206/io.c
+++ b/arch/sh/boards/se/7206/io.c
@@ -26,22 +26,24 @@ static inline void delay(void)
26static inline volatile __u16 * 26static inline volatile __u16 *
27port2adr(unsigned int port) 27port2adr(unsigned int port)
28{ 28{
29 if (port >= 0x2000) 29 if (port >= 0x2000 && port < 0x2020)
30 return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); 30 return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
31 else if (port >= 0x300 || port < 0x310) 31 else if (port >= 0x300 && port < 0x310)
32 return (volatile __u16 *) (PA_SMSC + (port - 0x300)); 32 return (volatile __u16 *) (PA_SMSC + (port - 0x300));
33
34 return (volatile __u16 *)port;
33} 35}
34 36
35unsigned char se7206_inb(unsigned long port) 37unsigned char se7206_inb(unsigned long port)
36{ 38{
37 return (*port2adr(port))&0xff; 39 return (*port2adr(port)) & 0xff;
38} 40}
39 41
40unsigned char se7206_inb_p(unsigned long port) 42unsigned char se7206_inb_p(unsigned long port)
41{ 43{
42 unsigned long v; 44 unsigned long v;
43 45
44 v = (*port2adr(port))&0xff; 46 v = (*port2adr(port)) & 0xff;
45 delay(); 47 delay();
46 return v; 48 return v;
47} 49}
@@ -51,12 +53,6 @@ unsigned short se7206_inw(unsigned long port)
51 return *port2adr(port);; 53 return *port2adr(port);;
52} 54}
53 55
54unsigned int se7206_inl(unsigned long port)
55{
56 maybebadio(port);
57 return 0;
58}
59
60void se7206_outb(unsigned char value, unsigned long port) 56void se7206_outb(unsigned char value, unsigned long port)
61{ 57{
62 *(port2adr(port)) = value; 58 *(port2adr(port)) = value;
@@ -73,11 +69,6 @@ void se7206_outw(unsigned short value, unsigned long port)
73 *port2adr(port) = value; 69 *port2adr(port) = value;
74} 70}
75 71
76void se7206_outl(unsigned int value, unsigned long port)
77{
78 maybebadio(port);
79}
80
81void se7206_insb(unsigned long port, void *addr, unsigned long count) 72void se7206_insb(unsigned long port, void *addr, unsigned long count)
82{ 73{
83 volatile __u16 *p = port2adr(port); 74 volatile __u16 *p = port2adr(port);
@@ -95,11 +86,6 @@ void se7206_insw(unsigned long port, void *addr, unsigned long count)
95 *ap++ = *p; 86 *ap++ = *p;
96} 87}
97 88
98void se7206_insl(unsigned long port, void *addr, unsigned long count)
99{
100 maybebadio(port);
101}
102
103void se7206_outsb(unsigned long port, const void *addr, unsigned long count) 89void se7206_outsb(unsigned long port, const void *addr, unsigned long count)
104{ 90{
105 volatile __u16 *p = port2adr(port); 91 volatile __u16 *p = port2adr(port);
@@ -116,8 +102,3 @@ void se7206_outsw(unsigned long port, const void *addr, unsigned long count)
116 while (count--) 102 while (count--)
117 *p = *ap++; 103 *p = *ap++;
118} 104}
119
120void se7206_outsl(unsigned long port, const void *addr, unsigned long count)
121{
122 maybebadio(port);
123}