Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: malas <malas@tcoe.iitm.ac.in>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: ad7793 adc rcv userspace test - passed succesfully
Date: Tue, 30 Aug 2011 11:02:04 +0100	[thread overview]
Message-ID: <4E5CB51C.5010809@cam.ac.uk> (raw)
In-Reply-To: <20110829053753.M60985@tcoe.iitm.ac.in>

On 08/29/11 06:39, malas wrote:
> 
> Dear Jonathan Cameron,
> 
> I last reported that after creating device node and opening it, read() call was failing.
> I got to fix this.
> 
> The reason was this:
> 4 functions are exported from ad7793 module to iio-ring module as ring setup ops:
> namely: 
>         .preenable = &ad7793_ring_preenable,
> 	.postenable = &iio_triggered_ring_postenable,
> 	.predisable = &iio_triggered_ring_predisable,
> 	.postdisable = &ad7793_ring_postdisable,
> 
> In the iio-ring modules "iio_store_ring_enable" function is invoked from user app,which
> inturn invokes the func "ad7793_ring_preenable" and subsequently driver's postenable
> function.
> 
> The "iio_triggered_ring_postenable" function then attaches the poll function to the ring
> trigger soft interrupt.
> 
> Since continuous mode was set and enabled the configured GPIO interrupt for capturing
> data ready signal (in ad7793_ring_preenable) as interrupt, iio_trigger_poll() invoked on
> interrupt (from drivers data rdy interrupt handler) failed to raise soft interrupt and
> as a consequence driver's ad7793_trigger_handler() was not invoked when data ready.
> 
> I patched as follows in ad7793.c:
> 
> 1. Moved irq enabling from ad7793_ring_preenable to ad7793_ring_postenable
> 2. Defined ad7793_ring_setup_ops ".postenable" as  ad7793_ring_postenable
> 3. In ad7793_ring_postenable, invoked &iio_triggered_ring_postenable and then enabled
> the data ready signalling GPIO interrupt.
Hmm.. That will fix the issue. Normally I'd expect to see the enable actually
happening in the trigger_set_state callback rather than there, but this device
shares the interrupt line with on of the spi signal lines so is messing with irq's
a lot more than normal so I guess that doesn't work?
> 
> Then, from user app after opening the device, Poll() for rcv data presence was
> successful and  read() call returned non-zero size . Could print the data from ring buffer.
> 
> Sincere thanks to you and Michael for guiding me through.
> 
> Take care.
> 
> regards
> Mala
> 
> 
> 
> 
> 


      reply	other threads:[~2011-08-30  9:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  8:26 ad7793 adc rcv userspace test - details attached malas
2011-08-24  8:44 ` Jonathan Cameron
2011-08-24  8:53   ` malas
2011-08-24 15:51     ` Jonathan Cameron
2011-08-25  6:58       ` malas
2011-08-29  5:39       ` ad7793 adc rcv userspace test - passed succesfully malas
2011-08-30 10:02         ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E5CB51C.5010809@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=malas@tcoe.iitm.ac.in \
    --cc=michael.hennerich@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox