summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* iio: imu: inv_mpu6050: fix possible deadlock between mutex and iioJean-Baptiste Maneyrol2018-05-061-18/+16
| | | | | | | | | | | | | | | | | Detected by kernel circular locking dependency checker. We are locking iio mutex (iio_device_claim_direct_mode) after locking our internal mutex. But when the buffer starts, iio first locks its mutex and then we lock our internal one. To avoid possible deadlock, we need to use the same order everwhere. So we change the ordering by locking first iio mutex, then our internal mutex. Fixes: 68cd6e5b206b ("iio: imu: inv_mpu6050: fix lock issues by using our own mutex") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: use i2c mux only for chip with i2c aux busJean-Baptiste Maneyrol2018-05-061-16/+25
| | | | | | | | icm20608 does not have i2c aux bus, so it does not make sense to allocate an i2c mux for this chip. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: afe: rescale: new driverPeter Rosin2018-04-285-0/+386
| | | | | | | | | | | | | | | If an ADC channel measures the midpoint of a voltage divider, the interesting voltage is often the voltage over the full resistance. E.g. if the full voltage is too big for the ADC to handle. Likewise, if an ADC channel measures the voltage across a shunt resistor, with or without amplification, the interesting value is often the current through the resistor. This driver solves these problems by allowing to linearly scale a channel and/or by allowing changes to the type of the channel. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: bcm150: Remove handling for regmap raw_read_maxCharles Keepax2018-04-281-20/+3
| | | | | | | | The regmap core now handles splitting up transactions according to max_raw_read, so this code is no longer required in client drivers. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: clean read channel data error pathJean-Baptiste Maneyrol2018-04-281-6/+10
| | | | | | | | Delete the useless ored result and give a second chance to turn the chip back off at the end. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: clean read raw by factorizing out raw dataJean-Baptiste Maneyrol2018-04-281-54/+62
| | | | | | | Factorize reading channel data in its own function. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: use devm_* at init and delete removeJean-Baptiste Maneyrol2018-04-285-47/+12
| | | | | | | | | Use devm_* for iio_triggered_buffer_setup, iio_device_register, iio_trigger_register. Delete unneeded inv_mpu6050_remove_trigger, inv_mpu_core_remove, and inv_mpu_remove for spi driver. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: imu: inv_mpu6050: fix error path not turning chip back offJean-Baptiste Maneyrol2018-04-282-16/+32
| | | | | | | | | Some functions are turning the chip on and not back off in error path. With set_power function using a reference counter that would keep the chip on forever. Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: stm32-dfsdm: add check on spi-max-frequencyFabrice Gasnier2018-04-281-0/+5
| | | | | | | | | | spi-max-frequency is requested for SPI master mode (only), to tune output clock. It may happen requested frequency isn't reachable. Add explicit check, so probe fails with error in this case. Otherwise, output clock may simply be silently turned off (conversions fail). Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: stm32-dfsdm: add check on max filter idFabrice Gasnier2018-04-281-2/+2
| | | | | | | | | reg property should be checked against number of available filters. BTW, dfsdm->num_fls wasn't used. But it can be used for this purpose. This prevents using data out of allocated dfsdm->fl_list array. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: stm32-dfsdm: misc style improvements and fixesFabrice Gasnier2018-04-281-5/+4
| | | | | | | | | | Misc fixes & style improvements: - checkpatch warns about line over 80 characters. - remove extra spaces and a blank line (e.g. checkpatch --strict) - remove bad error message always printed in probe routine. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: common: hid-sensors: simplify getting .drvdataWolfram Sang2018-04-281-6/+3
| | | | | | | | We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: common: cros_ec_sensors: simplify getting .drvdataWolfram Sang2018-04-281-4/+2
| | | | | | | | We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: accel: st_accel: Add support for the SMO8840 ACPI idHans de Goede2018-04-211-0/+1
| | | | | | | | The Lenovo Ideapad Miix 320 uses an st accelerometer with an ACPI id of SMO8840, add support for this. Signed-off-by: Hans de Goede <hdegoede@redhat.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>
* 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-155-0/+143
| | | | | | | | | | | | | | | | | | | | 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-155-166/+246
| | | | | | | | | | | | | 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-154-0/+14
| | | | | | | | | | 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>
* 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-303-0/+343
| | | | | | | | 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>
* 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>
* 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: accel: adis16201: Move adis16201 driver out of stagingHimanshu Jha2018-03-243-0/+334
| | | | | | | | 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>
* iio: adc: ad7791: implement IIO_CHAN_INFO_SAMP_FREQAlexandru Ardelean2018-03-171-0/+56
| | | | | | | | | | | | | | | | | Now that the old read/write frequency sysfs attrs have been removed, we have a clean slate to implement IIO_CHAN_INFO_SAMP_FREQ. This driver also pre-dates IIO_CHAN_INFO_SAMP_FREQ, and this change implements this behavior. The `ad7791_write_raw` would have overlapped quite a bit with the old read/write frequency functions, making things a bit harder to follow. Fixes: a13e831fcaa7 ("staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ") Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: adc: ad7791: remove sample freq sysfs attributesAlexandru Ardelean2018-03-171-49/+0
| | | | | | | | | | | | | | | | | | | | In the current state, these attributes are broken, because they are registered already, and the kernel throws a warning. The first registration happens via the `IIO_CHAN_INFO_SAMP_FREQ` flag from the `ad_sigma_delta` driver. In this commit these attrs are removed, and in the following the IIO_CHAN_INFO_SAMP_FREQ behavior will be implemented, which replaces these hooks. This is done to make things a bit easier to review as there is a bit of overlap in the patch if it's done all at once. Fixes: a13e831fcaa7 ("staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ") Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: cros_ec: Move cros_ec_sensors_core.h in /includeGwendal Grignou2018-03-175-185/+4
| | | | | | | | Similar to other common iio frameworks, move cros_ec_sensors_core.h from drivers/iio/common/cros_ec_sensors/ to include/linux/iio/common. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: stx104: Implement get_multiple callbackWilliam Breathitt Gray2018-03-171-0/+11
| | | | | | | | | | | | | | | | The Apex Embedded Systems STX104 series of devices provides 4 TTL compatible lines of inputs accessed via a single 4-bit port. Since four input lines are acquired on a single port input read, the STX104 GPIO driver may improve multiple input reads by utilizing a get_multiple callback. This patch implements the stx104_gpio_get_multiple function which serves as the respective get_multiple callback. Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* Merge tag 'iio-for-4.17b' of ↵Greg Kroah-Hartman2018-03-1424-34/+857
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new device support, features and cleanup for IIO in the 4.17 cycle The uptick in staging cleanup is partly due to GSoC Applications process being underway and one of Daniel's tasks being to try cleaning up an IIO driver to move out of staging. Naturally there is some normal staging cleanup progress in here as well. New device support * Microchip mcp4018 - New driver supproting MCP4017, MCP4018 and MCP4019 digital pots. * On Semiconductor lv0104cs - New driver to support this ambient light sensor. Cleanup * axp20x_adc - remove a !! in favour of clear ternary operator. * ad2s1210 (staging cleanup) - Reorganise to avoid ending a line with [ - Remove some unnecessary defines. - Remove unsed variable. * ad5380 - Replace magic 0 with IIO_CHAN_INFO_RAW * ad5764 - Replace magic 0 with IIO_CHA_INFO_RAW * ad7150 (staging cleanup) - Align arguements with parenthesis. * ad7152 (staging cleanup) - Align arguements. * ad7746 (staging cleanup) - Align arguements. * ad7816 - Remove pointless void pointer cast. * ade7753 - Replace IIO_DEV_ATTR_CH_OFF with equivalent to avoid confusing checkpatch (this macro didn't really help anyway). Also drop the macro from the meter.h header. * ade7754 (staging cleanup) - Add names to funciton definition arguements. - Align arguements with open parenthesis where possible. * ade7758 (staging cleanup) - Remove __func__ from dev_dbg statements as provided by dynamic debug anyway. - Align arguements with open parenthesis where possible. * ade7759 (staging cleanup) - Replace IIO_DEV_ATTR_CH_OFF with equiavalent to avoid confusing checkpatch. * adis16201 (staging cleanup) - Headers in alphabetical order. - Blank lines before returns. * adis16209 (staging cleanup) - Headers in alphabetical order - Change some definition names to make them more meaningful (2 rounds of this). - Add explicit _REG prefix to register names to make them obviously different from fields within those registers. - Remove some superflous comments and group definitions better. - Use a switch statement to make it semantically obvious that we only have two options (rather than an unlimited 'else'). - Use sign_extent32 instead of open coding. * adt7316 (staging cleanup) - Move an export next to symbol. * bmc150 - drop redundant __func__ in dynamic debug. * ccs811 - Rename varaible to better reflect what it does. * cros_ec - Reduce sampling frequency before suspending to avoid preventing suspend. * dummy - Correct whitespace in Kconfig. - Add extra description in Kconfig. * ds1803 - Remove a VLA which we always know is 2 long. * hid-sensor-accel - Replace magic number 0 by IIO_CHAN_INFO_RAW. * hid-sensor-gyro - Replace magic number 0 by IIO_CHAN_INFO_RAW. * hid-sensor-light - Replace magic number 0 by IIO_CHAN_INFO_RAW. * hid-sensor-magn - Replace magic number 0 by IIO_CHAN_INFO_RAW. * lm3533 - Replace magic number 0 by IIO_CHAN_INFO_RAW * mlx90632 - Squash a smatch warning - no runtime effect. * stm32_dfsdm: - Cleanup the dt bindings. * sx9500 - Add GPIO ACPI mapping table to behave correctly when firmware doesn't provide the mapping. * tsl2x7x (staging cleanup) - Fix the proximity sensor functionality. - Remove platform data provided power functions. There are much better ways to do this these days. - Introduce some common functions to avoid various repititions. - Stop using mutex_trylock when mutex_lock and wait a bit is fine. - Improve error handling in various places. - Drop some 'Camel case' (which wasn't actually strickly camel case but was a bit odd. - Drop some _available sysfs attributes for things that don't exist (for particular supported parts).
| * iio: potentiometer: mcp4018: driver for Microchip digital potentiometersPeter Rosin2018-03-103-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Microchip digital potentiometers and rheostats MCP4017, MCP4018, MCP4019 They all have one wiper with 128 steps and come in 5, 10, 50 and 100 kOhm variations. Datasheet: http://www.microchip.com/downloads/en/DeviceDoc/22147a.pdf Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: potentiometer: ds1803: Remove VLA usageHimanshu Jha2018-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In preparation to enabling -Wvla, remove VLA usage and replace it with fixed a fixed length array and therefore, prevent potential stack overflow attacks. Fixed as a part of the discussion to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Cc: keescook@chromium.org Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: Replace occurrences of magic number 0 by IIO_CHAN_INFO_RAWRodrigo Siqueira2018-03-076-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Usually, functions responsible for reading raw data typically relies on values from iio_chan_info_enum to correctly identify the type of data to be read. There is a set of a device driver that uses the magic number 0 instead of IIO_CHAN_INFO_RAW. This patch improves the readability by replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW in six devices driver in the IIO subsystem. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio:magnetometer: Replace magic number 0 by IIO_CHAN_INFO_RAWRodrigo Siqueira2018-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | The function magn_3d_read_raw has a switch statement handling multiple cases per channel. The first case statement uses the magic number 0, which means IIO_CHAN_INFO_RAW. Additionally, the iio_chan_spec for magn_3d_channels is configured to be IIO_CHAN_INFO_RAW. Therefore, this patch replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio:dummy: Add extra paragraphs on KconfigRodrigo Siqueira2018-03-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the checkpatch.pl warning: drivers/iio/dummy/Kconfig:21: WARNING: please write a paragraph that describes the config symbol fully drivers/iio/dummy/Kconfig:27: WARNING: please write a paragraph that describes the config symbol fully This patch expands the explanation about IIO_DUMMY_EVGEN by using the code documentation found in iio/dummy/iio_dummy_evgen.c. In the same way, the information related to IIO_SIMPLE_DUMMY_BUFFER was extracted from file iio_simple_dummy_buffer.c. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: dummy: Add correct tabs and spaces to KconfigRodrigo Siqueira2018-03-031-10/+10
| | | | | | | | | | | | | | | | | | | | | | Kconfig from iio/dummy does not follow the coding style recommendations. According to the coding-style, Lines under a config definition are indented with one tab, while help text is indented an additional two spaces. This patch adds the proper tabulation and space. Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * iio: light: lv0104cs: Add support for LV0104CS light sensorJeff LaBundy2018-03-033-0/+542
| | | | | | | | | | | | | | | | This patch adds support for the On Semiconductor LV0104CS ambient light sensor. Signed-off-by: Jeff LaBundy <jeff@labundy.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>