14 #include <linux/errno.h>
19 #include <linux/kernel.h>
20 #include <linux/list.h>
21 #include <linux/module.h>
25 #include <mach/hardware.h>
27 #define GPIO_BASE (W90X900_VA_GPIO)
28 #define GPIO_DIR (0x04)
29 #define GPIO_OUT (0x08)
30 #define GPIO_IN (0x0C)
31 #define GROUPINERV (0x10)
32 #define GPIO_GPIO(Nb) (0x00000001 << (Nb))
33 #define to_nuc900_gpio_chip(c) container_of(c, struct nuc900_gpio_chip, chip)
35 #define NUC900_GPIO_CHIP(name, base_gpio, nr_gpio) \
39 .direction_input = nuc900_dir_input, \
40 .direction_output = nuc900_dir_output, \
41 .get = nuc900_gpio_get, \
42 .set = nuc900_gpio_set, \
54 static int nuc900_gpio_get(
struct gpio_chip *
chip,
unsigned offset)
66 static void nuc900_gpio_set(
struct gpio_chip *
chip,
unsigned offset,
int val)
84 spin_unlock_irqrestore(&nuc900_gpio->
gpio_lock, flags);
87 static int nuc900_dir_input(
struct gpio_chip *chip,
unsigned offset)
100 spin_unlock_irqrestore(&nuc900_gpio->
gpio_lock, flags);
105 static int nuc900_dir_output(
struct gpio_chip *chip,
unsigned offset,
int val)
128 spin_unlock_irqrestore(&nuc900_gpio->
gpio_lock, flags);
148 for (i = 0; i < nr_group; i++) {
149 gpio_chip = &nuc900_gpio[
i];