Commit Graph

2407 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 055655a9f0 First set of IIO fixes for the 4.13 cycle.
* ad2s1210
   - Fix negative angular velocity reads (identified by a gcc 7 warning)
 * aspeed-adc
   - Wait for initialization sequence to finish before enabling channels.
   Without it no channels work.
 * axp288
   - Revert a patch that dropped some bogus register mods.  No one is entirely
   sure why but it breaks charging on some devices.
   - Fix GPADC pin read returning 0. Turns out a small sleep is needed.
 * bmc150
   - Make sure device is restored to normal state after suspend / resume
   cycle.  Otherwise, simple sysfs reads are broken.
 * tsl2563
   - fix wrong event code.
 * st-accel
   - add spi 3-wire support. Needed to fix the lsm303agr accelerometer
   which only had 3 wires in all cases.  Side effect is to enable optional
   3-wire support for other devices.
 * st-pressure
   - disable multiread by default for LPS22HB (only effects SPI)
 * sun4i-gpadc-iio
   - fix unbalanced irq enable / disable
 * vf610
   - Fix VALT slection for REFSEL bits - ensures we are using the
   right reference pins.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAll0lYgRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FoipzRAAk7wO9hvfl8UwgS6FTLVwQQHjP6MQSZ51
 USP2YN0hkBgDLKPQ2PbTt6t5jwboYPhOsd1n6iHWuAkje+W6Ie4JlXJBux/Gp9Wb
 GuZLLdFG+3Z1ZYcdDWRKs3u95vdku/5hFg63bxloPcpwkLzb82ykyQ4i9BjbGfv8
 jrig+l3eghkGp1kl1ChGdeegTcHAVIS/lPm8Ls0BwpWM30tW2Ip4XSkkm+T6IHvT
 8gPr1JMEJ5WaKEpDWKmitZQAr8jLAZ0dp9iLGh9qa2o0+OtX8gMYIas0bMHRR+UG
 3EM0wWaaeSaOuqYs8ZnqUQE2RcqP6plZWRmLR98rFLrAXPATX/HGMtZ+JQpKwEKm
 1H3XZAovwcppJ8X+XI7z6dZnpTCmQwwILYBpWvM/WWQCk2HZLZkFPOlkQyWCI4al
 3OhV+6o3XIl/M8aHepcRh3tpwYFDToNhLpo85EC6H7YtwaReY8tfXqNtlO8MMIKm
 1ZNVcA6NT8sdFwvyGtqg4yRIcQbx4Uarp11GgW5SSq13EgJ1LHEYC3lFrfn36pes
 D0oa01pA8hT6e7dPgqmFg6+J2XdWn8R1NVLRn+z+hjimr/BJlsxaZtk1JEJyS/ul
 qJS8UIEiwELUuze31uuz4QJJQHnPxuHlvM8EIf2c6vxg+l1CeMthXv7Hc9ht1vKg
 W/xgABUp/EY=
 =BApO
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First set of IIO fixes for the 4.13 cycle.

* ad2s1210
  - Fix negative angular velocity reads (identified by a gcc 7 warning)
* aspeed-adc
  - Wait for initialization sequence to finish before enabling channels.
  Without it no channels work.
* axp288
  - Revert a patch that dropped some bogus register mods.  No one is entirely
  sure why but it breaks charging on some devices.
  - Fix GPADC pin read returning 0. Turns out a small sleep is needed.
* bmc150
  - Make sure device is restored to normal state after suspend / resume
  cycle.  Otherwise, simple sysfs reads are broken.
* tsl2563
  - fix wrong event code.
* st-accel
  - add spi 3-wire support. Needed to fix the lsm303agr accelerometer
  which only had 3 wires in all cases.  Side effect is to enable optional
  3-wire support for other devices.
* st-pressure
  - disable multiread by default for LPS22HB (only effects SPI)
* sun4i-gpadc-iio
  - fix unbalanced irq enable / disable
* vf610
  - Fix VALT slection for REFSEL bits - ensures we are using the
  right reference pins.
2017-07-23 20:54:31 -07:00
Arnd Bergmann 105967ad68 staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
gcc-7 points out an older regression:

drivers/staging/iio/resolver/ad2s1210.c: In function 'ad2s1210_read_raw':
drivers/staging/iio/resolver/ad2s1210.c:515:42: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]

