summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/adc
AgeCommit message (Collapse)Author
2013-12-09iio: adc: add STMPE ADC driver using IIO frameworkStefan Agner
This adds an ADC driver for the STMPE device using the industrial input/output interface. The driver supports raw reading of values. The driver depends on the MFD stmpe driver. If the touchscreen block is enabled too, only for of the 8 ADC channels are available.
2011-07-18staging:iio:adc:ad7476: Incorrect pointer into spi_set_drvdata.Jonathan Cameron
Will cause issues only on driver removal. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Staging: iio: some uninitialized variable bugsDan Carpenter
There were some uninitialized variable warnings in iio. Two of these came from the recent changes to how the private data was allocated in 83f0422dc6a16 "staging:iio:accel:sca3000: allocate state in iio_dev and use iio_priv to access." drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_probe': drivers/staging/iio/accel/sca3000_core.c:1137:9: warning: 'st' may be used uninitialized in this function drivers/staging/iio/adc/ad7291.c: In function 'ad7291_probe': drivers/staging/iio/adc/ad7291.c:805:15: warning: 'chip' may be used uninitialized in this function drivers/staging/iio/dac/ad5624r_spi.c: In function 'ad5624r_probe': drivers/staging/iio/dac/ad5624r_spi.c:228:24: warning: 'st' may be used uninitialized in this function Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28Staging: iio: dereferencing uninitialized variableDan Carpenter
In the error handling, it dereferences "st" before it has been initialized. I also just tidied it up a bit to remove some extra conditions. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28IIO: ADC: New driver for AD7792/AD7793 3 Channel SPI ADCMichael Hennerich
New driver for AD7792/AD7793 3-Channel, Low Noise, Low Power, 16-/24-Bit Sigma-Delta ADC with On-Chip In-Amp and Reference. The AD7792/AD7793 features a dual use data out ready DOUT/RDY output. In order to avoid contentions on the SPI bus, it's necessary to use spi bus locking. The DOUT/RDY output must also be wired to an interrupt capable GPIO. In INDIO_RING_TRIGGERED mode, this driver may block its SPI bus segment for an extended period of time. Changes since V1: Use bool where applicable. Use data buffer that lives in their own cache line. Restructure ad7793_calibrate_all to use an array. Use msleep. Query REG_ID instead of doing a write/read This is a test. Add support for unipolar mode. Drop range attribute in favor of write scale. Add proper locking. Use new validate_trigger callbacks. Use IIO_IN_DIFF for differential channels. Change attribute naming. Use available_scan_masks. Some other miscellaneous cleanup (none functional changes). Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:adt7410 allocate chip state with iio_dev and use iio_priv to ↵Jonathan Cameron
access. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:adt7310: allocate chip state with iio_dev and use iio_priv ↵Jonathan Cameron
for access. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:adt75: allocate chip state with iio_dev and cleanup some ↵Jonathan Cameron
function calls. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7816: allocate chip state with iio_dev and use iio_priv to ↵Jonathan Cameron
access. Again, get rid of unwanted iio_dev pointer in state. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7745 allocate chip state with iio_dev and use iio_priv to ↵Jonathan Cameron
access. Also remove the iio_dev pointer from chip state as never needed. V2: Actually allocate the space for iio_priv data. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7314 allocate chip state with iio_dev and use iio_priv to ↵Jonathan Cameron
access. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7291: allocate chip state with iio_dev and use iio_priv ↵Jonathan Cameron
for access. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7152: allocate chip state with iio_dev and use iio_priv ↵Jonathan Cameron
for access. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7150: allocate chip state with iio_dev and use iio_priv to ↵Jonathan Cameron
access. V2 - actually allocate some space for the iio_priv data. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad799x clear out last few uses of iio_dev->dev_data.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7887 clear out last few uses of iio_dev->dev_data.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging:iio:adc:ad7476 allocate state with iio_dev and use iio_priv to access.Jonathan Cameron
Reg handling is a little fiddly given the ordering of calls. All part of getting rid of iio_dev->dev_data Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: Trivial kconfig reorganization and uniformity improvements.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: use pollfunc allocation helpers in remaining drivers.Jonathan Cameron
Some didn't get converted the first time around. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify ↵Jonathan Cameron
event code spitting out. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: implement an iio_info structure to take some of the constant ↵Jonathan Cameron
elements out of iio_dev. This was suggested by Arnd Bergmann, Other elements may well move in here in future, but it definitely makes sense for these. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:ad7780 trivial unused header cleanup.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc: AD7780: Use private data space from iio_allocate_device + ↵Michael Hennerich
trivial fixes Use private data space from iio_allocate_device Drop dev_data in favour of iio_priv() Fix typo in gpio name Fix error return path, free gpio Make scale_uv type unsigned long Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:AD7780: Convert to new channel registration methodMichael Hennerich
Convert to new channel registration method Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv()Michael Hennerich
Some other small cleanups including excess header removals. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc: AD7606: Consitently use indio_devMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:AD7298: Use private data space from iio_allocate_deviceMichael Hennerich
Use private data space from iio_allocate_device Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: rationalization of different buffer implementation hooks.Jonathan Cameron
1) move a generic helper function out of ring_sw. It applies to other buffers as well. 2) Get rid of a lot of left over function definitions. 3) Move all the access functions into static structures. 4) Introduce and use a static structure for the setup functions, preenable etc. Some driver conversions thanks to Michael Hennerich (pulled out of patches that would otherwise sit after this). Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:buffer - remove unused event code for buffer events.Jonathan Cameron
These events are no longer passed up to userspace. ad7745 - was using these events to indicate directly dataready events. I'm not sure when it ever makes sense to push these to userspace so for now I've taken them to event codes 0 and 1 until someone has time to make this driver do something more standard. (they were arbitary before, they still are, be it in a different way!) Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:adt7410 replace abuse of buffer events.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:adt7310 replace abuse of buffer events.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7291 remove abuse of buffer events and replace with ↵Jonathan Cameron
something almost sane This device has separate events for a sort of decaying average and for the raw value. We don't have a way of specifying this as yet. For now I have both resulting in the same event code. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7816 and adt75 change to meaningful event code.Jonathan Cameron
This was another abuse of the buffer event codes. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7150 fix event codes.Jonathan Cameron
I won't guarantee I got these right, but they are certainly closer than the abuse of buffer event codes that was perviously in here. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:max1363 add new 2 channels parts form maxim, 11644-7Jonathan Cameron
V2: IIO_CHAN macro usage update. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:max1363 trivial removal of unused trig pointer.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7606: Use private data space from iio_allocate_deviceMichael Hennerich
Trivial backport done by Jonathan Cameron Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7606 Convert to new channel registration method Update Add ↵Michael Hennerich
missing call to iio_trigger_notify_done() Set pollfunc top and bottom half handler V3: rebase fixup. Backported to relevant merge point by Jonathan Cameron. V2: IIO_CHAN macro usage update Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7298: Convert to new channel registration methodMichael Hennerich
Convert to new channel registration method Update Add missing call to iio_trigger_notify_done() Backported to a point that will allow the driver to build all the way through the series. V2: IIO_CHAN macro usage updated. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad799x removed unused headers.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad799x: Use private data space from iio_allocate_deviceMichael Hennerich
Use private data space from iio_allocate_device Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad799x: Convert to new channel registration method.Michael Hennerich
Convert to new channel registration method Update copyright header Add missing call to iio_trigger_notify_done() V2: IIO_CHAN macro updates Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7887: Use private data space from iio_allocate_deviceMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7887: Convert to new channel registration method.Michael Hennerich
Convert to new channel registration method Update / change license copyright header Add missing call to iio_trigger_notify_done() V2: use IIO_CHAN macro. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: use the new central name attribute creation codeJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad799x move to irqchip based trigger handling.Jonathan Cameron
Untested. Also cleared out last_timestamp as it isn't used anywhere. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7887 move to irqchip based trigger handling.Jonathan Cameron
Untested. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7606 conversion to irq_chip based polling.Jonathan Cameron
I'm far from sure what the best way to handle this particular part is, so have (I think) done the absolute minimum to change it to the new interface. V2: Trivial constification of device name. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7298 move to irqchip based trigger handling.Jonathan Cameron
Untested. This one is of a different form, so worth a closer look than the previous incredibly similar patches (which were based on the adis16400 that I have tested). Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:adc:ad7476 move to irqchip based triggeringJonathan Cameron
Untested V2: Fixed missing free of pollfunc->name pointed out by Michael Hennerich. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>