aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/iio_simple_dummy.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-04-09staging:iio:dummy: Fix mismatch and export sysfs entryJin Feng1-2/+9
Correct the mismatch bewteen calibscale and calibbias, and export the in_accel_calibscale sysfs entry Updated to apply to current tree. Signed-off-by: Jin Feng <jin88.feng@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:dummy move to info_mask_(shared_by_type/separate)Jonathan Cameron1-18/+15
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2012-12-27iio: Fix some commentsAlexander Stein1-2/+2
Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-21staging: iio: remove use of __devinitBill Pemberton1-1/+1
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-09-22staging:iio:dummy: Fix potential NULL pointer dereferenceLars-Peter Clausen1-13/+7
If the config contains CONFIG_IIO_BUFFER=y and CONFIG_IIO_SIMPLE_DUMMY_BUFFER=n iio_simple_dummy_configure_buffer() is stubbed out and iio_buffer_register() is not. As a result we try to register a buffer which has not been configured. This will causes a NULL pointer deref in iio_buffer_register. To solve this issue move the iio_buffer_register() call to iio_simple_dummy_configure_buffer(), so it will only be called if iio_simple_dummy_configure_buffer() has been called. Reported-by: Fengguang Wu <fengguang.wu@intel.com> 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 Cameron1-1/+1
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-14staging:iio: Constify static iio_chan_spec arraysLars-Peter Clausen1-1/+1
The per driver iio_chan_spec arrays are usually shared between multiple device instances. So a single device instance may not modify the iio_chan_spec array since this would also affect the other device instances. To make this restriction explicit mark the per driver iio_chan_spec arrays as const. Conversion was done automatically using the following coccinelle semantic patch: // <smpl> @disable optional_qualifier@ identifier channels; @@ static +const struct iio_chan_spec channels[] = ...; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-15staging: iio: fix typos in simple dummy driverPeter Meerwald1-5/+5
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14staging:iio:dummy: Remove outdated commentLars-Peter Clausen1-2/+0
iio_device_free has to be called regardless of whether the device has been registered or not when freeing it. 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 Clausen1-3/+3
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 Cameron1-4/+4
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-18staging:iio: Add IIO_CHAN_INFO_RAW entries to the dummy driverLars-Peter Clausen1-2/+17
Precursor to making value read / write attribute optional. No processed values in resolvers at the moment. 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-30staging: iio: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer1-1/+2
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-11-26staging:iio:treewide only use shared to decide on interfacesJonathan Cameron1-20/+23
Internally the fact that say scale is shared across channels is actually of remarkably little interest. Hence lets not store it. Numerous devices have weird combinations of channels sharing scale anyway so it is not as though this was really telling us much. Note however that we do still use the shared sysfs attrs thus massively reducing the number of attrs in complex drivers. Side effect is that certain drivers that were abusing this (mostly my work) needed to do a few more checks on what the channel they are being queried on actually is. This is also helpful for in kernel interfaces where we just want to query the scale and don't care whether it is shared with other channels or not. 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-26staging:iio: Do not use bitmasks for channel info addressesLars-Peter Clausen1-6/+6
Currently the iio framework uses bitmasks for the address field of channel info attributes. This is for historical reasons and no longer required since it will only ever query a single info attribute at once. This patch changes the code to use the non-shifted iio_chan_info_enum values for the info attribute address. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26staging:iio: header reorganizationJonathan Cameron1-1/+2
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 buffered reading supportJonathan Cameron1-9/+64
Very simple buffered reading. Did not provide a trigger as the sysfs trigger already meets that requirement. 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-22/+31
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>
2011-10-17staging:iio:Documentation Simple dummy driver to explain the basicsJonathan Cameron1-0/+481
The documenation explaining how to go about writing a driver is lagging horribly, so here is another approach; an actual driver with lots of explanatory comments. Note it is currently minimal in that there are no events and no buffer. With care they can probably be added in additional files without messing up the clarity of what we have here. V2: Addressed some of Manuel Stahl's feedback. Fixed up kernel doc. Added more general description. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>