X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fio.h;h=6c7f0ba0d5faf473b6c2ffb60d1a0c957c007059;hb=040dec3b37e4b9ec15b359bf5744f1ceba39fe3e;hp=81877ea39309aea73cef4a63a3212c69ab5c9131;hpb=0ca9caae2d05ee0c4878aa3e2619cd23f4ad4cb4;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/io.h b/include/linux/io.h index 81877ea3930..6c7f0ba0d5f 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -22,37 +22,49 @@ #include #include +struct device; + void __iowrite32_copy(void __iomem *to, const void *from, size_t count); void __iowrite64_copy(void __iomem *to, const void *from, size_t count); +#ifdef CONFIG_MMU int ioremap_page_range(unsigned long addr, unsigned long end, unsigned long phys_addr, pgprot_t prot); +#else +static inline int ioremap_page_range(unsigned long addr, unsigned long end, + unsigned long phys_addr, pgprot_t prot) +{ + return 0; +} +#endif -/** - * check_signature - find BIOS signatures - * @io_addr: mmio address to check - * @signature: signature block - * @length: length of signature - * - * Perform a signature comparison with the mmio address io_addr. This - * address should have been obtained by ioremap. - * Returns 1 on a match. +/* + * Managed iomap interface */ +#ifdef CONFIG_HAS_IOPORT +void __iomem * devm_ioport_map(struct device *dev, unsigned long port, + unsigned int nr); +void devm_ioport_unmap(struct device *dev, void __iomem *addr); +#else +static inline void __iomem *devm_ioport_map(struct device *dev, + unsigned long port, + unsigned int nr) +{ + return NULL; +} -static inline int check_signature(const volatile void __iomem *io_addr, - const unsigned char *signature, int length) +static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) { - int retval = 0; - do { - if (readb(io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - } while (length); - retval = 1; -out: - return retval; } +#endif + +void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, + unsigned long size); +void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, + unsigned long size); +void devm_iounmap(struct device *dev, void __iomem *addr); +int check_signature(const volatile void __iomem *io_addr, + const unsigned char *signature, int length); +void devm_ioremap_release(struct device *dev, void *res); #endif /* _LINUX_IO_H */