All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <plroskin@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Jonah Petri <jonah@sense.com>, linux-iio@vger.kernel.org
Subject: Re: Raw data block input: is IIO a good choice?
Date: Tue, 11 Apr 2017 14:01:35 -0700	[thread overview]
Message-ID: <CAN_72e1voayyNrg2+6V7hhGG4uJi0FSotwrT9FeQ4QgTPoawUw@mail.gmail.com> (raw)
In-Reply-To: <4311cd69-c853-8fee-c0d2-0476b24580e4@kernel.org>

Hi Jonathan,

I appreciate your response.

On Sat, Apr 8, 2017 at 7:36 AM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 08/04/17 07:13, Pavel Roskin wrote:
>> Jonah, I appreciate your advice.
>>
>> I'm still considering using IIO, as I would need some ways to
>> configure the hardware (set interrupt watermark, set some other
>> configuration registers). But it's good to understand why the
>> resulting driver would be unlike all others.
> The primary reason for the existence of a subsystem is to
> provide a consistent userspace interface. In some ways it doesn't
> matter what goes on within the kernel at all.
>
> Now it may be possible to do this for your device, but that would
> only make sense if we were to describe the data in your ring buffer.
> It could be implemented as a hardware ring buffer with no software
> buffer.

I can describe the data.

My concern is that I don't see way to read unparsed blocks of data.
realbits and storagebits are described by u8, which limits them to 255
bits or 63 bytes.

The main userspace consumer of the data will need whole blocks of data
captures at the same time.

> Whilst we fairly recently move the sca3000 driver away from this,
> as in that case an intermediate software buffer made more sense,
> that driver used to do this.
> Jumping back an arbitrary distance:
> https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/drivers/staging/iio/accel/sca3000_ring.c?h=iio-for-4.7a&id=486294f184c05cff116160bb731cbb679f047621
> I believe there are drivers in analog devices out of mainline tree
> that do it as well. One example there is the spi offload engine
> support which uses the hardware buffer stuff, but that is somewhat
> cryptic so the sca3000 driver above is probably a better starting
> point.

Thank you for the example! The driver is quite large, it will take me
a while to process.

Do you have any documentation about buffers? It's good to have
iio_simple_dummy_buffer.c, but it doesn't have a hardware buffer mode.

> Then we come to the question of how to describe the data. If you
> don't do this of course you can use IIO out of mainline, but there
> will be little interest in merging it.
>
> If you describe the data using normal IIO channels it is up to you
> whether you then use your own userspace stack or something more
> general.  What we are interested in from a subsystem point of view
> is ensuring you 'could' use standard userspace code.
>
> So what is actually in this magic data dump?  Sensor data by the
> sound of it, so it could be described?  Without that description
> I'm not going to be keen to have it mainline IIO.

Yes, it can be described. It's sensor data, nothing unusual.

> p.s. When replying to a thread, please keep all relevant previous
> emails in there! Makes it a lot easier for those of us running
> a bit behind to catch up.

My bad, I just realized gmail can do the right thing. Jonathan, please
ignore the personal reply, my email setup is new to me.

Pavel

  reply	other threads:[~2017-04-11 21:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 21:48 Raw data block input: is IIO a good choice? Pavel Roskin
2017-04-08  0:20 ` Jonah Petri
2017-04-08  1:47   ` Pavel Roskin
2017-04-08  3:10     ` Jonah Petri
2017-04-08  6:13       ` Pavel Roskin
2017-04-08 14:36         ` Jonathan Cameron
2017-04-11 21:01           ` Pavel Roskin [this message]
2017-04-12  0:05             ` Pavel Roskin
2017-04-12 14:36               ` Jonathan Cameron

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=CAN_72e1voayyNrg2+6V7hhGG4uJi0FSotwrT9FeQ4QgTPoawUw@mail.gmail.com \
    --to=plroskin@gmail.com \
    --cc=jic23@kernel.org \
    --cc=jonah@sense.com \
    --cc=linux-iio@vger.kernel.org \
    /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 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.