18 #include <linux/kernel.h>
19 #include <linux/module.h>
23 #include <linux/slab.h>
43 static irqreturn_t iio_gpio_trigger_poll(
int irq,
void *
private)
58 unsigned long irqflags;
60 int irq,
ret = 0, irq_res_cnt = 0;
66 if (irq_res ==
NULL) {
73 for (irq = irq_res->
start; irq <= irq_res->
end; irq++) {
78 goto error_free_completed_registrations;
81 trig_info = kzalloc(
sizeof(*trig_info),
GFP_KERNEL);
84 goto error_put_trigger;
88 trig->
ops = &iio_gpio_trigger_ops;
90 irqflags, trig->
name, trig);
93 "request IRQ-%d failed", irq);
94 goto error_free_trig_info;
99 goto error_release_irq;
102 &iio_gpio_trigger_list);
106 }
while (irq_res !=
NULL);
114 error_free_trig_info:
117 iio_trigger_put(trig);
118 error_free_completed_registrations:
122 &iio_gpio_trigger_list,
141 &iio_gpio_trigger_list,
147 iio_trigger_put(trig);
155 .probe = iio_gpio_trigger_probe,
158 .name =
"iio_gpio_trigger",