summaryrefslogtreecommitdiffstats
path: root/drivers/iio
AgeCommit message (Collapse)Author
2019-12-08iio: st_accel: Fix unused variable warningYueHaibing
drivers/iio/accel/st_accel_core.c:1005:44: warning: mount_matrix_ext_info defined but not used [-Wunused-const-variable=] Using stub helper while CONFIG_ACPI is disabled to fix it. Suggested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-08iio: adc: ad7606: fix reading unnecessary data from deviceBeniamin Bia
When a conversion result is being read from ADC, the driver reads the number of channels + 1 because it thinks that IIO_CHAN_SOFT_TIMESTAMP is also a physical channel. This patch fixes this issue. Fixes: 2985a5d88455 ("staging: iio: adc: ad7606: Move out of staging") Reported-by: Robert Wörle <rwoerle@mibtec.de> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-13Merge tag 'iio-for-5.5c' of ↵Greg Kroah-Hartman
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third set of IIO new device support cleanups and fixes for the 5.5 cycle. New device support * ad5446 - Support the ad5600 DAC (id only needed). * ad7292 ADC DAC etc - New driver plus dt-bindings. * veml6030 ambient light sensor - New driver plus dt-bindings and sysfs docs. Features * mpu6050 - Explicit VDD control. * stm32-adc - Allow limiting of max clock frequency from devicetree to ensure it's suitable for external circuitry. yaml binding conversions * ltc1660 * mcp3911 Fixes * adis16480 - Fix wrong scale factors. - Fix debugfs reg access by providing the callback. * cros_ec_baro - Fixing missing mask entry to make available sample frequencies visible in sysfs. * st_lsm6dsx - Explicitly handle different ODR table sizes. - Handle restrictions between slave ODR and accel ODR when both are enabled. - Allow ODR to be expressed more accurately by using miliHz. * tools - Fix an issue with parallel builds. Cleanups and warning fixes * adis16136, adis16400, adis16460, adis-lib - Change some checks on return values to be for 0 rather than strictly negative. Avoids some fiddly issues with the compiler concluding some variables are initialized due to a mixture of error checks. - Assign values only on success of 'read' operations - avoiding any chance the compiler will falsly suggest they might be used uninitialized. - Whitespace and simlar cleanups. * aspeed adc - devm_platfom_ioremap_resource to reduce boilerplate. * bcm-iproc-adc - Stray semicolon removal. * cc10001 - devm_platfom_ioremap_resource to reduce boilerplate. * dln2-adc - Reorganise the buffered mode setup and tear down. Part of moving towards being able to refactor this area of the IIO core. * hdc100x - Reorganise the buffered mode setup and tear down. * ingenic-adc - devm_platfom_ioremap_resource to reduce boilerplate. * lpc18xx-adc - devm_platfom_ioremap_resource to reduce boilerplate. * lpc18xx-dac - devm_platfom_ioremap_resource to reduce boilerplate. * mt6577 - devm_platfom_ioremap_resource to reduce boilerplate. * npcm - devm_platfom_ioremap_resource to reduce boilerplate. * rcar-gyroadc - devm_platfom_ioremap_resource to reduce boilerplate. * spear-adc - devm_platfom_ioremap_resource to reduce boilerplate. * vf610-adc - devm_platfom_ioremap_resource to reduce boilerplate. * vf610-dac - devm_platfom_ioremap_resource to reduce boilerplate. * tag 'iio-for-5.5c' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (43 commits) iio: adis16480: Add debugfs_reg_access entry iio: adis16480: Fix scales factors tools: iio: Correctly add make dependency for iio_utils iio: adc: Add driver support for AD7292 dt-bindings: iio: adc: Add dt-schema for AD7292 dt-bindings: iio: adc: Migrate MCP3911 documentation to yaml iio: imu: mpu6050: Add support for vdd-supply regulator dt-bindings: iio: imu: mpu6050: add vdd-supply iio: cros_ec_baro: set info_mask_shared_by_all_available field iio: dac: ad5446: Add support for new AD5600 DAC dt-bindings: iio: dac: Migrate LTC1660 documentation to yaml iio: documentation: light: Add veml6030 sysfs documentation dt-bindings: iio: light: add veml6030 ALS bindings iio: light: add driver for veml6030 ambient light sensor iio: imu: st_lsm6dsx: express odr in mHZ iio: imu: st_lsm6dsx: fix ODR check in st_lsm6dsx_write_raw iio: imu: st_lsm6dsx: explicitly define odr table size iio: adc: stm32: allow to tune analog clock dt-bindings: iio: stm32-adc: add max clock rate property iio: dac: vf610: Use devm_platform_ioremap_resource ...
2019-11-11iio: adis16480: Add debugfs_reg_access entryNuno Sá
The driver is defining debugfs entries by calling `adis16480_debugfs_init()`. However, those entries are attached to the iio_dev debugfs entry which won't exist if no debugfs_reg_access callback is provided. Fixes: 2f3abe6cbb6c ("iio:imu: Add support for the ADIS16480 and similar IMUs") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-11iio: adis16480: Fix scales factorsNuno Sá
This patch fixes the scales for the gyroscope, accelerometer and barometer. The pressure scale was just wrong. For the others, the scale factors were not taking into account that a 32bit word is being read from the device. Fixes: 7abad1063deb ("iio: adis16480: Fix scale factors") Fixes: 82e7a1b25017 ("iio: imu: adis16480: Add support for ADIS1649x family of devices") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-11Merge 5.4-rc7 into staging-nextGreg Kroah-Hartman
We want the staging fixes in here, and it resolves some merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-10iio: adc: Add driver support for AD7292Marcelo Schmitt
The AD7292 is a 10-bit monitor and control system with ADC, DACs, temperature sensor, and GPIOs. Configure AD7292 devices in direct access mode, enabling single-ended ADC readings. Datasheet: Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7292.pdf Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-10iio: imu: mpu6050: Add support for vdd-supply regulatorStephan Gerhold
MPU6050 has two power supply pins: VDD and VLOGIC, but the mpu6050 driver only supports enabling one of them at the moment. In some cases, they may need to be enabled separately. Add an additional "vdd-supply" that stays enabled for as long as the driver is loaded. We cannot turn off the VDD regulator during suspend as this would cause register settings (FSR, sampling rate, ...) to be lost. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-10iio: cros_ec_baro: set info_mask_shared_by_all_available fieldGwendal Grignou
Field was already set for light/proximity and accelerometer/gyroscope/magnetometer sensors. Fixes: ae7b02ad2f32 ("iio: common: cros_ec_sensors: Expose cros_ec_sensors frequency range via iio sysfs") Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-10iio: dac: ad5446: Add support for new AD5600 DACStefan Popa
The AD5600 is a single channel, 16-bit resolution, voltage output digital to analog converter (DAC). The AD5600 uses a 3-wire SPI interface. It is part of the AD5541 family of DACs. The ad5446 IIO driver implements support for some of these DACs (in the AD5441 family), so the change is a simple entry in this driver. Link: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5600.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-10iio: light: add driver for veml6030 ambient light sensorRishi Gupta
veml6030 is an ambient light sensor from Vishay semiconductors. It has 16-bit resolution, supports both ambient light measurement and white channel which is more responsive to wider wavelength spectrum. It has flexible power saving, integration time and gain options. Communication with host is over I2C. Signed-off-by: Rishi Gupta <gupt21@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: imu: st_lsm6dsx: express odr in mHZLorenzo Bianconi
Express available frequencies in mHZ in order to support even rational ODRs. This patch is need to fix an Android CTS failure Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: imu: st_lsm6dsx: fix ODR check in st_lsm6dsx_write_rawLorenzo Bianconi
Since st_lsm6dsx i2c master controller relies on accel device as trigger and slave devices can run at different ODRs we must select an accel_odr >= slave_odr. Report real accel ODR in st_lsm6dsx_check_odr() in order to properly set sensor frequency in st_lsm6dsx_write_raw and avoid to report unsupported frequency Fixes: 6ffb55e5009ff ("iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor ids") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: imu: st_lsm6dsx: explicitly define odr table sizeLorenzo Bianconi
Introduce odr_len in st_lsm6dsx_odr_table_entry data structure in order to explicitly define odr table size and support devices with different odr table map Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: adc: stm32: allow to tune analog clockFabrice Gasnier
Add new optional dt property to tune analog clock prescaler. Driver looks for optional "st,max-clk-rate-hz", then computes best approximation below that rate, using ADC internal prescaler. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-09iio: dac: vf610: Use devm_platform_ioremap_resourceJonathan Cameron
Reduce local boilerplate. Suggested by coccinelle CHECK drivers/iio/dac/vf610_dac.c drivers/iio/dac/vf610_dac.c:189:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Sanchayan Maity <maitysanchayan@gmail.com>
2019-11-09iio: dac: lpc18xx: Use devm_platform_ioremap_resourceJonathan Cameron
Reduce boilerplate. Suggested by coccinelle CHECK drivers/iio/dac/lpc18xx_dac.c drivers/iio/dac/lpc18xx_dac.c:121:1-10: WARNING: Use devm_platform_ioremap_resource for dac -> base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> CC: Joachim Eastwood <manabian@gmail.com>
2019-11-09iio: adc: vf610: use devm_platform_ioremap_resourceJonathan Cameron
Reduces boilerplate. Suggested by coccinelle CHECK drivers/iio/adc/vf610_adc.c drivers/iio/adc/vf610_adc.c:819:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Fugang Duan <b38611@freescale.com>
2019-11-09iio: adc: spear_adc: Use devm_platform_ioremap_resourceJonathan Cameron
Avoids local boilerplate doing the same thing. Suggested by coccinelle CHECK drivers/iio/adc/spear_adc.c drivers/iio/adc/spear_adc.c:283:1-22: WARNING: Use devm_platform_ioremap_resource for st -> adc_base_spear6xx Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2019-11-09iio: adc: rcar-gyroadc: use devm_platform_ioremap_resourceJonathan Cameron
Avoids some local boilerplate. Suggested by coccinelle. CHECK drivers/iio/adc/rcar-gyroadc.c drivers/iio/adc/rcar-gyroadc.c:495:1-11: WARNING: Use devm_platform_ioremap_resource for priv -> regs Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-11-09iio: adc: npcm: use devm_platform_ioremap_resourceJonathan Cameron
Reduces local boilerplate code. Suggested by coccinelle via coccicheck. CHECK drivers/iio/adc/npcm_adc.c drivers/iio/adc/npcm_adc.c:200:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Tomer Maimon <tmaimon77@gmail.com>
2019-11-09iio: adc: lpc18xx: use devm_platform_ioremap_resourceJonathan Cameron
Avoid local boilerplate. Identified by coccinelle CHECK drivers/iio/adc/lpc18xx_adc.c drivers/iio/adc/lpc18xx_adc.c:137:1-10: WARNING: Use devm_platform_ioremap_resource for adc -> base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Joachim Eastwood <manabian@gmail.com>
2019-11-09iio: adc: ingenic: Use devm_platform_ioremap_resourceJonathan Cameron
Replaces local boilerplate. Identified by coccinelle. CHECK drivers/iio/adc/ingenic-adc.c drivers/iio/adc/ingenic-adc.c:449:1-10: WARNING: Use devm_platform_ioremap_resource for adc -> base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Artur Rojek <contact@artur-rojek.eu>
2019-11-09iio: adc: cc10001: use devm_platform_ioremap_resourceJonathan Cameron
Reduces local boilerplate. Found by coccinelle: drivers/iio/adc/cc10001_adc.c:344:1-18: WARNING: Use devm_platform_ioremap_resource for adc_dev -> reg_base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Naidu Tellapati <naidu.tellapati@imgtec.com>
2019-11-09iio: adc: bcm_iproc_adc: drop a stray semicolonJonathan Cameron
Found by coccinelle / coccicheck CHECK drivers/iio/adc/bcm_iproc_adc.c drivers/iio/adc/bcm_iproc_adc.c:311:3-4: Unneeded semicolon Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
2019-11-09iio: adc: mt6577_auxdac: use devm_platform_ioremap_resourceJonathan Cameron
Reduces boilerplate. Identified by coccinelle CHECK drivers/iio/adc/mt6577_auxadc.c drivers/iio/adc/mt6577_auxadc.c:257:1-18: WARNING: Use devm_platform_ioremap_resource for adc_dev -> reg_base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Zhiyong Tao <zhiyong.tao@mediatek.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2019-11-09iio: adc: aspeed: use devm_platform_ioremap_resourceJonathan Cameron
Reduces boilerplate. Identified by: Coccinelle / coccicheck CHECK drivers/iio/adc/aspeed_adc.c drivers/iio/adc/aspeed_adc.c:189:1-11: WARNING: Use devm_platform_ioremap_resource for data -> base Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Rick Altherr <raltherr@google.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2019-11-03iio: imu: adis: assign read val in debugfs hook only if op successfulAlexandru Ardelean
This was also caught by the `-Wmaybe-uninitialized` warning, which (ironically as-is) it makes quite a lot of sense to do for this. The code that actually calls this function will fail to copy on the uninitialized value. Hence, patch does not need to go into stable. Fixes: 78026a6fde8f7 ("iio:imu:adis: Add debugfs register access support") Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16480: assign bias value only if operation succeededAlexandru Ardelean
This was found only after the whole thing with the inline functions, but the compiler actually found something. The value of the `bias` (in adis16480_get_calibbias()) should only be set if the read operation was successful. No actual known problem occurs as users of this function all ultimately check the return value. Hence probably not stable material. Fixes: 2f3abe6cbb6c9 ("iio:imu: Add support for the ADIS16480 and similar IMUs") Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16480: prefer `unsigned int` over `unsigned`Alexandru Ardelean
This is a typical checkpatch warning. The change just renames the type of the `freq` var to `unsigned int`. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16480: fix indentation of return statementAlexandru Ardelean
This is just a minor indentation/alignment fix for the default case of a switch statement. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis: check ret val for non-zero vs less-than-zeroAlexandru Ardelean
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16480: check ret val for non-zero vs less-than-zeroAlexandru Ardelean
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16460: check ret val for non-zero vs less-than-zeroAlexandru Ardelean
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: imu: adis16400: check ret val for non-zero vs less-than-zeroAlexandru Ardelean
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: gyro: adis16136: check ret val for non-zero vs less-than-zeroAlexandru Ardelean
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-02iio: hdc100x: fix iio_triggered_buffer_{predisable,postenable} positionsAlexandru Ardelean
The iio_triggered_buffer_postenable() hook should be called first to attach the poll function and the iio_triggered_buffer_predisable() hook should be called last in the predisable hook. This change updates the driver to attach/detach the poll func in the correct order. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-02iio: dln2-adc: fix iio_triggered_buffer_postenable() positionAlexandru Ardelean
The iio_triggered_buffer_postenable() hook should be called first to attach the poll function. The iio_triggered_buffer_predisable() hook is called last (as is it should). This change moves iio_triggered_buffer_postenable() to be called first. It adds iio_triggered_buffer_predisable() on the error paths of the postenable hook. For the predisable hook, some code-paths have been changed to make sure that the iio_triggered_buffer_predisable() hook gets called in case there is an error before it. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-27iio: imu: st_lsm6dsx: add support to LSM6DSRXLorenzo Bianconi
Add support to STM LSM6DSRX 6-axis (acc + gyro) Mems sensor https://www.st.com/resource/en/datasheet/lsm6dsrx.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-27iio: adc: stm32-adc: fix stopping dmaFabrice Gasnier
There maybe a race when using dmaengine_terminate_all(). The predisable routine may call iio_triggered_buffer_predisable() prior to a pending DMA callback. Adopt dmaengine_terminate_sync() to ensure there's no pending DMA request before calling iio_triggered_buffer_predisable(). Fixes: 2763ea0585c9 ("iio: adc: stm32: add optional dma support") Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-27iio: st: Drop GPIO includeLinus Walleij
None of the ST sensor drivers use any symbols from <linux/gpio.h>, just drop the include from all of them. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: adc: hx711: optimize performance in read cycleAndreas Klinger
Set gain in hx711_reset() to its default value after a reset cycle. This omits one precautionary read cycle, because the read is performed in hx711_set_gain_for_channel() anyway if gain has changed. Check for DOUT low and if its high wait some time if it goes down instead of doing a blind reset cycle when DOUT is not down. This is a performance optimization which allows to query the sensor with a higher frequency. Signed-off-by: Andreas Klinger <ak@it-klinger.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: adc: stm32-adc: fix kernel-doc warningsFabrice Gasnier
Fix the following warnings when documentation is built: drivers/iio/adc/stm32-adc-core.c:62: warning: cannot understand function prototype: 'struct stm32_adc_common_regs ' drivers/iio/adc/stm32-adc-core.c:78: warning: cannot understand function prototype: 'struct stm32_adc_priv_cfg ' drivers/iio/adc/stm32-adc-core.c:123: warning: Function parameter or member 'pdev' not described in 'stm32f4_adc_clk_sel' drivers/iio/adc/stm32-adc.c:219: warning: cannot understand function prototype: 'struct stm32_adc_regs ' drivers/iio/adc/stm32-adc.c:237: warning: cannot understand function prototype: 'struct stm32_adc_regspec ' drivers/iio/adc/stm32-adc.c:264: warning: cannot understand function prototype: 'struct stm32_adc_cfg ' drivers/iio/adc/stm32-adc.c:323: warning: Function parameter or member 'difsel' not described in 'N' drivers/iio/adc/stm32-adc.c:323: warning: Function parameter or member 'pcsel' not described in 'stm32_adc' drivers/iio/adc/stm32-adc.c:371: warning: cannot understand function prototype: 'const struct stm32_adc_regs stm32f4_sq[STM32_ADC_MAX_SQ + 1] drivers/iio/adc/stm32-adc.c:417: warning: cannot understand function prototype: 'const struct stm32_adc_regs stm32f4_smp_bits[] = ' drivers/iio/adc/stm32-adc.c:508: warning: cannot understand function prototype: 'const struct stm32_adc_regs stm32h7_smp_bits[] = ' drivers/iio/adc/stm32-adc.c:1112: warning: Function parameter or member 'indio_dev' not described in 'stm32_adc_get_trig_extsel' drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member 'indio_dev' not described in 'stm32_adc_debugfs_reg_access' drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member 'reg' not described in 'stm32_adc_debugfs_reg_access' drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member 'writeval' not described in 'stm32_adc_debugfs_reg_access' drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member 'readval' not described in 'stm32_adc_debugfs_reg_access' Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: pressure: zpa2326: fix iio_triggered_buffer_postenable positionAlexandru Ardelean
The iio_triggered_buffer_{predisable,postenable} functions attach/detach the poll functions. The iio_triggered_buffer_postenable() should be called before (to attach the poll func) and then the The iio_triggered_buffer_predisable() function is hooked directly without anything, which is probably fine, as the postenable() version seems to also do some reset/wake-up of the device. This will mean it will be easier when removing it; i.e. it just gets removed. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: imu: inv_mpu6050: fix no data on MPU6050Jean-Baptiste Maneyrol
Some chips have a fifo overflow bit issue where the bit is always set. The result is that every data is dropped. Change fifo overflow management by checking fifo count against a maximum value. Add fifo size in chip hardware set of values. Fixes: f5057e7b2dba ("iio: imu: inv_mpu6050: better fifo overflow handling") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: chemical: sgp30: drop excess semicolonJonathan Cameron
Suggested by coccinelle / coccicheck. CHECK drivers/iio/chemical/sgp30.c drivers/iio/chemical/sgp30.c:486:2-3: Unneeded semicolon Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Andreas Brauchli <a.brauchli@elementarea.net>
2019-10-22iio: adc: twl4030: Use false / true instead of 0 / 1 with booleansJonathan Cameron
Suggestion from coccinelle / coccicheck CHECK drivers/iio/adc/twl4030-madc.c drivers/iio/adc/twl4030-madc.c:524:6-15: WARNING: Comparison of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:655:1-43: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:659:2-44: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:664:1-43: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:498:2-34: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:510:2-19: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:511:2-11: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:531:2-19: WARNING: Assignment of 0/1 to bool variable drivers/iio/adc/twl4030-madc.c:532:2-11: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Sebastian Reichel <sre@kernel.org>
2019-10-22iio: temperature: Add support for LTC2983Nuno Sá
The LTC2983 is a Multi-Sensor High Accuracy Digital Temperature Measurement System. It measures a wide variety of temperature sensors and digitally outputs the result, in °C or °F, with 0.1°C accuracy and 0.001°C resolution. It can measure the temperature of all standard thermocouples (type B,E,J,K,N,S,R,T), standard 2-,3-,4-wire RTDs, thermistors and diodes. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: pressure: bmp280: use devm action and remove labels from probeBartosz Golaszewski
We can drop some duplicate code if we use devm_action for disabling regulators and pm and the managed variant of iio_device_register(). This allows us to completely remove all remove() callbacks from both i2c and spi code. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-22iio: pressure: bmp280: use bulk regulator opsBartosz Golaszewski
The vddd and vdda supplies are always operated on together. We can shrink the code a bit by using the bulk regulator helpers. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>