From: Jonathan Cameron <jic23@cam.ac.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
mingo@elte.hu, linux-kernel@vger.kernel.org,
Jonathan Cameron <jic23@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH RESEND] x86, intel_mid: ADC management
Date: Wed, 11 Apr 2012 12:19:04 +0100 [thread overview]
Message-ID: <4F8568A8.5060206@cam.ac.uk> (raw)
In-Reply-To: <20120411121309.4b8f8e40@pyramind.ukuu.org.uk>
On 4/11/2012 12:13 PM, Alan Cox wrote:
>>>> happily enough. IIO can use it from staging and IIO can migrate whenever.
>> IIO is about a heck of a lot other than ADCs. Keep that in mind. They
>> are a substantial
>> corner but we handle a lot of output devices and other input devices
>> (though these
>> might be adc's inside, that's not what your average users think of them as).
>> We 'have' to ensure anything we do works for the other device types as well.
> At the IIO layer, but an ADC layer itself needs very very little indeed.
>
> You've got
> allocate
> deallocate
> read_samples (block/nonblock)
> setup
> ->samples() callback
To add a few more things that are common (there are others).
Read scale, read offset.
Hardware event interrupts,
Triggering control.
Filtering control.
Some adcs may only need what you specify, others need a whole lot more.
You might term these setup I suppose, but the consumer of the data often
needs to know about them.
>
> and devices are either polled, IRQ driven or DMA.
>
> Now setup is a lot of different things but those can be abstracted and
> added as needed (and much probably taken from the IIO bits).
>
> A pure ADC abstraction ought to be a very very thin layer of code.
Except that you then end up with simple_adc abstraction and a whole host
of more
complex abstractions on top.
>
>> I know it's not ideal, but at the end of the day IIO had a rather
>> different target when
>> we wrote it from SoC ADCs. That target of consistent userspace
>> interfaces and
>> brute force data capture still has to be met without introducing major
>> regressions.
> I don't see the two conflicting. At one level we have a need for a simple
> abstraction for low level ADC access within devices (akin to gpio). At the
> level above we have a need for a consistent, sensible interface to
> userspace with a stable API.
We have that simple abstraction. Dumb polled or irq driven adc stuff
can be done cleanly
in minimal code.
What I disagree on is that the bit you have grouped into setup is
actually separate. That
needs to be abstracted as well. Consumers might not care that the gain
just doubled
because someone else requested it, but I suspect many of them will.
>
> Your simple IIO examples would just use the ADC abstraction, your complex
> IIO examples would use the ADC abstraction *and* layer it with IIO level
> code that is mixing it with all the other needed work.
I suspect you'll end up adding more and more to your adc abstraction
till you actually
end up with most of IIO. That's effectively what we did... It's big
because there are
actually not that many 'simple' adc's out there.
Jonathan
next prev parent reply other threads:[~2012-04-11 11:19 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 13:20 [PATCH RESEND] x86, intel_mid: ADC management Alan Cox
2012-04-10 13:12 ` Mark Brown
2012-04-10 13:25 ` Alan Cox
2012-04-10 13:33 ` Mark Brown
2012-04-10 13:42 ` Alan Cox
2012-04-10 14:07 ` Mark Brown
2012-04-10 14:15 ` Alan Cox
2012-04-10 15:19 ` Mark Brown
2012-04-10 16:56 ` Alan Cox
2012-04-10 17:58 ` Mark Brown
2012-04-10 19:39 ` Jonathan Cameron
2012-04-10 22:37 ` Mark Brown
2012-04-11 6:19 ` Jonathan Cameron
2012-04-11 6:19 ` Jonathan Cameron
2012-04-11 7:44 ` Jonathan Cameron
2012-04-11 15:38 ` Greg Kroah-Hartman
2012-04-11 16:30 ` Jonathan Cameron
2012-04-11 23:46 ` Greg Kroah-Hartman
2012-04-12 6:25 ` Jonathan Cameron
2012-04-11 10:24 ` Alan Cox
2012-04-11 10:38 ` Mark Brown
2012-04-11 10:48 ` Jonathan Cameron
2012-04-11 11:13 ` Alan Cox
2012-04-11 11:19 ` Jonathan Cameron [this message]
2012-04-11 12:30 ` Alan Cox
2012-04-11 12:55 ` Jonathan Cameron
2012-04-12 17:53 ` Mark Brown
2012-04-12 18:04 ` Mark Brown
2012-04-11 11:38 ` 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=4F8568A8.5060206@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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.