All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio/kern: consider the case where channel number > number of channels
Date: Wed, 12 Jun 2013 10:53:33 +0200	[thread overview]
Message-ID: <51B8370D.1090102@linutronix.de> (raw)
In-Reply-To: <51B791D1.9020105@metafoo.de>

On 06/11/2013 11:08 PM, Lars-Peter Clausen wrote:
>>> This doesn't work in general.  The index is not the same as channel
>>> (or any other form of index present). Note that modified channels may
>>> all have channel set to 0  (accel_x, accel_y etc for instance).
>>>
>>> The index refers directly into those channels registered.
>>> Is it possible for channels to move at runtime between the two units?
>>> I would imagine not as this is very much a case of wiring.
>>>
>>> Thus we have a fairly messy bit if interdependence in the device
>>> tree but it should work.
>>>
>>> I don't actually have much / any real experience of device tree configurations
>>> and this is Guenter's code, hence I have cc'd him.
>>>
>>> Note that it is acceptable and relatively common to have missing
>>> values in scan_index but that isn't really relevant here.
>>>
>>> Jonathan
>>
>> Too long ago since I looked into that, but this code changes the API
>> from "get nth channel" to "channel with channel index n".
>> Not really sure I understand why that should be necessary.
>>
> 
> yea, this will definitively not work channels of different types will
> usually have the same channel numbers.

I see. I've been looking at the Documentation. It says "IIO specifier"
for the second argument. Now I assumed it is referred to the channel
number and not the order of channel registration. The "read" requests
(in the drivers I checked) checked the channel's number in order to
associate the request with the wire. I see now some use the "address"
field.
So it kind of looked like a bug where one did not assume that the
channel number could start at != 0. It is either the documentation or
me reading it. I guess it is the latter. Anyway, if this is the
intention of the parameter, just drop the patch and everything is fine
:)

Sebastian

      reply	other threads:[~2013-06-12  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 15:42 [PATCH] iio/kern: consider the case where channel number > number of channels Sebastian Andrzej Siewior
2013-06-11 19:55 ` Jonathan Cameron
2013-06-11 20:44   ` Guenter Roeck
2013-06-11 21:08     ` Lars-Peter Clausen
2013-06-12  8:53       ` Sebastian Andrzej Siewior [this message]

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=51B8370D.1090102@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=jic23@cam.ac.uk \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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.