Commit Graph

1136 Commits (a4eef3057dff597099673c42f8e3d0455deb9fe1)

Author SHA1 Message Date
Lars-Peter Clausen a4eef3057d staging:iio:adt7310: Do not return error code in interrupt handler
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-08 20:02:26 +01:00
Lars-Peter Clausen abad65cbb2 staging:iio:ad7298: Do not return error code in interrupt handler
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-08 20:02:26 +01:00
Sascha Hauer 1764eff7d5 staging iio adt7410: fix 13bit mode
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-08 20:02:25 +01:00
Sascha Hauer 3a427d184f staging iio adt7410: sysfs store function must return length
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-08 20:02:25 +01:00
Lars-Peter Clausen a91aff1c09 staging:iio: Request threaded-only IRQs with IRQF_ONESHOT
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-08 20:02:24 +01:00
Jonathan Cameron f699d10202 staging:iio:accel:adis16204 support the rss channel via chan spec.
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-30 10:15:25 +01:00
Jonathan Cameron 07c7f79ee1 staging:iio:imu:adis16400 drop sysfs interface for manual device reset.
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-30 10:15:20 +01:00
Jonathan Cameron 15a1a7530c staging:iio:gyro:adis16260 drop sysfs interface for manual device reset.
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-30 10:15:17 +01:00
Jonathan Cameron 13d947db1c staging:iio:accel drop sysfs interface for resetting devices.
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-30 10:15:14 +01:00
Jonathan Cameron 314be14bb8 iio: Rename _st_ functions to loose the bit that meant the staging version.
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-30 10:15:12 +01:00
Jonathan Cameron c1f1a9d48f Merge branch 'fixes-togreg' into togreg 2012-06-30 10:14:29 +01:00
Jonathan Cameron 06d5199d4c staging:iio: Add some missing peak elements to the info_mask
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-30 10:12:36 +01:00
Jonathan Cameron 467d0becaf staging:iio:accel:adis16204 fix bug in channel modifier handling
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-30 10:12:33 +01:00
Lars-Peter Clausen 05eda67d2c staging:iio:ad7793: Fix scan index for the "shorted" channel
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-30 10:12:30 +01:00
Peter Meerwald ce7b04c629 iio staging: fix resource leak in _write_sysfs_int()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:28 +01:00
Peter Meerwald a4d429e362 iio staging: fix potential memory/resource leaks in find_type_by_name()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:24 +01:00
Peter Meerwald 578f737dd3 iio staging: fix potential resource leak in generic_buffer
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:12:21 +01:00
Peter Meerwald bb23378c0b staging: iio: quell asprintf() warning, missing #includes
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-26 14:57:30 -07:00
Peter Meerwald 1bcdfbcf75 staging: iio: use PRId64 format specifier for int64_t
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-26 14:57:30 -07:00
Peter Meerwald 42196d3963 staging: iio: fix warning 'static but used in inline function'
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-26 14:57:29 -07:00
Peter Meerwald d8da0eeed7 staging: iio: generic_buffer cleanup
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-26 14:57:29 -07:00
Peter Meerwald b42f2a0c65 staging: iio: move comment
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-26 14:57:29 -07:00
Peter Meerwald 109379210e staging: iio: remove unused variable
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-26 14:57:29 -07:00
Peter Meerwald 1d633fd153 staging: iio: fix generic_buffer print2byte()
drop extra argument, move cast

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-26 14:57:28 -07:00
Peter Meerwald 8b32b11c2e staging: iio: fix typo, improve timestamp alignment comment
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-22 21:24:27 -07:00
Peter Meerwald 970689f10e staging: iio: simplify timestamp alignment in iio_simple_dummy
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-22 21:24:27 -07:00
Peter Meerwald 708706ff29 staging: iio: fix trigger handler of iio_simple_dummy driver
accessing first and last channel fails:
fakedata[0] is never accessed, out-of-bound access for last channel

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-22 21:24:27 -07:00
Lars-Peter Clausen 4bf8172772 staging:iio:trigger: Use to_iio_trigger() instead of dev_get_drvdata()
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-06-22 21:08:10 -07:00
Peter Meerwald d163a19d91 iio staging: another typo in iio_simple_dummy_buffer
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-18 17:31:42 -07:00
Peter Meerwald 2a1d45ecc8 iio staging: fix spelling of suppression in isl29018
beware, does change the ABI as proximity_on_chip_ambient_infrared_supression
is changed to proximity_on_chip_ambient_infrared_suppression

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:29:29 -07:00
Peter Meerwald 7695afdeb4 iio staging: fix tsl2x7x file mode
just drop execute permission

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-18 17:29:29 -07:00
Peter Meerwald 0941b9307e iio staging: fix typos in tsl*: register
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-18 17:29:28 -07:00
Lars-Peter Clausen ae3805c3ae staging:iio:adc:ad799x: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-06-18 17:26:10 -07:00
Lars-Peter Clausen cc4dd03a6a staging:iio:adc:ad7887: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-06-18 17:26:10 -07:00
Lars-Peter Clausen 82796edca9 staging:iio:adc:ad7793: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-06-18 17:26:10 -07:00
Lars-Peter Clausen 74ed964931 staging:iio:adc:ad7606: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-06-18 17:26:10 -07:00
Lars-Peter Clausen 397b85dd86 staging:iio:adc:ad7476: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-06-18 17:26:10 -07:00
Lars-Peter Clausen d045b9d21b staging:iio:adc:ad7298: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

The previous code was not passing the temperature channel to iio_buffer_register
since the temperature channel can not be used in buffered mode. With the new
helper functions it is not possible to do this, instead the scan index for the
temperature channel is set to -1 which will cause iio_buffer_register to ignore
the channel. (Also While we are at it also assign the symbolic constant instead
of the raw value to the channel address for the temperature channel).

Also as part of the conversion drop scan_timestamp being enabled by default,
since it is a left over of an earlier cleanup.

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-06-18 17:26:09 -07:00
Lars-Peter Clausen a648232dc5 staging:iio:adc:ad7192: Use new triggered buffer setup helper function
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

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-06-18 17:26:09 -07:00
Peter Meerwald 60ba16e35b staging: iio:: fix some typos
typos in comments, fix ring_sw module description

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-15 14:39:18 -07:00
Peter Meerwald a21601463d staging: iio: add IIO_ALTVOLTAGE to iio_event_monitor example
IIO_ALTVOLTAGE is used by frequency/adf4350 and frequency/ad9523

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-15 14:39:18 -07:00
Lars-Peter Clausen eaedfa54db staging: iio: Remove superfluous flush_scheduled_work
None of these drivers ever schedule any work, so there is no need to flush any
scheduled work when the driver is removed.

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-06-15 14:36:26 -07:00
Peter Meerwald 25c38aa3d1 staging: iio: fix typos in simple dummy driver
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-15 14:36:26 -07:00
Lars-Peter Clausen 07a8329c48 staging:iio:adis16400: Fix ADIS163xx AUX_ADC address
The ADIS163xx variants use a different register address for the auxiliary ADC
channel than the ADIS16400. This patch fixes them to use the correct address.

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-06-15 14:36:25 -07:00
Lars-Peter Clausen bb7cf8bc52 staging:iio:adis16400: Fix ADIS16334 temperature address
The channel spec for ADUS16334's temperature channel uses the address and scan
index for the Z-axis acceleration channel. This patch fixes it to use the
temperature channel address and scan index instead.

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-06-15 14:36:25 -07:00
Lars-Peter Clausen 6f30592e8c staging:iio:adis16400: Fix ADIS16300 temperature address
The ADIS16300 uses the same address for the temperature register as the
ADIS16350 and not the same as the ADIS16400.

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-06-15 14:36:25 -07:00
Lars-Peter Clausen 791de6771e staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address
In the current driver ROLL_OUT register address is the same as the PITCH_OUT
register address. This patch fixes it to use the correct address.

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-06-15 14:36:25 -07:00
Leed Aguilar 4d9505af77 staging:iio:gyro:adis16080: remove sparse warnings
Removed the following sparse warning:

In function 'adis16080_read_raw':
warning: 'ut' may be used uninitialized in this function

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 17:30:17 -07:00
Greg Kroah-Hartman 89a86a2da3 Merge branch 'staging-linus' into staging-next
We need this for the pstore fixes that went into the staging-linus branch, so
that things apply properly for the pstore/android code merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13 16:57:09 -07:00
Lars-Peter Clausen 33735a94af staging:iio:ad7298: Fix linker error due to missing IIO kfifo buffer
The ad7298 drivers buffer implementation uses the IIO kfifo buffer, so it needs
to select IIO_KFIFO_BUF. Otherwise (if no other driver selects the symbol) the
following linker error will occur:

drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
	(.text+0x245cf2): undefined reference to `iio_kfifo_allocate'
drivers/built-in.o: In function `ad7298_register_ring_funcs_and_init':
	(.text+0x245d7d): undefined reference to `iio_kfifo_free'
drivers/built-in.o: In function `ad7298_ring_cleanup':
	(.text+0x245dcd): undefined reference to `iio_kfifo_free'

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 11:12:19 -07:00