From c5e50fa90ce42b1689692f587d4881308881b73d Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 10 May 2012 13:07:55 +0900 Subject: [PATCH] sh: Provide stubbed I/O routines for NO_IOPORT case. Too many drivers fail at IOPORT vs IOMEM checking before blindly calling in to the API, so we may as well just provide basic stubs to get more build coverage. Other platforms already do this, too (tile, parisc, etc.) Signed-off-by: Paul Mundt --- arch/sh/include/asm/io.h | 5 ++++ arch/sh/include/asm/io_noioport.h | 41 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 arch/sh/include/asm/io_noioport.h diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index ec464a6b95fe..0cf60a628814 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -218,8 +218,13 @@ __BUILD_IOPORT_STRING(w, u16) __BUILD_IOPORT_STRING(l, u32) __BUILD_IOPORT_STRING(q, u64) +#else /* !CONFIG_HAS_IOPORT */ + +#include + #endif + #define IO_SPACE_LIMIT 0xffffffff /* synco on SH-4A, otherwise a nop */ diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h new file mode 100644 index 000000000000..e136d28d1d2e --- /dev/null +++ b/arch/sh/include/asm/io_noioport.h @@ -0,0 +1,41 @@ +#ifndef __ASM_SH_IO_NOIOPORT_H +#define __ASM_SH_IO_NOIOPORT_H + +static inline u8 inb(unsigned long addr) +{ + BUG(); + return -1; +} + +static inline u16 inw(unsigned long addr) +{ + BUG(); + return -1; +} + +static inline u32 inl(unsigned long addr) +{ + BUG(); + return -1; +} + +#define outb(x, y) BUG() +#define outw(x, y) BUG() +#define outl(x, y) BUG() + +#define inb_p(addr) inb(addr) +#define inw_p(addr) inw(addr) +#define inl_p(addr) inl(addr) +#define outb_p(x, addr) outb((x), (addr)) +#define outw_p(x, addr) outw((x), (addr)) +#define outl_p(x, addr) outl((x), (addr)) + +#define insb(a, b, c) BUG() +#define insw(a, b, c) BUG() +#define insl(a, b, c) BUG() + +#define outsb(a, b, c) BUG() +#define outsw(a, b, c) BUG() +#define outsl(a, b, c) BUG() + +#endif /* __ASM_SH_IO_NOIOPORT_H */ -- 2.20.1