From: Barry Song <21cnbao@gmail.com>
To: jic23@hermes.cam.ac.uk, manuel.stahl@iis.fraunhofer.de
Cc: linux-kernel@vger.kernel.org
Subject: IIO ring buffer
Date: Mon, 22 Feb 2010 17:03:34 +0800 [thread overview]
Message-ID: <3c17e3571002220103v9e6158ehb80ac73eb232f9bd@mail.gmail.com> (raw)
Hi Jonathan,
Now users depend on iio ring
events(IIO_EVENT_CODE_RING_50/75/100_FULL) to read data:
read_size = fread(&dat, 1, sizeof(struct iio_event_data),
fp_ev);
switch (dat.id) {
case IIO_EVENT_CODE_RING_100_FULL:
toread = RingLength;
break;
case IIO_EVENT_CODE_RING_75_FULL:
toread = RingLength*3/4;
break;
case IIO_EVENT_CODE_RING_50_FULL:
toread = RingLength/2;
break;
default:
printf("Unexpecteded event code\n");
continue;
}
read_size = read(fp,
data,
toread*size_from_scanmode(NumVals, scan_ts));
if (read_size == -EAGAIN) {
printf("nothing available \n");
continue;
}
And iio ring access node doesn't support blocking io too. It seems we
lost to let users read data once ring is not empty. And some users
maybe not care about iio ring events at all, but just want to read
data like a input or audio driver. So how about adding the following
support in iio ring:
1. add NOT EMPTY event in IIO event nodes
2. add blocking io support in read function of IIO access nodes
If you agree with that, I can begin to add these and send you a patch.
And a problem I don't know is what you and other people have changed
to Greg's staging tree, and I am not sure what tree the patch should
be againest.
For long term plan, is it possible for ring common level to handle
more common work to avoid code repeating in different drivers?
Thanks
Barry
reply other threads:[~2010-02-22 9:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3c17e3571002220103v9e6158ehb80ac73eb232f9bd@mail.gmail.com \
--to=21cnbao@gmail.com \
--cc=jic23@hermes.cam.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=manuel.stahl@iis.fraunhofer.de \
/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
all inboxes | Powered by JetHome®