linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to use GPIO pin as the trigger for IIO devices?
@ 2016-04-07  3:51 Yong Li
  2016-04-10 14:46 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Yong Li @ 2016-04-07  3:51 UTC (permalink / raw)
  To: linux-iio

 am testing an IIO gyro sensor using kernel 4.4, currently I can use
the sysfs trigger as a trigger, I can read the data from
/dev/iio:deviceX after "echo 1 > trigger_now".


I want to use a gpio pin for the data trigger. For example, when the
GPIO pin 62 is low, the data will be ready.


How to connect/setup the gpio with the IIO triggers, how can I use the
iio_trig_interrupt.ko? I found there is new triggers in the
/sys/bus/iio/devices after I loaded the iio_trig_interrupt.ko.

Thanks,
Yong

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use GPIO pin as the trigger for IIO devices?
  2016-04-07  3:51 How to use GPIO pin as the trigger for IIO devices? Yong Li
@ 2016-04-10 14:46 ` Jonathan Cameron
  2016-04-12  5:19   ` Yong Li
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2016-04-10 14:46 UTC (permalink / raw)
  To: Yong Li, linux-iio

On 07/04/16 04:51, Yong Li wrote:
>  am testing an IIO gyro sensor using kernel 4.4, currently I can use
> the sysfs trigger as a trigger, I can read the data from
> /dev/iio:deviceX after "echo 1 > trigger_now".
> 
> 
> I want to use a gpio pin for the data trigger. For example, when the
> GPIO pin 62 is low, the data will be ready.
> 
> 
> How to connect/setup the gpio with the IIO triggers, how can I use the
> iio_trig_interrupt.ko? I found there is new triggers in the
> /sys/bus/iio/devices after I loaded the iio_trig_interrupt.ko.
Hi Yong,

Unfortunately a means of identifying that a given IRQ (GPIO or otherwise)
is to be used as an iio_trigger is needed.  At the moment, that driver
only supports getting this from an IORESOURCE_IRQ in a board file.

There was a recent thread on device tree bindings for these;
http://marc.info/?l=linux-iio&m=145621588017248&w=2

It got a little non obvious from the point of view of what the bindings
should look like and buried under other work.

Still the patches there will probably get you going.

Jonathan

> 
> Thanks,
> Yong
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to use GPIO pin as the trigger for IIO devices?
  2016-04-10 14:46 ` Jonathan Cameron
@ 2016-04-12  5:19   ` Yong Li
  0 siblings, 0 replies; 3+ messages in thread
From: Yong Li @ 2016-04-12  5:19 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio

Thanks Jonathan for your mail!

2016-04-10 22:46 GMT+08:00 Jonathan Cameron <jic23@kernel.org>:
> On 07/04/16 04:51, Yong Li wrote:
>>  am testing an IIO gyro sensor using kernel 4.4, currently I can use
>> the sysfs trigger as a trigger, I can read the data from
>> /dev/iio:deviceX after "echo 1 > trigger_now".
>>
>>
>> I want to use a gpio pin for the data trigger. For example, when the
>> GPIO pin 62 is low, the data will be ready.
>>
>>
>> How to connect/setup the gpio with the IIO triggers, how can I use the
>> iio_trig_interrupt.ko? I found there is new triggers in the
>> /sys/bus/iio/devices after I loaded the iio_trig_interrupt.ko.
> Hi Yong,
>
> Unfortunately a means of identifying that a given IRQ (GPIO or otherwise)
> is to be used as an iio_trigger is needed.  At the moment, that driver
> only supports getting this from an IORESOURCE_IRQ in a board file.
>
> There was a recent thread on device tree bindings for these;
> http://marc.info/?l=linux-iio&m=145621588017248&w=2
>
> It got a little non obvious from the point of view of what the bindings
> should look like and buried under other work.
>
> Still the patches there will probably get you going.
>
> Jonathan
>
>>
>> Thanks,
>> Yong
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-12  5:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07  3:51 How to use GPIO pin as the trigger for IIO devices? Yong Li
2016-04-10 14:46 ` Jonathan Cameron
2016-04-12  5:19   ` Yong Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).