aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/ring_sw.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-01-26staging:iio: drop sw_ring buffer implementation.Jonathan Cameron1-30/+0
Whilst this is IIO's oldest buffer implementation it is messy, poorly implemented and whilst it works, no one is entirely sure it always will. New IIO drivers have not been using this for some time and now all remaining old users have been converted to use the kfifo based alternative. Clearly a fifo isn't the same as a ring buffer but in many use cases it really doesn't matter. We also loose the watershed based poll implementation. However having poll effectively report data only when the buffer was half full was at best an 'unusual' use of the interface. At somepoint in the future we may bring watersheds back on a different buffer implementation, but then we will think a lot more about how to do the interface first. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-04-25IIO: Move core headers to include/linux/iioJonathan Cameron1-1/+1
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-02-09staging:iio: Setup buffer access functions when allocating the bufferLars-Peter Clausen1-5/+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-11-26staging:iio: header reorganizationJonathan Cameron1-1/+1
Issue brought up by Lars-Peter Clausen. This is a varient of what he suggested. io/iio.h for driver stuff (has to include types.h) Sub files for the bits drivers may or may not use iio/sysfs.h iio/buffer.h (contents of current buffer_generic.h) (obviously anything offering events will need events.h as well) iio/types.h for the enums that matter to both iio_chan_type, iio_modifier iio/events.h for the event code stuff IIO_EVENT_CODE and friends. + everything in chrdev.h So this is the stuff that userspace cares about. Also include iio_event_type, iio_event_direction Thus iio drivers include iio.h + as required events.h sysfs.h buffer.h in kernel users (once that interface is merged) will need inkern.h which will pull in types.h Userspace will need just events.h (which pulls in types.h) to get everything they need to know about. Buffer userspace access doesn't currently need any core defines. All information about the data format is passed through sysfs. 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 Cameron1-3/+3
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: rename ring_generic.h -> buffer_generic.hJonathan Cameron1-1/+1
Nothing in this file is specific to RING buffers so rename it. 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 Cameron1-19/+0
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 Cameron1-174/+2
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:ring_sw add function needed for threaded irq.Jonathan Cameron1-0/+1
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19staging:iio:buffering remove unused parameter dead_offset from read_last_n in all buffer implementations.Jonathan Cameron1-3/+1
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>
2011-04-25staging:iio: replace rip_lots naming with read_first_nJonathan Cameron1-7/+7
Change suggested by Arnd Bergmann, Related patch to remove pointless (now) dead_offset parameter will have await proper fix for the sca3000 driver. That depends on some intermediate patches so may be a little while. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18staging:iio:buffering move the copy to user on rip down into implementationsJonathan Cameron1-2/+2
The current interface is not as adaptable as it should be. Moving this complexity into the implementations makes it easier to add new implementations. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Tested-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: iio rename ring attributesManuel Stahl1-6/+6
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-08-02staging: iio: ring_sw remove unnecessary function stub.Jonathan Cameron1-2/+0
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02staging: iio: iio_sw_ring_helper_state - add dummy case for no buffer builds.Jonathan Cameron1-0/+3
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Add iio_sw_ring_helper_state and functions to cover common case.Jonathan Cameron1-0/+10
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 a bits per element element to ring_generic allowing a general ring_sw_preenable_function.Barry Song1-1/+1
Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-12drop explicit include of autoconf.hSam Ravnborg1-1/+0
kbuild.h forces include of autoconf.h on the commandline using -include - so we do not need to include the file explicit. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2009-12-11Staging: iio: lots of doc fixesRandy Dunlap1-20/+48
Fix iio header files kernel-doc notation errors, spelling, typos, indentation, grammar, etc. It would also be good if these function names were spelled correctly, but I didn't change them: iio_push_or_escallate_ring_event() iio_trigger_dettach_poll_func() 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>
2009-09-15Staging: IIO: Ring buffer: Initial pass at rarely locked ring bufferJonathan Cameron1-0/+189
Please note this ring buffer implementation is very much a work in progress (and hence RFC). In it's current form it is stable and reasonably efficient. There are a couple of unlikely cases that will lead to more data being lost that is strictly necessary. The target was for the case of requiring regular sampling even during user space reads. All comments welcome. The intention is to make this only one of several implementations with run time selection. For now there is only one, so it is hard coded into the drivers using it. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>