Linux Audio

Check our new training course

Loading...
v5.4
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * arch/sh/kernel/ioport.c
 4 *
 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
11unsigned long sh_io_port_base __read_mostly = -1;
12EXPORT_SYMBOL(sh_io_port_base);
13
14void __iomem *__ioport_map(unsigned long addr, unsigned int size)
15{
16	if (sh_mv.mv_ioport_map)
17		return sh_mv.mv_ioport_map(addr, size);
18
19	return (void __iomem *)(addr + sh_io_port_base);
20}
21EXPORT_SYMBOL(__ioport_map);
22
23void __iomem *ioport_map(unsigned long port, unsigned int nr)
24{
25	void __iomem *ret;
26
27	ret = __ioport_map_trapped(port, nr);
28	if (ret)
29		return ret;
30
31	return __ioport_map(port, nr);
32}
33EXPORT_SYMBOL(ioport_map);
34
35void ioport_unmap(void __iomem *addr)
36{
37	if (sh_mv.mv_ioport_unmap)
38		sh_mv.mv_ioport_unmap(addr);
39}
40EXPORT_SYMBOL(ioport_unmap);
v4.17
 
 1/*
 2 * arch/sh/kernel/ioport.c
 3 *
 4 * Copyright (C) 2000  Niibe Yutaka
 5 * Copyright (C) 2005 - 2007 Paul Mundt
 6 *
 7 * This file is subject to the terms and conditions of the GNU General Public
 8 * License.  See the file "COPYING" in the main directory of this archive
 9 * for more details.
10 */
11#include <linux/module.h>
12#include <linux/io.h>
13
14unsigned long sh_io_port_base __read_mostly = -1;
15EXPORT_SYMBOL(sh_io_port_base);
16
17void __iomem *__ioport_map(unsigned long addr, unsigned int size)
18{
19	if (sh_mv.mv_ioport_map)
20		return sh_mv.mv_ioport_map(addr, size);
21
22	return (void __iomem *)(addr + sh_io_port_base);
23}
24EXPORT_SYMBOL(__ioport_map);
25
26void __iomem *ioport_map(unsigned long port, unsigned int nr)
27{
28	void __iomem *ret;
29
30	ret = __ioport_map_trapped(port, nr);
31	if (ret)
32		return ret;
33
34	return __ioport_map(port, nr);
35}
36EXPORT_SYMBOL(ioport_map);
37
38void ioport_unmap(void __iomem *addr)
39{
40	if (sh_mv.mv_ioport_unmap)
41		sh_mv.mv_ioport_unmap(addr);
42}
43EXPORT_SYMBOL(ioport_unmap);