X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fio.h;h=c244a0cc9319bc37dfaee08d2c385b638dcbc990;hb=e7b58f5259a81dbd9fbfea79408d272f44eb894f;hp=420e2fdf26f654a4d89b7853340783dad432fffe;hpb=71d530cd1b6d97094481002a04c77fea1c8e1c22;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/io.h b/include/linux/io.h index 420e2fdf26f..c244a0cc931 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -18,9 +18,56 @@ #ifndef _LINUX_IO_H #define _LINUX_IO_H +#include #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); +int ioremap_page_range(unsigned long addr, unsigned long end, + unsigned long phys_addr, pgprot_t prot); + +/* + * Managed iomap interface + */ +void __iomem * devm_ioport_map(struct device *dev, unsigned long port, + unsigned int nr); +void devm_ioport_unmap(struct device *dev, void __iomem *addr); + +void __iomem * devm_ioremap(struct device *dev, unsigned long offset, + unsigned long size); +void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, + unsigned long size); +void devm_iounmap(struct device *dev, void __iomem *addr); + +/** + * 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. + */ + +static inline int check_signature(const volatile void __iomem *io_addr, + const unsigned char *signature, int length) +{ + int retval = 0; + do { + if (readb(io_addr) != *signature) + goto out; + io_addr++; + signature++; + length--; + } while (length); + retval = 1; +out: + return retval; +} + #endif /* _LINUX_IO_H */