+static void set_irq_types(void) {
+ int err;
+ unsigned int irq;
+ unsigned long type;
+ int i;
+
+ if (gpio_evmi == NULL)
+ return;
+
+ switch (gpio_evmi->flags & (GPIOKPF_ACTIVE_HIGH|GPIOKPF_LEVEL_TRIGGERED_IRQ)) {
+ default:
+ type = IRQ_TYPE_EDGE_FALLING;
+ break;
+ case GPIOKPF_ACTIVE_HIGH:
+ type = IRQ_TYPE_EDGE_RISING;
+ break;
+ case GPIOKPF_LEVEL_TRIGGERED_IRQ:
+ type = IRQ_TYPE_LEVEL_LOW;
+ break;
+ case GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_ACTIVE_HIGH:
+ type = IRQ_TYPE_LEVEL_HIGH;
+ break;
+ }
+
+ printk(KERN_INFO PREFIX "Settinhg IRQ type to 0x%lx\n", type);
+
+ for (i = 0; i < gpio_evmi->ninputs; i++) {
+
+ err = irq = gpio_to_irq(gpio_evmi->input_gpios[i]);
+
+ if (err < 0)
+ return;
+
+ err = set_irq_type(irq, type);
+ }
+}