All of lore.kernel.org
 help / color / mirror / Atom feed
* ST driver - ad-hoc allocation of trigger interrupt
@ 2015-06-15 15:04 simon
  2015-06-15 17:20 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: simon @ 2015-06-15 15:04 UTC (permalink / raw)
  To: linux-iio

Hi all,
A friend and I were attempting to get a LSM303DLHC breakout board hooked
up to the expansion header on the RaspPi yesterday - it was him doing the
work and me offering suggestions from afar (unfortunately the blind
leading the blind)...

Anyhow 'we' got reasonably far and could read raw value and trigger the
buffer via the 'iio-sysfs-trig'. The problem came when we wanted the
device to trigger itself at the set sample frequency.

We infer that we need to connect the DRDY signal to a CPU interrupt line,
but can't see how we tell the ST iio driver which one.

I did find this is the source:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/common/st_sensors/st_sensors_trigger.c?id=refs/tags/v4.1-rc8#n21

Which shows that the 'sdata->get_irq_data_ready()' can be pre-defined in
the data structure passed on driver init. But how can we do that from the
command line, or even a little script/app once the kernel is up and
running?


The story of our attempt is documented here:
https://groups.google.com/forum/?hl=en#!topic/richards-tech-user-forum/BjQpWjTmims

Any suggestions on how we can succeed?

Many thanks,
Simon.


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

* Re: ST driver - ad-hoc allocation of trigger interrupt
  2015-06-15 15:04 ST driver - ad-hoc allocation of trigger interrupt simon
@ 2015-06-15 17:20 ` Jonathan Cameron
  2015-06-18 20:53   ` simon
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2015-06-15 17:20 UTC (permalink / raw)
  To: simon, linux-iio



On 15 June 2015 16:04:58 BST, simon@mungewell.org wrote:
>Hi all,
>A friend and I were attempting to get a LSM303DLHC breakout board
>hooked
>up to the expansion header on the RaspPi yesterday - it was him doing
>the
>work and me offering suggestions from afar (unfortunately the blind
>leading the blind)...
>
>Anyhow 'we' got reasonably far and could read raw value and trigger the
>buffer via the 'iio-sysfs-trig'. The problem came when we wanted the
>device to trigger itself at the set sample frequency.
>
>We infer that we need to connect the DRDY signal to a CPU interrupt
>line,
>but can't see how we tell the ST iio driver which one.
>
>I did find this is the source:
>https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/common/st_sensors/st_sensors_trigger.c?id=refs/tags/v4.1-rc8#n21
>
>Which shows that the 'sdata->get_irq_data_ready()' can be pre-defined
>in
>the data structure passed on driver init. But how can we do that from
>the
>command line, or even a little script/app once the kernel is up and
>running?
>
>
>The story of our attempt is documented here:
>https://groups.google.com/forum/?hl=en#!topic/richards-tech-user-forum/BjQpWjTmims
>
>Any suggestions on how we can succeed?

Looks like you basically got there with the DT file at the end. Adhoc arrangements
 like this are often done with device tree overlays (which can be added to a
 running device). A quick Google suggests the raspberry pi uses these for standard hats.

Good luck.

Jonathan

>
>Many thanks,
>Simon.
>
>--
>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

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: ST driver - ad-hoc allocation of trigger interrupt
  2015-06-15 17:20 ` Jonathan Cameron
@ 2015-06-18 20:53   ` simon
  2015-06-19 16:29     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: simon @ 2015-06-18 20:53 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio


>>The story of our attempt is documented here:
>>https://groups.google.com/forum/?hl=en#!topic/richards-tech-user-forum/BjQpWjTmims
>>
>>Any suggestions on how we can succeed?
>
> Looks like you basically got there with the DT file at the end. Adhoc
> arrangements
>  like this are often done with device tree overlays (which can be added to
> a
>  running device). A quick Google suggests the raspberry pi uses these for
> standard hats.

A little follow-up that you might like; Richard was able to get the IIO
devices configured via Device Tree, even to the point of getting a full
sensor fusion working to give pose and heading.

https://richardstechnotes.wordpress.com/2015/06/17/rteiioimu-driving-a-9-dof-imu-via-industrial-io-iio/

Simon.


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

* Re: ST driver - ad-hoc allocation of trigger interrupt
  2015-06-18 20:53   ` simon
@ 2015-06-19 16:29     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2015-06-19 16:29 UTC (permalink / raw)
  To: simon, Jonathan Cameron; +Cc: linux-iio



On 18 June 2015 21:53:53 BST, simon@mungewell.org wrote:
>
>>>The story of our attempt is documented here:
>>>https://groups.google.com/forum/?hl=en#!topic/richards-tech-user-forum/BjQpWjTmims
>>>
>>>Any suggestions on how we can succeed?
>>
>> Looks like you basically got there with the DT file at the end. Adhoc
>> arrangements
>>  like this are often done with device tree overlays (which can be
>added to
>> a
>>  running device). A quick Google suggests the raspberry pi uses these
>for
>> standard hats.
>
>A little follow-up that you might like; Richard was able to get the IIO
>devices configured via Device Tree, even to the point of getting a full
>sensor fusion working to give pose and heading.
>
>https://richardstechnotes.wordpress.com/2015/06/17/rteiioimu-driving-a-9-dof-imu-via-industrial-io-iio/
>
>Simon.
Nice.

Thanks for the heads up!
>
>--
>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

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

end of thread, other threads:[~2015-06-19 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 15:04 ST driver - ad-hoc allocation of trigger interrupt simon
2015-06-15 17:20 ` Jonathan Cameron
2015-06-18 20:53   ` simon
2015-06-19 16:29     ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.