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 16:15:25 +0100 [thread overview]
Message-ID: <4DC4108D.6020601@cam.ac.uk> (raw)
In-Reply-To: <20110506142316.GP23729@opensource.wolfsonmicro.com>
On 05/06/11 15:23, Mark Brown wrote:
> On Fri, May 06, 2011 at 04:13:26PM +0200, Ithamar R. Adema wrote:
>
>> Would it be worth considering generalizing the model that s3c uses[1]
>> for adc? I've reused that for at least two other platforms already,
>> though not mainlined (yet).
>
>> It could make for a good /drivers/adc/ base IMHO. Any opinions?
>
> I'd have expected that this stuff should be able to fit into IIO and
> that it would be able to be used by in-kernel users.
To my mind this is just like any other bit of hardware used by drivers
in different subsystems. Fits in MFD as far as I am concerned (and there
are several parts doing this ls drivers/mfd/*adc*).
Take the jz4740-adc.c file. That provides adc reading to a touchscreen
a battery monitor and hwmon driver. Any thing else is just reinventing
the wheel...
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).
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.
IIO does have a (prototype) bridge to input, but that's done via userspace
is there to handle people doing unusual things with sensors typically used
for very different purposes (using 500 dolar IMU as a joystick for example).
We could do this in kernel, but that involves adding some logic at the
back end of the high data rate paths and hence would rather not...
Jonathan
next prev parent reply other threads:[~2011-05-06 15:15 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 [this message]
2011-05-06 15:56 ` Mark Brown
2011-05-06 16:29 ` Jonathan Cameron
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=4DC4108D.6020601@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).