Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-sh/gpio.h |
| 3 | * |
Magnus Damm | 2967dab | 2008-10-08 20:41:43 +0900 | [diff] [blame] | 4 | * Generic GPIO API and pinmux table support for SuperH. |
Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 5 | * |
Magnus Damm | 2967dab | 2008-10-08 20:41:43 +0900 | [diff] [blame] | 6 | * Copyright (c) 2008 Magnus Damm |
Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 7 | * |
| 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 Mundt | e4b41db | 2008-10-23 12:37:20 +0900 | [diff] [blame] | 15 | #include <linux/kernel.h> |
Paul Mundt | 5501093 | 2008-10-21 17:48:40 +0900 | [diff] [blame] | 16 | #include <linux/errno.h> |
| 17 | |
Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 18 | #if defined(CONFIG_CPU_SH3) |
Paul Mundt | f15cbe6 | 2008-07-29 08:09:44 +0900 | [diff] [blame] | 19 | #include <cpu/gpio.h> |
Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 20 | #endif |
| 21 | |
Magnus Damm | 69edbba | 2008-12-25 18:17:34 +0900 | [diff] [blame] | 22 | #define ARCH_NR_GPIOS 512 |
Magnus Damm | fae4339 | 2009-11-27 07:38:01 +0000 | [diff] [blame] | 23 | #include <linux/sh_pfc.h> |
Magnus Damm | 69edbba | 2008-12-25 18:17:34 +0900 | [diff] [blame] | 24 | |
| 25 | #ifdef CONFIG_GPIOLIB |
| 26 | |
| 27 | static inline int gpio_get_value(unsigned gpio) |
| 28 | { |
| 29 | return __gpio_get_value(gpio); |
| 30 | } |
| 31 | |
| 32 | static inline void gpio_set_value(unsigned gpio, int value) |
| 33 | { |
| 34 | __gpio_set_value(gpio, value); |
| 35 | } |
| 36 | |
| 37 | static inline int gpio_cansleep(unsigned gpio) |
| 38 | { |
| 39 | return __gpio_cansleep(gpio); |
| 40 | } |
| 41 | |
| 42 | static inline int gpio_to_irq(unsigned gpio) |
| 43 | { |
Paul Mundt | 532f375 | 2010-10-03 03:55:39 +0900 | [diff] [blame] | 44 | return __gpio_to_irq(gpio); |
Magnus Damm | 69edbba | 2008-12-25 18:17:34 +0900 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | static inline int irq_to_gpio(unsigned int irq) |
| 48 | { |
Paul Mundt | 532f375 | 2010-10-03 03:55:39 +0900 | [diff] [blame] | 49 | return -ENOSYS; |
Magnus Damm | 69edbba | 2008-12-25 18:17:34 +0900 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | #endif /* CONFIG_GPIOLIB */ |
| 53 | |
Markus Brunner | dfc5ed2 | 2007-08-20 08:58:12 +0900 | [diff] [blame] | 54 | #endif /* __ASM_SH_GPIO_H */ |