7 #ifndef __ARCH_BLACKFIN_GPIO_H__
8 #define __ARCH_BLACKFIN_GPIO_H__
10 #define gpio_bank(x) ((x) >> 4)
11 #define gpio_bit(x) (1<<((x) & 0xF))
12 #define gpio_sub_n(x) ((x) & 0xF)
14 #define GPIO_BANKSIZE 16
15 #define GPIO_BANK_NUM DIV_ROUND_UP(MAX_BLACKFIN_GPIOS, GPIO_BANKSIZE)
17 #include <mach/gpio.h>
19 #define PERIPHERAL_USAGE 1
22 #ifndef BFIN_GPIO_PINT
23 # define BFIN_GPIO_PINT 0
28 #include <linux/compiler.h>
120 #ifdef BFIN_SPECIAL_GPIO_BANKS
121 void bfin_special_gpio_free(
unsigned gpio);
122 int bfin_special_gpio_request(
unsigned gpio,
const char *
label);
124 void bfin_special_gpio_pm_hibernate_restore(
void);
125 void bfin_special_gpio_pm_hibernate_suspend(
void);
130 int bfin_pm_standby_ctrl(
unsigned ctrl);
132 static inline int bfin_pm_standby_setup(
void)
134 return bfin_pm_standby_ctrl(1);
137 static inline void bfin_pm_standby_restore(
void)
139 bfin_pm_standby_ctrl(0);
142 void bfin_gpio_pm_hibernate_restore(
void);
143 void bfin_gpio_pm_hibernate_suspend(
void);
144 void bfin_pint_suspend(
void);
145 void bfin_pint_resume(
void);
148 int gpio_pm_wakeup_ctrl(
unsigned gpio,
unsigned ctrl);
152 unsigned short maska;
153 unsigned short maskb;
155 unsigned short polar;
192 #include <asm/errno.h>
194 #ifdef CONFIG_GPIOLIB
225 static inline int gpio_request(
unsigned gpio,
const char *
label)
230 static inline void gpio_free(
unsigned gpio)
235 static inline int gpio_direction_input(
unsigned gpio)
240 static inline int gpio_direction_output(
unsigned gpio,
int value)
274 for (i = 0; i < num; i++, array++) {
287 static inline void gpio_free_array(
const struct gpio *array,
size_t num)