The original code had 'unsigned short' here, but incorrectly got
converted to 'bool'. This reverts the regression and uses a normal
type instead.

Fixes: 29148543c5 ("staging:iio:resolver:ad2s1210 minimal chan spec conversion.")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-07-15 12:41:54 +01:00
Greg Kroah-Hartman d06838de4a Merge 4.12-rc6 into staging-next
We want the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-20 10:17:45 +08:00
Alexey Khoroshilov 95264c8c6a staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()
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: 6572389bcc ("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-05-28 15:45:46 +01:00
Surender Polsani 52325ff42a staging: iio: light: Replace symbolic permissions as per coding style
Fixed the following checkpatch.pl warnings:
octal permissions are more preferable than symbolic permissions

Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
as suggested by Greg K-H. Changed attributes and function
names where ever required to satisfy internal macro definitions
like __ATTR__RW().

Signed-off-by: Surender Polsani <surenderpolsani@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-21 15:06:09 +01:00
Harinath Nampally 4ae2f37a2f staging: iio: meter: Fix the identations for proper alignments.
This patch fixes below checkpatch.pl kind of warnings:
CHECK: Alignment should match open parenthesis

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-14 16:25:55 +01:00
Enric Balletbo i Serra 8d04300483 tsl2x7x: remove paragraph about writing to the FSF's mailing address
Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF
has changed addresses in the past, and may do so again. Linux
already includes a copy of the GPL.

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 13:50:46 +01:00
Brian Masney 38a67ffd44 staging: iio: tsl2x7x: rename driver for consistency with other IIO light drivers
This patch renames the tsl2x7x_core.c file to tsl2x7x.c so that the
naming convention is consistent with other IIO light drivers outside
of staging.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 13:10:17 +01:00
Quentin Swain b46c39a098 iio: ade7854: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal to fix
warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:07:41 +01:00
Quentin Swain 78425b3290 iio: ade7758: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal permissions to
fix warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:06:24 +01:00
Quentin Swain 37cbe596e2 iio: ade7754: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal permissions
to resolve warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:05:17 +01:00
Quentin Swain 3e8eae9079 iio: ade7753 Convert: symbolic permissions to octal
Convert S_IRUGO and S_IWUSR macros to octal permissions to resolve
warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:01:44 +01:00
Quentin Swain 2451c5dda4 iio: ad9834 convert symbolic permissions to octal
Remove checkpatch warnings by converting symbolic S_IRUGO and S_IWUSR
permissions to octal

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 00:59:21 +01:00
Brian Masney 105c3de1eb staging: iio: isl29028: move out of staging
Move ISL29028 ALS / Proximity Sensor out of staging and into mainline.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:28:25 +01:00
Brian Masney e4ff6c1b41 staging: iio: isl29028: correct proximity sleep times
The sysfs attribute in_proximity_sampling_frequency_available currently
shows the values 1 3 5 10 13 20 83 100. These values are supposed to
correspond to the sleep values 800 400 200 100 75 50 12.5 0 (all in ms).
When passing in a sampling frequency of 3, it actually uses a sleep
time of 200ms instead of the expected 400ms value. This patch changes
the value shown by this sysfs attribute to use fixed-point numbers so
that the correct sampling frequency is shown to the user. This patch
also changes the code that updates the proximity sampling frequency to
only allow values that are shown in the _available sysfs attribute.

The original code showed the value 83 that corresponds to the sleep
time 12 ms. The data sheet actually lists 12.5 ms as the sleep time,
so the proximity frequency was updated to 80.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:26:09 +01:00
Paolo Cretaro d6d0014c6b staging: iio: tsl2x7x: Replace deprecated macros (S_IRUGO, S_IWUSR)
Use octal digits as suggested by checkpatch instead of deprecated macros.

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:04:47 +01:00
René Hickersberger?= ddf9ee4084 Staging: iio: accel: adis16203: fixed a brace coding style issue
Fixed a brace coding style issue.

Signed-off-by: René Hickersberger <renehickersberger@gmx.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-14 16:13:34 +01:00
Chen Guanqiao b4bac145b9 iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR)
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-14 15:09:07 +01:00
Narcisa Ana Maria Vasile 984fb24430 staging: iio: ad5933: Protect DIRECT mode using claim/release helpers
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-14 15:09:06 +01:00
Chen Guanqiao d97a913206 iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)
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-14 15:09:05 +01:00
Guru Das Srinagesh 13e283d6fc staging: iio: ad9832: use 4-digit octal permissions
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-02 10:20:48 +01:00
simran singhal 5a70925b16 iio: gyro: adis16060: Change the name of function.
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-02 09:10:32 +01:00
simran singhal d952b4e6ad staging: iio: light: tsl2x7x constify attribute_group structures
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-04-01 11:40:36 +01:00
Gargi Sharma b71244b62b staging: iio: update locking method during frequency writes
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-30 19:20:38 +01:00
Olivier Leveque 40dffd9974 staging: iio: adc: ad7280a: fix permission coding style issue
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-25 17:07:24 +00:00
Mark Stenglein baecc573d8 staging: iio: accel: remove unneeded braces around single statements
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-25 17:02:26 +00:00
Eva Rachel Retuya cf6c77323a staging: iio: tsl2x7x_core: Fix standard deviation calculation
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: 3c97c08b57 ("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-25 16:47:13 +00:00
Arushi Singhal e29e7b3236 staging: iio: Remove extra Parenthesis.
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-25 16:04:38 +00:00
Gargi Sharma 66893ea375 staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIAS
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-23 19:43:36 +00:00
Narcisa Ana Maria Vasile 745c6dad49 staging: iio: cdc: ad7746: Fix alignment with paranthesis
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-23 19:43:35 +00:00
Narcisa Ana Maria Vasile 6602292e1d staging: iio: Add blank lines after function declarations
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-23 19:43:34 +00:00
Narcisa Ana Maria Vasile fb4d75a9db staging: iio: adt7136: Remove unnecessary blank lines
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-23 19:43:33 +00:00
Arushi Singhal 755d0da465 staging: ad7606: Replace mlock with driver private lock
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-23 19:43:32 +00:00
simran singhal 64822be434 staging: iio: ade7753: Remove trailing whitespaces
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-23 19:43:31 +00:00
simran singhal d62bb1ad05 staging: ade7754: Clean up #includes
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-23 19:43:30 +00:00
Arushi Singhal 63bb38c000 staging: iio: Replace a bit shift by a use of BIT.
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-23 19:43:29 +00:00
simran singhal 9dde479e9f staging: iio: adis16060: Remove iio_dev mlock and refactor code
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-23 19:43:03 +00:00
Gargi Sharma dba968c4fe staging: iio: ad7280: Replace mlock with driver private lock
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-19 11:11:37 +00:00
Miguel Robles 2b7cb7bed6 Staging: iio: resolver: ad2s1210: Fix warning, statements should start on a 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-19 11:06:59 +00:00
Miguel Robles 1aca202610 Staging: iio: cdc: ad7746: use octal permissions instead of symbolic
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-19 11:05:15 +00:00
Narcisa Ana Maria Vasile ae81abcb6a staging: iio: adis16209: Remove mutex_lock() and mutex_unlock() calls
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-19 11:01:19 +00:00
Aishwarya Pant 099c4cef24 staging: iio: accel: adis16201: remove iio_dev mlock
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-19 10:18:34 +00:00
Varsha Rao 2e2c8d227a staging: iio: adis16240: Remove mutex_lock() and mutex_unlock() function call.
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-18 14:19:43 +00:00
sayli karnik 01d2de39cd staging: iio: ad9834: Remove unnecessary goto statement
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-15 22:13:57 +00:00
sayli karnik c63313c605 staging: iio: ad9834: Use private driver lock instead of mlock
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-15 22:12:21 +00:00
Miguel Robles 8fa06c902a Staging: iio: cdc: ad7152.c, use octal permissions instead of symbolic
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-15 22:01:19 +00:00
Aishwarya Pant 9854a1b5c4 staging:iio:cdc:ade7746 replace mlock with driver private lock
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-15 21:56:50 +00:00
Narcisa Ana Maria Vasile 0bdd35bd95 staging: iio: adis16240: Group similar macros into enums
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-13 21:20:39 +00:00
Narcisa Ana Maria Vasile a3b2ce9635 staging: iio: adis16209: Group similar macros into enums
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-13 21:20:38 +00:00
simran singhal e7d87687cb staging: iio: gyro: Remove & on function name to conform to similar IIO drivers
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-13 21:20:38 +00:00