Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/kernel/io_hs7751rvoip.c |
| 3 | * |
| 4 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel |
| 5 | * Based largely on io_se.c. |
| 6 | * |
| 7 | * I/O routine for Renesas Technology sales HS7751RVoIP |
| 8 | * |
| 9 | * Initial version only to support LAN access; some |
| 10 | * placeholder code from io_hs7751rvoip.c left in with the |
| 11 | * expectation of later SuperIO and PCMCIA access. |
| 12 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/types.h> |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 15 | #include <linux/module.h> |
Paul Mundt | e5723e0 | 2006-09-27 17:38:11 +0900 | [diff] [blame^] | 16 | #include <linux/pci.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <asm/io.h> |
| 18 | #include <asm/hs7751rvoip/hs7751rvoip.h> |
| 19 | #include <asm/addrspace.h> |
| 20 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | extern void *area6_io8_base; /* Area 6 8bit I/O Base address */ |
| 22 | extern void *area5_io16_base; /* Area 5 16bit I/O Base address */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | /* |
| 25 | * The 7751R HS7751RVoIP uses the built-in PCI controller (PCIC) |
| 26 | * of the 7751R processor, and has a SuperIO accessible via the PCI. |
| 27 | * The board also includes a PCMCIA controller on its memory bus, |
| 28 | * like the other Solution Engine boards. |
| 29 | */ |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #define CODEC_IO_BASE 0x1000 |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 32 | #define CODEC_IOMAP(a) ((unsigned long)area6_io8_base + ((a) - CODEC_IO_BASE)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | static inline unsigned long port2adr(unsigned int port) |
| 35 | { |
| 36 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) |
| 37 | if (port == 0x3f6) |
| 38 | return ((unsigned long)area5_io16_base + 0x0c); |
| 39 | else |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 40 | return ((unsigned long)area5_io16_base + 0x800 + |
| 41 | ((port-0x1f0) << 1)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 43 | maybebadio((unsigned long)port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | return port; |
| 45 | } |
| 46 | |
| 47 | /* The 7751R HS7751RVoIP seems to have everything hooked */ |
| 48 | /* up pretty normally (nothing on high-bytes only...) so this */ |
| 49 | /* shouldn't be needed */ |
| 50 | static inline int shifted_port(unsigned long port) |
| 51 | { |
| 52 | /* For IDE registers, value is not shifted */ |
| 53 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) |
| 54 | return 0; |
| 55 | else |
| 56 | return 1; |
| 57 | } |
| 58 | |
| 59 | #if defined(CONFIG_HS7751RVOIP_CODEC) |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 60 | #define codec_port(port) \ |
| 61 | ((CODEC_IO_BASE <= (port)) && ((port) < (CODEC_IO_BASE + 0x20))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #else |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 63 | #define codec_port(port) (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | /* |
| 67 | * General outline: remap really low stuff [eventually] to SuperIO, |
| 68 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) |
| 69 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) |
| 70 | * should be way beyond the window, and is used w/o translation for |
| 71 | * compatibility. |
| 72 | */ |
| 73 | unsigned char hs7751rvoip_inb(unsigned long port) |
| 74 | { |
| 75 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 76 | return ctrl_inb(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 78 | return ctrl_inb(CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 79 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 80 | return ctrl_inb(pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 82 | return ctrl_inw(port2adr(port)) & 0xff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | unsigned char hs7751rvoip_inb_p(unsigned long port) |
| 86 | { |
| 87 | unsigned char v; |
| 88 | |
| 89 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 90 | v = ctrl_inb(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 92 | v = ctrl_inb(CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 93 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 94 | v = ctrl_inb(pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 96 | v = ctrl_inw(port2adr(port)) & 0xff; |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 97 | ctrl_delay(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | return v; |
| 99 | } |
| 100 | |
| 101 | unsigned short hs7751rvoip_inw(unsigned long port) |
| 102 | { |
| 103 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 104 | return ctrl_inw(port); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 105 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 106 | return ctrl_inw(pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 108 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | return 0; |
| 110 | } |
| 111 | |
| 112 | unsigned int hs7751rvoip_inl(unsigned long port) |
| 113 | { |
| 114 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 115 | return ctrl_inl(port); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 116 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 117 | return ctrl_inl(pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 119 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | void hs7751rvoip_outb(unsigned char value, unsigned long port) |
| 124 | { |
| 125 | |
| 126 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 127 | ctrl_outb(value, port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 129 | ctrl_outb(value, CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 130 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 131 | ctrl_outb(value, pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 133 | ctrl_outb(value, port2adr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | void hs7751rvoip_outb_p(unsigned char value, unsigned long port) |
| 137 | { |
| 138 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 139 | ctrl_outb(value, port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 141 | ctrl_outb(value, CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 142 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 143 | ctrl_outb(value, pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 145 | ctrl_outw(value, port2adr(port)); |
| 146 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 147 | ctrl_delay(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | void hs7751rvoip_outw(unsigned short value, unsigned long port) |
| 151 | { |
| 152 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 153 | ctrl_outw(value, port); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 154 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 155 | ctrl_outw(value, pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 156 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 157 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | void hs7751rvoip_outl(unsigned int value, unsigned long port) |
| 161 | { |
| 162 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 163 | ctrl_outl(value, port); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 164 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 165 | ctrl_outl(value, pci_ioaddr(port)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 167 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count) |
| 171 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 172 | u8 *buf = addr; |
| 173 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 175 | while (count--) |
| 176 | *buf++ = ctrl_inb(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 178 | while (count--) |
| 179 | *buf++ = ctrl_inb(CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 180 | else if (is_pci_ioaddr(port) || shifted_port(port)) { |
| 181 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 183 | while (count--) |
| 184 | *buf++ = *bp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | } else { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 186 | volatile u16 *p = (volatile u16 *)port2adr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 188 | while (count--) |
| 189 | *buf++ = *p & 0xff; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | } |
| 191 | } |
| 192 | |
| 193 | void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count) |
| 194 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 195 | volatile u16 *p; |
| 196 | u16 *buf = addr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | |
| 198 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 199 | p = (volatile u16 *)port; |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 200 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 201 | p = (volatile u16 *)pci_ioaddr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 202 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 203 | p = (volatile u16 *)port2adr(port); |
| 204 | while (count--) |
| 205 | *buf++ = *p; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count) |
| 209 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 211 | if (is_pci_ioaddr(port) || shifted_port(port)) { |
| 212 | volatile u32 *p = (volatile u32 *)pci_ioaddr(port); |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 213 | u32 *buf = addr; |
| 214 | |
| 215 | while (count--) |
| 216 | *buf++ = *p; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 218 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count) |
| 222 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 223 | const u8 *buf = addr; |
| 224 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 226 | while (count--) |
| 227 | ctrl_outb(*buf++, port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | else if (codec_port(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 229 | while (count--) |
| 230 | ctrl_outb(*buf++, CODEC_IOMAP(port)); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 231 | else if (is_pci_ioaddr(port) || shifted_port(port)) { |
| 232 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 234 | while (count--) |
| 235 | *bp = *buf++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | } else { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 237 | volatile u16 *p = (volatile u16 *)port2adr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 239 | while (count--) |
| 240 | *p = *buf++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | } |
| 242 | } |
| 243 | |
| 244 | void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count) |
| 245 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 246 | volatile u16 *p; |
| 247 | const u16 *buf = addr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | |
| 249 | if (PXSEG(port)) |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 250 | p = (volatile u16 *)port; |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 251 | else if (is_pci_ioaddr(port) || shifted_port(port)) |
| 252 | p = (volatile u16 *)pci_ioaddr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 254 | p = (volatile u16 *)port2adr(port); |
| 255 | |
| 256 | while (count--) |
| 257 | *p = *buf++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count) |
| 261 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 262 | const u32 *buf = addr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 264 | if (is_pci_ioaddr(port) || shifted_port(port)) { |
| 265 | volatile u32 *p = (volatile u32 *)pci_ioaddr(port); |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 266 | |
| 267 | while (count--) |
| 268 | *p = *buf++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | } else |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 270 | maybebadio(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | } |
| 272 | |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 273 | void __iomem *hs7751rvoip_ioport_map(unsigned long port, unsigned int size) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | { |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 275 | if (PXSEG(port)) |
| 276 | return (void __iomem *)port; |
| 277 | else if (unlikely(codec_port(port) && (size == 1))) |
| 278 | return (void __iomem *)CODEC_IOMAP(port); |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 279 | else if (is_pci_ioaddr(port)) |
| 280 | return (void __iomem *)pci_ioaddr(port); |
Paul Mundt | 373e68b | 2006-09-27 15:41:24 +0900 | [diff] [blame] | 281 | |
| 282 | return (void __iomem *)port2adr(port); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | } |