At the IIO layer, but an ADC layer itself needs very very little indeed.IIO is about a heck of a lot other than ADCs. Keep that in mind. Theyhappily enough. IIO can use it from staging and IIO can migrate whenever.
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.
You've got
allocate
deallocate
read_samples (block/nonblock)
setup
->samples() callback
Except that you then end up with simple_adc abstraction and a whole host of more
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.
We have that simple abstraction. Dumb polled or irq driven adc stuff can be done cleanly
I know it's not ideal, but at the end of the day IIO had a ratherI don't see the two conflicting. At one level we have a need for a simple
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.
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.
I suspect you'll end up adding more and more to your adc abstraction till you actually
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.