aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/trigger (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-05-09Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linuxLinus Torvalds1-1/+1
Pull removal of GENERIC_GPIO from Grant Likely: "GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it is possible to do so which has been causing confusion and breakage. This branch does the work to completely eliminate GENERIC_GPIO." * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux: gpio: update gpio Chinese documentation Remove GENERIC_GPIO config option Convert selectors of GENERIC_GPIO to GPIOLIB blackfin: force use of gpiolib m68k: coldfire: use gpiolib mips: pnx833x: remove requirement for GENERIC_GPIO openrisc: default GENERIC_GPIO to false avr32: default GENERIC_GPIO to false xtensa: remove explicit selection of GENERIC_GPIO sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB powerpc: remove redundant GENERIC_GPIO selection unicore32: default GENERIC_GPIO to false unicore32: remove unneeded select GENERIC_GPIO arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB arm: remove redundant GENERIC_GPIO selection mips: alchemy: require gpiolib mips: txx9: change GENERIC_GPIO to GPIOLIB mips: loongson: use GPIO driver on CONFIG_GPIOLIB mips: remove redundant GENERIC_GPIO select
2013-04-16Convert selectors of GENERIC_GPIO to GPIOLIBAlexandre Courbot1-1/+1
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-03-25iio:trigger: Introduce iio_tigger_{set,get}_drvdataLars-Peter Clausen4-15/+15
Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific data to a trigger. The functions wrap access to the triggers private_data field and all current users are updated to use iio_tigger_{set,get}_drvdata instead of directly accessing the private_data field. This is the first step towards removing the private_data field from the iio_trigger struct. The following coccinelle script has been used to update the drivers: <smpl> @@ struct iio_trigger *trigger; expression priv; @@ -trigger->private_data = priv +iio_trigger_set_drv_data(trigger, priv) @@ struct iio_trigger *trigger; @@ -trigger->private_data +iio_trigger_get_drv_data(trigger) </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-24Merge branch 'core/irq_work' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into irq/coreIngo Molnar1-1/+0
irq_work fixes and cleanups, in preparation for full dyntics support. Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-11-21staging: iio: remove use of __devexit_pBill Pemberton3-3/+3
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devexitBill Pemberton3-3/+3
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devinitBill Pemberton3-3/+3
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-17irq_work: Remove CONFIG_HAVE_IRQ_WORKFrederic Weisbecker1-1/+0
irq work can run on any arch even without IPI support because of the hook on update_process_times(). So lets remove HAVE_IRQ_WORK because it doesn't reflect any backend requirement. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-09-17staging:iio:trigger:bfintmr Add output supportLars-Peter Clausen2-16/+80
Some converters require an external signal to start the conversion. This patch adds support to the bfintmr trigger driver to generate such a signal. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:trigger:bfintmr: Only enable timer when necessaryLars-Peter Clausen1-3/+24
This patch hooks up the set_trigger_state callback for the blackfin timer trigger driver and only enables the timer when a trigger consumer requests it to be enabled. There really is no reason to keep the timer running and generate interrupts if nobody is listening to them. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:trigger:bfintmr: Avoid divide by zeroLars-Peter Clausen1-2/+8
If the timer frequency has not been configured yet get_gptimer_period() will return 0. Handle this case instead of blindly dividing by the returned value. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-06staging:iio:sysfs-trigger: Use irq_work to properly active triggerLars-Peter Clausen2-1/+18
Since iio_trigger_poll() calls generic_handle_irq() it need to be called from hardirq context. The sysfs trigger is kicked from userspace, so it is obviously not possible to fulfill this requirement by calling iio_trigger_poll directly. As a workaround commit 1f785681 ("staging:iio:trigger sysfs userspace trigger rework.") added iio_trigger_poll_chained() which uses handle_nested_irq instead of generic_handle_irq. This in itself is a hack and only works by chance. handle_nested_irq is intended to be called from the threaded interrupt handler of the parent IRQ. Using handle_nested_irq is also problematic since it will only call the threaded handler of the IRQ. But quite a few IIO drivers rely on their hardirq handler being called or undefined behaviour will occur. This patch uses the irq_work framework to schedule the call to iio_trigger_poll() from hardirq context, which fixes the issues described above. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-03staging:iio: Update email address for Jonathan Cameron.Jonathan Cameron2-2/+2
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-27staging:iio: Add missing __devinit and __devexit annotationsLars-Peter Clausen2-6/+6
Autogenerated using the following coccinelle semantic patch: // <smpl> @r1@ identifier driver; identifier fn; position p; type T; @@ T driver = { .remove = ( fn@p | __devexit_p(fn@p) ) }; @r2@ identifier r1.fn; position p != r1.p; @@ fn@p @r3@ identifier r1.fn; position r1.p; @@ ( __devexit_p(fn@p) | -fn@p +__devexit_p(fn) ) @depends on !r2@ identifier r1.fn; @@ static -int fn +int __devexit fn (...) { ... } @r11@ identifier driver; identifier fn; position p; type T; @@ T driver = { .probe = fn@p }; @r12@ identifier r11.fn; position p != r11.p; @@ fn@p @depends on !r12@ identifier r11.fn; @@ static -int fn +int __devinit fn (...) { ... } // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-22staging:iio:trigger: Use to_iio_trigger() instead of dev_get_drvdata()Lars-Peter Clausen3-5/+5
Use to_iio_trigger(dev) instead of dev_get_drvdata(dev). Both will return the trigger which belongs to the device, but the the first on is a bit more lightweight. Also this will eventually free up the drvdata pointer of the device for driver specific data. 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 Clausen4-11/+11
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 Cameron4-8/+8
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-03-02staging: iio: Convert platform_drivers to use module_platform_driverMichael Hennerich3-33/+3
No functional changes. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-16staging:iio: iio_trigger contains defunct owner field. Remove it.Jonathan Cameron1-1/+0
This field moved into the trigger_ops structure a while back, but somehow never quite got cleared up. This clears the last few drivers to set it (nothing uses it) and gets rid of it entirely. 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-10-23staging:iio:trigger:bfin-timer: Fix compile errorLars-Peter Clausen1-1/+1
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24staging:iio:trigger:sysfs trigger: Add a release function to avoid warning on module removal.Jonathan Cameron1-0/+7
The device is static and should never actually be deleted. The release is just to avoid a warning from the kernel. 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 iio_trig_structure.Jonathan Cameron4-4/+21
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-06-28staging: IIO corrected the spelling in iio-trig-gpioanish1-1/+1
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-05-19staging:iio:trigger handle name attr in core, remove old alloc and register any control_attrs via struct deviceJonathan Cameron4-67/+27
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:trigger sysfs userspace trigger rework.Jonathan Cameron1-35/+135
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-12iio: trigger: iio-trig-bfin-timer: select missing dependencyMichael Hennerich1-0/+1
This driver requires CONFIG_BFIN_GPTIMERS. 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-02-23staging: IIO: trigger: New Blackfin specific trigger driver iio-trig-bfin-timerMichael Hennerich3-0/+263
This driver allows any Blackfin system timer to be used as IIO trigger. It supports trigger rates from 0 to 100kHz in Hz resolution. Changes since V1: IIO: trigger: Apply review feedback Add comment explaining Blackfin hardware timer configurations Fix frequency_store, don't return -EINVAL for frequency set to 0 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-02-09Staging: IIO: TRIGGER: New sysfs based triggerMichael Hennerich3-0/+119
This patch adds a new trigger that can be invoked by writing the sysfs file: trigger_now. This approach can be valuable during automated testing or in situations, where other trigger methods are not applicable. For example no RTC or spare GPIOs. Last but not least we can allow user space applications to produce triggers. IIO: TRIGGER: Apply review feedback by Greg Kroah-Hartman Changes since v1: Add sysfs documentation. Change license notice. Add module alias. Add more Kconfig help text 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>
2010-09-04staging: iio: Make use of the convenient IIO_TRIGGER_NAME_ATTR macroJonathan Cameron2-12/+2
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-07-22staging: iio: remove timestamp field from trigger and pass instead through pollfuncsJonathan Cameron2-2/+4
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: iio: Use kasprintf to allocate and fill trig->nameJonathan Cameron2-16/+5
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18Staging: iio: standardize kconfig/makefile spacing/styleMike Frysinger1-1/+2
Standardize the spacing/style across the IIO build files: - comment block in Kconfigs - newlines at ends of files - trailing lines at ends of files - indent with one tab, not spaces or mixed 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: trigger: fix up some global variablesGreg Kroah-Hartman2-4/+4
These should be static. Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: iio: iio-trig-gpio: Remove redundant gpio_requestMichael Hennerich1-66/+61
Remove redundant gpio_request: The GPIO used as trigger IRQ, is also requested as gpio, but actually never read. Use platform resource facility to get IRQs numbers and flags. Make sure this driver can be used with any system IRQ, not necessarily limited to GPIO-IRQs. Use dev_err(dev...) and friends instead of printk(KERN_ERR...) 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>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo2-0/+2
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-11Staging: iio: kconfig and make editsRandy Dunlap1-3/+3
Fix spelling, typos, indentation in iio Kconfig files. 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: fix duplicate dev_attr_nameRandy Dunlap2-3/+3
device attr's should be static, otherwise duplicate identifiers are created: drivers/staging/iio/trigger/iio-trig-gpio.o:(.data+0x1c): multiple definition of `dev_attr_name' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: IIO: Proof of concept gpio triggerJonathan Cameron3-1/+209
Simple example of how a gpio trigger driver would work. Things to be added include interupt type control (high, low). Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: IIO: Periodic timer based triggerJonathan Cameron3-0/+248
The original posting of this driver led to a discussion in which it was commented that a better system was needed for dealing with the many possible periodic interrupt sources available on some SoCs. Unfortunately that is a big task and as far as I know, no-one has taken it on as yet. So in the meantime this driver is still in here. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>