aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/iio_simple_dummy_events.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-25iio: Move IIO Dummy Driver out of stagingCristina Opriceana1-276/+0
This patch moves the reference IIO dummy driver from drivers/staging/iio into a separate folder, drivers/iio/dummy and adds the proper Kconfig and Makefile for it. A new config menu entry called IIO dummy driver has also been added in the Industrial I/O support menu, corresponding to this driver. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-23Staging: iio: Move evgen interrupt generation to irq_workCristina Opriceana1-5/+14
Enhance interrupt generation in the dummy driver and expand its usage by introducing the irq_work infrastructure to trigger an interrupt. This way, the irq_work_queue() wrapper permits calling both of the top half and threaded part from a hard irq context, unlike handle_nested_irq(), which only calls the threaded part. As an outcome, the driver succeeds in simulating real hardware interrupts, while keeping the normal interrupt flow. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-08-05staging: iio_simple_dummy: Fix indentation errorsLars Svensson1-2/+2
Fixing indentation errors in drivers/staging/iio/iio_simple_dummy_events.c. Signed-off-by: Lars Svensson <lars1.svensson@sonymobile.com> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01staging: iio_simple_dummy: fix return typesVladimirs Ambrosovs1-3/+1
The functions iio_dummy_remove(), iio_simple_dummy_events_unregister() and iio_dummy_evgen_release_irq() were changed to return void instead of int. Signed-off-by: Vladimirs Ambrosovs <rodriguez.twister@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-04-30iio: example code is buggyAlan1-0/+2
Shock horror, example template code that has never been used in reality is in fact a hazard. This fixes the obvious bug, probably these kind of "examples" should be deleted so real (working) examples are followed. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-27iio: core: Remove IIO_EV_TYPE_INSTANCEIrina Tirdea1-2/+2
By introducing IIO_EV_TYPE_CHANGE, IIO_EV_TYPE_INSTANCE becomes redundant. The effect of IIO_EV_TYPE_INSTANCE can be obtained by using IIO_EV_TYPE_CHANGE with IIO_EV_INFO_VALUE set to 1. Remove all instances of IIO_EV_TYPE_INSTANCE and replace them with IIO_EV_TYPE_CHANGE where needed. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-22iio: dummy: Demonstrate the usage of new channel typesDaniel Baluta1-0/+43
Adds support for the new channel types in the dummy driver: * a new channel IIO_ACTIVITY * two state transition events (running and walking) * a new channel IIO_STEPS and support for reading and writing pedometer step counter * step detect event * a new IIO_CHAN_INFO_CALIBHEIGHT mask bit for reading and writing user's height. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-22iio: dummy: Add virtual registers for dummy deviceDaniel Baluta1-5/+18
We need a way to store events generated by iio_dummy_evgen module, in order to correctly process IRQs in iio_simple_dummy_events. For the moment, we add two registers: * id_reg - ID register, stores the source of the event * id_data - DATA register, stores the type of the event e.g echo 4 > /sys/bus/iio/devices/iio_evgen/poke2 id_reg 0x02, id_data 0x04 This means, event of type 4 was generated by fake device 2. We currently use a hardcoded mapping of virtual events to IIO events. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-09-19staging: iio: dummy: add blank lines after declarations.Catalina Mocanu1-0/+1
This fixes the following checkpatch.pl warning: WARNING: Missing a blank line after declarations. Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-12staging:iio:simple_dummy: Switch to new event config interfaceLars-Peter Clausen1-15/+34
Switch the simple_dummy driver to the new IIO event config interface as the old one is going to be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-05-08staging: iio: Fix typo in iioMasanari Iida1-1/+1
Correct spelling typo in staging/iio Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Michael Hennerich<michael.hennerich@analog.com> 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-3/+3
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>
2011-11-26staging:iio: header reorganizationJonathan Cameron1-0/+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-10-17staging:iio:dummy Add event support + fake event generatorJonathan Cameron1-0/+190
The event generator is not very pretty but does the job and allows this driver to look a lot more like a normal driver than it otherwise would. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>