linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jic23@cam.ac.uk (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] ARM: SPMP8000: Add ADC driver
Date: Tue, 11 Oct 2011 16:39:46 +0100	[thread overview]
Message-ID: <4E946342.4030807@cam.ac.uk> (raw)
In-Reply-To: <201110111724.48069.arnd@arndb.de>

On 10/11/11 16:24, Arnd Bergmann wrote:
> On Tuesday 11 October 2011, Mark Brown wrote:
>> On Tue, Oct 11, 2011 at 04:17:51PM +0200, Arnd Bergmann wrote:
>>> On Monday 10 October 2011, Mark Brown wrote:
>>
>>>> At the minute it seems to me that arch/arm is as good a place as any
>>>> really - currently this code is getting dumped wherever the main device
>>>> is.
>>
>>> My feeling is that there is a general class of drivers involving
>>> the gpio, pinmux, pwm, led, adc and dac: these are basically all
>>> things you do with a single pin. Right now we have subsystems for
>>> some of them, adding some others and don't have anything for adc
>>> basides iio (which only partially fits here).
>>
>> We've been round this loop repeatedly before, trying to push all this
>> stuff into pins really doesn't map terribly well.  For example, SoCs
>> will frequently have PWM controllers which are isolated IP blocks within
>> the device and may each have multiple mappings out of the device onto
>> pins.  In the case of DACs, ADCs and PWM you definitely don't have a one
>> to one mapping with a single pin - they can be differential inputs and
>> outputs, or entirely internal to a device.  Trying to push everything
>> into a single namespace just makes things confusing.
> 
> I didn't mean to suggest that they should be the same subsystem, but
> it would be nice to use similar in-kernel interfaces so that a driver
> author doesn't have to learn about six different interfaces for
> a new soc. If we add an adc subsystem, I would definitely recommend
> looking at how the others work.
Yup, I'm reading the clk api stuff right now.
> 
>>> Since there is no externally visible interface for this kind of
>>> adc driver, we can always fix it later, which helps a lot. How
>>> about putting it into drivers/adc or drivers/misc/adc for now
>>> and waiting for others to join it? We can then later make it a
>>> proper subsystem along the lines of gpio and pwm and move
>>> interfaces for input, hwmon and iio into the subsystem.
>>
>> I'm not sure that IIO isn't the kernel subsystem we're looking for here
>> - as I keep saying when this comes up it's just representing bare DACs
>> and ADCs pretty directly which looks like a generic subsystem to me.
> 
> Possible, yes. Until now, IIO is a subsystem for user-level access
> not for kernel access though, so it's not the right place yet.
Technically proof of concept code for kernel access went out this morning
(sorry, didn't cc you as you hadn't entered this thread yet).   It's
all of 10 lines of code right now.  But yeah, its userspace focussed.

https://lkml.org/lkml/2011/10/11/141

Covers basic hwmon type usage (polled single channel read).  I'm not nearly
as sure how to handle complex channel scans.  There's a lot of infrastructure
involved in those.

> If we decide to let IIO handle all ADC input, do you think it would
> also be the right place to do PWM output, rather than having a
> separate subsystem for that?
That's one I've been avoiding talking about.  The fuzzy region is between
DDS (direct digital synthesis - waveform generator) chips which we have
been taking in IIO so far.   We don't actually handle these that well
at the moment.  Our core channel registration code doesn't handle the
weird routing these can do - single underlying generator does several
synchronized waveforms.

Pwm is small compact and nice.  Perhaps a similar shim to that I proposed
to hwmon alongside that patch earlier.  So simple pwm only device sits
in pwm, but we have a general purpose driver sitting on IIO that can
provide pwm from an appropriate channel of a more complex device.
It would need hooks that aren't there at the moment and more of the
DDS control to become part of the IIO core.

We may ultimately want to hive off more of IIO into a layer sitting
at same level as other users. It's tricky to know where to make
such divisions though.

