All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aniroop Mathur <aniroop.mathur@gmail.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org
Subject: Re: IIO: Why cannot open two iio device node file descriptors simultaneously ?
Date: Mon, 4 Aug 2014 20:41:37 +0530	[thread overview]
Message-ID: <CADYu30_n3jndmH3oTq5V0ahJOGMn0ibvLckp+-0gq0jtqghAiw@mail.gmail.com> (raw)
In-Reply-To: <53DF33CE.4080100@metafoo.de>

On Mon, Aug 4, 2014 at 12:48 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/03/2014 11:32 AM, Aniroop Mathur wrote:
>>
>> On Sun, Aug 3, 2014 at 1:41 PM, Lars-Peter Clausen <lars@metafoo.de>
>> wrote:
>>>
>>> On 08/02/2014 06:57 PM, Jonathan Cameron wrote:
>>> [...]
>>>
>>>>> So, even after opening iio device node,
>>>>> can we write the data to IIO device node from user space ?
>>>>> (I do not see write function in below fileops)
>>>>
>>>>
>>>>
>>>> Indeed.  Lars was working on some buffered support for DACs but hasn't
>>>> yet submitted it for mainline inclusion.  Lars how is the buffered
>>>> output
>>>> stuff coming along?
>>>
>>>
>>>
>>> I still need to do the re-write you wanted me to do, otherwise its
>>> working
>>> fine ;)
>>>
>>
>> Great :)
>> So, it is possible to write data to iio fd ?
>
>
> No you can't. At least not with the upstream code. What exactly is it that
> you want to do with this?
>

Okay :)
Actually, I am working on IIO device simulator android application.
This simulator will record the sensor data first and then replay it again.
For recording, we can read the data from iio device node and store it some file.
And for replay, we need to write the recorded data back to iio device node.
But as you said, from hal/application we cannot write the data to iio
device node
and therefore i am stuck how to replay back the recorded data.

In normal input device node, we can both read and write data,
so simulator is working fine for this case.
I was hoping to do the same with IIO device node.

Is there any scope this facility will be included in future for IIO ? :)

Also, few days back I posted this query on Linuxquestions.org.
http://www.linuxquestions.org/questions/linux-general-1/iio-why-cannot-open-same-iio-device-node-twice-4175512869/

I think now this thread could be marked as solved.
Title - IIO: Why cannot open same iio device node twice ?

May be if it is okay, please help to put the answer upon the link above.

>From my side,
Below is the answer i am able to derive from above discussion:

"Basically IIO is a different design for the userspace interfaces.
IIO mainly deals with much faster devices so overhead of description of data
has been removed to avoid overhead in kernel.

An alternate solution would be to use a input client driver for IIO,
which can uses an iio device as the source of it's data.
That way we end up with all the normal input interfaces.

Ultimately if we want multiple user applications to share a datastream,
then it makes sense to avoid multiple switches in and out of the kernel
and do it in userspace instead."

Is the answer okay ?

> - Lars

  reply	other threads:[~2014-08-04 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 17:07 IIO: Why cannot open two iio device node file descriptors simultaneously ? Aniroop Mathur
2014-08-02 11:28 ` Jonathan Cameron
2014-08-02 13:07   ` Aniroop Mathur
2014-08-02 16:57     ` Jonathan Cameron
2014-08-03  8:11       ` Lars-Peter Clausen
2014-08-03  9:32         ` Aniroop Mathur
2014-08-04  7:18           ` Lars-Peter Clausen
2014-08-04 15:11             ` Aniroop Mathur [this message]
2014-08-04 17:20               ` Lars-Peter Clausen
2014-08-04 19:18                 ` Aniroop Mathur
2014-08-01 17:17 Aniroop Mathur

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=CADYu30_n3jndmH3oTq5V0ahJOGMn0ibvLckp+-0gq0jtqghAiw@mail.gmail.com \
    --to=aniroop.mathur@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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.