From: jic23@cam.ac.uk (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] What is the preferred way to share ADC unit between hwmon and input(ts) drivers?
Date: Fri, 06 May 2011 17:29:39 +0100 [thread overview]
Message-ID: <4DC421F3.40404@cam.ac.uk> (raw)
In-Reply-To: <20110506155636.GA23646@sirena.org.uk>
On 05/06/11 16:56, Mark Brown wrote:
> On Fri, May 06, 2011 at 04:15:25PM +0100, Jonathan Cameron wrote:
>
>> We can add in kernel hooks to IIO (would be easy enough -
>> for low rate stuff). I'd be happy to accept patches for this (it's not
>> a priority for any current active developers as far as I know).
>
> The fact that the interface is stuck in staging has been putting me off
> looking at this, building on top of staging would be a step back for the
> uses I have. I'd guess that most of the existing users have no other
> option than to use IIO which isn't the case for this sort of user.
Sure - this sort of user isn't what I at least conceive IIO as being for.
>
>> However, that's silly if all you want is to pass it directly to input and hwmon.
>> Just write a driver that registers both interfaces directly.
>> If one of the adc channels needs stuff from IIO, add that as well.
>
> The pattern that's present in a lot of PMICs it that there's an AUXADC
> which is used for voltage/temperature monitoring (typically exposed by
> hwmon and power) and can also be used for random inputs (in the style of
> IIO). The AUXADC is logically just a bunch of random ADC channels that
> needs some software on top of it to provide semantics, which sounds a
> lot like IIO.
>
> Currently you end up with a part-specific ADC interface that some of the
> other drivers are consumers for. I'd really expect that IIO would be
> able to save everyone having to reinvent this per chip.
Currently at least, IIO sits at the same level as input and hwmon. We
are interested in handling parts that are too fast / too complicated or just
plain don't fit in one of those. It would be easy enough to add what you
are talking about, but in the same fashion as in theory input could add
interfaces for hwmon if they wanted to. The question is whether this a
job for IIO or should be abstracted below this level (and I agree there
is scope for abstraction here). I'm a little worried that if we put
it in IIO it will result in bloat away from the core aims of handling
the many weird and wonderful sensors out there in a coherent way.
So you could write a hwmon driver that talks through an iio driver
(easy enough to do I think - though only a small subset of stuff would
be supported). It's also low rate so the iio and hwmon interfaces
wouldn't get in each others way very much.
Input is trickier as the data paths for IIO and input
are deliberately rather different due to different requirements.
Yes we could write a driver that hooks in at a low level, but that
would then break the IIO data flow.
Basically, yes - we could bludgeon support for ADC in kernel sharing
into IIO, but its not all that close to our current scope. If anyone
wants to look at that, feel free, but I still feel that this sits
better in mfd. Often you will be sharing interrupts as well and they
may well be a mix of ADC and non ADC sources.
next prev parent reply other threads:[~2011-05-06 16:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-25 0:37 [RFC] What is the preferred way to share ADC unit between hwmon and input(ts) drivers? Ilya Yanok
2011-04-25 5:25 ` Kurt Van Dijck
2011-05-05 23:41 ` Ilya Yanok
2011-04-25 11:02 ` Mark Brown
2011-05-05 23:43 ` Ilya Yanok
2011-05-06 13:43 ` Jonathan Cameron
2011-05-06 14:13 ` Ithamar R. Adema
2011-05-06 14:23 ` Mark Brown
2011-05-06 15:15 ` Jonathan Cameron
2011-05-06 15:56 ` Mark Brown
2011-05-06 16:29 ` Jonathan Cameron [this message]
2011-05-06 17:20 ` Mark Brown
2011-05-09 13:25 ` Jonathan Cameron
2011-05-09 14:39 ` Mark Brown
2011-05-09 16:35 ` Jonathan Cameron
2011-05-09 19:54 ` Mark Brown
2011-05-10 9:51 ` Jonathan Cameron
2011-05-06 15:21 ` Ithamar R. Adema
2011-05-07 18:11 ` Linus Walleij
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=4DC421F3.40404@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=linux-arm-kernel@lists.infradead.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 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).