From: Jonathan Cameron <jic23@cam.ac.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Linus Walleij <linus.ml.walleij@gmail.com>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
zdevai@gmail.com
Subject: Re: [PATCH] staging:iio:proof of concept in kernel interface.
Date: Mon, 17 Oct 2011 11:32:03 +0100 [thread overview]
Message-ID: <4E9C0423.5010909@cam.ac.uk> (raw)
In-Reply-To: <20111017101959.GC3042@opensource.wolfsonmicro.com>
On 10/17/11 11:19, Mark Brown wrote:
> On Mon, Oct 17, 2011 at 10:43:53AM +0100, Jonathan Cameron wrote:
>
>> For the adc channel I'm not particularly keen on insisting every device
>> have a unique name for every channel. That breaks the effort we went to
>> in IIO to enforce consistent naming (for userspace interfaces) in the first
>> place. To my mind it should never be anything other than a number.
>
> I think you want something similar to what we do with platform devices -
> have both a name and a number. For devices that are just a bunch of
> symmetric channels (which seems to be the main case you're thinking of)
> the name would always be the same and the number would vary but if the
> device has a bunch of different functions then they'd be named. That
> way you don't have to remember that the channels of a given type start
> at offset X.
>
> For example, on a PMIC you'll often have ADC channels wired up to
> specific supplies plus some extras which are left for board use. The
> fixed channels might get named after the supplies and the extras all
> have the same name distinguished by number.
>
We effectively have the equivalent already - I can add it to the query
interface. It allows channels to have a supplementary name typically
if they are measuring something not of general purpose (such as the
sensor supply voltage).
I'd also allow for name to be NULL - it provides no information at all
for a lot of devices.
Note, if we are talking functions such 'acceleration' then I'd much
rather have explicit enums for type, direction etc in there. This
means that we are mapping onto the full channel spec rather than the
channel index. Really don't want strings on the adc side (except for
special cases as described above) as I just spent rather a long time
ripping them out precisely to enforce a consistent interface where
there was previously too much flexibility.
We have a system that allows describing of more or less everything we
have ever encountered in a rigorous consistent fashion (I say almost
as there is a slight wrinkle with some dds channels as currently defined).
Initially I'd be tempted to only support numbered channels (on adc side).
Later we can add the named option - iff it has real use cases.
Jonathan
next prev parent reply other threads:[~2011-10-17 10:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 11:43 [PATCH RFC] IIO: Proof of concept in kernel interface Jonathan Cameron
2011-10-11 11:43 ` [PATCH] staging:iio:proof " Jonathan Cameron
2011-10-13 14:32 ` Mark Brown
2011-10-13 14:46 ` Jonathan Cameron
2011-10-13 20:44 ` Mark Brown
2011-10-14 15:59 ` Jonathan Cameron
2011-10-14 19:33 ` Mark Brown
2011-10-16 18:45 ` Linus Walleij
2011-10-17 9:39 ` Mark Brown
2011-10-17 9:44 ` Jonathan Cameron
2011-10-17 9:43 ` Jonathan Cameron
2011-10-17 10:19 ` Mark Brown
2011-10-17 10:32 ` Jonathan Cameron [this message]
2011-10-17 10:46 ` Mark Brown
2011-10-17 11:13 ` Jonathan Cameron
2011-10-17 11:18 ` Mark Brown
2011-10-17 11:32 ` Jonathan Cameron
2011-10-17 12:08 ` Mark Brown
2011-10-17 12:31 ` Jonathan Cameron
2011-10-17 12:48 ` Mark Brown
2011-10-17 13:03 ` Jonathan Cameron
2011-10-17 13:55 ` Mark Brown
2011-10-17 14:05 ` Jonathan Cameron
2011-10-17 13:55 ` Linus Walleij
2011-10-17 14:01 ` 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=4E9C0423.5010909@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linus.ml.walleij@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zdevai@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).