summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2017-05-28staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()Alexey Khoroshilov
ad7152_write_raw_samp_freq() is called by ad7152_write_raw() with chip->state_lock held. So, there is unavoidable deadlock when ad7152_write_raw_samp_freq() locks the mutex itself. The patch removes unneeded locking. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Fixes: 6572389bcc11 ("staging: iio: cdc: ad7152: Implement IIO_CHAN_INFO_SAMP_FREQ attribute") Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-14Staging: iio: accel: adis16203: fixed a brace coding style issueRené Hickersberger?=
Fixed a brace coding style issue. Signed-off-by: René Hickersberger <renehickersberger@gmx.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-14iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR)Chen Guanqiao
This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of 4-digit octal numbers. Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-14staging: iio: ad5933: Protect DIRECT mode using claim/release helpersNarcisa Ana Maria Vasile
This device operates in DIRECT_MODE and BUFFER_HARDWARE mode. Replace usages of iio_dev->mlock with iio_device_{claim|release}_direct_mode() helper functions to guarantee DIRECT mode and consequently protect BUFFER mode too. Add and use a device private lock to protect against conflicting access of the state data. This helps with IIO subsystem redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. Protect changing of attributes inside ad5933_store(). Attributes can no longer be changed while in buffered mode. Remove lock from ad5933_work() because buffer mode should be enabled when we reach this, and claiming DIRECT mode in all the other places should protect it. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-14iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)Chen Guanqiao
Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace with 4 digit octal. Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02staging: iio: ad9832: use 4-digit octal permissionsGuru Das Srinagesh
This fixes the coding style issue of using S_IWUSR in place of 4-digit octal numbers. Issue detected by checkpatch. Signed-off-by: Guru Das Srinagesh <gurooodas@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02iio: gyro: adis16060: Change the name of function.simran singhal
Change the name of function from adis16060_spi_write_than_read() to adis16060_spi_write_then_read(). change "than" to "then" as its time depended. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01staging: iio: light: tsl2x7x constify attribute_group structuressimran singhal
As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. File size before: text data bss dec hex filename 15064 1528 0 16592 40d0 drivers/staging/iio/light/tsl2x7x_core.o File size after: text data bss dec hex filename 15192 1400 0 16592 40d0 drivers/staging/iio/light/tsl2x7x_core.o Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-30staging: iio: update locking method during frequency writesGargi Sharma
The driver needs to insure atomicity during frequency changes of bus and device. The iiodev->mlock as used was not doing that. Replace it with the drivers existing buffer lock and introduce an auxiliary spi_write() that does not hold the lock. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: adc: ad7280a: fix permission coding style issueOlivier Leveque
Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred. Consider using octal permissions '0644'. Found running checkpatch. Signed-off-by: Olivier Leveque <o_leveque@orange.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: accel: remove unneeded braces around single statementsMark Stenglein
Fixes three checkpatch warnings due to braces used when single statements are sufficient. Signed-off-by: Mark Stenglein <mark@stengle.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: tsl2x7x_core: Fix standard deviation calculationEva Rachel Retuya
Standard deviation is calculated as the square root of the variance where variance is the mean of sample_sum and length. Correct the computation of statP->stddev in accordance to the proper calculation. Fixes: 3c97c08b5735 ("staging: iio: add TAOS tsl2x7x driver") Reported-by: Abhiram Balasubramanian <abhiram@cs.utah.edu> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: Remove extra Parenthesis.Arushi Singhal
Remove the extra parenthesis remove the checkpatch issue. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIASGargi Sharma
adis16203_read_raw does not need lock for IIO_CHAN_INFO_CALIBBIAS since adis_read_reg_16 is already atomic and nothing else needs to be protected. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: cdc: ad7746: Fix alignment with paranthesisNarcisa Ana Maria Vasile
This was reported by checkpatch.pl: CHECK: Alignment should match open parenthesis Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: Add blank lines after function declarationsNarcisa Ana Maria Vasile
This was reported by checkpatch.pl: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: adt7136: Remove unnecessary blank linesNarcisa Ana Maria Vasile
This was reported by checkpatch.pl Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: ad7606: Replace mlock with driver private lockArushi Singhal
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: ade7753: Remove trailing whitespacessimran singhal
This patch removes trailing whitespaces in order to follow the Linux coding style. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: ade7754: Clean up #includessimran singhal
Alphabetize and separate kernel and subsystem headers. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: Replace a bit shift by a use of BIT.Arushi Singhal
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: iio: adis16060: Remove iio_dev mlock and refactor codesimran singhal
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. In the driver, buf_lock protects both the adis16060_spi_write() and adis16060_spi_read() functions and both are always called in pair. First write, then read. Refactor the code to have one single function adis16060_spi_write_than_read() protected by the buf_lock. This removes the need for additional locking via mlock, so this locking is removed. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19staging: iio: ad7280: Replace mlock with driver private lockGargi Sharma
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19Staging: iio: resolver: ad2s1210: Fix warning, statements should start on a ↵Miguel Robles
tabstop Fix checkpatch warning: Statements should start on a tabstop. Signed-off-by: Miguel Robles <miguel.robles@farole.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19Staging: iio: cdc: ad7746: use octal permissions instead of symbolicMiguel Robles
Fix checkpatch warnings: Symbolic permissions 'S_IWUSR' are not preferred. Signed-off-by: Miguel Robles <miguel.robles@farole.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19staging: iio: adis16209: Remove mutex_lock() and mutex_unlock() callsNarcisa Ana Maria Vasile
The function adis16209_read_raw() is safe to be run in parallel. The call to adis_read_reg_16() is safe since adis_read_reg() uses the txrx_lock from struct adis to protect simultaneous changes. Remove mutex.h inclusion since it is no longer needed. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19staging: iio: accel: adis16201: remove iio_dev mlockAishwarya Pant
In the driver adis16201 read raw does not require an iio_dev->mlock for reads. It can run concurrently as adis_read_reg_16() is protected by a transaction lock. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-18staging: iio: adis16240: Remove mutex_lock() and mutex_unlock() function call.Varsha Rao
Remove mutex_lock() and mutex_unlock() function calls, as the adis16240_spi_read_signed() function can be run parallel and safely multiple times. Also remove the mutex.h header file and comment, which are no longer required. As indio_dev is declared and initialized in adis16240_spi_read_signed(), again declaration to same type and initialization to same value is not required, remove it from adis16240_read_12bit_signed(). Simplify the return logic, by merging assignment and return into a single line. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15staging: iio: ad9834: Remove unnecessary goto statementsayli karnik
The patch removes unnecessary use of goto statement. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15staging: iio: ad9834: Use private driver lock instead of mlocksayli karnik
iio_dev->mlock should be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. Replace mlock with a lock in the device's global data to protect hardware state changes. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15Staging: iio: cdc: ad7152.c, use octal permissions instead of symbolicMiguel Robles
Fix checkpatch warnings: Symbolic permissions are not preferred. Consider using octal permissions. Signed-off-by: Miguel Robles <miguel.robles@farole.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-15staging:iio:cdc:ade7746 replace mlock with driver private lockAishwarya Pant
The IIO subsystem is redefining iio_dev mlock to be used by IIO core only for protecting device operating mode changes. In driver ad7746 wherever mlock was used to protect hardware state changes, it has been replaced with a driver private lock. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16240: Group similar macros into enumsNarcisa Ana Maria Vasile
Group the scan indexes into an enum. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16209: Group similar macros into enumsNarcisa Ana Maria Vasile
Group the scan indexes into an enum. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: gyro: Remove & on function name to conform to similar IIO driverssimran singhal
Remove & from function pointers to conform to the style preferred in IIO. (Note that this is fine in staging drivers, but would create too much churn to do outside of staging, unless otherwise working on a driver). Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: resolver: Remove & on function name to align with other IIO ↵simran singhal
drivers. Remove & from function pointers to conform to the style found in the wider subsystem. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16203: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16209: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16201: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16240: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: cdc: ad7152: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: cdc: ad7746: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: ad7780: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: ad7192: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: ade7754: Move contents of header file to source filesayli karnik
The contents of ade7754.h are only used in ade7754.c. Move the header contents to the source file and delete the header file. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: ad9832: replace mlock with driver private lockAlison Schofield
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-11Staging: iio: return expression instead of return retBo Yu
The following Coccinelle script was used to detect this: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Bo YU <tsu.yubo@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-11staging: iio: ade7759: Move contents of header file to source filesayli karnik
The contents of ade7759.h are only used in ade7759.c. Move the header contents to the source file and delete the header file. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-05staging: iio: accel: Rename source files and update MakefileNarcisa Ana Maria Vasile
Rename adis162xx_core.c files to adis162xx.c because these are the only source files for these drivers. Update Makefile to correspond to the new file names. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> rename drivers/staging/iio/accel/{adis16201_core.c => adis16201.c} (100%) rename drivers/staging/iio/accel/{adis16203_core.c => adis16203.c} (100%) rename drivers/staging/iio/accel/{adis16209_core.c => adis16209.c} (100%) rename drivers/staging/iio/accel/{adis16240_core.c => adis16240.c} (100%) Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04staging: iio: meter: ade7753: Clean up includesKatie Dunne
Alphabetize header files. Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu> Signed-off-by: Jonathan Cameron <jic23@kernel.org>