All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Location for ADC driver
Date: Mon, 26 Mar 2012 18:07:49 +0000	[thread overview]
Message-ID: <4F70B075.1020309@cam.ac.uk> (raw)
In-Reply-To: <201203261733.38794.sr@denx.de>

On 03/26/2012 04:33 PM, Stefan Roese wrote:
> Hi,
> 
> I'll start porting a driver for the ST SPEAr600 SoC internal ADC in a short 
> while. First I thought it would be located in drivers/hwmon with its 
> infrastructure. Then I noticed the drivers/staging/iio/adc directory.
> 
> So my question is, where should such an SoC internal ADC driver best be 
> placed? hwmon or iio/adc? Or can I choose freely?
> 
It rather depends on what the adc is used for.  Hwmon is unsurprisingly
suitable for monitoring hardware.  So typically it is relatively low
speed polling of the adc channels via sysfs.

IIO has this mode (and indeed there is a iio_hwmon driver that allows
an iio device to provide a child hwmon device for a selection of channels).

It adds,

1) Buffered support for faster reading of lots of samples.
2) Event handling (there is some alarm support in hwmon).
3) Interfaces to allow other kernel drivers to make use of
the services provided by the ADC.  Right now only interfaces
that poll are supported by mainline. Interfaces that use a callback
are undergoing review.

I'm not having much luck tracking down docs for the SPEAr600 adc, so
I'll guess it is similar to the SPEAr320 one?  Looks like a straight
forward adc without a conversion completion interrupt (which will make
the driver tedious as you'll have to dead reckon the conversion time)
It's not that clever, so I think whether to go with IIO or hwmon
directly is largely a matter of how quick you want to grab data from it...

Jonathan

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  reply	other threads:[~2012-03-26 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 15:33 Location for ADC driver Stefan Roese
2012-03-26 15:33 ` [lm-sensors] " Stefan Roese
2012-03-26 18:07 ` Jonathan Cameron [this message]
2012-03-26 18:15 ` Guenter Roeck

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=4F70B075.1020309@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=lm-sensors@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.