summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)Author
2020-05-10iio: light: cm32181: Add some extra register definesHans de Goede
These come from a newer version of cm32181.c, which is floating around the net, with a copyright of: * Copyright (C) 2014 Capella Microsystems Inc. * Author: Kevin Tsai <ktsai@capellamicro.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2, as published * by the Free Software Foundation. Note that this removes the bogus CM32181_CMD_ALS_ENABLE define, there is no enable bit, only a disable bit and enabled is the absence of being disabled. This is a preparation patch for adding support for the older CM3218 model of the light sensor. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-10iio: light: cm32181: Add support for ACPI enumerationHans de Goede
Add support for ACPI enumeration, this has been tested on a HP HP Pavilion x2 Detachable 10 (Bay Trail model). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-10iio: light: cm32181: Switch to new style i2c-driver probe functionHans de Goede
Switch to the new style i2c-driver probe_new probe function and drop the unnecessary i2c_device_id table (we do not have any old style board files using this). This is a preparation patch for adding ACPI binding support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-10iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_triggerAlexandru Ardelean
The main intent here is to get rid of the iio_buffer_set_attrs() helper, or at least rework it's usage a bit. The problem with that helper is that it needs a pointer to the buffer, which makes supporting multiple buffers per IIO device a bit more cumbersome. The hid_sensor_setup_trigger() is pretty much used in the same way: - iio_triggered_buffer_setup() gets called before - then hid_sensor_setup_trigger() and hid_sensor_setup_batch_mode() gets called which may attach some fifo attributes This change merges the 2 together under the hid_sensor_setup_trigger() function. Only the &iio_pollfunc_store_time is passed to all devices, so it's not even required to pass it explicitly outside of the common hid_sensor_setup_trigger() function. Moving the devm_iio_triggered_buffer_setup/cleanup() calls into the common place code can help the rework of the buffer code, since it is in one place. One detail of the change is that there are 2 drivers that use devm_iio_triggered_buffer_setup(). That function gets implicitly replaced with iio_triggered_buffer_setup()/cleanup(), but since all drivers call both hid_sensor_setup_trigger9) & hid_sensor_remove_trigger() trigger, the iio_triggered_buffer_cleanup() piggy backs on the hid_sensor_remove_trigger() call, which should cover the cleanup. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: vcnl4000: Add buffer support for VCNL4010/20.Mathieu Othacehe
The VCNL4010 and VCNL4020 chips are able to raise interrupts on data ready. Use it to provide triggered buffer support for proximity data. Those two chips also provide ambient light data. However, they are sampled at different rate than proximity data. As this is not handled by the IIO framework for now, and the sample frequencies of ambient light data are very low, do add buffer support for them. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: vcnl4000: Add sampling frequency support for VCNL4010/20.Mathieu Othacehe
Add sampling frequency support for proximity data on VCNL4010 and VCNL4020 chips. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: vcnl4000: Add event support for VCNL4010/20.Mathieu Othacehe
The VCNL4010 and VCNL4020 chips are able to raise interrupts on proximity threshold events. Add support for threshold rising and falling events for those two chips. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: vcnl4000: Factorize data reading and writing.Mathieu Othacehe
Factorize data reading in vcnl4000_measure into a vcnl4000_read_data function. Also add a vcnl4000_write_data function. Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: vcnl4000: Fix i2c swapped word reading.Mathieu Othacehe
The bytes returned by the i2c reading need to be swapped unconditionally. Otherwise, on be16 platforms, an incorrect value will be returned. Taking the slow path via next merge window as its been around a while and we have a patch set dependent on this which would be held up. Fixes: 62a1efb9f868 ("iio: add vcnl4000 combined ALS and proximity sensor") Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: imu: adis16xxx: use helper to access iio core debugfs dirAlexandru Ardelean
The IIO core provides a iio_get_debugfs_dentry() helper. It seems that the ADIS IMU drivers access that field directly. This change converts them to use iio_get_debugfs_dentry() instead. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: stm32-dfsdm: fix device used to request dmaFabrice Gasnier
DMA channel request should use device struct from platform device struct. Currently it's using iio device struct. But at this stage when probing, device struct isn't yet registered (e.g. device_register is done in iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create symlinks between DMA channels and slaves"), a warning message is printed as the links in sysfs can't be created, due to device isn't yet registered: - Cannot create DMA slave symlink - Cannot create DMA dma:rx symlink Fix this by using device struct from platform device to request dma chan. Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone") Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: stm32-adc: fix device used to request dmaFabrice Gasnier
DMA channel request should use device struct from platform device struct. Currently it's using iio device struct. But at this stage when probing, device struct isn't yet registered (e.g. device_register is done in iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create symlinks between DMA channels and slaves"), a warning message is printed as the links in sysfs can't be created, due to device isn't yet registered: - Cannot create DMA slave symlink - Cannot create DMA dma:rx symlink Fix this by using device struct from platform device to request dma chan. Fixes: 2763ea0585c99 ("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>
2020-05-03iio: adc: ti-ads8344: Fix channel selectionGregory CLEMENT
During initial submission the selection of the channel was done using the scan_index member of the iio_chan_spec structure. It was an abuse because this member is supposed to be used with a buffer so it was removed. However there was still the need to be able to known how to select a channel, the correct member to store this information is address. Thanks to this it is possible to select any other channel than the channel 0. Fixes: 8dd2d7c0fed7 ("iio: adc: Add driver for the TI ADS8344 A/DC chips") Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: DAC extension for ltc2634-12/10/8Chris Ruehl
This patch add support for Analog Devices (Linear Technology) LTC2634 Quad 12-/10-/8-Bit Rail-to-Rail DAC. The SPI functionality based on them from LTC2632 therefor add the definitions only and update the Kconfig. Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: documentation ltc2632_chip_info add num_channelsChris Ruehl
The documentation for ltc_2632_chip_info missed the desciption for the num_channels. This trivial patch adds it. Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Fixes: 9f15a4a0adc9 ("iio: dac: ltc2632: add support for LTC2636 family") Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: magnetometer: ak8974: Provide scalingLinus Walleij
The manual for the HSCDTD008A gives us a scaling for the three axis as +/- 2.4mT (24 Gauss) per axis. The manual for the AMI305 and AMI306 gives us a scaling for the three axis as +/- 12 Gauss per axis. Tests with the HSCDTD008A sensor, cat the raw values: $ cat in_magn_*_raw raw 45 189 -19 The scaling factor in in_magn_*_scale is 0.001464843, which gives: 0.065 Gauss 0.277 Gauss -0.027 Gauss The earths magnetic field is in the range of 0.25 to 0.65 Gauss on the surface according to Wikipedia, so these seem like reasonable values. Again we are guessing that the AK8974 has a 12 bit ADC, based on the similarity with AMI305 and AMI306. Cc: Nick Reitemeyer <nick.reitemeyer@web.de> Cc: Stephan Gerhold <stephan@gerhold.net> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: magnetometer: ak8974: Break out measurementLinus Walleij
This breaks out the measurement code to its own function so we can handle this without swirling it up with the big switch() statement inside ak8974_read_raw(). Keep a local s16 helper variable for the signed value coming out of the measurement before assigning it to the integer *val. The local variable makes the code easier to read and the compiler will optimize it if possible. Cc: Nick Reitemeyer <nick.reitemeyer@web.de> Cc: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: magnetometer: ak8974: Correct realbitsLinus Walleij
The HSCDTD008A has 15 bits of actual ADC valie, and the AMI305 and AMI306 has 12 bits. Correct this by providing an extra parameter to the channel macro and define a separate set of channels for each variant of the chip. The resolution is the actual resolution of the internal ADC of the chip. The values are stored in a S16 in 2's complement so all 16 bits are used for storing (no shifting needed). The AMI305, AMI306 and HSCDTD008A valid bits are picked from respective datasheet. My best educated guess is that AK8974 is also 12 bits. The AK8973 is an 8 bit and earlier version, and the sibling drivers AMI305 and AMI306 are 12 bits, so it makes sense to assume that the AK8974 is also 12 bits. Cc: Nick Reitemeyer <nick.reitemeyer@web.de> Cc: Stephan Gerhold <stephan@gerhold.net> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: magnetometer: ak8974: add Alps hscdtd008aNick Reitemeyer
The hscdtd008a is similar to the AK8974: Only the whoami value and some registers are different. Signed-off-by: Nick Reitemeyer <nick.reitemeyer@web.de> Reviewed-by: Stephan Gerhold <stephan@gerhold.net> Tested-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: imu: st_lsm6dsx: enable 833Hz sample frequency for tagged sensorsLorenzo Bianconi
Enable 833Hz ODR for sensors that supports tagged hw FIFO: - LSM6DSO/LSM6DSOX - LSM6DSR/LSM6DSRX - ASM330LHH Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: ad7476: remove redundant null check on an arrayColin Ian King
The null check on st->chip_info->convst_channel is redundant because convst_channel is a 2 element array of struct iio_chan_spec objects and this can never be null. Fix this by removing the null check. Addresses-Coverity: ("Array compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: buffer: extend short-hand use for 'indio_dev->buffer'Alexandru Ardelean
This change is both cosmetic and a prequel to adding support for attaching multiple buffers per IIO device. The IIO buffer sysfs attrs are mostly designed to support only one attached buffer, and in order to support more, we need to centralize [in each attr function] the buffer which is being accessed. This also makes it a bit more uniform, as in some functions there is a short-hand 'buffer' variable and at the same time the 'indio_dev->buffer' is still access directly. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: dac: ad5592r: Fix a typo in the name of a functionChristophe JAILLET
This module is related to AD5592R, not AD5593R, so be consistent in naming. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: dac: ad5593r: Fix a typo in MODULE_DESCRIPTIONChristophe JAILLET
This module is related to AD5593R, not AD5592R. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: st_sensors: Use get_unaligned_be24() and sign_extend32()Andy Shevchenko
Use these functions instead of open-coding them. Cc: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: temperature: max31856: Use get_unaligned_beXX()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: pressure: zpa2326: Use get_unaligned_le24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: pressure: ms5611: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: pressure: hp206c: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: magnetometer: rm3100: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Song Qiang <songqiang1304521@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: light: zopt2201: Use get_unaligned_le24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: light: si1133: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: health: afe4403: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: gyro: adis16130: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: dac: ad5446: Use put_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: dac: ad5624r_spi: Use put_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: dac: ltc2632: Use put_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: ti-ads124s08: Use get_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: mpc3422: Use get_unaligned_beXX()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: Use an early return in iio_device_alloc to simplify code.Jonathan Cameron
Noticed whilst reviewing Alexandru's patch to the same function. If we simply flip the logic and return NULL immediately after memory allocation failure we reduce the indent of the following block and end up with more 'idiomatic' kernel code. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-05-03iio: chemical: Add OF match table for CCS811 VOC sensorManivannan Sadhasivam
Add devicetree OF match table support for CCS811 VOC sensor. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: chemical: Add support for external Reset and Wakeup in CCS811Manivannan Sadhasivam
CCS811 VOC sensor exposes nRESET and nWAKE pins which can be connected to GPIO pins of the host controller. These pins can be used to externally release the device from reset and also to wake it up before any I2C transaction. The initial driver support assumed that the nRESET pin is not connected and the nWAKE pin is tied to ground. This commit improves it by adding support for controlling those two pins externally using a host controller. For the case of reset, if the hardware reset is not available, the mechanism to do software reset is also added. As a side effect of doing this, the IIO device allocation needs to be slightly moved to top of probe to make use of priv data early. Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: imu: Add support for adis16475Nuno Sá
Support ADIS16475 and similar IMU devices. These devices are a precision, miniature MEMS inertial measurement unit (IMU) that includes a triaxial gyroscope and a triaxial accelerometer. Each inertial sensor combines with signal conditioning that optimizes dynamic performance. The driver adds support for the following devices: * adis16470, adis16475, adis16477, adis16465, adis16467, adis16500, adis16505, adis16507. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-02iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()'Christophe JAILLET
A call to 'vf610_dac_exit()' is missing in an error handling path. Fixes: 1b983bf42fad ("iio: dac: vf610_dac: Add IIO DAC driver for Vybrid SoC") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-27Merge 5.7-rc3 into staging-nextGreg Kroah-Hartman
We need the staging fixes in here too, and this resolves a merge issue with the vt6656 driver. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-25iio: imu: st_lsm6dsx: unlock on error in st_lsm6dsx_shub_write_raw()Dan Carpenter
We need to release a lock if st_lsm6dsx_check_odr() fails, we can't return directly. Fixes: 76551a3c3df1 ("iio: imu: st_lsm6dsx: specify slave odr in slv_odr") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adis: Support different burst sizesNuno Sá
Add burst_max_len to `adis_burst`. This is useful for devices which support different burst modes with different sizes. The buffer to be used in the spi transfer is allocated with this variable making sure that has space for all burst modes. The spi transfer length should hold the "real" burst length depending on the current burst mode configured in the device. Moreover, `extra_len` in `adis_burst` is made const and it should contain the smallest extra length necessary for a burst transfer. In `struct adis` was added a new `burst_extra_len` that should hold the extra bytes needed depending on the device instance being used. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adis: Add adis_update_bits() APIsNuno Sá
This patch adds a `regmap_update_bits()` like API to the ADIS library. It provides locked and unlocked variant. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: imu: adis: Add irq flag variableNuno Sá
There are some ADIS devices that can configure the data ready pin polarity. Hence, we cannot hardcode our IRQ mask as IRQF_TRIGGER_RISING since we might want to have it as IRQF_TRIGGER_FALLING. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>