aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/st_lsm6dsx (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-22iio: imu: st_lsm6dsx: inline per-sensor dataLorenzo Bianconi1-34/+16
As it has been already done for other st sensors in 'commit 9049531c91b4 ("iio: accel: st_accel: inline per-sensor data")', get rid of some defines and just open code the values into the appropriate struct elements since the semantic meaning is inherent in the name of the C99-addressable fields and there is no reason to duplicate the code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-14iio: imu: st_lsm6dsx: remove set but not used variables 'acc_sensor' and 'gyro_sensor'YueHaibing1-4/+0
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 14c7c6e1a860 ("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-07iio: imu: st_lsm6dsx: add support to LSM6DSRLorenzo Bianconi6-6/+83
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-04iio: imu: st_lsm6dsx: add support to LSM6DSOXLorenzo Bianconi6-4/+17
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-04iio: imu: st_lsm6dsx: add support to ASM330LHHLorenzo Bianconi6-6/+57
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>
2018-12-22iio: imu: st_lsm6dsx: remove set but not used variable ''YueHaibing1-2/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c: In function 'st_lsm6dsx_shub_read_reg': drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c:108:41: warning: variable 'hub_settings' set but not used [-Wunused-but-set-variable] It never used since introduction in commit c91c1c844ebd ("iio: imu: st_lsm6dsx: add i2c embedded controller support") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-25iio: imu: st_lsm6dsx: do not use a fixed read len in read_oneshotLorenzo Bianconi1-6/+8
Generalize st_lsm6dsx_shub_read_oneshot in order to not use a fixed read length and take into account iio channel realbits for single read operations Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16iio: imu: st_lsm6dsx: add hw FIFO support to i2c controllerLorenzo Bianconi4-6/+125
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-16iio: imu: st_lsm6dsx: add st_lsm6dsx_push_tagged_data routineLorenzo Bianconi1-15/+29
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-16iio: imu: st_lsm6dsx: add i2c embedded controller supportLorenzo Bianconi4-43/+909
i2c controller embedded in lsm6dx series can connect up to four slave devices using accelerometer sensor as trigger for i2c read/write operations. Introduce sensor hub support for lsm6dso sensor. Add register map for lis2mdl magnetometer sensor. In order to perform single read/write operations st_lsm6dsx driver relies on SLV0 channel (hw FIFO is not supported yet) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routineLorenzo Bianconi3-33/+15
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-16iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor idsLorenzo Bianconi3-9/+88
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-16iio: imu: st_lsm6dsx: remove static from st_lsm6dsx_set_watermarkLorenzo Bianconi2-1/+2
Remove static qualifier from st_lsm6dsx_set_watermark routine in order to be reused supporting st_lsm6dsx i2c controller Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16iio: imu: st_lsm6dsx: reload trimming parameter at bootstrapLorenzo Bianconi1-3/+15
Perform a complete device reset at bootstrap reloading trimming parameter after sw reset is completed. Device sw reset/boot is explained here: https://www.st.com/resource/en/application_note/dm00517282.pdf, section 5.7 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16iio: imu: st_lsm6dsx: introduce locked read/write utility routinesLorenzo Bianconi3-38/+90
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-09-16Merge 4.19-rc4 into staging-nextGreg Kroah-Hartman1-7/+6
Handle the merge issues and take the iio and staging driver fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-02iio: imu: st_lsm6dsx: add support to LSM6DSOLorenzo Bianconi6-8/+205
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-02iio: imu: st_lsm6dsx: add addr/max_word_len to st_lsm6dsx_read_block()Lorenzo Bianconi1-7/+9
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-02iio: imu: st_lsm6dsx: make st_lsm6dsx_check_odr() non-staticLorenzo Bianconi2-2/+2
Remove static qualifier from st_lsm6dsx_check_odr() definition in order to use it for the support of new devices Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-09-02iio: imu: st_lsm6dsx: add read_fifo callback to fifo_opsLorenzo Bianconi3-3/+11
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-02iio: imu: st_lsm6dsx: take into account ts samples in wm configurationLorenzo Bianconi1-7/+6
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: 213451076bd3 ("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-07-15iio: imu: st_lsm6dsx: add error logs to st_lsm6dsx_read_fifo()Lorenzo Bianconi1-3/+13
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-04-08iio: imu: st_lsm6dsx: add support to ism330dlcLorenzo Bianconi6-7/+21
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-08iio: imu: st_lsm6dsx: fix FIFO threshold mask for LSM6DSM/LSM6DSLLorenzo Bianconi1-2/+2
According to the latest datasheet, LSM6DSM and LSM6DSL imu sensors export GENMASK(10, 0) for FIFO threshold mask definition. Despite that is not an actual issue since write on fifo_th register is protected by max_fifo_size value, fix fifo_th and fifo_diff register definitions Fixes: 290a6ce11d93 ("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>
2018-01-30iio: imu: st_lsm6dsx: add hw timestamp supportLorenzo Bianconi3-70/+224
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-08iio: imu: st_lsm6dsx: remove st_lsm6dsx_write_with_mask() declarationLorenzo Bianconi1-2/+0
Remove st_lsm6dsx_write_with_mask() declaration since it has been removed in commit 6674bef628e6 ("iio: imu: st_lsm6dsx: add regmap API support") 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-08iio: imu: st_lsm6dsx: pre-allocate read buffer at bootstrapLorenzo Bianconi3-4/+11
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: 290a6ce11d93 ("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-08iio: imu: st_lsm6dsx: add regmap API supportLorenzo Bianconi6-211/+131
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-08iio: imu: st_lsm6dsx: introduce conf_lock mutexLorenzo Bianconi3-8/+21
Add conf_lock mutex to prevent concurrent FIFO configuration update Fixes: 290a6ce11d93 (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-08iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()Lorenzo Bianconi1-1/+1
Apply le16_to_cpu() to data read from the sensor in order to take into account architecture endianness Fixes: 290a6ce11d93 (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>
2017-10-09iio: imu: st_lsm6dsx: add FIFO ops data structureLorenzo Bianconi3-15/+63
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-09iio: imu: st_lsm6dsx: move decimator info in st_lsm6dsx_sensor_settingsLorenzo Bianconi3-14/+47
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-09iio: imu: st_lsm6dsx: split fifo mode and fifo odr configurationLorenzo Bianconi1-15/+17
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-09iio: imu: st_lsm6dsx: convert max_fifo_size in FIFO sample sizeLorenzo Bianconi1-6/+5
Express max fifo depth in ST_LSM6DSX_SAMPLE_SIZE instead of in bytes. That change will be necessary 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-09-24iio: imu: st_lsm6dsx: remove rounding configurationLorenzo Bianconi1-7/+0
Remove rounding configuration since it is enabled by default for the FIFO output registers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-09-24iio: imu: st_lsm6dsx: remove LIR configurationLorenzo Bianconi1-8/+0
Remove Latched Interrupt configuration since it is enabled by default for FIFO watermark interrupt Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-09-24iio: imu: st_lsm6dsx: set sensor->odr value just in st_lsm6dsx_write_raw()Lorenzo Bianconi1-1/+2
Update odr value in st_lsm6dsx_sensor data structure just in st_lsm6dsx_write_raw() in order to avoid to set the same value multiple times Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-08-22iio:imu: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-2/+0
The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-07-01iio: imu: st_lsm6dsx: support open drain modeLorenzo Bianconi1-0/+17
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-06-11iio: imu: st_lsm6dsx: support active-low interruptsLorenzo Bianconi1-0/+14
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-05-21iio: imu: st_lsm6dsx: substitute ifdef CONFIG_PM with __maybe_unused macroLorenzo Bianconi1-4/+2
Get rid of #ifdef CONFIG_PM by adding __maybe_unused macro to st_lsm6dsx_suspend and st_lsm6dsx_resume function declarations Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30iio: imu: st_lsm6dsx: add system power management supportLorenzo Bianconi4-0/+58
Add system sleep power management support to st_lsm6dsx driver. In particular during suspend phase each sensor is disabled and hw fifo is configured in bypass in order to avoid subsequent I/O operations. The patch has been tested on HiKey board device Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30iio: imu: st_lsm6dsx: modify st_lsm6dsx_flush_fifo and st_lsm6dsx_set_fifo_mode scopeLorenzo Bianconi2-3/+6
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-14iio: imu: st_lsm6dsx: simplify data ready pin parsingLorenzo Bianconi1-9/+1
Simplify st_lsm6dsx_of_get_drdy_pin routine since of_property_read_u32 error conditions are already managed in st_lsm6dsx_get_drdy_reg() Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-08iio: imu: st_lsm6dsx: use i2c/spi device name for iio_dev nameLorenzo Bianconi4-8/+14
Use the correct chip name (e.g. lsm6dsm) as suffix for iio_dev name instead of a generic one (lsm6dsx) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-03Merge tag 'iio-for-4.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman2-17/+28
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-02iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handlerLorenzo Bianconi1-15/+26
This patch allows to avoid a transitory that occurs when a given sensor has been already enabled (e.g. gyroscope) and the user is configuring the sample frequency of the other one (e.g. accelerometer). The transitory lasts until the accelerometer is enabled. During that time slice the gyroscope ODR is incorrectly modified as well. At the end of the transitory both sensors work at the right frequency. Fix it introducing st_lsm6dsx_check_odr() routine to check ODR consistency in write_raw handler in order to apply frequency configuration just in st_lsm6dsx_set_odr() Fixes: 290a6ce11d93 (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-04-02iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointersimran singhal1-2/+2
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-03-27Merge 4.11-rc4 into staging-nextGreg Kroah-Hartman1-2/+2
We need the IIO fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-19iio: imu: st_lsm6dsx: fix FIFO_CTRL2 overwrite during watermark configurationLorenzo Bianconi1-2/+2
Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>