1
0
Fork 0
Commit Graph

39 Commits (873af59ba276f436bbba540788de331e222a31d7)

Author SHA1 Message Date
Lorenzo Bianconi 6f367fb1b7 iio: imu: st_lsm6dsx: fix edge-trigger interrupts
commit 3f9bce7a22 upstream

If we are using edge IRQs, new samples can arrive while processing
current interrupt since there are no hw guarantees the irq line
stays "low" long enough to properly detect the new interrupt.
In this case the new sample will be missed.
Polling FIFO status register in st_lsm6dsx_handler_thread routine
allow us to read new samples even if the interrupt arrives while
processing previous data and the timeslot where the line is "low"
is too short to be properly detected.

Fixes: 89ca88a7cd ("iio: imu: st_lsm6dsx: support active-low interrupts")
Fixes: 290a6ce11d ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/5e93cda7dc1e665f5685c53ad8e9ea71dbae782d.1605378871.git.lorenzo@kernel.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[sudip: manual backport to old irq handler path]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-17 14:05:34 +01:00
Lorenzo Bianconi 3b72950d5a iio: imu: st_lsm6dsx: introduce update_fifo function pointer
Introduce update_fifo routine pointer in st_lsm6dsx_fifo_ops data
structure since we will need a different update FIFO configuration
callback adding support for lsm6ds0/lsm9ds1 imu device

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-26 08:52:03 +01:00
Lorenzo Bianconi db947a79fc iio: imu: st_lsm6dsx: add support to ISM330DHCX
Add support to STM ISM330DHCX 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/ism330dhcx.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-05 15:22:43 +01:00
Sean Nyekjaer ec76d918f2 iio: imu: st_lsm6dsx: flip irq return logic
No need for using reverse logic in the irq return,
fix this by flip things around.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 22:55:27 +01:00
Lorenzo Bianconi dbcd2088a7 iio: imu: st_lsm6dsx: add support to LSM6DS3TR-C
Add support to STM LSM6DS3TR-C 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6ds3tr-c.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 20:11:17 +01:00
Thomas Gleixner fda8d26e61 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177
Based on 1 normalized pattern(s):

  licensed under the gpl 2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 135 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:29:19 -07:00
YueHaibing 631bd2f7ec iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor'
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c: In function 'st_lsm6dsx_read_tagged_fifo':
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:41: warning:
 variable 'gyro_sensor' set but not used [-Wunused-but-set-variable]

drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:520:28: warning:
 variable 'acc_sensor' set but not used [-Wunused-but-set-variable]

