summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel/lis3l02dq_ring.c
AgeCommit message (Collapse)Author
2012-07-15iio staging: fix cast warning and cleanup alignment codeiio-fixes-3.6bPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:lis3l02dq: Do not return error code in interrupt handlerLars-Peter Clausen
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:__lis3l02dq_write_data_ready_config: Pass IIO device directlyLars-Peter Clausen
When calling __lis3l02dq_write_data_ready_config 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-29staging:iio: Streamline API function namingLars-Peter Clausen
Currently we use two different naming schemes in the IIO API, iio_verb_object and iio_object_verb. E.g iio_device_register and iio_allocate_device. This patches renames instances of the later to the former. The patch also renames allocate to alloc as this seems to be the preferred form throughout the kernel. In particular the following renames are performed by the patch: iio_put_device -> iio_device_put iio_allocate_device -> iio_device_alloc iio_free_device -> iio_device_free iio_get_trigger -> iio_trigger_get iio_put_trigger -> iio_trigger_put iio_allocate_trigger -> iio_trigger_alloc iio_free_trigger -> iio_trigger_free The conversion was done with the following coccinelle patch with manual fixes to comments and documentation. <smpl> @@ @@ -iio_put_device +iio_device_put @@ @@ -iio_allocate_device +iio_device_alloc @@ @@ -iio_free_device +iio_device_free @@ @@ -iio_get_trigger +iio_trigger_get @@ @@ -iio_put_trigger +iio_trigger_put @@ @@ -iio_allocate_trigger +iio_trigger_alloc @@ @@ -iio_free_trigger +iio_trigger_free </smpl> 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 Cameron
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 scan_timestamp to the core as well as buffers.Jonathan Cameron
This will be needed when multiple buffer support is added. 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-04-24staging:iio: add caching of the number of bytes in a scan.Jonathan Cameron
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-03-02drivers:staging:iio Fix typos and comments in staging iio.Justin P. Mattock
The below patch fixes some comments and some typos that I have found while reading drivers/staging/iio/* Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09staging:iio: Setup buffer access functions when allocating the bufferLars-Peter Clausen
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:accel:lis3l02dq scrap reading from buffer for sysfs access.Jonathan Cameron
No obvious usecase and complicates in kernel interface work. 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:buffer remove unused owner field from struct iio_bufferJonathan Cameron
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 Cameron
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 Cameron
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 Cameron
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-11-30staging: iio: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer
The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.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 Gortmaker
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:accel:lis3l02dq ring->buffer renames.Jonathan Cameron
This driver already supports kfifo usage, so the term ring is misleading and hence replaced. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26staging:iio: replacing term ring with buffer in the IIO core.Jonathan Cameron
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 Cameron
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 Cameron
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 ↵Jonathan Cameron
channels. 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 Cameron
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 Cameron
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 ↵Jonathan Cameron
struct iio_dev. 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:accel header housekeeping - remove unecessary includes.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23staging:iio:accel: usused header removals.Jonathan Cameron
Missing from the iio_chan_spec conversion patches. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23staging:iio:triggers introduce iio_trigger_ops to take const bits out of ↵Jonathan Cameron
iio_trig_structure. Right now this results in increased code, but I still think it is worth doing to avoid replication across instances of drivers etc and move as much stuff as possible to constant. Ops structure is optional for the occasional driver that uses none of it (currently only the ad7793). 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:accel:lis3l02dq make write_reg_8 take value not a pointer to value.Jonathan Cameron
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-19staging:iio: ring core cleanups + check if read_last available in lis3l02dqJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio: Rip out helper for software rings.Jonathan Cameron
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-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:trigger handle name attr in core, remove old alloc and register ↵Jonathan Cameron
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-19staging:iio:lis3l02dq remerge the two interrupt handlers.Jonathan Cameron
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-19staging:iio:accel:lis3l02dq move to threaded trigger handling.Jonathan Cameron
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-19staging:iio: lis3l02dq - separate entirely interrupt handling for thesholds ↵Jonathan Cameron
from that for the datardy signal. This removes the one and only real user of the rather complex event list management. V3: More trivial rebase fixups. V2: Trivial rebase fixup. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:lis3l02dq: General cleanupJonathan Cameron
As Arnd observed, things are clearner if we pass iio_dev into read and write fucntions. Now uses st for lis3l02dq_state everywhere. Other bits of trivial tidying. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:lis3l02dq - move to new channel_spec approach.Jonathan Cameron
V3: Move to single IIO_CHAN macro. V2: Update to two part read_raw value. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-02-18staging:iio:lis3l02dq allow buffer implementation selectionJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16drivers/staging: Remove unnecessary semicolonsJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21staging: iio: lis3l02dq add _index attribute registrationJonathan Cameron
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 Cameron
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: lis3l02dq add _type attributes for all scan elementsJonathan Cameron
Also, adds a macro to make defining such attributes simple. 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-04staging: iio: Make use of the convenient IIO_TRIGGER_NAME_ATTR macroJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: iio move scan_elements into ring bufferManuel Stahl
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: lis3l02dq adjust lis3l02dq_configure_ringManuel Stahl
Now fits other driver's structure for easier modification. 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 Stahl
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: lis3l02dq: use iio_sw_ring_helper_state and funcsJonathan Cameron
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: Make extensive use of iio_sw_ring_preenableJonathan Cameron
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>