From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <1512161180-30116-1-git-send-email-mfornero@gmail.com> <20171202115257.5e561988@archlinux> In-Reply-To: From: Matthew Fornero Date: Tue, 05 Dec 2017 18:01:13 +0000 Message-ID: Subject: Re: [PATCH] iio: buffer-dma: Expose data available To: Lars-Peter Clausen Cc: Jonathan Cameron , linux-iio@vger.kernel.org, Matt Fornero Content-Type: multipart/alternative; boundary="001a1144b57a81aead055f9b9f97" List-ID: --001a1144b57a81aead055f9b9f97 Content-Type: text/plain; charset="UTF-8" On Tue, Dec 5, 2017 at 1:32 AM Lars-Peter Clausen wrote: > I guess one question is whether this should be generic. > iio_dma_buffer_data_available() is a generic function and not specific to the > DMA buffers, so it would work just fine for FIFO based buffers as well. So it looks like we could implement this generically as a member of iio_buffer_attrs, and have it simply use iio_buffer_data_available() instead of iio_dma_buffer_data_available(). This would also be a bit cleaner, as the iio_buffer_attrs logic already has code to append existings attrs, allowing device-specific attrs to be easily added. What about the case when the data_available element in iio_buffer_access_funcs is undefined (e.g. industrialio-buffer-cb)? Do we modify iio_buffer_data_available() to return 0, do we make the sysfs function return -ENOENT or -EINVAL, or simply not expose the sysfs interface for this case? -- -- Matthew Fornero matthew.fornero@gmail.com (734)-846-4968 --001a1144b57a81aead055f9b9f97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Dec 5, 2017 at 1:32 AM Lars-Peter Clausen <= ;lars@metafoo.de> wrote:
> I guess one question is whether this should be generic.
&g= t; iio_dma_buffer_data_available() is a generic function and not specific t= o the
> DMA buffers, so it would work just fine for FIFO based= buffers as well.

So it looks like we could implem= ent this generically as a member of
iio_buffer_attrs, and hav= e it simply use iio_buffer_data_available()
instead of iio_dma_bu= ffer_data_available().

This would also be a bit cl= eaner, as the iio_buffer_attrs logic already
has code to append e= xistings attrs, allowing device-specific attrs to be
easily added= .

What about the case when the data_available elem= ent in=C2=A0
iio_buffer_access_funcs is undefined (e.g. industria= lio-buffer-cb)?=C2=A0
Do we modify iio_buffer_data_available() to= return 0, do we make the
sysfs function return -ENOENT or -EINVA= L, or simply not expose the sysfs
interface for this case?
--

--

Matt= hew Fornero

matthew.forn= ero@gmail.com

(734)-846-4968

--001a1144b57a81aead055f9b9f97--