Commit Graph

654 Commits

Author SHA1 Message Date
Jonathan Cameron beeada734f staging:iio: one more fix for IIO_RING_BUFFER not enabled.
Same problem as seen and fixed in adis16204 et al.
These were fixed by Randy in:
staging: fix more iio builds when IIO_RING_BUFFER is not enabled

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:48:13 -07:00
Dan Carpenter f88af7e7d3 Staging: iio: dereferencing uninitialized variable
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-28 14:48:13 -07:00
maximilian attems 7959a7c477 staging: iio light Kconfig fixlet
No point to start comments with '\'.

Signed-off-by: maximilian attems <max@stro.at>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:47:26 -07:00
Michael Hennerich c2f37c8dca iio: dac: New driver for AD5686R, AD5685R, AD5684R Digital to analog converters
New driver for AD5686R, AD5685R, AD5684R Quad channel digital to analog converters

Changes since V1:

drop header file
use strtobool()
Fix dev attribute macros
Reorder probe() function

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-28 14:47:26 -07:00
Michael Hennerich ae19178eac iio: industrialio-core: Add IIO_OUT type
Add IIO_OUT type for DAC like devices
In case of IIO_OUT make sure the channel device attribute is writable

Ideally we add a flag to iio_chan_spec that tells the core that
the channel device attribute is writable...

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-28 14:47:25 -07:00
Michael Hennerich 88bc30548a IIO: ADC: New driver for AD7792/AD7793 3 Channel SPI ADC
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-28 14:47:25 -07:00
anish kumar 3fd47d4486 staging:iio:accel:kxsd9 replace kmallocs in power_up with use of already allocated buffer.
Signed-off-by: anish kumar <anish198519851985@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:52 -07:00
anish d5614701df staging: IIO corrected the spelling in iio-trig-gpio
Corrected the spelling.

Signed-off-by: anish kumar <anish198519851985@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:52 -07:00
Jonathan Cameron d31907f343 staging:iio:accel:adis16201 general cleanup, move to iio_priv and buffers in adis16201_state
Basically use various new facilities to tidy up.

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-28 14:39:52 -07:00
Jonathan Cameron 927afbec71 staging:iio:light:isl29018: allocate device state with iio_dev
V2: Actually allocate the space for iio_priv

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:51 -07:00
Jonathan Cameron 88fa4de48e staging:iio:magnetometer:hmc5843: allocate device state with iio_dev.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:51 -07:00
Jonathan Cameron afc2ff0afa staging:iio:meter:ade7759: allocate state with iio_dev
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-28 14:39:51 -07:00
Jonathan Cameron 338473c819 staging:iio:magnetometer:ak8975: allocate chip state with iio_dev.
Here the ordering is a little tricky, so to keep changes minimal, a copy of the gpio
number is introduced.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:51 -07:00
Jonathan Cameron 58f08b0af8 staging:iio:resolver:ad2s90 general cleanup
Very simple driver, so not much to do.

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-28 14:39:50 -07:00
Jonathan Cameron 8f2bd8363f staging:iio:resolver:ad2s120x cleanup.
I've currently squashed the vel + pos combined attribute.  If people need them
precisely paired I doubt they will get them from the sysfs interface anyway.
If that is a requirement it should come via a buffer implementation.

