spi-topcliff-pch: add recovery processing in case wait-event timeout
[zen-stable.git] / arch / openrisc / include / asm / gpio.h
blob0b0d174f47cdd13cce8fcbd29bcf2247ab88d62a
1 /*
2 * OpenRISC Linux
4 * Linux architectural port borrowing liberally from similar works of
5 * others. All original copyrights apply as per the original source
6 * declaration.
8 * OpenRISC implementation:
9 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
10 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
11 * et al.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
19 #ifndef __ASM_OPENRISC_GPIO_H
20 #define __ASM_OPENRISC_GPIO_H
22 #include <linux/errno.h>
23 #include <asm-generic/gpio.h>
25 #ifdef CONFIG_GPIOLIB
28 * OpenRISC (or1k) does not have on-chip GPIO's so there is not really
29 * any standardized implementation that makes sense here. If passing
30 * through gpiolib becomes a bottleneck then it may make sense, on a
31 * case-by-case basis, to implement these inlined/rapid versions.
33 * Just call gpiolib.
35 static inline int gpio_get_value(unsigned int gpio)
37 return __gpio_get_value(gpio);
40 static inline void gpio_set_value(unsigned int gpio, int value)
42 __gpio_set_value(gpio, value);
45 static inline int gpio_cansleep(unsigned int gpio)
47 return __gpio_cansleep(gpio);
51 * Not implemented, yet.
53 static inline int gpio_to_irq(unsigned int gpio)
55 return -ENOSYS;
58 static inline int irq_to_gpio(unsigned int irq)
60 return -EINVAL;
63 #endif /* CONFIG_GPIOLIB */
65 #endif /* __ASM_OPENRISC_GPIO_H */