blob: 04f53d31489f2cc142f804bd444593305db27c01 [file] [log] [blame]
Markus Brunnerdfc5ed22007-08-20 08:58:12 +09001/*
2 * include/asm-sh/gpio.h
3 *
Magnus Damm2967dab2008-10-08 20:41:43 +09004 * Generic GPIO API and pinmux table support for SuperH.
Markus Brunnerdfc5ed22007-08-20 08:58:12 +09005 *
Magnus Damm2967dab2008-10-08 20:41:43 +09006 * Copyright (c) 2008 Magnus Damm
Markus Brunnerdfc5ed22007-08-20 08:58:12 +09007 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#ifndef __ASM_SH_GPIO_H
13#define __ASM_SH_GPIO_H
14
Paul Mundte4b41db2008-10-23 12:37:20 +090015#include <linux/kernel.h>
Paul Mundt55010932008-10-21 17:48:40 +090016#include <linux/errno.h>
17
Markus Brunnerdfc5ed22007-08-20 08:58:12 +090018#if defined(CONFIG_CPU_SH3)
Paul Mundtf15cbe62008-07-29 08:09:44 +090019#include <cpu/gpio.h>
Markus Brunnerdfc5ed22007-08-20 08:58:12 +090020#endif
21
Magnus Damm69edbba2008-12-25 18:17:34 +090022#define ARCH_NR_GPIOS 512
Magnus Dammfae43392009-11-27 07:38:01 +000023#include <linux/sh_pfc.h>
Magnus Damm69edbba2008-12-25 18:17:34 +090024
25#ifdef CONFIG_GPIOLIB
26
27static inline int gpio_get_value(unsigned gpio)
28{
29 return __gpio_get_value(gpio);
30}
31
32static inline void gpio_set_value(unsigned gpio, int value)
33{
34 __gpio_set_value(gpio, value);
35}
36
37static inline int gpio_cansleep(unsigned gpio)
38{
39 return __gpio_cansleep(gpio);
40}
41
42static inline int gpio_to_irq(unsigned gpio)
43{
Paul Mundt532f3752010-10-03 03:55:39 +090044 return __gpio_to_irq(gpio);
Magnus Damm69edbba2008-12-25 18:17:34 +090045}
46
47static inline int irq_to_gpio(unsigned int irq)
48{
Paul Mundt532f3752010-10-03 03:55:39 +090049 return -ENOSYS;
Magnus Damm69edbba2008-12-25 18:17:34 +090050}
51
52#endif /* CONFIG_GPIOLIB */
53
Markus Brunnerdfc5ed22007-08-20 08:58:12 +090054#endif /* __ASM_SH_GPIO_H */