summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
...
| * iio: light: Add support for UPISEMI uS5182d als and proximity sensorAdriana Reus2015-09-233-0/+518
| | | | | | | | | | | | | | | | | | | | Add support for UPISEMI us5182d als and proximity sensor. Supports raw readings. Data sheet for this device can be found here: http://www.upi-semi.com/temp/uS5182D-DS-P0103-temp.pdf Signed-off-by: Adriana Reus <adriana.reus@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: chemical: add SGX VZ89x VOC sensor supportMatt Ranostay2015-09-235-0/+260
| | | | | | | | | | | | | | | | Add support for VZ89X sensors VOC and CO2 reporting channels in percentage which can be converted to part per million. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: resistance: add IIO_RESISTANCE channel typeMatt Ranostay2015-09-231-0/+1
| | | | | | | | | | Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: chemical: Add IIO_CONCENTRATION channel typeMatt Ranostay2015-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | There are air quality sensors that report data back in parts per million of VOC (Volatile Organic Compounds) which are usually indexed from CO2 or another common pollutant. This patchset adds an IIO_CONCENTRATION type that returns a percentage of substance because no other channels types fit this use case. Modifiers for IIO_MOD_CO2 and IIO_MOD_VOC gas types are defined. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: twl6030-gpadc: Fix module autoload for OF platform driverLuis de Bethencourt2015-09-231-0/+1
| | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: dac: max5821: Fix module autoload for OF platform driverLuis de Bethencourt2015-09-231-0/+1
| | | | | | | | | | | | | | | | This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: leave sysfs namings to the iio coreMartin Kepplinger2015-09-231-1/+0Star
| | | | | | | | | | | | | | | | | | | | This doesn't actually change anything since the core names the sysfs folder for the iio event attributes "events" anyways. It only leaves the job to the core. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: add copyright notice commentMartin Kepplinger2015-09-231-0/+1
| | | | | | | | | | | | Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: add support for MMA8652FC and MMA8653FCMartin Kepplinger2015-09-232-8/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MMA8652FC and MMA8653FC don't provide the transient interrupt source, so the motion interrupt source is used by providing a new iio_chan_spec definition, so that other supported devices are not affected by this. Datasheets for the newly supported devices are available at Freescale's website: http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8653FC.pdf Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: add freefall / motion interrupt sourceMartin Kepplinger2015-09-231-8/+36
| | | | | | | | | | | | | | | | | | | | This adds the freefall / motion interrupt source definitions to the driver. It is used in this series' next patch, for chips that don't support the transient interrupt source. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: add support for MMA8453Q accelerometer chipMartin Kepplinger2015-09-232-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the 10 bit version if Freescale's accelerometers of this series. The datasheet is available at Freescale's website: http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8453Q.pdf It creates a devicetree bindings file to document the new functionality and removes the driver from the trivial-devices list. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mma8452: refactor for seperating chip specific dataMartin Kepplinger2015-09-231-49/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a struct mma_chip_info to hold data that will remain specific to the chip in use. It is provided during probe() and linked in struct of_device_id. Also this suggests that the driver is called "mma8452" and now handles the MMA8452Q device, but is not limited to it. Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: humidity: add HDC100x supportMatt Ranostay2015-09-233-0/+330
| | | | | | | | | | | | | | | | Add support for the HDC100x temperature and humidity sensors including the resistive heater element. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: hi8435: Holt HI-8435 threshold detectorVladimir Barinov2015-09-233-0/+546
| | | | | | | | | | | | | | Add Holt threshold detector driver for HI-8435 chip Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mxc4005: add data ready trigger for mxc4005Teodora Baluta2015-08-311-1/+141
| | | | | | | | | | | | | | | | Add iio trigger for the data ready interrupt that signals new measurements for the X, Y and Z axes. Signed-off-by: Teodora Baluta <teodora.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mxc4005: add triggered buffer mode for mxc4005Teodora Baluta2015-08-312-3/+78
| | | | | | | | | | | | | | | | This patch adds support for buffered readings for the 3-axis accelerometer mxc4005. Signed-off-by: Teodora Baluta <teodora.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: accel: add support for mxc4005 accelerometerTeodora Baluta2015-08-313-0/+367
| | | | | | | | | | | | | | | | | | This patch adds support for Memsic MXC4005XC 3-axis accelerometer. The current implementation is a minimal one as it adds raw readings for the three axes and setting scale from userspace. Signed-off-by: Teodora Baluta <teodora.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Add SPI driverMarkus Pargmann2015-08-313-1/+64
| | | | | | | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Separate i2c and core driverMarkus Pargmann2015-08-315-67/+108
| | | | | | | | | | | | | | | | | | | | This patch separates the core driver using regmap and the i2c driver which creates the i2c regmap. Also in the Kconfig file BMG160 and BMG160_I2C are separate now. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: proximity: add support for PulsedLight LIDARMatt Ranostay2015-08-313-0/+301
| | | | | | | | | | | | | | | | | | | | | | | | Add support for the PulsedLight LIDAR rangefinder sensor which allows high speed (over 300Hz) distance measurements using Barker Coding within 40 meter range. Support only tested on the "blue label" rev 2, but may work using low sample frequencies on the original version. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: tsl4531: fix error handling in tsl4531_check_id()Dan Carpenter2015-08-311-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tsl4531_check_id() function returned 1 on "found" and 0 on "not found" and negative error codes on failure. This was non-standard and bug prone. The caller treated all non-zero values including error codes as "found". This patch fixes it by changing the tsl4531_check_id() to return zero on success or a negative error code, and updates the caller. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: add APDS9960 ALS + promixity driverMatt Ranostay2015-08-313-0/+1149
| | | | | | | | | | | | | | | | | | | | APDS9960 is a combination of ALS, proximity, and gesture sensors. This patch adds support for these functions along with gain control, integration time, and event thresholds. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: vf610: Add IIO buffer support for Vybrid ADCSanchayan Maity2015-08-312-7/+100
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for IIO buffer to the Vybrid ADC driver. IIO triggered buffer infrastructure along with iio sysfs trigger is used to leverage continuous sampling support provided by the ADC block. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: light: fix platform_no_drv_owner.cocci warningskbuild test robot2015-08-311-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | drivers/iio/light/opt3001.c:796:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Andreas Dannenberg <dannenberg@ti.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Support triggered eventsVladimir Barinov2015-08-275-4/+88
| | | | | | | | | | | | | | | | | | | | Support triggered events. This is useful for chips that don't have their own interrupt sources. It allows to use generic/standalone iio triggers for those drivers. Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: mlx90614: Implement filter configurationCrt Mori2015-08-271-3/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented Low pass 3db frequency filter which configures FIR and IIR values within the configuration register of EEPROM. For more standardized interface we have fixed the FIR value to 1024, while changes in IIR value are directly connected to filter responses. The new datasheet version will provide a simplified table (also in reStructured text format below) with this change, to provide quick overview of possible settings. Below sensor timings (bandwidth) are calculated for 3db frequency low pass filter. +--------------------+-----------------+ | Filter setting (%) | Band width (Hz) | | (rounded to 1.0) | | +====================+=================+ | 13 | 0.15 | +--------------------+-----------------+ | 17 | 0.20 | +--------------------+-----------------+ | 25 | 0.31 | +--------------------+-----------------+ | 50 | 0.77 | +--------------------+-----------------+ | 57 | 0.86 | +--------------------+-----------------+ | 67 | 1.10 | +--------------------+-----------------+ | 80 | 1.53 | +--------------------+-----------------+ | 100 | 7.23 | +--------------------+-----------------+ The diff is made towards togreg branch. Added myself to MAINTAINERS and authors as per discussion with Jonathan. Signed-off-by: Crt Mori <cmo@melexis.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: humidity: si7020: replaced bitmask on humidity values with range checkNicola Corna2015-08-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The maximum possible value for the relative humidity is 55575 (100%RH). This value, if shifted right by 2 bits, uses 14 bits and masking it with a 12 bit mask removes 2 meaningful bits. The masking has been replaced with a range check that sets the minimum value at 786 (0%RH) and the maximum at 13893 (99.998%RH). Signed-off-by: Nicola Corna <nicola@corna.info> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: mcp320x: Set struct spi_driver .of_match_tableJavier Martinez Canillas2015-08-221-0/+1
| | | | | | | | | | | | | | | | | | The driver has an OF id table but the .of_match_table is not set so the SPI core can't do an OF style match and the table was unused. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Michael Welling <mwelling@ieee.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Export SPI module alias information in missing driversJavier Martinez Canillas2015-08-222-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPI core always reports the MODALIAS uevent as "spi:<modalias>" regardless of the mechanism that was used to register the device (i.e: OF or board code) and the table that is used later to match the driver with the device (i.e: SPI id table or OF match table). So drivers needs to export the SPI id table and this be built into the module or udev won't have the necessary information to autoload the needed driver module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: dac: ad7303: Add OF match tableJavier Martinez Canillas2015-08-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | The Documentation/devicetree/bindings/iio/dac/ad7303.txt DT binding doc lists "adi,ad7303" as a compatible string but the corresponding driver does not have an OF match table. Add the table to the driver so the SPI core can do an OF style match. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: frequency: adf4350: Add OF match tableJavier Martinez Canillas2015-08-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | The Documentation/devicetree/bindings/iio/frequency/adf4350.txt DT binding doc lists "adi,adf4350" or "adi,adf4351" as compatible strings but the corresponding driver does not have an OF match table. Add the table to the driver so the SPI core can do an OF style match. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc128s052: Add OF match tableJavier Martinez Canillas2015-08-221-0/+8
| | | | | | | | | | | | | | | | | | | | The Documentation/devicetree/bindings/iio/adc/ti-adc128s052.txt DT binding doc lists "ti,adc128s052" or "ti,adc122s021" as compatible strings but the corresponding driver does not have an OF match table. Add the table to the driver so the SPI core can do an OF style match. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: as3935: Add OF match tableJavier Martinez Canillas2015-08-221-0/+7
| | | | | | | | | | | | | | | | | | | | The Documentation/devicetree/bindings/iio/proximity/as3935.txt DT binding doc lists "ams,as3935" as a compatible string but the corresponding driver does not have an OF match table. Add the table to the driver so the SPI core can do an OF style match. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: max1027: Set struct spi_driver .of_match_tableJavier Martinez Canillas2015-08-221-0/+1
| | | | | | | | | | | | | | | | The driver has an OF id table but the .of_match_table is not set so the SPI core can't do an OF style match and the table was unused. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: xilinx-xadc: Push interrupts into hardirq contextXander Huff2015-08-162-29/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver currently registers a pair of irq handlers using request_threaded_irq(), however the synchronization mechanism between the hardirq and the threadedirq handler is a regular spinlock. Unfortunately, this breaks PREEMPT_RT builds, where a spinlock can sleep, and is thus not able to be acquired from a hardirq handler. This patch gets rid of the threaded handler and pushes all interrupt handling into the hardirq context, and uses request_irq(). To validate that this change has no impact on RT performance, here are cyclictest values with no processes running: $ sudo cyclictest -S -m -p 98 policy: fifo: loadavg: 0.00 0.01 0.05 1/174 2539 T: 0 ( 1405) P:98 I:1000 C:167010520 Min: 9 Act: 12 Avg: 12 Max: 75 T: 1 ( 1862) P:98 I:1500 C:111340339 Min: 9 Act: 12 Avg: 12 Max: 73 Then, all xadc raw handles were accessed in a continuous loop via /sys/bus/iio/devices/iio:device0: $ sudo cyclictest -S -m -p 98 policy: fifo: loadavg: 7.84 7.70 7.63 3/182 4260 T: 0 ( 2559) P:98 I:1000 C:241557018 Min: 11 Act: 18 Avg: 21 Max: 74 T: 1 ( 2560) P:98 I:1500 C:161038006 Min: 10 Act: 21 Avg: 20 Max: 73 Signed-off-by: Xander Huff <xander.huff@ni.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: percolate error if event fd failsLinus Walleij2015-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This makes the error from iio_event_getfd() percolate up to userspace properly so we can know for sure there is no events on this device (-ENODEV returned). Before this patch we would bail out looking for the unsupported events on the erroneous (negative) file descriptor. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: st_sensors: add debugfs register read hookLinus Walleij2015-08-165-0/+26
| | | | | | | | | | | | | | | | | | | | This adds a debugfs hook to read/write registers in the ST sensors using debugfs. Proved to be awesome help when trying to debug why IRQs do not arrive. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Remove remaining uses of i2c_clientMarkus Pargmann2015-08-161-30/+29Star
| | | | | | | | | | Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Use generic dev_drvdataMarkus Pargmann2015-08-161-5/+5
| | | | | | | | | | | | | | | | | | i2c_get_clientdata() is specifically for i2c. Replace it with the generic dev_get/set_drvdata() to support different protocols. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Remove i2c_client from data structMarkus Pargmann2015-08-161-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | i2c_client variable is not really used anymore in the core driver. It is only used to get the device to make proper outputs. This patch replaces all i2c_client usage through direct usage of the device pointer. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: bmg160: Use i2c regmap instead of direct i2c accessMarkus Pargmann2015-08-162-111/+88Star
| | | | | | | | | | | | | | | | | | This patch introduces regmap usage into the driver. This is done to later easily support the SPI interface of this chip. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Move generic buffer implementations to sub-directoryLars-Peter Clausen2015-08-167-25/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For generic IIO trigger implementations we already have a sub-directory, but the generic buffer implementations currently reside in the IIO top-level directory. The main reason is that things have historically grown into this form. With more generic buffer implementations on its way now is the perfect time to clean this up and introduce a sub-directory for generic buffer implementations to avoid too much clutter in the top-level directory. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: Move callback buffer to its own moduleLars-Peter Clausen2015-08-153-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently the IIO callback buffer implementation is directly built into the IIO core module when enabled. Given that the callback buffer module is standalone functionallity there is really no reason to do this. So move it to its own module. Also rename the source to follow the standard IIO module naming convention as well as add a license notice to the file. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adc:cc10001_adc: resort entry in Kconfig and MakefileHartmut Knaack2015-08-122-12/+12
| | | | | | | | | | | | | | | | Move the entry for the CC 10001 ADC driver in Kconfig and Makefile up to maintain alphabetic order. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:magnetometer:bmc150_magn: sort entry alphabeticallyHartmut Knaack2015-08-122-17/+19
| | | | | | | | | | | | | | | | | | | | Sort the entry for bmc105_magn in Kconfig and Makefile to its correct position. Also add the minor module information for completeness. Fixes: c91746a2361d ("iio: magn: Add support for BMC150 magnetometer") Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:light:stk3310: adjust indentationHartmut Knaack2015-08-121-3/+3
| | | | | | | | | | | | | | | | Adjust some indentation issues as spotted by checkpatch.pl --strict Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:light:stk3310: use correct names and type for stateHartmut Knaack2015-08-121-5/+5
| | | | | | | | | | | | | | | | | | Indicate the bit number of predefined states, make use of these names and change the state type in _resume to u8 to avoid type casting. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:light:stk3310: add more error handlingHartmut Knaack2015-08-121-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for the following error cases: * lower boundary for val in _write_event * return value of regmap_(field_)read * possible values for chan->type * return value of stk3310_gpio_probe Also add an error path in _probe to put the sensor back into stand-by mode in case of serious errors. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adc:berlin2-adc: coding style cleanupHartmut Knaack2015-08-121-29/+35
| | | | | | | | | | | | | | | | Some adjustment of indentation to make checkpatch.pl happy in strict mode. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio:adc:berlin2-adc: enable interrupts with mutex lockedHartmut Knaack2015-08-121-9/+8Star
| | | | | | | | | | | | | | | | | | Move the call to enable channel interrupts into its _read() function to have it protected by a mutex. This ensures that only one channel is sampled at a time. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>