blob: c402e9b31f4c61148ee5466b29f9ec176f11b78f [file] [log] [blame]
David Brownell4c203862007-02-12 00:53:11 -08001#ifndef _ARCH_ARM_GPIO_H
2#define _ARCH_ARM_GPIO_H
3
Peter De Schrijver (NVIDIA)44986ab2011-12-21 10:48:45 +01004#if CONFIG_ARCH_NR_GPIO > 0
Stephen Warrenca950232012-01-05 21:36:27 +01005#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
Peter De Schrijver (NVIDIA)44986ab2011-12-21 10:48:45 +01006#endif
7
David Brownell4c203862007-02-12 00:53:11 -08008/* not all ARM platforms necessarily support this API ... */
Russell Kinga09e64f2008-08-05 16:14:15 +01009#include <mach/gpio.h>
David Brownell4c203862007-02-12 00:53:11 -080010
Russell King8f3c4532011-08-08 13:58:28 +010011#ifndef __ARM_GPIOLIB_COMPLEX
Russell King22fe6782011-07-26 11:04:51 +010012/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
13#include <asm-generic/gpio.h>
14
15/* The trivial gpiolib dispatchers */
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#endif
20
Russell King01e7dc82011-07-26 11:29:42 +010021/*
22 * Provide a default gpio_to_irq() which should satisfy every case.
23 * However, some platforms want to do this differently, so allow them
24 * to override it.
25 */
26#ifndef gpio_to_irq
27#define gpio_to_irq __gpio_to_irq
28#endif
29
David Brownell4c203862007-02-12 00:53:11 -080030#endif /* _ARCH_ARM_GPIO_H */