Jonathan

  reply	other threads:[~2011-10-11 15:39 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-09 16:36 Add support for the SPMP8000 SoC and Letcool board Zoltan Devai
2011-10-09 16:36 ` [PATCH 1/9] ARM: vic: Don't write to the read-only register VIC_IRQ_STATUS Zoltan Devai
2011-10-10  1:35   ` Linus Walleij
2011-10-10 13:59     ` Zoltan Devai
2011-10-09 16:36 ` [PATCH 2/9] ARM: SPMP8000: Add machine base files Zoltan Devai
2011-10-09 17:22   ` Jamie Iles
2011-10-10 11:36     ` Zoltan Devai
2011-10-10 11:52       ` Jamie Iles
2011-10-11 14:44   ` Arnd Bergmann
2011-10-16 14:10     ` Zoltan Devai
2011-10-16 15:57       ` Russell King - ARM Linux
2011-10-16 20:59       ` Arnd Bergmann
2011-10-16 20:52         ` Jean-Christophe PLAGNIOL-VILLARD
2011-10-17 11:44           ` Arnd Bergmann
2011-10-09 16:36 ` [PATCH 3/9] ARM: SPMP8000: Add clk support Zoltan Devai
2011-10-13  9:38   ` Russell King - ARM Linux
2011-10-16 14:16     ` Zoltan Devai
2011-10-17 12:15       ` Mark Brown
2011-10-18 10:18         ` Russell King - ARM Linux
2011-10-09 16:36 ` [PATCH 4/9] ARM: SPMP8000: Add ADC driver Zoltan Devai
2011-10-10  1:29   ` Linus Walleij
2011-10-10  9:42     ` Jonathan Cameron
2011-10-10  9:46       ` Jonathan Cameron
2011-10-10 10:00       ` Mark Brown
2011-10-10 11:42         ` Zoltan Devai
2011-10-10 11:44           ` Mark Brown
2011-10-11 14:17             ` Arnd Bergmann
2011-10-11 14:40               ` Mark Brown
2011-10-11 15:24                 ` Arnd Bergmann
2011-10-11 15:39                   ` Jonathan Cameron [this message]
2011-10-12 14:42                   ` Mark Brown
2011-10-12 15:41                     ` Jonathan Cameron
2011-10-13  9:47             ` Russell King - ARM Linux
2011-10-13 11:09               ` Linus Walleij
2011-10-13 11:35                 ` Jonathan Cameron
2011-10-13 11:35               ` Mark Brown
2011-10-13 12:17                 ` Russell King - ARM Linux
2011-10-13 14:19                   ` Arnd Bergmann
2011-10-13 14:27                     ` Mark Brown
2011-10-13 14:38                   ` Mark Brown
2011-10-13 14:56                     ` Arnd Bergmann
2011-10-13 16:25                       ` Mark Brown
2011-10-09 16:36 ` [PATCH 5/9] ARM: SPMP8000: Add pinmux driver Zoltan Devai
2011-10-10  1:32   ` Linus Walleij
2011-10-10  8:01     ` Barry Song
2011-10-10  8:34       ` Linus Walleij
2011-10-09 16:36 ` [PATCH 6/9] ARM: SPMP8000: Add pwm driver Zoltan Devai
2011-10-10  1:50   ` Linus Walleij
2011-10-10  9:30     ` Sascha Hauer
2011-10-09 16:36 ` [PATCH 7/9] ARM: SPMP8000: Add dts file of SPMP8000 SoC and Letcool board Zoltan Devai
2011-10-10  8:54   ` Jamie Iles
2011-10-09 16:36 ` [PATCH 8/9] ARM: SPMP8000: Add support for the " Zoltan Devai
2011-10-11 14:09   ` Arnd Bergmann
2011-10-11 14:43     ` Zoltan Devai
2011-10-11 15:18       ` Arnd Bergmann
2011-10-13  9:54   ` Russell King - ARM Linux
2011-10-09 16:36 ` [PATCH 9/9] ARM: SPMP8000: Add Kconfig and Makefile entries to build the machine Zoltan Devai
2011-10-09 17:25   ` Jamie Iles
2011-10-10  1:43   ` Linus Walleij
2011-10-13  9:53   ` Russell King - ARM Linux
2011-10-10  8:55 ` Add support for the SPMP8000 SoC and Letcool board Jamie Iles
2011-10-10 12:00   ` Zoltan Devai
2011-10-10 12:03     ` Jamie Iles
2011-10-11 14:57 ` Arnd Bergmann
     [not found] ` <1319040118-29773-1-git-send-email-zoss@devai.org>
2011-10-19 16:01   ` [PATCH v2 1/5] ARM: SPMP8000: Add machine base files Zoltan Devai
2011-10-19 19:15     ` Arnd Bergmann
2011-10-21 22:54       ` Russell King - ARM Linux
2011-10-23 21:47         ` Zoltan Devai
2011-10-23 21:37       ` Zoltan Devai
2011-10-24  9:13         ` Arnd Bergmann
2011-10-24 11:00           ` Jamie Iles
2011-11-02 13:29             ` Zoltan Devai
2011-11-03 15:08               ` Arnd Bergmann
2011-10-19 16:01   ` [PATCH v2 2/5] ARM: SPMP8000: Add clk support Zoltan Devai
2011-10-19 16:01   ` [PATCH v2 3/5] ARM: SPMP8000: Add clocksource and clockevent drivers Zoltan Devai
2011-10-19 16:01   ` [PATCH v2 4/5] ARM: SPMP8000: Add SPMP8000 SoC and Letcool board dts descriptions Zoltan Devai
2011-10-24 12:47     ` Rob Herring
2011-10-19 16:01   ` [PATCH v2 5/5] ARM: SPMP8000: Add Kconfig and Makefile entries Zoltan Devai

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=4E946342.4030807@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).