All of lore.kernel.org
 help / color / mirror / Atom feed
* IIO ring buffer
@ 2010-02-22  9:03 Barry Song
  0 siblings, 0 replies; 32+ messages in thread
From: Barry Song @ 2010-02-22  9:03 UTC (permalink / raw)
  To: jic23, manuel.stahl; +Cc: linux-kernel

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

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

end of thread, other threads:[~2010-07-08 15:04 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <0F1B54C89D5F954D8535DB252AF412FA05A222FC@chinexm1.ad.analog.com>
2010-02-22 11:16 ` IIO ring buffer Jonathan Cameron
2010-02-23  4:11   ` Song, Barry
2010-02-23 11:44     ` Jonathan Cameron
2010-02-24  6:42       ` Song, Barry
2010-02-24  6:48         ` [Uclinux-dist-devel] " Song, Barry
2010-02-24 14:10         ` Jonathan Cameron
2010-03-02  9:57           ` Barry Song
2010-03-02 10:45             ` J.I. Cameron
2010-03-03  3:26               ` Barry Song
2010-03-03  5:59                 ` [Uclinux-dist-devel] " Zhang, Sonic
2010-03-04 12:33                 ` Jonathan Cameron
2010-03-08  3:41                   ` Barry Song
2010-03-08 11:23                     ` Jonathan Cameron
2010-06-02  8:01   ` [Uclinux-dist-devel] " Barry Song
2010-06-02 13:21     ` Jonathan Cameron
2010-06-10  4:48       ` Barry Song
2010-06-10  4:51         ` Barry Song
2010-06-10 13:48         ` Jonathan Cameron
2010-06-11  3:19           ` Barry Song
2010-06-11 10:22             ` Jonathan Cameron
2010-06-12  2:26               ` Barry Song
2010-06-12 17:35                 ` Jonathan Cameron
2010-06-21  9:21                   ` Barry Song
2010-06-25 14:11                     ` Jonathan Cameron
2010-06-25 17:18         ` Jonathan Cameron
2010-06-28  7:59           ` Barry Song
2010-06-28 10:26             ` Jonathan Cameron
2010-06-30  7:51               ` Barry Song
2010-06-30 14:30                 ` Jonathan Cameron
2010-07-08 10:38               ` Barry Song
2010-07-08 15:04                 ` Jonathan Cameron
2010-02-22  9:03 Barry Song

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.