diff options
-rw-r--r-- | include/asm-generic/io.h | 2 | ||||
-rw-r--r-- | include/asm-generic/iomap.h | 4 | ||||
-rw-r--r-- | lib/iomap.c | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index a1caf2d25d82..912088773a69 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -332,6 +332,7 @@ static inline void iounmap(void *addr) | |||
332 | } | 332 | } |
333 | #endif /* CONFIG_MMU */ | 333 | #endif /* CONFIG_MMU */ |
334 | 334 | ||
335 | #ifdef CONFIG_HAS_IOPORT | ||
335 | #ifndef CONFIG_GENERIC_IOMAP | 336 | #ifndef CONFIG_GENERIC_IOMAP |
336 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) | 337 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) |
337 | { | 338 | { |
@@ -345,6 +346,7 @@ static inline void ioport_unmap(void __iomem *p) | |||
345 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | 346 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); |
346 | extern void ioport_unmap(void __iomem *p); | 347 | extern void ioport_unmap(void __iomem *p); |
347 | #endif /* CONFIG_GENERIC_IOMAP */ | 348 | #endif /* CONFIG_GENERIC_IOMAP */ |
349 | #endif /* CONFIG_HAS_IOPORT */ | ||
348 | 350 | ||
349 | #define xlate_dev_kmem_ptr(p) p | 351 | #define xlate_dev_kmem_ptr(p) p |
350 | #define xlate_dev_mem_ptr(p) __va(p) | 352 | #define xlate_dev_mem_ptr(p) __va(p) |
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 76b0cc5637f8..c74ef2c6e633 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h | |||
@@ -56,17 +56,21 @@ extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long coun | |||
56 | extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); | 56 | extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); |
57 | extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); | 57 | extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); |
58 | 58 | ||
59 | #ifdef CONFIG_HAS_IOPORT | ||
59 | /* Create a virtual mapping cookie for an IO port range */ | 60 | /* Create a virtual mapping cookie for an IO port range */ |
60 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | 61 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); |
61 | extern void ioport_unmap(void __iomem *); | 62 | extern void ioport_unmap(void __iomem *); |
63 | #endif | ||
62 | 64 | ||
63 | #ifndef ARCH_HAS_IOREMAP_WC | 65 | #ifndef ARCH_HAS_IOREMAP_WC |
64 | #define ioremap_wc ioremap_nocache | 66 | #define ioremap_wc ioremap_nocache |
65 | #endif | 67 | #endif |
66 | 68 | ||
69 | #ifdef CONFIG_PCI | ||
67 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 70 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
68 | struct pci_dev; | 71 | struct pci_dev; |
69 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | 72 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); |
70 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | 73 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); |
74 | #endif | ||
71 | 75 | ||
72 | #endif | 76 | #endif |
diff --git a/lib/iomap.c b/lib/iomap.c index d32229385151..5dbcb4b2d864 100644 --- a/lib/iomap.c +++ b/lib/iomap.c | |||
@@ -224,6 +224,7 @@ EXPORT_SYMBOL(iowrite8_rep); | |||
224 | EXPORT_SYMBOL(iowrite16_rep); | 224 | EXPORT_SYMBOL(iowrite16_rep); |
225 | EXPORT_SYMBOL(iowrite32_rep); | 225 | EXPORT_SYMBOL(iowrite32_rep); |
226 | 226 | ||
227 | #ifdef CONFIG_HAS_IOPORT | ||
227 | /* Create a virtual mapping cookie for an IO port range */ | 228 | /* Create a virtual mapping cookie for an IO port range */ |
228 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | 229 | void __iomem *ioport_map(unsigned long port, unsigned int nr) |
229 | { | 230 | { |
@@ -238,7 +239,9 @@ void ioport_unmap(void __iomem *addr) | |||
238 | } | 239 | } |
239 | EXPORT_SYMBOL(ioport_map); | 240 | EXPORT_SYMBOL(ioport_map); |
240 | EXPORT_SYMBOL(ioport_unmap); | 241 | EXPORT_SYMBOL(ioport_unmap); |
242 | #endif /* CONFIG_HAS_IOPORT */ | ||
241 | 243 | ||
244 | #ifdef CONFIG_PCI | ||
242 | /** | 245 | /** |
243 | * pci_iomap - create a virtual mapping cookie for a PCI BAR | 246 | * pci_iomap - create a virtual mapping cookie for a PCI BAR |
244 | * @dev: PCI device that owns the BAR | 247 | * @dev: PCI device that owns the BAR |
@@ -280,3 +283,4 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | |||
280 | } | 283 | } |
281 | EXPORT_SYMBOL(pci_iomap); | 284 | EXPORT_SYMBOL(pci_iomap); |
282 | EXPORT_SYMBOL(pci_iounmap); | 285 | EXPORT_SYMBOL(pci_iounmap); |
286 | #endif /* CONFIG_PCI */ | ||