[ramips] platform.h is rt288x specific, move it
[openwrt.git] / target / linux / ramips / files / arch / mips / include / asm / mach-ralink / gpio.h
1 /*
2 * Ralink RT288x GPIO API definitions
3 *
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
10 *
11 */
12
13 #ifndef __ASM_MACH_RT288X_GPIO_H
14 #define __ASM_MACH_RT288X_GPIO_H
15
16 #define ARCH_NR_GPIOS 64
17 #include <asm-generic/gpio.h>
18
19 #include <asm/mach-ralink/rt288x.h>
20
21 extern void __rt288x_gpio_set_value(unsigned gpio, int value);
22 extern int __rt288x_gpio_get_value(unsigned gpio);
23
24 static inline int gpio_to_irq(unsigned gpio)
25 {
26 return RT288X_GPIO_IRQ(gpio);
27 }
28
29 static inline int irq_to_gpio(unsigned irq)
30 {
31 return irq - RT288X_GPIO_IRQ_BASE;
32 }
33
34 static inline int gpio_get_value(unsigned gpio)
35 {
36 if (gpio < RT288X_GPIO_COUNT)
37 return __rt288x_gpio_get_value(gpio);
38
39 return __gpio_get_value(gpio);
40 }
41
42 static inline void gpio_set_value(unsigned gpio, int value)
43 {
44 if (gpio < RT288X_GPIO_COUNT)
45 __rt288x_gpio_set_value(gpio, value);
46 else
47 __gpio_set_value(gpio, value);
48 }
49
50 #define gpio_cansleep __gpio_cansleep
51
52 #endif /* __ASM_MACH_RT288X_GPIO_H */
This page took 0.048983 seconds and 5 git commands to generate.