MIPS: Yosemite, Emma: Fix off-by-two in arcs_cmdline buffer size check
[linux-2.6/linux-mips.git] / arch / arm / mach-ixp4xx / include / mach / gpio.h
blob83d6b4ed60bbd42f3e912d68611205d720ad98a1
1 /*
2 * arch/arm/mach-ixp4xx/include/mach/gpio.h
4 * IXP4XX GPIO wrappers for arch-neutral GPIO calls
6 * Written by Milan Svoboda <msvoboda@ra.rockwell.com>
7 * Based on PXA implementation by Philipp Zabel <philipp.zabel@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef __ASM_ARCH_IXP4XX_GPIO_H
26 #define __ASM_ARCH_IXP4XX_GPIO_H
28 #include <linux/kernel.h>
29 #include <mach/hardware.h>
31 #define __ARM_GPIOLIB_COMPLEX
33 static inline int gpio_request(unsigned gpio, const char *label)
35 return 0;
38 static inline void gpio_free(unsigned gpio)
40 might_sleep();
42 return;
45 static inline int gpio_direction_input(unsigned gpio)
47 gpio_line_config(gpio, IXP4XX_GPIO_IN);
48 return 0;
51 static inline int gpio_direction_output(unsigned gpio, int level)
53 gpio_line_set(gpio, level);
54 gpio_line_config(gpio, IXP4XX_GPIO_OUT);
55 return 0;
58 static inline int gpio_get_value(unsigned gpio)
60 int value;
62 gpio_line_get(gpio, &value);
64 return value;
67 static inline void gpio_set_value(unsigned gpio, int value)
69 gpio_line_set(gpio, value);
72 #include <asm-generic/gpio.h> /* cansleep wrappers */
74 extern int gpio_to_irq(int gpio);
75 #define gpio_to_irq gpio_to_irq
76 extern int irq_to_gpio(unsigned int irq);
78 #endif