summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* dt-bindings: iio:imu:mpu6050: support more interrupt typesMartin Kelly2018-04-211-3/+8
| | | | | | | | | | | | Document that the hardware supports falling edge, rising edge, level low, and level high interrupt types, rather than just rising edge. The language used is the same as that in st_lsm6dsx.txt. Signed-off-by: Martin Kelly <mkelly@xevo.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:imu: inv_mpu6050: support more interrupt typesMartin Kelly2018-04-215-8/+64
| | | | | | | | | | | | | | | | | | | | | | | Currently, we support only rising edge interrupts, and in fact we assume that the interrupt we're given is rising edge (and things won't work if it's not). However, the device supports rising edge, falling edge, level low, and level high interrupts. Empirically, on my system, switching to level interrupts has fixed a problem I had with significant (~40%) interrupt loss with edge interrupts. This issue is likely related to the SoC I'm using (Allwinner H3), but being able to switch the interrupt type is still a very useful workaround. I tested this with each interrupt type and verified correct behavior in a logic analyzer. Add support for these interrupt types while also eliminating the error case of the device tree and driver using different interrupt types. Signed-off-by: Martin Kelly <mkelly@xevo.com> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: use set_power_itg function in i2c muxJean-Baptiste Maneyrol2018-04-211-20/+13
| | | | | | | | Set power function is rewritten manually inside i2c mux select. Better use the already identical existing function. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: clean set_power_itg and fix usageJean-Baptiste Maneyrol2018-04-211-20/+24
| | | | | | | | | | | Rewrite set_power_itg. Failing when turning power off is no more decreasing the counter now and sleeping only happens when effectively turning the chip on. Fix also usage in init function (setting power on one time is sufficient to ensure chip is effectively on). Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* dt-bindings: iio: adc: mcp320x: Use vendor prefix compatible stringsFabian Mewes2018-04-211-1/+1
| | | | | | | | | Update the example to use the compatible string including the vendor prefix instead of the ones deprecated in 3a872138e4b. Signed-off-by: Fabian Mewes <architekt@coding4coffee.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Fix bound checkingsHernán Gonzalez2018-04-211-2/+2
| | | | | | | Also remove unnecessary parenthesis Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: sca3000: Handle errors returned by 'sca3000_configure_ring()' in ↵Christophe JAILLET2018-04-151-1/+3
| | | | | | | | | | 'sca3000_probe()' 'sca3000_configure_ring()' can fail, so test its return value and propagate it if needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: sca3000: Fix an error handling path in 'sca3000_probe()'Christophe JAILLET2018-04-151-8/+1
| | | | | | | | | | | | | Use 'devm_iio_kfifo_allocate()' instead of 'iio_kfifo_allocate()' in order to simplify code and avoid a memory leak in an error path in 'sca3000_probe()'. A call to 'sca3000_unconfigure_ring()' was missing. Sent via the next merge window as unimportant bug and there are other patches dependent on it. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Add AD5671R/75R/94/94R/95R/96/96R supportStefan Popa2018-04-156-0/+144
| | | | | | | | | | | | | | | | | | | | The AD5694/AD5694R/AD5695R/AD5696/AD5696R are a family of 4 channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices have either no built-in reference, or built-in 2.5V reference. The AD5671R/AD5675R are similar, except that they have 8 instead of 4 channels. These devices are similar to AD5672R/AD5676/AD5676R and AD5684/AD5684R/AD5684/AD5685R/AD5686/AD5686R, except that they use i2c instead of spi. Datasheets: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5671R_5675R.pdf http://www.analog.com/media/en/technical-documentation/data-sheets/AD5696R_5695R_5694R.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Refactor the driverStefan Popa2018-04-156-166/+253
| | | | | | | | | | | | | In this patch restructures the existing ad5686 driver by adding a module for SPI and a header file, while the baseline module deals with the chip-logic. This is a necessary step, as this driver should support in the future similar devices which differ only in the type of interface used (I2C instead of SPI). Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Add AD5672R/76/76R/84R/86R supportStefan Popa2018-04-151-0/+46
| | | | | | | | | | | | | | | | The AD5684R/AD5686R are a family of 4 channel DACs with 12-bit, 14-bit and 16-bit precision respectively. The devices come either with a built-in reference or no built-in reference. The AD5672R/AD5676/AD5676R are similar, except that they have 8 channels instead of 4. Datasheets: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5672R_5676R.pdf http://www.analog.com/media/en/technical-documentation/data-sheets/AD5686R_5685R_5684R.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Add support for AD5685RStefan Popa2018-04-151-3/+4
| | | | | | | | | | | | This driver acctually supports the AD5685R device and NOT the AD5685, which does not exist. Maintain old id entry in case we have devicetrees out there which are using the wrong name. More information can be found in the datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5686_5684.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Add support for various number of channelsStefan Popa2018-04-151-20/+25
| | | | | | | | | | This patch adds a new num_channels attribute as part of the ad5686_chip_info struct which replaces the AD5686_DAC_CHANNELS define. This is a necessary step, since this driver should support similar devices which differ only in the number of channels. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Change license descriptionStefan Popa2018-04-151-2/+1
| | | | | | | | Add GPLv2+ SPDX identifier and remove license notice to keep the whole purpose of using an SPDx id. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio:dac:ad5686: Style fixes no functional changesStefan Popa2018-04-151-11/+14
| | | | | | | | This patch fixes some indentation issues and does not modify the functionality of the driver. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: Add mpu9255 support to mpu6050 driverDouglas Fischer2018-04-155-0/+15
| | | | | | | | | | Added support for the mpu9255 IMU to the mpu6050 driver. The register map is the same as the other chips; the only driver difference is the compatible string and the WHOAMI register value. Signed-off-by: Douglas Fischer <fischerdouglasc@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: chemical: atlas-ph-sensor: use msleep() for long uncritical delaysMatt Ranostay2018-04-151-7/+7
| | | | | | | | | | | usleep_range() uses hrtimers and provides no advantage over msleep() for larger delays. Cc: Nicholas Mc Guire <hofrat@osadl.org> Link: http://lkml.org/lkml/2017/1/11/377 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Reviewed-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: potentiometer: mcp4531: switch to using .probe_newPeter Rosin2018-04-151-73/+72
| | | | | | | Use the new probe style for i2c drivers. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: potentiometer: mcp4018: switch to using .probe_newPeter Rosin2018-04-151-21/+20
| | | | | | | Use the new probe style for i2c drivers. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: do not flush fifo when iio buffer is fullJean-Baptiste Maneyrol2018-04-151-4/+2
| | | | | | | | | | There is no need to flush fifo and loose all data when the iio buffer is full. Just drop the data by ignoring the error as commonly done in other drivers. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Martin Kelly <martin@martingkelly.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Reorder variable declarationsHernán Gonzalez2018-04-151-3/+3
| | | | | | | Reorder some variable declarations in an inverse-pyramid scheme. Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Reorder includes alphabeticallyHernán Gonzalez2018-04-151-5/+5
| | | | | Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Fix multiple line dereferenceHernán Gonzalez2018-04-151-2/+1
| | | | | | | | | Clear checkpatch.pl WARNING about multiple line derefence but creates a new one of line over 80 characters. In my opinion, it improves readability. Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Adjust arguments to match open parenthesisHernán Gonzalez2018-04-151-2/+3
| | | | | | | Clear a couple more checkpatch.pl CHECKS. Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad7746: Automatically swap values in readings/writingsHernán Gonzalez2018-04-151-8/+8
| | | | | | | | Data to read or write was being handled with the swab16() macro instead of using i2c_smbus_{read,write}_swapped. Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Documentation: dt: iio: imu: st_lsm6dsx: add ism330dlc sensor device bindingLorenzo Bianconi2018-04-081-0/+1
| | | | | Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: st_lsm6dsx: add support to ism330dlcLorenzo Bianconi2018-04-086-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>
* iio: imu: st_lsm6dsx: fix FIFO threshold mask for LSM6DSM/LSM6DSLLorenzo Bianconi2018-04-081-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>
* Staging: iio: adis16209: Move adis16209 driver out of stagingShreeya Patel2018-03-305-14/+14
| | | | | | | | Move the adis16209 driver out of staging directory and merge to the mainline IIO subsystem. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: adis16209: Use GENMASKShreeya Patel2018-03-301-17/+14
| | | | | | | | Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: adis16209: Remove unused headersShreeya Patel2018-03-301-3/+0
| | | | | | | | Remove few unused header files since the adis core handles the sysfs and buffer support. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: adis16209: Add a blank line after return statementsShreeya Patel2018-03-301-0/+2
| | | | | | | | Add a blank line after return statements to improve the code readability. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: adis16209: Prefer reverse christmas tree orderingShreeya Patel2018-03-301-2/+2
| | | | | | | | Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: adis16209: Indent the field definitionsShreeya Patel2018-03-301-5/+5
| | | | | | | | Have indentation in field definitions to make them clearly different from the register addresses. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: clean double declaration of set_power_itgJean-Baptiste Maneyrol2018-03-301-1/+0
| | | | | Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: meson-saradc: add support for Meson AXGXingyu Chen2018-03-301-0/+8
| | | | | | | | Add the SAR ADC driver for the Amlogic Meson-AXG SoC. Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* dt-bindings: iio: adc: document the Meson AXG supportXingyu Chen2018-03-301-0/+1
| | | | | | | | | Update the documentation to expicitly support the Meson-AXG SoC. Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: meson-saradc: squash and share the common adc platform dataYixun Lan2018-03-301-33/+42
| | | | | | | | | | | Extract and promote common adc platform data into a new structure, to make it better share the info between several SoCs, this will avoid duplicating the code all over the place, Save a few memory and make the code more maintainable. Signed-off-by: Yixun Lan <yixun.lan@amlogic.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: use either direction for IIO_EV_INFO_{ENABLE,PERIOD}Brian Masney2018-03-251-5/+4
| | | | | | | | | | | | | | | | | | | | The events IIO_EV_INFO_VALUE and IIO_EV_INFO_ENABLE currently have a falling and rising direction configured. There does not need to be a separate distinction so this patch changes these to use the either direction. Directory listing of event sysfs attributes for a TSL2772 with this patch applied: in_intensity0_thresh_either_en in_intensity0_thresh_either_period in_intensity0_thresh_falling_value in_intensity0_thresh_rising_value in_proximity0_thresh_either_en in_proximity0_thresh_either_period in_proximity0_thresh_falling_value in_proximity0_thresh_rising_value Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: use auto increment I2C protocolBrian Masney2018-03-251-33/+67
| | | | | | | | | | The hardware supports 16-bit ALS and proximity readings, however the datasheet recommends using the I2C auto increment protocol so that the correct high and low bytes are read even if the integration cycle ends between reading the lower and upper registers. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: accel: adis16201: Move adis16201 driver out of stagingHimanshu Jha2018-03-245-13/+13
| | | | | | | | Move adis16201 driver out of staging and merge into mainline IIO subsystem. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: accel: adis16201: Fix 80 character line limitHimanshu Jha2018-03-241-1/+2
| | | | | | | | Split the line over 80 characters limit to fix checkpatch warning. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: accel: adis16201: Use GENMASKHimanshu Jha2018-03-241-19/+15
| | | | | | | | Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Staging: iio: accel: adis16201: Remove unused headersHimanshu Jha2018-03-241-3/+0
| | | | | | | | Remove few unused headers files since the adis core handles the buffer and sysfs support. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: add copyrightBrian Masney2018-03-241-1/+3
| | | | | | | | | Add Brian Masney's copyright and to the list of module authors for all of the staging cleanups. This patch also update's Jon Brenner's current work email address since AMS now owns TAOS. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: put local variables in reverse Christmas tree orderBrian Masney2018-03-241-13/+8
| | | | | | | | | This patch ensures that all of the local variable declarations are in reverse Christmas tree order where possible to increase code readability. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: remove ch0 and ch1 variables from tsl2x7x_get_lux()Brian Masney2018-03-241-11/+10
| | | | | | | | | Remove the ch0 and ch1 variables from tsl2x7x_get_lux() and write those values directly into the chip->als_cur_info.als_ch0 and chip->als_cur_info.als_ch01 variables. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: remove unused variables from tsl2x7x_get_lux()Brian Masney2018-03-241-11/+0
| | | | | | | | tsl2x7x_get_lux() has a ch0lux and ch1lux variables that are not used so this patch removes them. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: split out als and prox persistence settingsBrian Masney2018-03-242-16/+17
| | | | | | | | | | | | | | | | | | | | The struct tsl2x7x_settings contained a persistence member that contained both the ALS and proximity persistence fields. This patch splits this out into two separate fields so that the bitmasks in several parts of the code are no longer necessary. The default persistence settings are also changed by this patch from: - Proximity: 0 (Every proximity cycle generates an interrupt) - ALS: 255 (60 consecutive values out of range) to something a little more reasonable based on my testing: - Proximity: 1 (1 proximity value out of range) - ALS: 1 (1 value outside of threshold range) Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: tsl2x7x: make logging consistent and correct newlinesBrian Masney2018-03-241-26/+16
| | | | | | | | | | This patch updates all of the logging commands so that they are consistent with the other messages, includes __func__ in the message, and all of the messages include newlines. This patch also removes some debug log messages. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>