Note this patch leaves the completely non standard interface alone.
That will get fixed later.

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-28 14:39:50 -07:00
Jonathan Cameron b19e9ad5e2 staging:iio:resolver:ad2s1210 general driver cleanup.
Note I haven't made any changes to the userspace interface as yet.
This is all about cleaning up what was actually there (handling
all errors etc).

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-28 14:39:49 -07:00
Jonathan Cameron 937a960121 staging:iio:meter:ade7854: Allocate buffers in state and state with iio_dev.
Requires moving a few things around, but should be no functional changes.

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-28 14:39:49 -07:00
Jonathan Cameron 57157d1c0e staging:iio:meter:ade7754: allocate state with iio_dev and buffers 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-28 14:39:48 -07:00
Jonathan Cameron bfccd4fb9a staging:iio:meter:ade7753 allocate chip state with iio_dev; allocate buffers within 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-28 14:39:48 -07:00
Jonathan Cameron ba61bb18c2 staging:iio:gyro:adxrs450: allocate chip state with iio_dev
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-28 14:39:48 -07:00
Jonathan Cameron d088ab8388 staging:iio:gyro:adis16260: allocate chip state with iio_dev and use iio_priv to 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-28 14:39:47 -07:00
Jonathan Cameron 9f8632d73e staging:iio:gyro:adis16130: allocate chip state with iio_dev and use iio_priv to access it.
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-28 14:39:47 -07:00
Jonathan Cameron 1dd9290a7e staging:iio:gyro:adis16080: allocate chip state with iio_dev
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-28 14:39:47 -07:00
Jonathan Cameron 3a5952f97a staging:iio:gyro:adis16060 allocate chip state with iio_dev.
This is still a very odd driver.

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-28 14:39:47 -07:00
Jonathan Cameron 3e772581c2 staging:iio:dds:ad9951: allocate chip state with iio_dev
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-28 14:39:46 -07:00
Jonathan Cameron fb565f132b staging:iio:dds:ad9910: allocate chip state with iio_dev
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-28 14:39:46 -07:00
Jonathan Cameron a28299114b staging:iio:dds:ad9810: allocate chip state with iio_dev and use iio_priv 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-28 14:39:46 -07:00
Jonathan Cameron 7be94372ca staging:iio:dds:ad9850 allocate chip state with iio_dev + fix name of attr group.
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-28 14:39:45 -07:00
Jonathan Cameron 8b7163a5f6 staging:iio:ad9834: allocate chip state with iio_dev and use iio_priv to 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-28 14:39:45 -07:00
Jonathan Cameron 39f3b32eb3 staging:iio:dds:ad9832: allocate chip state with iio_dev and use iio_priv to 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-28 14:39:45 -07:00
Jonathan Cameron 7074e1d44f staging:iio:dds:ad5930 Fix attr group location + allocate state with iio_dev
The main attribute group was placed under driver name for some reason.

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-28 14:39:44 -07:00
Jonathan Cameron cada11fa20 staging:iio:dac:max517: allocate chip state with iio_dev and use iio_priv to access it.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:44 -07:00
Jonathan Cameron f5730d52ba staging:iio:dac:ad5791: allocate chip state with iio_dev and use iio_priv for access.
Slightly fiddly case with two regulators - could reorder, but this is the approach with
smallest likely impact.

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-28 14:39:43 -07:00
Jonathan Cameron 86729fc46f staging:iio:dac:ad5446: allocate chip state with iio_dev and use iio_priv 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-28 14:39:43 -07:00
Jonathan Cameron a3684ded4f staging:iio:dac:ad5504: allocate chip state with iio_dev and use iio_priv 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-28 14:39:43 -07:00
Jonathan Cameron 3ff242055b staging:iio:dac:ad5624r: allocate chip state with iio_dev and use iio_priv 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-28 14:39:42 -07:00
Jonathan Cameron d3de2935b6 staging:iio:adc:adt7410 allocate chip state with iio_dev and use iio_priv to 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-28 14:39:42 -07:00
Jonathan Cameron 70be42919a staging:iio:addac:adt7316: allocate chip state with iio_dev and use iio_priv to access.
Various minor cleanups needed to deal with removal of iio_dev pointer from chip 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-28 14:39:42 -07:00
Jonathan Cameron 7978f9f8f9 staging:iio:adc:adt7310: allocate chip state with iio_dev and use iio_priv 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-28 14:39:41 -07:00
Jonathan Cameron 84e8d84d0f staging:iio:adc:adt75: allocate chip state with iio_dev and cleanup some 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-28 14:39:41 -07:00
Jonathan Cameron b0011d6dba staging:iio:adc:ad7816: allocate chip state with iio_dev and use iio_priv to 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-28 14:39:41 -07:00
Jonathan Cameron febafb94d6 staging:iio:adc:ad7745 allocate chip state with iio_dev and use iio_priv to 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-28 14:39:40 -07:00
Jonathan Cameron 744e4a6b85 staging:iio:adc:ad7314 allocate chip state with iio_dev and use iio_priv to 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-28 14:39:39 -07:00
Jonathan Cameron d439797281 staging:iio:adc:ad7291: allocate chip state with iio_dev and use iio_priv 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-28 14:39:39 -07:00
Jonathan Cameron f4c794a2c1 staging:iio:adc:ad7152: allocate chip state with iio_dev and use iio_priv 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-28 14:39:38 -07:00
Jonathan Cameron 46a6af3820 staging:iio:adc:ad7150: allocate chip state with iio_dev and use iio_priv to 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-28 14:39:38 -07:00
Jonathan Cameron d8aea29b62 staging:iio:adc:ad799x clear out last few uses 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-06-28 14:39:37 -07:00
Jonathan Cameron f490f42bdf staging:iio:adc:ad7887 clear out last few uses 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-06-28 14:39:37 -07:00
Jonathan Cameron 67688105af staging:iio:adc:ad7476 allocate state with iio_dev and use iio_priv to access.
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-06-28 14:39:37 -07:00
Jonathan Cameron ed0c012b85 staging:iio:accel:kxsd9: allocate state with iio_dev and use iio_priv to access.
V2: Actually allocate the storage.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:36 -07:00
Jonathan Cameron 83f0422dc6 staging:iio:accel:sca3000: allocate state in iio_dev and use iio_priv to access.
Mechanical change.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:39:36 -07:00
Jonathan Cameron 01a6721600 staging:iio:accel:adis16220 allocate tx and rx in state plus state via iio_priv
Few other misc cleanups.

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-28 14:39:35 -07:00
Jonathan Cameron a22ff7066c staging:iio:accel:adis16240 allocate tx and rx in state plus state via iio_priv
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-28 14:39:35 -07:00
Jonathan Cameron 35212dfa6b staging:iio:accel:adis16209 allocate tx and rx in state plus state via iio_priv
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-28 14:39:35 -07:00
Jonathan Cameron 4de66bbb3e staging:iio:accel:adis16204 allocate tx and rx in state plus state via iio_priv
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-28 14:39:35 -07:00
Jonathan Cameron 6a0d8090a6 staging:iio:accel:adis16203 move buffers into state and use iio_priv to avoid allocating state separately.
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-28 14:39:34 -07:00
Michael Hennerich 5c04af0483 iio: industrialio-core: iio_write_channel_info accept IIO_VAL_INT_PLUS_NANO
Allow iio_write_channel_info() to accept IIO_VAL_INT_PLUS_NANO

Changes since V1:
use callback to query expected format/precision

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-28 14:39:34 -07:00
Michael Hennerich 43a4360ea8 iio: trigger: Add filter callback
Allow devices to reject triggers and vice versa.

Changes since V1:
Added kernel-doc
Moved callback into iio_info
Changed function naming
Revised return value passing
Add forward declaration to avoid warnings

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-28 14:39:33 -07:00
Michael Hennerich 03e1672a70 iio: trigger: Move declaration of struct iio_poll_func to avoid warnings
Move declaration of struct iio_poll_func to avoid warnings

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-28 14:39:33 -07:00
Michael Hennerich 71646e2c7a iio: industrialio-core: introduce IIO_VAL_INT_PLUS_NANO
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-28 14:39:32 -07:00
Geert Uytterhoeven 928f911166 Staging: iio: Make IIO depend on GENERIC_HARDIRQS
On m68k (which doesn't support generic hardirqs yet):

drivers/staging/iio/industrialio-trigger.c: In function ‘iio_trigger_poll’:
drivers/staging/iio/industrialio-trigger.c:180: error: implicit declaration of function ‘generic_handle_irq’
drivers/staging/iio/industrialio-trigger.c: In function ‘iio_trigger_poll_chained’:
drivers/staging/iio/industrialio-trigger.c:200: error: implicit declaration of function ‘handle_nested_irq’
drivers/staging/iio/industrialio-trigger.c: In function ‘iio_trig_release’:
drivers/staging/iio/industrialio-trigger.c:379: error: implicit declaration of function ‘irq_modify_status’
drivers/staging/iio/industrialio-trigger.c:382: error: implicit declaration of function ‘irq_set_chip’
drivers/staging/iio/industrialio-trigger.c:384: error: implicit declaration of function ‘irq_set_handler’
drivers/staging/iio/industrialio-trigger.c:388: error: implicit declaration of function ‘irq_free_descs’
drivers/staging/iio/industrialio-trigger.c: In function ‘iio_trig_subirqmask’:
drivers/staging/iio/industrialio-trigger.c:402: error: implicit declaration of function ‘irq_data_get_irq_chip’
drivers/staging/iio/industrialio-trigger.c:402: warning: initialization makes pointer from integer without a cast
drivers/staging/iio/industrialio-trigger.c: In function ‘iio_trig_subirqunmask’:
drivers/staging/iio/industrialio-trigger.c:411: warning: initialization makes pointer from integer without a cast
drivers/staging/iio/industrialio-trigger.c: In function ‘iio_allocate_trigger’:
drivers/staging/iio/industrialio-trigger.c:432: error: implicit declaration of function ‘irq_alloc_descs’
drivers/staging/iio/industrialio-trigger.c:455: error: ‘handle_simple_irq’ undeclared (first use in this function)
drivers/staging/iio/industrialio-trigger.c:455: error: (Each undeclared identifier is reported only once
drivers/staging/iio/industrialio-trigger.c:455: error: for each function it appears in.)

Hence IIO_TRIGGER should depend on GENERIC_HARDIRQS.
But as IIO_TRIGGER and IIO_RING_BUFFER form a maze of dependencies and selects,
just make the whole IIO subsystem depend on GENERIC_HARDIRQS.

This dependency also covers !S390, so that one can be removed again.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-27 14:19:21 -07:00
Randy Dunlap fdf2df0e8c Staging: fix iio builds when IIO_RING_BUFFER is not enabled
Fix build by moving enum list outside of
#ifdef CONFIG_IIO_RING_BUFFER.

drivers/staging/iio/accel/adis16201_core.c:413: error: 'ADIS16201_SCAN_SUPPLY' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:417: error: 'ADIS16201_SCAN_TEMP' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:422: error: 'ADIS16201_SCAN_ACC_X' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:427: error: 'ADIS16201_SCAN_ACC_Y' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:432: error: 'ADIS16201_SCAN_AUX_ADC' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:436: error: 'ADIS16201_SCAN_INCLI_X' undeclared here (not in a function)
drivers/staging/iio/accel/adis16201_core.c:441: error: 'ADIS16201_SCAN_INCLI_Y' undeclared here (not in a function)

vers/staging/iio/accel/adis16203_core.c:374: error: 'ADIS16203_SCAN_SUPPLY' undeclared here (not in a function)
drivers/staging/iio/accel/adis16203_core.c:378: error: 'ADIS16203_SCAN_AUX_ADC' undeclared here (not in a function)
drivers/staging/iio/accel/adis16203_core.c:382: error: 'ADIS16203_SCAN_INCLI_X' undeclared here (not in a function)
drivers/staging/iio/accel/adis16203_core.c:388: error: 'ADIS16203_SCAN_INCLI_Y' undeclared here (not in a function)
drivers/staging/iio/accel/adis16203_core.c:392: error: 'ADIS16203_SCAN_TEMP' undeclared here (not in a function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-27 14:19:21 -07:00
Randy Dunlap 89089158d1 Staging: fix more iio builds when IIO_RING_BUFFER is not enabled
Fix lots more build errors in staging/iio when CONFIG_IIO_RING_BUFFER
is not enabled by moving enums and defines outside of the
CONFIG_IIO_RING_BUFFER ifdef block.

Examples (one from each driver; there were 116 total errors):

drivers/staging/iio/accel/adis16204_core.c:437: error: 'ADIS16204_SCAN_SUPPLY' undeclared here (not in a function)
drivers/staging/iio/accel/adis16209_core.c:410: error: 'ADIS16209_SCAN_SUPPLY' undeclared here (not in a function)
drivers/staging/iio/gyro/adis16260_core.c:420: error: 'ADIS16260_SCAN_GYRO' undeclared here (not in a function)
drivers/staging/iio/imu/adis16400_core.c:565: error: 'ADIS16400_SCAN_SUPPLY' undeclared here (not in a function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-27 14:19:20 -07:00
Roland Stigge 8aa460e9e9 staging: iio: max517: Fix iio_info changes
struct iio_info introduced a bug where the second channel of a MAX518 can't be
used. This commit fixes the typo (using max518 instead of the max517 struct).

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-09 10:07:47 -07:00
Andre Bartke 53aebb5312 staging: iio: error case memory leak fix
The data pointer should be freed in the error
cases of adis16400_trigger_handler().

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 12:28:43 -07:00
Michael Hennerich c11c4eebdd staging: iio: industrialio-trigger: set iio_poll_func private_data
Failure to set iio_poll_func private_data, causes zero pointer access
violations in all consumer trigger handlers.

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-07 12:28:41 -07:00
Jonathan Cameron db60697a08 staging:iio: Trivial kconfig reorganization and uniformity improvements.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:06 -07:00
Jonathan Cameron 44d8b3542f staging:iio:documenation partial update.
More to be added, but this brings the docs in line with
the current code. Now they are hopefully just uninformative
rather than actually incorrect.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:06 -07:00
Jonathan Cameron 0ed731d234 staging:iio: use pollfunc allocation helpers in remaining drivers.
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-19 16:15:06 -07:00
Jonathan Cameron 58f0a25545 staging:iio:max1363 misc cleanups and use of for_each_bit_set to simplify event code spitting out.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:05 -07:00
Jonathan Cameron 6fe8135fcc staging:iio: implement an iio_info structure to take some of the constant 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-19 16:15:05 -07:00
Michael Hennerich a3f02370c9 staging:iio:meter:ade7758: Use private data space from iio_allocate_device
Use private data space from iio_allocate_device.
Drop dev_data in favor of iio_priv().
Fix indention issues from previous patches.

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-19 16:15:05 -07:00
Jonathan Cameron 7df86302f4 staging:iio:accel:lis3l02dq make write_reg_8 take value not a pointer to value.
Silliness that has been there a long time.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:05 -07:00
Jonathan Cameron 8d213f24f2 staging:iio: ring core cleanups + check if read_last available in lis3l02dq
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:05 -07:00
Jonathan Cameron c74b0de166 staging:iio:core cleanup: squash tiny wrappers and use dev_set_name to handle creation of event interface name.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:04 -07:00
Jonathan Cameron 21b185f8d5 staging:iio: poll func allocation clean up.
Add a function to neatly deal with allocation of poll functions.
Ultimately this allows us to more easily change the implementation.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:04 -07:00
Jonathan Cameron e3796e6bbb staging:iio:ad7780 trivial unused header cleanup.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:04 -07:00
Michael Hennerich f07458ad8f staging:iio:adc: AD7780: Use private data space from iio_allocate_device + 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-19 16:15:04 -07:00
Michael Hennerich 643ea260b4 staging:iio:adc:AD7780: Convert to new channel registration method
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-19 16:15:04 -07:00
Michael Hennerich 44039a671e staging:iio:adc: AD7606: Drop dev_data in favour of iio_priv()
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-19 16:15:03 -07:00
Michael Hennerich b9c445155e staging:iio:adc: AD7606: Consitently use indio_dev
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-19 16:15:03 -07:00
Jonathan Cameron 7b2fdd192f staging:iio: Rip out helper for software rings.
It seemed like a good idea at the time, it wasn't.
The code with this in place is larger and more complex for
no real gain.  Basically we've cleaned up the core around
it so much that this no longer makes sense.

Only really effects the lis3l02dq driver.

Signed-off-by: Jonathan Cameron <jic23@cam.acuk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:03 -07:00
Michael Hennerich cc4a48e4cf staging:iio:adc:AD7298: Use private data space from iio_allocate_device
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-19 16:15:03 -07:00
Jonathan Cameron 5565a45024 staging:iio: rationalization of different buffer implementation hooks.
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-19 16:15:03 -07:00
Jonathan Cameron 38d15f06f9 staging:iio:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev.
Uses the iio_allocate_device parameter to set aside space for adis16400_state and
____cacheline_aligned buffers for tx and rx to avoid separatel allocating them.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:03 -07:00
Jonathan Cameron 59c85e82c2 staging:iio:trigger handle name attr in core, remove old alloc and register any control_attrs via struct device
As the majority of triggers don't actually have any other control_attrs lets use the fact
that struct device has a groups element when we do need to have these attributes registered.
A vargs function is used to cut down on lots of building strings in every single driver
just in order to pass them into the allocate.

Also iio_allocate_trigger_named -> iio_allocate_trigger as there is no
unamed version any more, so that is now just confusing.

Blackfin tested and fixed by Michael Hennerich.

V2: Elements from Michael Hennerich's patches for the ade7758

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:02 -07:00
Jonathan Cameron 3b8ebfb47f staging:iio: iio_event_interfaces - clean out unused elements
Also removed const casting of _name that was unnecessary.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:02 -07:00
Jonathan Cameron d731aea081 staging:iio:lis3l02dq remerge the two interrupt handlers.
Does add a small burden to both handlers, but the gain is somewhat
simpler code.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:02 -07:00
Jonathan Cameron 02db0bb33a staging:iio:buffer - remove unused event code for buffer events.
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-19 16:15:01 -07:00
Jonathan Cameron 383f650f6c staging:iio:addac:adt7316 replace abuse of buffer events.
Currently squashed the fault condition from external
temperature sensor - lots of other issues to be fixed
with this driver which obeys almost no elements of the
abi.

V2: removed a couple of usused variables that sparse found.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:01 -07:00
Jonathan Cameron d1ab8552cd staging:iio:adc:adt7410 replace abuse of buffer events.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:01 -07:00
Jonathan Cameron e7a2c32383 staging:iio:adc:adt7310 replace abuse of buffer events.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:01 -07:00
Jonathan Cameron b206c3bbb4 staging:iio:adc:ad7291 remove abuse of buffer events and replace with 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-19 16:15:01 -07:00
Jonathan Cameron 0bb8be6431 staging:iio:adc:ad7816 and adt75 change to meaningful event code.
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-19 16:15:00 -07:00
Jonathan Cameron d91a0ab06c staging:iio:adc:ad7150 fix event codes.
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-19 16:15:00 -07:00
Jonathan Cameron 41c775240a staging:iio:core clean out unused elements.
Trivial cleanup of things that have fallen by the way.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:00 -07:00
Jonathan Cameron 1f785681a8 staging:iio:trigger sysfs userspace trigger rework.
Awaiting comments on using the nested_irq_trick so that may change.
Moves away from platform device to sysfs controlled creation and
removal of these triggers.

Fix double free of name on trigger allocation failure thanks
to Michael Hennerich.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Reviewed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:15:00 -07:00
Jonathan Cameron 586d15255d staging:iio:max1363 add new 2 channels parts form maxim, 11644-7
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-19 16:14:59 -07:00
Jonathan Cameron bb20d65dbc staging:iio:max1363 trivial removal of unused trig pointer.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:59 -07:00
Jonathan Cameron a88b3ebc91 staging:iio: rip out scan_el attributes. Now handled as iio_dev_attrs like everything else.
Drivers have no need to use this functionality any more and we save a lot of
code by getting rid of it.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:59 -07:00
Michael Hennerich 8a27a023f8 staging:iio:meter:ade7758: Use iio channel spec and miscellaneous other changes.
Use iio channel spec for the ring buffer channels.
Add/update file comment/license headers.
Use available_scan_masks to prevent that multiple channels are enabled.
Remove wavefrom type attributes. (no handled directly by the scan_elements)
Use SPI_MODE_1.
Move ade7758_initial_setup() before ade7758_probe_trigger() to ensure the
ADE7758 interrupt is disabled when the host interrupt get's enabled.
Add spi_device_id.
Update ring buffer setup.

Some backporting needed to ensure driver builds all the way through core
changes.

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-19 16:14:59 -07:00
Michael Hennerich 9308bc9af0 staging:iio:meter:ade7758: Fix list and set of available sample frequencies.
Fix list of available sample frequencies.
Fix ade7758_write_frequency().

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-19 16:14:59 -07:00
Michael Hennerich fb7f6ccac2 staging:iio:meter:ade7758: Fix return value of ade7758_write_reset
Update file comment/license header.

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-19 16:14:58 -07:00
Michael Hennerich f535e08eb6 staging:iio:meter:ade7758: Fix timing on SPI read accessor functions.
According to the ADE7758 datasheet the minimum time between read command
(that is, a write to communication register) and data read must not be
less than 4us.

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-19 16:14:58 -07:00
Michael Hennerich 69c272cc8e staging:iio:meter:ade7758: Update trigger to the new API
Update trigger to the new API.
Add file comment/license header.

Some backporting needed to keep the driver building all the way
through the core changes.

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-19 16:14:58 -07:00
Michael Hennerich faf290e867 staging:iio: Add channel types IIO_CURRENT and IIO_POWER.
This is required for the ADE7758 driver cleanup.

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-19 16:14:58 -07:00
Michael Hennerich e61181d0a3 staging:iio:adc:ad7606: Use private data space from iio_allocate_device
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-19 16:14:57 -07:00
Michael Hennerich 1caf7cb461 staging:iio:adc:ad7606 Convert to new channel registration method Update Add 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-19 16:14:57 -07:00
Jonathan Cameron 29b7f43ef4 staging:iio:gyro:adis16260 move to chan_spec based setup.
For clean drivers its easier to convert to chan_spec based
registration than to work around the scan_el attributes
going away.

Some minor cleanups done whilst here.

Untested.
V3: rebase fixup and make attribute_group static.

V2: IIO_CHAN macro updates.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:57 -07:00
Jonathan Cameron cd69f57dee staging:iio:accel:adis16240 move to chan_spec based setup.
For clean drivers its easier to convert to chan_spec based
registration than to work around the scan_el attributes
going away.

Some minor cleanups done whilst here.

Untested.
V2: IIO_CHAN macro use updated.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:57 -07:00
Jonathan Cameron eb7fea53e5 staging:iio: Add chan info support for 'peak_raw' attributes.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:57 -07:00
Jonathan Cameron 1e8fa5b863 staging:iio:accel: lis3l02dq add writing for calibscale and calibbias.
This was missed out in original chan_spec conversion.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:56 -07:00
Michael Hennerich 01a99e1823 staging:iio:adc:ad7298: Convert to new channel registration method
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-19 16:14:56 -07:00
Jonathan Cameron 6684e5b47d staging:iio:adc:ad799x removed unused headers.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:56 -07:00
Michael Hennerich 1bf7ac76cc staging:iio:adc:ad799x: Use private data space from iio_allocate_device
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-19 16:14:56 -07:00
Michael Hennerich d22fd9c553 staging:iio:adc:ad799x: Convert to new channel registration method.
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-19 16:14:56 -07:00
Michael Hennerich f39e086adc staging:iio:adc:ad7887: 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-19 16:14:55 -07:00
Michael Hennerich 596d06097f staging:iio:adc:ad7887: Convert to new channel registration method.
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-19 16:14:55 -07:00
Jonathan Cameron a34c26dcd4 staging:iio:accel:adis16209 move to chan_spec based setup.
For clean drivers its easier to convert to chan_spec based
registration than to work around the scan_el attributes
going away.

Some minor cleanups done whilst here.

Untested.

V2: IIO_CHAN macro used.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:55 -07:00
Jonathan Cameron ad3eb9ab12 staging:iio:accel:adis16204 move to chan_spec based setup.
For clean drivers its easier to convert to chan_spec based
registration than to work around the scan_el attributes
going away.

Some minor cleanups done whilst here.

Untested.

V2: used IIO_CHAN macro

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:55 -07:00
Jonathan Cameron d37b24b3c0 staging:iio:accel:adis16203 move to chan_spec based setup.
Mainly motivated by wish to remove the remaing users of the
scan helpers.

Some minor cleanups done whilst here.

Untested.

V2: Use IIO_CHAN macro
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:54 -07:00
Jonathan Cameron cf96ffd8c2 staging:iio:accel:adis16201 move to chan_spec based setup.
Mainly motivated by wish to remove the remaing users of the
scan helpers.

Some minor cleanups done whilst here.

Untested.

V2: IIO_CHAN macro used.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:54 -07:00
Jonathan Cameron cbcdf4dd4f staging:iio:light:tsl2563: chan_spec based channel setup.
Makes a small interface change by splitting event _en attr
in two.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:54 -07:00
Jonathan Cameron 845bd12ac7 staging:iio: use the new central name attribute creation code
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:54 -07:00
Jonathan Cameron 1b732888d8 staging:iio: Add core attribute handling for name of device.
Saves on a fair bit of code replication.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:54 -07:00
Jonathan Cameron 51c060a069 staging:iio:trigger remove legacy pollfunc elements.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:53 -07:00
Jonathan Cameron 504b4958ff staging:iio:gyro:adis16260 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:53 -07:00
Jonathan Cameron 36177c0318 staging:iio:adc:ad799x move to irqchip based trigger handling.
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-19 16:14:53 -07:00
Jonathan Cameron e362dfbb69 staging:iio:adc:ad7887 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:53 -07:00
Jonathan Cameron 13cfac2038 staging:iio:adc:ad7606 conversion to irq_chip based polling.
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-19 16:14:52 -07:00
Jonathan Cameron 70d4fd3fcd staging:iio:adc:ad7298 move to irqchip based trigger handling.
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-19 16:14:52 -07:00
Jonathan Cameron d6d30d2685 staging:iio:accel:adis16240 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:52 -07:00
Jonathan Cameron d7e044f146 staging:iio:accel:adis16209 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:52 -07:00
Jonathan Cameron 80142f0de6 staging:iio:accel:adis16204 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:52 -07:00
Jonathan Cameron f3dadc1dd2 staging:iio:accel:adis16203 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:51 -07:00
Jonathan Cameron 05c2858d2f staging:iio:accel:adis16201 move to irqchip based trigger handling.
Untested.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:51 -07:00
Jonathan Cameron 20e79c515f staging:iio:imu remove adis16300 driver.
Support is now provided by the unified adis16400 driver.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:51 -07:00
Jonathan Cameron 8e886e651f staging:iio:imu:adis16400 add support for adis16300
Next patch will remove original driver.
Note this leaves holes in the scan indexing.

Untested - except via adis16350...

V3: rebase fixup.
V2: move to single IIO_CHAN macro.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:51 -07:00
Jonathan Cameron 70987b81ec staging:iio:imu remove old adis16350. Support now in adis16400 driver.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:51 -07:00
Jonathan Cameron 2a29a90b58 staging:iio:imu:adis16350 etc support into adis16400 driver.
Next patch will remove the current adis16350 driver.
These should have been merged a long time ago, but there we are.

V3: rebase fixup + add missing extend_name for supply on adis16350

V2: Move to single IIO_CHAN macro + use the new extend_name
to make the naming of the temperature sensors contain x, y, z
rather than messing with modifiers.  This a very weird case
and I don't want temperature to use axial modifiers.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:50 -07:00
Jonathan Cameron e78548455d staging:iio:imu:adis16400 move to irq based triggers and channel spec channel registration.
V2: rebase fixup.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:50 -07:00
Jonathan Cameron 3f00ca47fc staging:iio:meter:ade7758 move to irqchip based trigger handling.
Untested

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:50 -07:00
Jonathan Cameron f20546e004 staging:iio:adc:ad7476 move to irqchip based triggering
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>
2011-05-19 16:14:50 -07:00
Jonathan Cameron c5e0819e2d staging:iio:adc:ad7476 use channel_spec
V3: Trivial rebase fixup.
V2: Move to new single IIO_CHAN macro.

Done without hardware.

Fix from Michael Hennerich incorporated to use
iio_ring_buffer_register_ex instead of
iio_ring_buffer_register and thus actually make it work.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:49 -07:00
Jonathan Cameron 6da288a35b staging:iio:adc:max1363 move to irqchip based threaded irq triggering
V2: Fixed missing free of pollfunc->name as pointed out by
Michael Hennerich.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:49 -07:00
Jonathan Cameron d1dbf01128 staging:iio:accel:lis3l02dq move to threaded trigger handling.
V2: Cleaned up handling of name string.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:49 -07:00
Jonathan Cameron 8384d9573e staging:iio: add generic data ready poll function.
This case is extremely common, so let us only have the one
copy.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:49 -07:00
Jonathan Cameron e058003265 staging:iio:ring_sw add function needed for threaded irq.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:49 -07:00
Jonathan Cameron 52615d4783 staging:iio:Documentation generic_buffer.c update to new abi for buffers + misc fixes
Trivial space before newline fix incorporated.

Additional fixes related to handling of sign extension and shifted
data.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>

squash into buffer handling update.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:48 -07:00
Jonathan Cameron d96d1337e3 staging:iio: Add infrastructure for irq_chip based triggers
V3: Get rid of separate interrupt pool. This is well handled
    by irq_get_descs and irq_free_descs.  Two functions I simply
    wasn't aware of previously.  Thus the allocation for a given
    trigger is now handled by core code rather than us reinventing
    the wheel.

V2: Stop silly name duplication.
    Move pool handling to industrialio-trigger as that is the only user.
    Changed over to using irq_modify_status rather than the arm
    specific set_irq_flags as per Thomas Gleixner's suggestion.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 16:14:48 -07:00