Re: [spi-devel-general] SPI-ADC

From: Linus Walleij
Date: Sat Feb 13 2010 - 16:20:19 EST


2010/2/13 Jonathan Cameron <kernel@xxxxxxxxxxxxxxxxxxxxx>:

>>> can anybody share how to start a spi based ADC linux driver.I am having a
>>> MAXIM 1242 ADC chip.
>>
>> The áernel does not contain any generic ADC subsystem abstraction
>> (...)
>
> That's not entirely true. ÂThese are covered by the IIO subsystem which
> is admittedly currently in staging as some elements still need cleaning up.
> (...)
> ADC drivers are under drivers/staging/iio/adc.

Great stuff. I knew about IIO and then it fell out of my mind, how
could I...

What strikes me especially about IIO is the underlying assumption, which I
think ought to be written in clear somewhere where I missed it, and that
is that all IIO drivers are supposed to deliver values and be controller from
userspace with this nice ABI, and nothing's wrong with that of course.

But I'm hinting about a few in-kernel uses: for AB3100 we have a battery
charging mechanism, which use a (calibrated) ADC value supporting the
bulk of the driver in the power/ subsystem.

As it looks today IIO is not intended for the case where another subsystem
needs to grab and use and ADC for its own purposes. Is this correct or did
I get it all wrong?

Would you say it'd be a good idea to hack the IIO ADC interface (for
example) to be used also internally in the kernel, or would that violate
the idea behind IIO?

If these are disparate categories it would warrant a separate adc/
subsystem, see.

> Currently all discussions take place on LKML, but we are working on a more
> focused alternative list which I'll announce once it is sorted out.

LKML is just fine with me, for one.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/