On Sat, Apr 18, 2015 at 3:14 PM, Daniel Baluta <daniel.baluta@xxxxxxxxx> wrote: > On Fri, Apr 17, 2015 at 11:57 PM, Paul Thomas <pthomas8589@xxxxxxxxx> wrote: >> Hello, I would like to setup an iio_interrupt_trigger. I see the the >> actual request_irq happens in iio_interrupt_trigger_probe. What is a >> good example of a driver using this? >> > > Good question. AFAIK there is no driver directly using iio_interrupt_trigger. > >> I take it that, if I have a GPIO pin setup as an interrupt from >> userspace, there is no way to add the trigger from userspace in a way >> similar to 'iio_sysfs_trigger/add_trigger'? > > You could use this trigger from user space by writing: > > echo irqtrigX > /sys/bus/iio/iio:device0/trigger/current_trigger Great thanks! I'll try this tomorrow. > > The problem is GPIO irq setup. iio-trig-interrupt uses platform data to receive > the IRQ number to associate with the irqtrigger. > > Could you tell use more about what exactly to you want to achieve? :). Really it's just a data ready interrupt. So with the irqtrigX that's all I need to test, but for the actual driver I was thinking the GPIO interrupt would be part of the device tree, but even though configuring the GPIO pin from sysfs is OK, I'm not too clear how this would look in the device tree. > > If you don't really need a hardware interrupt to be the event source > for your trigger > you can use the IIO hrtimer patches. The work is still on going here: > > https://lkml.org/lkml/2015/4/6/113 I saw that, it looks cool. It this case I think it would double the interrupts, the hrtimer could start the conversion, but then you'd still have to wait for the data to be ready. thanks, Paul -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html