They are not used since commit 14c7c6e1a8 ("iio: imu: st_lsm6dsx: add
st_lsm6dsx_push_tagged_data routine")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-14 13:39:30 +01:00
Lorenzo Bianconi 43901008fd iio: imu: st_lsm6dsx: add support to LSM6DSR
Add support to STM LSM6DSR 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dsr.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-07 11:29:43 +01:00
Lorenzo Bianconi 6af0e8a9a7 iio: imu: st_lsm6dsx: add support to LSM6DSOX
Add support to STM LSM6DSOX 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dsox.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:20:00 +01:00
Lorenzo Bianconi 3054c4ff28 iio: imu: st_lsm6dsx: add support to ASM330LHH
Add support to STM ASM330LHH 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/asm330lhh.pdf

Tested-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:19:49 +01:00
Lorenzo Bianconi 6d0205fd1e iio: imu: st_lsm6dsx: add hw FIFO support to i2c controller
Introduce hw FIFO support to lsm6dsx i2c controller.
st_lsm6dsx sensor-hub relies on SLV0 for slave configuration since SLV0
is the only channel that can be used to write into i2c slave devices.
SLV{1,2,3} channels are used to read external data and push them into
the hw FIFO

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 18:32:34 +00:00
Lorenzo Bianconi 14c7c6e1a8 iio: imu: st_lsm6dsx: add st_lsm6dsx_push_tagged_data routine
Introduce st_lsm6dsx_push_tagged_data routine to push samples
to iio buffers. st_lsm6dsx_push_tagged_data will be reused adding
hw fifo support to st_lsm6dsx i2c embedded controller in order to
improve code readability

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 18:32:34 +00:00
Lorenzo Bianconi 1775044356 iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routine
Add st_lsm6dsx_sensor_set_enable routine and remove
st_lsm6dsx_sensor_{enable/disable} ones in order to make the code more
readable and remove unnecessary functions

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 18:32:33 +00:00
Lorenzo Bianconi 6ffb55e500 iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor ids
Add ST_LSM6DSX_ID_EXT{0,1,2} sensor ids as reference for slave devices
connected to st_lsm6dsx i2c controller. Moreover introduce odr dependency
between accel and ext devices since i2c embedded controller relies on the
accelerometer sensor as bus read/write trigger so we need to enable accel
device at odr = max(accel_odr, ext_odr) in order to properly communicate
with i2c slave devices

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 18:32:33 +00:00
Lorenzo Bianconi 739aff87a8 iio: imu: st_lsm6dsx: introduce locked read/write utility routines
Add st_lsm6dsx_update_bits_locked, st_lsm6dsx_read_locked and
st_lsm6dsx_write_locked utility routines in order to guarantee
the bus access is atomic respect to reg page configuration.
This is a preliminary patch to add i2c sensor hub support since
i2c master registers are accessed through a reg page multiplexer

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 18:32:32 +00:00
Greg Kroah-Hartman 7dc074348e Merge 4.19-rc4 into staging-next
Handle the merge issues and take the iio and staging driver fixes.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-16 22:04:13 +02:00
Lorenzo Bianconi 801a6e0af0 iio: imu: st_lsm6dsx: add support to LSM6DSO
Add support to STM LSM6DSO 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dso.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-02 21:30:47 +01:00
Lorenzo Bianconi 5b3c87fd92 iio: imu: st_lsm6dsx: add addr/max_word_len to st_lsm6dsx_read_block()
Add reg addr and max_word_len parameters to st_lsm6dsx_read_block
since LSM6DSO will use a different register address to read samples
from the FIFO and a different sample len

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-02 21:29:24 +01:00
Lorenzo Bianconi 50ff457d1b iio: imu: st_lsm6dsx: add read_fifo callback to fifo_ops
Remove static qualifier from st_lsm6dsx_read_fifo definition and
introduce read_fifo function pointer in fifo_ops data structure
in order to run the proper read_fifo routine since other compliant
devices will use a different FIFO queueing scheme.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-02 21:26:38 +01:00
Lorenzo Bianconi a13bf65f3f iio: imu: st_lsm6dsx: take into account ts samples in wm configuration
Take into account hw timer samples in pattern length computation done
in st_lsm6dsx_update_watermark routine for watermark configuration.
Moreover use samples in pattern (sip) already computed in
st_lsm6dsx_update_decimators routine

Fixes: 213451076b ("iio: imu: st_lsm6dsx: add hw timestamp support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-02 21:19:53 +01:00
Lorenzo Bianconi a42174983c iio: imu: st_lsm6dsx: add error logs to st_lsm6dsx_read_fifo()
Add debug info to error conditions in st_lsm6dsx_read_fifo routine

Suggested-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-15 10:11:22 +01:00
Lorenzo Bianconi 179c8d608c iio: imu: st_lsm6dsx: add support to ism330dlc
Add support to STM ISM330DLC 6-axis (acc + gyro) Mems sensor
http://www.st.com/resource/en/datasheet/ism330dlc.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-04-08 17:27:10 +01:00
Lorenzo Bianconi 213451076b iio: imu: st_lsm6dsx: add hw timestamp support
Introduce hw timestamp support instead of compute sample timestamps
according to interrupt rate and configured watermark. LSM6DSx based
devices are able to queue in hw FIFO the time reference of data
sampling

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-01-30 18:33:29 +00:00
Lorenzo Bianconi 91a6b841a5 iio: imu: st_lsm6dsx: pre-allocate read buffer at bootstrap
Allocate device read buffer at bootstrap and do not put it on the stack
since it is pretty big (~200B) and its size will increase adding support
to device hw timestamp.
Moreover this patch fixes following sparse warnings:
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:250:17: warning: Variable length
array is used.
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c:283:55: error: cannot size
expression

Fixes: 290a6ce11d ("iio: imu: add support to lsm6dsx driver")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:43 +01:00
Lorenzo Bianconi 51a8b70762 iio: imu: st_lsm6dsx: add regmap API support
Introduce regmap API support to access to i2c/spi bus instead of
using a custom support. Set max bulk read to
(32 / SAMPLE_SIZE) * SAMPLE_SIZE since spi_write_then_read() used in
regmap_spi indicates that is the max buffer length to use in order to
avoid a kmalloc for each bus access.
Remove lock mutex since concurrency is already managed by regmap API

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:43 +01:00
Lorenzo Bianconi 335eaedce4 iio: imu: st_lsm6dsx: introduce conf_lock mutex
Add conf_lock mutex to prevent concurrent FIFO configuration update

Fixes: 290a6ce11d (iio: imu: add support to lsm6dsx driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:43 +01:00
Lorenzo Bianconi 92617c158a iio: imu: st_lsm6dsx: add FIFO ops data structure
Introduce FIFO ops data structure to contain FIFO related parameters
in order to properly support more devices in st_lsm6dsx driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:51:01 +01:00
Lorenzo Bianconi 7ca3ac9e9e iio: imu: st_lsm6dsx: move decimator info in st_lsm6dsx_sensor_settings
Move FIFO decimator info in st_lsm6dsx_sensor_settings list since
decimator registers are exported in register map just in
lsm6ds3/lsm6ds3h/lsm6dsl/lsm6dsm sensors and not in other compliant
devices

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:51:01 +01:00
Lorenzo Bianconi ff81a933c1 iio: imu: st_lsm6dsx: split fifo mode and fifo odr configuration
Separate fifo mode and max fifo sample rate configuration.
That change will be necessary to reuse st_lsm6dsx_set_fifo_mode()
routine and to support more devices in st_lsm6dsx driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 20:50:57 +01:00
Lorenzo Bianconi ff5fff4af4 iio: imu: st_lsm6dsx: support open drain mode
Add open drain support in order to share requested IRQ line between
st_lsm6dsx device and other peripherals

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-01 10:17:00 +01:00
Lorenzo Bianconi 89ca88a7cd iio: imu: st_lsm6dsx: support active-low interrupts
Add support for active low interrupts (IRQF_TRIGGER_LOW and
IRQF_TRIGGER_FALLING). Configure the device as active high or low
according to the requested irq line.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-06-11 15:07:36 +01:00
Lorenzo Bianconi 535de397b2 iio: imu: st_lsm6dsx: modify st_lsm6dsx_flush_fifo and st_lsm6dsx_set_fifo_mode scope
Remove static qualifier from st_lsm6dsx_flush_fifo() and
st_lsm6dsx_set_fifo_mode() in order to use them in system sleep pm support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30 17:55:12 +01:00
Greg Kroah-Hartman edf5e79422 Third set of new device support, cleanups and features for IIO in the 4.12 cycle
Somewhat dominated in patch numbers of last of the outreachy application
 window related patches (they are still coming, despite window being closed
 which is good to see!)
 
 Good set of new drivers as well.
 
 New device support
 * ASPEED ADC
   - new driver
 * cpcap PMIC ADC
   - new driver
 * hid-humidity
   - driver for HID compatible humidity sensors.
 * ltc2497 ADC
   - new driver
 * mpu6050
   - bring bindings up to date and add trivial support for 9250
 * rockchip-saradc
   - update bindings to cover rk3328
 * vl6180 light, proximity and time of flight sensor.
   - new driver
 
 Features
 * meson-saradc
   - add calibration
 
 Cleanup and minor fixes
 * ad5504
   - constify attribute_group structure
   - drop casting of void *
 * ad7150
   - replace some shifts of 1 by BIT macro usage
 * ad7152
   - blank lines between function definitions
 * ad7280a
   - octal permissions.
 * ad7606
   - replace use of core mlock mutex with a local lock
 * ad7746
   - replace some shifts of 1 by BIT macro usage
   - function parameter alignment
   - drop some excessive brackets (introduced in last pull request)
 * ad7753
   - white space cleanup
 * ad7754
   - includes in alphabetical order and groupped appropriately.
   - change from missuse of internal mlock mutex to using the buffer lock to
   also protect values during frequency update.
 * ad779x
   - constify attribute_group structures
 * ad9832
   - octal permissions
 * adis16060
   - remove use of core mlock mutex in favour of adding a local
   _spi_write_then_read which can use the local buffer protection lock.
   - fix naming of above function.
 * adis16203
   - remove locking during reads of calibbias that doesn't protect anything
   not protected elsewhere.
 * adis16209
   - remove unnecessary braces in single statement if
 * adis16240
   - remove unnecessary braces in single statement if
 * adt7136
   - drop excess blank lines and put some in between functions.
 * ams-iaq
   - replace comma with semi colon. Not actual bug, just unusual syntax.
 * apds9960
   - constify attribute group structure
 * as3935
   - constify attribute group structure
 * bm1750
   - constify attribute group structure
 * cros_ec
   - devm version of triggered buffer setup to simplify code.
 * exynos
   - drop casting of void *
 * hdc100x
   - constify attribute_group structure
 * hid-accel
   - fix wrong scale for newly introduced gravity sensor.
 * hts221
   - drop casting of void *
 * hx711
   - constify attribute_group structure
 * imx7d_adc
   - drop casting of void *
 * lm35333
   - constify attribute_group structure
 * lsm6dsx
   - drop casting of void *
   - hold ODR configuration until enabling to avoid a race condition.
 * max1027
   - drop casting of void *
 * max11100
   - fix a comma where semicolon was intended (no actual bug, just odd)
 * max1363
   - constify attribute_group structure
 * ms sensors
   - drop casting of void *
 * rockchip_saradc
   - drop casting of void *
 * sun4i-gpadc
   - fix missing dependency on THERMAL or presence of stubs (issue only
   introduced in pervious set)
   - drop casting of void *
 * tsl2x7x
   - fix wrong standard deviation calc.  Note these aren't actually used for
   anything at the moment so bug didn't really matter.
   - constify attribute group structure.
 * vf610adc
   - drop casting of void *
 * vz89x
   - replace comma with semicolon. Not actual bug, just odd syntax.
 * zpa2326
   - drop casting of void *
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAljhRoIRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Fohx7Q//ZFhtcXjdZhc38u2LbbKYL68PLK2upREm
 2lXOgM7WzRAxWKTk3om2b2Wc289dWclGe5eJp2gpV8HjnoOxiiGFyzZvDOA1mL1E
 rHBhlytSxOqOGs9ELMfkAWYfTtW28LN4+6bYM7kJ0ItDptxvBEyxh4KLYlkWpYpc
 LSk26+N29n2ZMeb0yCmwQgkHMWF6kK7bpDhAF530x8hN6vSd8C+OE0G2pb4SaAn6
 wNANJ2SUwAq6jS2TzcQfjTjKnIK9/jwRZCWoEr/JL/I7M8kpQGXzIapzNhNyCODL
 ymuylr/LP82rf3Kp/himx4wxTHQ99GQHhiQedIJTGSjcCSR6mpTtwYfoMJ6rmoDZ
 t60FC9worLoqTnqIUxaP3yQSqwy/Hj1Kd1IJmiZFJjm4ki8/YxTHbQfFS6OK0s2j
 lZKN8WYvytZNArdrxMKjNGUt8y3dW1orP31ykNoxN4znhVQTGIoSc5D4Oi2NUTmY
 MhM97jzLmlOgMVHp5NAkb9iiz0JccobIFQnwjyiyyS3Q6FW4hQeypzoBO+HhZoYz
 d6+3zK2LAz8+idN8UsiALYtVLII/khhMw0N0/jLiqNW3Ceh4DPdP4BTz8aa8bNNc
 DpzeFjhHzXqmBvwyvneGaUZIRGM1uNR8FO7+qsjmw1uet7Kfyfs2arL6KfeThox7
 nxVGjupwpuo=
 =YYdq
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Third set of new device support, cleanups and features for IIO in the 4.12 cycle

Somewhat dominated in patch numbers of last of the outreachy application
window related patches (they are still coming, despite window being closed
which is good to see!)

Good set of new drivers as well.

New device support
* ASPEED ADC
  - new driver
* cpcap PMIC ADC
  - new driver
* hid-humidity
  - driver for HID compatible humidity sensors.
* ltc2497 ADC
  - new driver
* mpu6050
  - bring bindings up to date and add trivial support for 9250
* rockchip-saradc
  - update bindings to cover rk3328
* vl6180 light, proximity and time of flight sensor.
  - new driver

Features
* meson-saradc
  - add calibration

Cleanup and minor fixes
* ad5504
  - constify attribute_group structure
  - drop casting of void *
* ad7150
  - replace some shifts of 1 by BIT macro usage
* ad7152
  - blank lines between function definitions
* ad7280a
  - octal permissions.
* ad7606
  - replace use of core mlock mutex with a local lock
* ad7746
  - replace some shifts of 1 by BIT macro usage
  - function parameter alignment
  - drop some excessive brackets (introduced in last pull request)
* ad7753
  - white space cleanup
* ad7754
  - includes in alphabetical order and groupped appropriately.
  - change from missuse of internal mlock mutex to using the buffer lock to
  also protect values during frequency update.
* ad779x
  - constify attribute_group structures
* ad9832
  - octal permissions
* adis16060
  - remove use of core mlock mutex in favour of adding a local
  _spi_write_then_read which can use the local buffer protection lock.
  - fix naming of above function.
* adis16203
  - remove locking during reads of calibbias that doesn't protect anything
  not protected elsewhere.
* adis16209
  - remove unnecessary braces in single statement if
* adis16240
  - remove unnecessary braces in single statement if
* adt7136
  - drop excess blank lines and put some in between functions.
* ams-iaq
  - replace comma with semi colon. Not actual bug, just unusual syntax.
* apds9960
  - constify attribute group structure
* as3935
  - constify attribute group structure
* bm1750
  - constify attribute group structure
* cros_ec
  - devm version of triggered buffer setup to simplify code.
* exynos
  - drop casting of void *
* hdc100x
  - constify attribute_group structure
* hid-accel
  - fix wrong scale for newly introduced gravity sensor.
* hts221
  - drop casting of void *
* hx711
  - constify attribute_group structure
* imx7d_adc
  - drop casting of void *
* lm35333
  - constify attribute_group structure
* lsm6dsx
  - drop casting of void *
  - hold ODR configuration until enabling to avoid a race condition.
* max1027
  - drop casting of void *
* max11100
  - fix a comma where semicolon was intended (no actual bug, just odd)
* max1363
  - constify attribute_group structure
* ms sensors
  - drop casting of void *
* rockchip_saradc
  - drop casting of void *
* sun4i-gpadc
  - fix missing dependency on THERMAL or presence of stubs (issue only
  introduced in pervious set)
  - drop casting of void *
* tsl2x7x
  - fix wrong standard deviation calc.  Note these aren't actually used for
  anything at the moment so bug didn't really matter.
  - constify attribute group structure.
* vf610adc
  - drop casting of void *
* vz89x
  - replace comma with semicolon. Not actual bug, just odd syntax.
* zpa2326
  - drop casting of void *
2017-04-03 15:29:12 +02:00
simran singhal 407e0b537e iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-02 09:51:45 +01:00
Greg Kroah-Hartman 1c816bad41 Merge 4.11-rc4 into staging-next
We need the IIO fixes in here as well to handle merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-27 09:11:25 +02:00
Lorenzo Bianconi 6985bd5e21 iio: imu: st_lsm6dsx: fix FIFO_CTRL2 overwrite during watermark configuration
Fixes: 290a6ce11d (iio: imu: add support to lsm6dsx driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19 10:44:42 +00:00
Lorenzo Bianconi df47710a6e iio: imu: st_lsm6dsx: add support to lsm6ds3h
Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-04 12:25:05 +00:00
Lorenzo Bianconi 0b2a3e5f17 iio: imu: st_lsm6dsx: add support to lsm6dsl
Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-04 12:23:37 +00:00
Lorenzo Bianconi 290a6ce11d iio: imu: add support to lsm6dsx driver
Add support to STM LSM6DS3-LSM6DSM 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6ds3.pdf
http://www.st.com/resource/en/datasheet/lsm6dsm.pdf

- continuous mode support
- i2c support
- spi support
- sw fifo mode support
- supported devices: lsm6ds3, lsm6dsm

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-14 12:40:37 +00:00