summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2012-07-15iio staging: fix cast warning and cleanup alignment codePeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-15iio staging: fix cast warningPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-14staging:iio:tsl2x7x: Ensure request_irq and free_irq dev_id parameter matchLars-Peter Clausen
The data parameters for request_irq and free_irq have to match, otherwise the IRQ wont be freed. The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; @@ ( request_irq(..., (void *)data) | request_irq(..., data) | request_threaded_irq(..., (void *)data) | request_threaded_irq(..., data) ) @r2@ type r1.T; T data; position p; @@ ( free_irq@p(..., (void *)data) | free_irq@p(..., data) ) @depends on r1@ position p != r2.p; @@ *free_irq@p(...) // </smpl> Cc: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-14staging:iio:lpc32xx_adc: Ensure request_irq and free_irq dev_id parameter matchLars-Peter Clausen
The data parameters for request_irq and free_irq have to match, otherwise the IRQ wont be freed. The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; @@ ( request_irq(..., (void *)data) | request_irq(..., data) | request_threaded_irq(..., (void *)data) | request_threaded_irq(..., data) ) @r2@ type r1.T; T data; position p; @@ ( free_irq@p(..., (void *)data) | free_irq@p(..., data) ) @depends on r1@ position p != r2.p; @@ *free_irq@p(...) // </smpl> Cc: Roland Stigge <stigge@antcom.de> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-14staging:iio:tsl2x7x: Fix client data inconsistencyLars-Peter Clausen
In probe the I2C client data is set to the iio_dev struct in probe(), but assumed to be the tsl2X7X_chip struct in remove(). Fix this by reading the client data back as iio_dev as well. The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; expression dev; @@ ( i2c_set_clientdata(dev, (void *)data) | i2c_set_clientdata(dev, data) ) @r2@ type r1.T; T data; position p; expression dev; @@ data = i2c_get_clientdata@p(dev) @depends on r1@ position p != r2.p; expression dev; identifier data; @@ *data = i2c_get_clientdata@p(dev) // </smpl> Cc: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-14staging:iio:adis16260: Fix drvdata inconsistencyLars-Peter Clausen
The SPI drvdata is set to adis16260_state struct in probe(), but assumed to be the iio_dev struct in remove(). Fix this by setting it to the iio_dev in probe(). The issue has been discovered using the following coccinelle patch: // <smpl> @r1@ type T; T data; expression dev; @@ ( spi_set_drvdata(dev, (void *)data) | spi_set_drvdata(dev, data) ) @r2@ type r1.T; T data; position p; expression dev; @@ data = spi_get_drvdata@p(dev) @depends on r1@ position p != r2.p; expression dev; identifier data; @@ *data = spi_get_drvdata@p(dev) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-12Merge tag 'togreg-3.6a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next IIO: One new driver and a couple of nice cleanups.
2012-07-12Merge tag 'fixes-togreg-3.6a' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into work-next Various minor IIO fixes for staging-next.
2012-07-12staging:iio:max1363: Don't free uninitialized variableLars-Peter Clausen
It is possible that on one of the error paths we are going to try to free 'rxbuf', even though it has not been allocated yet, which cause the following warning: drivers/staging/iio/adc/max1363_ring.c: In function 'max1363_trigger_handler': drivers/staging/iio/adc/max1363_ring.c:87:7: warning: 'rxbuf' may be used uninitialized in this function Reported-by: Fengguang Wu <wfg@linux.intel.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2012-07-10iio: Trivial documentation fix to correct kernel version info inJonathan Cameron
21cd1fab058671313f7c178b640999fcd0d8de21 Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reported-by: Peter Meerwald <pmeerw@pmeerw.net>
2012-07-10IIO channel type and modifiers for CCT and RGBC dataJon Brenner
Add iio channel type and modifiers for Correlated Color Temperature (CCT) and RGBC (red/green/blue/clear) data. Add CCT and RGBC descriptions to documentation. Changes: Revised/condensed RGBC descriptions. Merge and trivial fix done by Jonathan Cameron. Signed-off-by: Jon Brenner <jbrenner@taosinc.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-09Merge tag 'togreg_8_7_2012' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Mixed back of updates and trivial examples fixes. Nothing terribly interesting in this one. 8 July 2012
2012-07-09staging:iio:ade7758: Use iio_validate_scan_mask_onehotLars-Peter Clausen
Only one of the channels of the ade7758 may be sampled at a time. Use the new validate_scan_mask callback and the iio_validate_scan_mask_onehot function to implement this restriction. Previously this was implemented using available_scan_masks, but this requires a individual scan mask for each channel. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-09staging:iio:ad7793: Use iio_validate_scan_mask_onehotLars-Peter Clausen
Only one of the channels of the ad7793 may be sampled at a time. Use the new validate_scan_mask callback and the iio_validate_scan_mask_onehot function to implement this restriction. Previously this was implemented using available_scan_masks, but this requires a individual scan mask for each channel. Also the previous code was adding the scan index of the timestamp channel to each available scan mask, this is not required though since the timestamp channel is not restricted by the available scan masks and can be enabled or disabled independently. So the new code does not have to take care of this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-09staging:iio:ad7192: Use iio_validate_scan_mask_onehotLars-Peter Clausen
Only one of the channels of the ad7192 may be sampled at a time. Use the new validate_scan_mask callback and the iio_validate_scan_mask_onehot function to implement this restriction. Previously this was implemented using available_scan_masks, but this requires a individual scan mask for each channel. Also the previous code was adding the scan index of the timestamp channel to each available scan mask, this is not required though since the timestamp channel is not restricted by the available scan masks and can be enabled or disabled independently. So the new code does not have to take care of this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:adis16400: Do not return error code in the 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-07-08staging:iio:adis16260: Do not return error code in the 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-07-08staging:iio:accel:adis16xxx: Do not return error code in the 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-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-07-08staging:iio:max1363: 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-07-08staging:iio:ad7887: 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-07-08staging:iio:ad7476: 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-07-08staging:iio:ad799x: 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-07-08staging:iio:dummy driver: 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-07-08staging:iio:adt7310: 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-07-08staging:iio:ad7298: 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-07-08staging iio adt7410: fix 13bit modeSascha Hauer
The driver assumes that in 13bit mode the 16bit value has to be shifted to the right by 3 bits. This is not true, in both 16bit and 13bit mode the MSB is at the same position. Currently the driver returns a temperature of 194 degrees Celsius in 13bit mode and 24 degrees Celsius in 16bit mode. Fix this by using the same algorithm for 16bit and 13bit mode and by just masking out the lower three bits in 13bit mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging iio adt7410: sysfs store function must return lengthSascha Hauer
Otherwise a write to the resolution entry never returns. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio: Request threaded-only IRQs with IRQF_ONESHOTLars-Peter Clausen
Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. This patch adds the IRQF_ONESHOT to IIO drivers where it is missing. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging:iio:adt7410: use local platformdata if none is specifiedSascha Hauer
The adt7410 expects information about an irq in platform_data. The driver can work without an irq, so make platform_data optional by specifying a dummy platform_data if the device has none. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08staging iio adt7410: make 16bit mode defaultSascha Hauer
In 13bit mode the lower three bits of the adc value contain flags. The driver does not use these flags at all, so make 16bit mode the default. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-08iio staging: add recently added modifiers to iio_event_monitorPeter Meerwald
maybe iio_modifier_names and iio_chan_type_name_spec should be exported from industrialio-core instead? Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-07-07iio staging: missing newline in printfPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30staging:iio:accel:adis16204 support the rss channel via chan spec.Jonathan Cameron
Reduces code and makes this channel available within the kernel. Note that it is not added to the buffer, thus maintaining the previous functionality of this driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30staging:iio:imu:adis16400 drop sysfs interface for manual device reset.Jonathan Cameron
There is no reason for userspace to do this, so lets drop this abi. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30staging:iio:gyro:adis16260 drop sysfs interface for manual device reset.Jonathan Cameron
There is no reason for userspace to do this, so lets drop this abi. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30staging:iio:accel drop sysfs interface for resetting devices.Jonathan Cameron
There is no reason why userspace should want to do this manually. Hence, lets drop this abi. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30iio: Rename _st_ functions to loose the bit that meant the staging version.Jonathan Cameron
These were originally introduced when the plan was to have parallel IIO cores in and out of staging with a slow move between them. Now we have reached the point where the whole core has moved, they need clearing up! Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30Merge branch 'fixes-togreg' into togregJonathan Cameron
2012-06-30staging:iio: Add some missing peak elements to the info_maskJonathan Cameron
These are supported by raw_read but not actually there. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30staging:iio:accel:adis16204 fix bug in channel modifier handlingJonathan Cameron
Will result in the correct scale value for the x axis. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2012-06-30staging:iio:ad7793: Fix scan index for the "shorted" channelLars-Peter Clausen
The code expects the scan index to match the offset of the channel into the channel array. For the "shorted" the offset is 3, but the scan index is set to 2. Also the scan index 2 is already taken by the previous channel. As a result the "shorted" channel will appear to be selected if the previous channel is selected and vice versa and it is not possible to sample the "shorted" channel in buffered mode. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30iio staging: fix resource leak in _write_sysfs_int()Peter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30iio staging: fix potential memory/resource leaks in find_type_by_name()Peter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30iio staging: fix potential resource leak in generic_bufferPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-26staging: iio: quell asprintf() warning, missing #includesPeter Meerwald
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-06-26staging: iio: use PRId64 format specifier for int64_tPeter Meerwald
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-06-26staging: iio: fix warning 'static but used in inline function'Peter Meerwald
iio_utils.h:367:10: warning: ‘iioutils_break_up_name’ is static but used in inline function ‘build_channel_array’ which is not static [enabled by default] 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-06-26staging: iio: generic_buffer cleanupPeter Meerwald
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-06-26staging: iio: move commentPeter Meerwald
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>