WIP FPC-III support
[linux/fpc-iii.git] / arch / sh / kernel / ioport.c
blobf39446a658bdb8773e6dc3ec513bbc49b365b121
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * arch/sh/kernel/ioport.c
5 * Copyright (C) 2000 Niibe Yutaka
6 * Copyright (C) 2005 - 2007 Paul Mundt
7 */
8 #include <linux/module.h>
9 #include <linux/io.h>
10 #include <asm/io_trapped.h>
12 unsigned long sh_io_port_base __read_mostly = -1;
13 EXPORT_SYMBOL(sh_io_port_base);
15 void __iomem *__ioport_map(unsigned long addr, unsigned int size)
17 if (sh_mv.mv_ioport_map)
18 return sh_mv.mv_ioport_map(addr, size);
20 return (void __iomem *)(addr + sh_io_port_base);
22 EXPORT_SYMBOL(__ioport_map);
24 void __iomem *ioport_map(unsigned long port, unsigned int nr)
26 void __iomem *ret;
28 ret = __ioport_map_trapped(port, nr);
29 if (ret)
30 return ret;
32 return __ioport_map(port, nr);
34 EXPORT_SYMBOL(ioport_map);
36 void ioport_unmap(void __iomem *addr)
38 if (sh_mv.mv_ioport_unmap)
39 sh_mv.mv_ioport_unmap(addr);
41 EXPORT_SYMBOL(ioport_unmap);