aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/imu/adis16400_ring.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-01-26staging:iio: Move adis16400 out of stagingLars-Peter Clausen1-96/+0
This adis16400 driver is in pretty good shape now, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Preallocate transfer messageLars-Peter Clausen1-134/+58
Similar to like we already did for the generic adis library preallocate and pre-construct the SPI transfer message for the adis16400. For devices which do not support burst mode sampling does not differ from other adis devices and so we use the generic functions of the adis library in this case. In burst mode we can only sample all channels at once, so use the IIO cores demux facility instead of doing this manually. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Use triggered buffer setup helper functionLars-Peter Clausen1-40/+7
Use the triggered buffer helper functions to setup and tear down the buffer for the adis16400 instead of doing this manually. This also means that we switch away from the deprecated sw_ring buffer and use the kfifo buffer now instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16400: Use adis libraryLars-Peter Clausen1-29/+30
Use the new adis library for the adis16400 driver. This allows us to completely scrap the adis16400 trigger code and more than half of the core driver code. For now we can not make use of the generic adis buffer implementation since the adis16400 driver has special requirements due to its burst mode support. But we will eventually get to this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio: Add support for multiple buffersJonathan Cameron1-3/+2
Route all buffer writes through the demux. Addition or removal of a buffer results in tear down and setup of all the buffers for a given device. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
2012-09-08iio: Drop timestamp parameter from buffer store_to callbackLars-Peter Clausen1-1/+1
Drop timestamp parameter from buffer store_to callback and subsequently from iio_push_to_buffer. The timestamp parameter is unused and it seems likely that it will stay unused in the future, so it should be safe to remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-06staging:iio: Use iio_push_to_bufferLars-Peter Clausen1-1/+1
Consistently use iio_push_to_buffer instead of manually calling the buffers store_to callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:adis16400: Do not return error code in the interrupt handlerLars-Peter Clausen1-8/+5
The interrupt handler should only ever return one of the three irqreturn_t constants and not an error code. Also make sure to always call iio_trigger_notify_done before leaving the trigger handler. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-05-14staging:iio:adis16400_ring: Pass IIO device directlyLars-Peter Clausen1-7/+5
When calling adis16350_spi_read_all and adis16400_spi_read_burst we pass the device struct of embedded in the IIO device only to look up the IIO device from the device struct again right away. This patch changes the code to pass the IIO device directly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25IIO: Move core headers to include/linux/iioJonathan Cameron1-2/+2
Step 1 in moving the IIO core out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging:iio: add caching of the number of bytes in a scan.Jonathan Cameron1-2/+2
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging:iio: Setup buffer access functions when allocating the bufferLars-Peter Clausen1-2/+0
Setup the buffer access functions in the buffer allocate function. There is no need to let each driver handle this on its own. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-08staging:iio:buffer remove unused owner field from struct iio_bufferJonathan Cameron1-1/+0
Legacy of having multiple chrdevs that never got cleaned up. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging:iio: scrap scan_count and ensure all drivers use active_scan_maskJonathan Cameron1-8/+11
Obviously drivers should only use this for pushing to buffers. They need buffer->scan_mask for pulling from them post demux. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging:iio:buffer move setup ops from buffer instance to iio_devJonathan Cameron1-1/+1
These callbacks should not be buffer instance specific. Hence move them out of the buffer. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging:iio:buffer drop bpe field.Jonathan Cameron1-1/+0
Has no remaining users. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-31staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users.Paul Gortmaker1-0/+1
Lots of drivers have in the past expected the presence of basic things like THIS_MODULE and EXPORT_SYMBOL. With the header cleanup, they wont have these. Call out the include explicitly. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-26staging:iio: replacing term ring with buffer in the IIO core.Jonathan Cameron1-13/+12
They aren't always ring buffers, so just use buffer for all naming. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26staging:iio: tree wide IIO_RING_TRIGGERED -> IIO_BUFFER_TRIGGEREDJonathan Cameron1-1/+1
also, IIO_RING_HARDWARE_BUFFER -> IIO_BUFFER_HARDWARE These aren't always rings so the naming should not imply that. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26staging:iio: treewide rename iio_triggered_ring_* to iio_triggered_buffer_*Jonathan Cameron1-2/+2
Not always a ring so naming is missleading. Also, kfifo_buf is probably first buffer to take out of staging and it definitely isn't a ring. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06staging:iio: Switch the channel masks to bitmaps so as to allow for more channels.Jonathan Cameron1-2/+3
This is as light as possible on changes to current drivers. Some drivers make assumptions that their masks fit in a single long. Given they were previously working this is clearly valid if not tidy. The max1363 is an example where there should be no such assumptions. V2: Add the new ad5933 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-09-06staging:iio:various move default scan mask setting after ring register or removeJonathan Cameron1-3/+0
The scan mask will be dynamically assigned in register, so don't use it before that. In adis16260 I've moved it as I know this driver has userspace code. Same for sca3000 where it is cost free due to hardware buffer. Can do that for the others, but in theory userspace code should always have been checking these and setting them appropriately anyway! V2: Clear default mask out of adis16400 as reported by Michael Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Reported-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24staging:iio: spit trigger.h into provider and consumer parts.Jonathan Cameron1-1/+1
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24staging:iio:pollfunc: Make explicit that private data is always pointer to a struct iio_dev.Jonathan Cameron1-1/+1
This is always true, so lets make it explicit. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23staging:iio:various header includes that should never have been.Jonathan Cameron1-1/+0
I will assume these were cut and pastes messup. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23staging:iio:imu:adis16400 remove now unused headers.Jonathan Cameron1-7/+0
These should really have gone away with the code that needed them. 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-07staging: iio: error case memory leak fixAndre Bartke1-3/+7
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-05-19staging:iio: poll func allocation clean up.Jonathan Cameron1-14/+9
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-19staging:iio: rationalization of different buffer implementation hooks.Jonathan Cameron1-6/+10
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:imu:adis16400 avoid allocating rx, tx, and state separately from iio_dev.Jonathan Cameron1-9/+8
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-19staging:iio:imu:adis16350 etc support into adis16400 driver.Jonathan Cameron1-19/+70
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-19staging:iio:imu:adis16400 move to irq based triggers and channel spec channel registration.Jonathan Cameron1-121/+39
V2: rebase fixup. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05staging: IIO: IMU: ADIS16400: Make sure only enabled scan_elements are pushed into the ringMichael Hennerich1-3/+7
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> CC: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05staging: IIO: IMU: ADIS16400: Fix up SPI messages cs_change behaviorMichael Hennerich1-2/+0
cs_change must not be set in the last transfer of a spi message Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> CC: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08staging: iio: adc add numbers to naming of all adc channels as needed to associate events with them.Jonathan Cameron1-12/+12
Given event codes are associated by number not name, all adc channels including those with names need to have numbers. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21staging: iio: adis16400 add _index attribute registrationJonathan Cameron1-0/+13
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21staging: iio: Remove unused bit_count from struct iio_scan_elJonathan Cameron1-23/+12
The job this was intended to do (never implemented) is now done by explicit definition of _type attributes in all drivers Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21staging: iio: adis16400 add _type attributes for all scan elementsJonathan Cameron1-0/+15
The bit depth of 14 for the supply adc on the datasheet is highly suspicious. Confirmation requested from Analog. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: iio sync drivers with current ABIManuel Stahl1-6/+6
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: iio move scan_elements into ring bufferManuel Stahl1-25/+24
tested with sca3000, adis16400 Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: iio rename ring attributesManuel Stahl1-1/+1
bps -> bytes_per_datum ring_enable -> enable Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Make extensive use of iio_sw_ring_preenableJonathan Cameron1-24/+2
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Add stubs for iio_ring_buffer_[un]register and equivalent driver stubsJonathan Cameron1-10/+0
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: replace combine_8_to_16 with be16_to_cpup where possible.Jonathan Cameron1-14/+3
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: remove timestamp field from trigger and pass instead through pollfuncsJonathan Cameron1-2/+2
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Add iio_triggered_ring postenable and predisable + use in driversJonathan Cameron1-18/+2
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Add and convert drivers to use iio_alloc_pollfuncJonathan Cameron1-7/+4
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18Staging: iio: adis16400: fix some minor issues and clean-upBarry Song1-0/+48
1. move adis16400_spi_read_burst() to adis16400_ring.c since it is only called there 2. add the lost calling to adis16400_self_test() 3. codes cleanup Signed-off-by: Barry Song <21cnbao@gmail.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18Staging: iio: pull in slab.h for kmalloc funcsMike Frysinger1-0/+1
These drivers use kzalloc() but don't include slab.h. They currently build though because the spi.h header will pull in slab.h for us. But rather than rely on that behavior forever, include slab.h explicitly. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11staging:iio:imu ADIS16400 and ADIS16405 driverBarry Song1-0/+245
Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Barry Song <Barry.Song@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>