22 #include <linux/kernel.h>
27 #include <linux/module.h>
30 #include <mach/hardware.h>
33 #include <mach/regs-gpio.h>
40 static void ks8695_gpio_mode(
unsigned int pin,
short gpio)
86 ks8695_gpio_mode(pin, 0);
99 static int ks8695_gpio_direction_input(
struct gpio_chip *
gc,
unsigned int pin)
107 ks8695_gpio_mode(pin, 1);
125 static int ks8695_gpio_direction_output(
struct gpio_chip *gc,
126 unsigned int pin,
int state)
134 ks8695_gpio_mode(pin, 1);
160 static void ks8695_gpio_set_value(
struct gpio_chip *gc,
161 unsigned int pin,
int state)
185 static int ks8695_gpio_get_value(
struct gpio_chip *gc,
unsigned int pin)
193 return (x &
IOPD(pin)) != 0;
200 static int ks8695_gpio_to_irq(
struct gpio_chip *gc,
unsigned int pin)
205 return gpio_irq[
pin];
222 static struct gpio_chip ks8695_gpio_chip = {
224 .direction_input = ks8695_gpio_direction_input,
225 .direction_output = ks8695_gpio_direction_output,
226 .get = ks8695_gpio_get_value,
227 .set = ks8695_gpio_set_value,
228 .to_irq = ks8695_gpio_to_irq,
243 #ifdef CONFIG_DEBUG_FS
256 seq_printf(s,
"Pin\tI/O\tFunction\tState\n\n");
264 if (ctrl & enable[i]) {
267 switch ((ctrl & intmask[i]) >> (4 * i)) {
284 if (ctrl & enable[i])
305 .
open = ks8695_gpio_open,
311 static int __init ks8695_gpio_debugfs_init(
void)