34 #include <linux/kernel.h>
35 #include <linux/module.h>
36 #include <linux/types.h>
41 static int gpio2_get(
struct gpio_chip *
chip,
unsigned offset)
46 static void gpio2_set(
struct gpio_chip *
chip,
unsigned offset,
int value)
51 static int gpio2_direction_input(
struct gpio_chip *
chip,
unsigned offset)
56 static int gpio2_direction_output(
struct gpio_chip *
chip,
unsigned offset,
63 static int gpio2_to_irq(
struct gpio_chip *
chip,
unsigned offset)
69 static int gpio1_get(
struct gpio_chip *
chip,
unsigned offset)
74 static void gpio1_set(
struct gpio_chip *
chip,
80 static int gpio1_direction_input(
struct gpio_chip *
chip,
unsigned offset)
85 static int gpio1_direction_output(
struct gpio_chip *
chip,
92 static int gpio1_to_irq(
struct gpio_chip *
chip,
unsigned offset)
99 .label =
"alchemy-gpio1",
100 .direction_input = gpio1_direction_input,
101 .direction_output = gpio1_direction_output,
104 .to_irq = gpio1_to_irq,
109 .label =
"alchemy-gpio2",
110 .direction_input = gpio2_direction_input,
111 .direction_output = gpio2_direction_output,
114 .to_irq = gpio2_to_irq,
120 static int alchemy_gpic_get(
struct gpio_chip *
chip,
unsigned int off)
125 static void alchemy_gpic_set(
struct gpio_chip *
chip,
unsigned int off,
int v)
130 static int alchemy_gpic_dir_input(
struct gpio_chip *
chip,
unsigned int off)
135 static int alchemy_gpic_dir_output(
struct gpio_chip *
chip,
unsigned int off,
141 static int alchemy_gpic_gpio_to_irq(
struct gpio_chip *
chip,
unsigned int off)
146 static struct gpio_chip au1300_gpiochip = {
147 .label =
"alchemy-gpic",
148 .direction_input = alchemy_gpic_dir_input,
149 .direction_output = alchemy_gpic_dir_output,
150 .get = alchemy_gpic_get,
151 .set = alchemy_gpic_set,
152 .to_irq = alchemy_gpic_gpio_to_irq,
157 static int __init alchemy_gpiochip_init(
void)
161 switch (alchemy_get_cputype()) {