Location for ADC driver
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?
Thanks,
Stefan
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Stefan Roese
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/hwmonwith its infrastructure. Then I noticed thedrivers/staging/iio/adcdirectory.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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 26 lines · Jonathan Cameron
Quoted 9 lines · Stefan Roese
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/hwmonwith its infrastructure. Then I noticed thedrivers/staging/iio/adcdirectory.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_hwmondriver 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.
Quoted 7 lines
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...
... and what its intended use is (generic adc or hardware monitoring).
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors