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>
Jonathan Cameron [Wed, 18 May 2011 13:42:26 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:24 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:23 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:22 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:19 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:18 +0000 (14:42 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:42:15 +0000 (14:42 +0100)]
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>
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>
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>
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>
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>
Jonathan Cameron [Wed, 18 May 2011 13:41:37 +0000 (14:41 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:41:28 +0000 (14:41 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:41:18 +0000 (14:41 +0100)]
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>
Jonathan Cameron [Wed, 18 May 2011 13:41:12 +0000 (14:41 +0100)]
staging:iio:adc:adt7410 move to current event handling
This device actually has a pair of interrupts. The code basically ignores
that and feeds them both to the same handlers. I'm not sure if that is
the right thing to do, but the updated code should do exactly the same.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:07 +0000 (14:41 +0100)]
staging:iio:adc:ad7816 move from old to current event handling.
I'm not sure what the event is and am very much against the dodgy
hack to give it a code. However for now, lets just stop it using
the deprecated core handling so we can move on.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:06 +0000 (14:41 +0100)]
staging:iio:adc:ad7745 move from old to current event handling.
Nice simple one. Not sure we actually want devices outputting
datardy signals like that, but I'll leave it for now.
Cleaned up some unneeded functions whilst here.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:05 +0000 (14:41 +0100)]
staging:iio:adt7316 get rid of legacy event handling code.
Note this driver is still a long way from being abi compliant.
What I have done here cleans up a few corners, but primarily gets
it away from using the infrastructure that is going away.
Untested
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Wed, 18 May 2011 13:41:02 +0000 (14:41 +0100)]
staging:iio:buffering remove unused parameter dead_offset from read_last_n in all buffer implementations.
This element has been usused by the core for quite some time. sca3000 set it none the less
until the rewrite in the previous patch (and hence didn't work).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>