12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18 #include <linux/kernel.h>
23 #include <mach/hardware.h>
25 #define KEYCTLR 0xb81c0000
26 #define KEYOUTR 0xb81c0002
27 #define KEYDETR 0xb81c0004
32 static int x3proto_gpio_direction_input(
struct gpio_chip *
chip,
unsigned gpio)
41 spin_unlock_irqrestore(&x3proto_gpio_lock, flags);
46 static int x3proto_gpio_get(
struct gpio_chip *
chip,
unsigned gpio)
51 static int x3proto_gpio_to_irq(
struct gpio_chip *
chip,
unsigned gpio)
63 static void x3proto_gpio_irq_handler(
unsigned int irq,
struct irq_desc *
desc)
66 struct irq_chip *chip = irq_data_get_irq_chip(data);
80 .label =
"x3proto-gpio",
81 .direction_input = x3proto_gpio_direction_input,
82 .get = x3proto_gpio_get,
83 .to_irq = x3proto_gpio_to_irq,
88 static int x3proto_gpio_irq_map(
struct irq_domain *domain,
unsigned int virq,
98 .map = x3proto_gpio_irq_map,
115 &x3proto_gpio_irq_ops,
NULL);
119 pr_info(
"registering '%s' support, handling GPIOs %u -> %u, "
125 irq_set_chained_handler(ilsel, x3proto_gpio_irq_handler);
133 pr_err(
"Failed deregistering GPIO\n");