aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-10-24Merge tag 'iio-fixes-for-4.9a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linusGreg Kroah-Hartman1-0/+2
Jonathan writes: First set of IIO fixes for the 4.9 cycle. * atlas chemical - Fix alignment of big endian values in a larger storage (by using the right size storage) * maxim thermocouple - Fix alignment of big endian values in larger (by using the correct sized storage). * sca3000 - Handle unexpected mode values. * ti-adc081 - Select IIO_TRIGGERED_BUFFER to avoid build errors
2016-10-23iio: accel: sca3000_core: avoid potentially uninitialized variableArnd Bergmann1-0/+2
The newly added __sca3000_get_base_freq function handles all valid modes of the SCA3000_REG_ADDR_MODE register, but gcc notices that any other value (i.e. 0x00) causes the base_freq variable to not get initialized: drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_write_raw': drivers/staging/iio/accel/sca3000_core.c:527:23: error: 'base_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds explicit error handling for unexpected register values, to ensure this cannot happen. Fixes: e0f3fc9b47e6 ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Ico Doornekamp <ico@pruts.nl> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-27Staging: iio: light: constify attribute_group structuresBhumika Goyal1-1/+1
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: drivers/staging/iio/light/tsl2583.o text data bss dec hex filename 6529 1052 0 7581 1d9d drivers/staging/iio/light/tsl2583.o File size after: drivers/staging/iio/light/tsl2583.o text data bss dec hex filename 6593 988 0 7581 1d9d drivers/staging/iio/light/tsl2583.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27Staging: iio: adc: constify attribute_group structuresBhumika Goyal1-1/+1
Check for attribute_group structures that are only stored in the attrs filed of iio_info structure. As the attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; struct iio_info x; @@ x.attrs=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: drivers/staging/iio/adc/ad7280a.o text data bss dec hex filename 6487 584 776 7847 1ea7 drivers/staging/iio/adc/ad7280a.o File size after: drivers/staging/iio/adc/ad7280a.o text data bss dec hex filename 6551 544 776 7871 1ebf drivers/staging/iio/adc/ad7280a.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20staging: iio: isl29018: remove the FSF's mailing addressBrian Masney1-4/+0
Address warning from checkpatch: CHECK: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20staging: iio: meter: ade7754: Match alignment with open parenthesisGeorgiana Rodica Chelu1-34/+25
Reorganize the parameters to improve the readability of the code in two manners: - parameters of distinctive variable types on different lines - parameters of similar variable types on the same line Also, take advantage of the horizontal space available and place all the parameters on a single line. Issues found by checkpatch.pl script. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20staging: iio: meter: ade7758_ring: Match alignment with open parenthesisGeorgiana Rodica Chelu1-7/+3
Organize the parameters on a single line to improve the readability of the code. Also, indent the line to match alignment with the open parenthesis. Ensure that the modifications do not break the rule of 80 characters per line. Issues found by checkpatch.pl script. Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: iio: ad5933: align arguments on new line with open parenthesisKatie Dunne1-19/+19
Issue found by checkpatch: "Alignment should match open parenthesis." Multiple lines are also reduced to a single line where possible. Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-18iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQIco Doornekamp2-122/+121
Moved functionality from IIO_DEV_ATTR_SAMP_FREQ attribute into IIO_CHAN_INFO_SAMP_FREQ handlers. Added sca3000_write_raw() to allow writing the element as well. Signed-off-by: Ico Doornekamp <ico@pruts.nl> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-14Merge tag 'iio-for-4.9b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman1-1/+1
Jonathan writes: Second set of iio new device support, features and cleanups for the 4.9 cycle. New device support * ad8801 dac - new driver supporting ad8801 and ad8803 DACs. * adc12138 - new driver supporting TI adc12130/adc12132 and adc12138 ADCs. * ltc2485 adc - new driver * mxc6255 - add support for the mxc6225 part name and fixup the ID check so it works. * vz89x VOC sensor - add support for the vz89te part which drops the voc_short channel and adds CRCs compared to other supported parts. New features * core - immutable triggers. These effectively grant exclusive control over a trigger. The typical usecase is a device representing an analog part (perhaps a MUX) that needs to control the sampling of a downstream ADC. - resource managed trigger registration and triggered_buffer_init. - iio_push_event now protected against case of the event interface registration not having yet occured. Only matters if an interrupt can occur during this window - might happen on shared interrupt lines. - helper to let a driver query if the trigger it is using is provided by itself (using the convention of both device and trigger having the same parent). * tools - iio-utils. Used channel modifier scaling in preference to generic scaling when both exist. * at91-adc - Add support for touchscreen switches closure time needed by some newer parts. * stx104 - support the ADC channels on this ADC/DAC board. As these are the primary feature of the board also move the driver to the iio/adc directory. * sx9500 - device tree bindings. Cleanups / Fixes * ad5755 - fix an off-by-one on devnr limit check (introduced earlier this cycle) * ad7266 - drop NULL check on devm_regulator_get_optional as it can't return NULL. * ak8974 - avoid an unused functional warning due to rework in PM core code. - remove .owner field setting as done by i2c_core. * ina2xx - clear out a left over debug field from chip global data. * hid-sensors - avoid an unused functional warning due to rework in PM core code. * maxim-thermocouple - fix non static symbol warnings. * ms5611 - fetch and enable regulators unconditionally when they aren't optional. * sca3000 - whitespace cleanup. * st_sensors - fetch and enable regulators unconditionally rather than having them supported as optional regulators (missunderstanding on my part amongst others a while back) - followup to previous patch fixes error checking on the regulators. - mark symbols static where possible. - use the 'is it my trigger' help function. This prevents the odd case of another device triggering from the st-sensors trigger whilst the st-sensors trigger is itself not using it but rather using say an hrtimer. * ti-ads1015 - add missing of_node_put. * vz89x - rework to all support of new devices. - prevent reading of a corrupted buffer. - fixup a return value of 0/1 in a bool returning function. Address updates - Vlad Dogaru email address change.
2016-09-05Merge 4.8-rc5 into staging-nextGreg Kroah-Hartman1-1/+1
We want the staging fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-29staging: iio: accel: sca3000: remove extra spaceClifton Barnes1-1/+1
fix checkpatch.pl warning about 'Statements should start on a tabstop' Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-23Merge tag 'iio-for-4.9a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into work-testingGreg Kroah-Hartman3-148/+129
Jonathan writes: First round of new features, device support and cleanups for IIO in the 4.9 cycle. Device support * ak8974 - New driver and bindings for this 2009 vintage magnetometer (it was very popular back then!) * atlas-ph-sensor - ORP sensor support(I had to look up what one of these was) * cio-dac - New driver for Measurement Computing DAC boards * dmard06 - New driver for Domintech DMARDO6 accelerometer. Also vendor prefix. * dmard09 - New driver for Domintech DMARD09 accelerometer. * maxim-thermocouple - max6675 and max31855 new driver * mt6577 auxdac - new driver for this Mediatek chip mt2701, mt6577 and mt8173 have this hardware. * ti-adc161s626 - new driver for this TI single channel differential ADC. * vcnl4000 - support vcnl4010 and vcnl4020 which are compatible for all features currently supported by this driver. New features * Core - Allow retrieving of underlying iio_dev from a callback buffer handle. This is needed to allow client drivers to perform operations such as configuring the trigger used. * hid-sensors - asynchronous resume support to avoid really long resume times. * kxcjk-1013 - add the mysterious KIOX000A ACPI id seen in the wild. * Tools - lsiio now enumerates processed as well as raw channels. Cleanup * ad7298 - use iio_device_claim_direct_mode and friends to simplify locking around mode switching and drop some boilerplate. * ad7793 - use iio_device_claim_direct_mode and friends to simplify locking around mode switching and drop some boilerplate. * ade7854 - checkpatch fixups (alignment of parameters) * atlas-ph-sensor - use iio_device_claim_direct_mode and friends to simplify locking around mode switching and drop some boilerplate. - Switch to REGCACHE_NONE as there are no useful register to cache. * bma180 - use iio_device_claim_direct_mode and friends to simplify locking around mode switching and drop some boilerplate. * hdc100x - Add mention of the HDC1000 and HDC1008 to the Kconfig help text. * isl29018 - Add driver specific prefixes to defines and function names. - Remove excessive logging. - Drop newlines which add nothing to readability. - General tidying up of comments. - Drop I2C_CLASS_HWMON as irrelevant to driver. * isl29028 - Add driver specific prefixes to defines, enums and function names. - Drop comma's from available attribute output as not ABI compliant. - Drop I2C_CLASS_HWMON as irrelevant to driver. * kxsd9 - devicetree bindings. * mag3110 - This one wasn't locking to protect against mode switches during raw_reads. Use the iio_claim_direct_mode function to fix this buglet. * maxim-theromcouple - Fix missing selects for triggered buffer support in Kconfig. * nau7802 - Use complete instead of complete_all as only one completion at a time. * sx9500 - Use complete instead of complete_all as only one completion at a time. * us5182d - Add a missing error code asignment instead of checking the result of an already checked statement. * vcnl4000 - Use BIT macro where appropriate. - Refactor return codes in read_raw callback. - Add some missing locking for concurrent accesses to the device.
2016-08-21staging: iio: ade7854: checkpatch fixes (alignment of parameters)Johanna Abrahamsson1-20/+20
CHECK: Alignment should match open parenthesis Signed-off-by: Johanna Abrahamsson <johanna@mjao.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-08-15staging: iio: ad5933: Return correct value for AD5933_OUT_RANGE.Phil Turnbull1-1/+1
The 'break' statement after calling ad5933_cmd only breaks out of the 'for' loop, which then unconditionally sets the return value to -EINVAL. Move the initialisation of 'ret' so we return the correct value. Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-24staging: iio: light: isl29018/28: remove I2C_CLASS_HWMON .class settingAlison Schofield2-2/+0
I2C_CLASS_HWMON is for a hardware monitoring chip wanting auto-detection. IIO drivers don't typically use .class. Remove it. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-14Merge tag 'iio-for-4.8c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman12-1488/+13
Jonathan writes: Third set of IIO new device support, features and cleanups for the 4.8 cycle. New core features - Selection of the clock source for IIO timestamps. This is done per device as it makes little sense to have events in one timebase and data timestamped on another. Biggest reason for this is that we currently use a clock source which is non monotonic which can result in 'interesting' data sets. (Includes export for get_monotonic_corse64 which Thomas Gleixner didn't mind in an earlier version.) - MAINTAINERS add the git tree to the list for IIO. New device support + a kind of indirect staging graduation. * Broadcom iproc-static-adc - new driver * mcp4531 - support for MCP454x, MCP456x, MCP464x and MCP466x potentiometers * mpu6050 - support the IC20608 6 axis motion tracking device * st-sensors - support the lis3l02dq + drop the lis3l02dq driver from staging. The general purpose driver is missing event support, but good to get rid of this driver which was rather long in the tooth. New driver features * ak8975 - Add vid regulator support and refactor handling in general. - Allow a delay after enabling regulators. - Runtime and system PM. * bmg160 - filter frequency control support. * bmp280 - SPI device support. - EOC interrupt support for the BMP085 - power management support. - supply regulator support. - reset gpio support - dt bindings for reset gpio and regulators. - of table to support device tree registration * max1363 - Device tree bindings. * mcp4531 - Device tree bindings. * st-pressure - temperature channels as part of triggered buffer (previously not due probably to alignment issues - see below). - lps22hb open drain interrupt support. - lps22hb temperature channel support Cleanups and reworkings. * numerous ADC drivers - ensure the iio_dev->dev.of_node is set to the parent dev.of_node so as to allow client bindings to find the device. * ak8975 - Fix incorrect handling of missing regulator - make sure power is down and remove. * bmp280 - read the calibration data only once as it doesn't change. * isl29125 - Use a few macros to make code a touch more readable. * mma8452 - fix a memory leak on error. - drop an unecessary bit of return value handling. * potentiometer kconfig - typo fix. * st-pressure - drop some uninformative default assignments of elements of the channel array structure (aids readability). * st-sensors - Harden interrupt handling considerably. These are actually all using level interrupts, but at least two known boards have them wired to edge only interrupt chips. Hence a slightly interesting bit of handling is needed in which we first allow for the easy option (level triggered) and secondly check the status registers before reenabling edge interrupts and fall back to a tight loop in the thread until we successfully clear the interrupt. No harm is done if we never succeed in doing so. It's an odd patch that has been through a lot of revisions to reach a consensus on how to handle what is basically broken hardware (which the previous defaults allowed to kind of work). - Fix alignment to defined storagebytes boundaries. - Ensure alignment of power of 2 byte boundaries. This has always in theory been part of the ABI of IIO, but we missed a few that snuck in that need fixing. The effect was minor as they were only followed by timestamp channels which were correctly aligned, - Add some docs to explain the gain calculations.
2016-07-10staging: iio: isl29028: Prefix functionsPeter Meerwald-Stadler1-2/+2
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29028: Expose scale and sample frequency available without commaPeter Meerwald-Stadler1-2/+2
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29028: Prefix stuffPeter Meerwald-Stadler1-16/+16
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29028: Prefix #definesPeter Meerwald-Stadler1-31/+31
and drop unused PROX_DRIVE Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29018: Prefix remaining functionsPeter Meerwald-Stadler1-17/+17
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29018: Cleanup of commentsPeter Meerwald-Stadler1-13/+6
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29018: Drop newlinesPeter Meerwald-Stadler1-3/+0
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29018: Remove excessive output messagesPeter Meerwald-Stadler1-13/+3
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-10staging: iio: isl29018: Prefix #definesPeter Meerwald-Stadler1-29/+32
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04staging:iio:lis3l02dq drop separate driverJonathan Cameron5-1477/+0
Retire this venerable driver as the basic support is now in the generic st-sensors accelerometer driver. There are a few missing features in the new driver: * Threshold events. * Access to the calibration adjustment registers (patch shortly) In exchange it brings a cleaner and more maintainable code base that actually gets tested more than once every few years. I'll actually be suprised if anyone other than me has a board with one of these on that is running an up to date kernel. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-04Merge 4.7-rc6 into staging-nextGreg Kroah-Hartman3-5/+5
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-30iio:core: timestamping clock selection supportGregor Boirie8-12/+14
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-27staging: iio: accel: add error checkLuis de Bethencourt1-0/+2
Go to error_ret if sca3000_read_ctrl_reg() failed. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-26staging: iio: accel: fix error checkLuis de Bethencourt1-1/+1
sca3000_read_ctrl_reg() returns a negative number on failure, check for this instead of zero. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11staging: iio: ad5933: fix order of cycle conditionsLuis de Bethencourt1-3/+3
Correctly handle the settling time cycles value. The else branch is an impossible condition, > 1022 in the else branch of > 511. Flipping the order. Based on the Table 13 at the bottom of Page 25 of the Data Sheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-11staging: iio: fix ad7606_spi regressionArnd Bergmann1-1/+1
As pointed out by Geert Uytterhoeven, the patch was incorrect and breaks the driver, which was fortunately pointed out by this gcc warning: drivers/staging/iio/adc/ad7606_spi.c: In function ‘ad7606_spi_read_block’: drivers/staging/iio/adc/ad7606_spi.c:34: warning: ‘data’ is used uninitialized in this function The effect of the patch is that the data is copied into a random memory location (from the uninitialized pointer) instead of being byteswapped in place. This adds the initialization for the 'data' variable back to restore the original behavior. Cc: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Fixes: 87787e5ef727 ("Staging: iio: Fix sparse endian warning") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16staging:iio:adis16240: Set self_test_no_autoclear flagLars-Peter Clausen1-0/+1
The ADIS16201 does not automatically clear the self test flag bit the self test has been, so clear it manually. Otherwise we'll see a offset caused by the self-test bias on the output values during normal operation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16staging:iio:adis16209: Set self_test_no_autoclear flagLars-Peter Clausen1-0/+1
The ADIS16201 does not automatically clear the self test flag bit the self test has been, so clear it manually. Otherwise we'll see a offset caused by the self-test bias on the output values during normal operation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16staging:iio:adis16203: Set self_test_no_autoclear flagLars-Peter Clausen1-0/+1
The ADIS16201 does not automatically clear the self test flag bit the self test has been, so clear it manually. Otherwise we'll see a offset caused by the self-test bias on the output values during normal operation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16staging:iio:adis16201: Set self_test_no_autoclear flagLars-Peter Clausen1-0/+1
The ADIS16201 does not automatically clear the self test flag bit the self test has been, so clear it manually. Otherwise we'll see a offset caused by the self-test bias on the output values during normal operation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-10staging: iio: ad7606: use iio_device_{claim|release}_direct_mode()Alison Schofield1-6/+6
Replace the code that guarantees the device stays in direct mode with iio_device_{claim|release}_direct_mode() which does same. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-04Merge tag 'iio-for-4.7a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman17-1213/+103
Jonathan writes: First round of IIO new device support, features and cleanups for the 4.7 cycle. New core support * UV light modifier (for intensity) * UV light index channel type. New device support * hp206c barometer and altimeter - new driver. * mcp4131 potentiometer - new driver supporting lots of parts from Microchip. * mma8452 - FXLS8471Q support - NXP LPC18XX SOC ADC - new driver. - NXP LPC18XX SOC DAC - new driver. - rockchip_saradc - support rk3399 * st accel - h3lis331dl support Staging driver removals * adis16204 - obsolete part making it hard to get parts to test the driver in order to clean it up. * adis16220 - obsolete part making it hard to get the parts test the driver in order to clean it up. Features * core - convenience functions to claim / release direct access to the device. Makes more consistent handling of this corner easier. Used in ad7192 driver. * ak8975 - power regulator support. * at91-sama5d2 - differential channel support. * mma8452 - runtime pm support - drop device specific autosleep and use the runtime pm one instead. * ms5611 - DT bindings - oversampling ratio support Cleanups and minor fixes * MAINTAINERS - Peter got married - hence name change! * Documentation - Fix a typo in in_proximity_raw description. - Add some missing docs for iio_buffer_access_funcs. * Tools - update iio_event_monitor names to match new stuff. - make generic_buffer look for triggers ending in -trigger as we let these in for a number of drivers a long time back and now it is a fairly common option. Drivers * staging wide - convert bare unsigned usage to unsigned int to comply with coding style. * non staging wide: - since boiler plate gpio handling of interrupts has been moved into the ACPI core we don't need to include gpio/consumer.h in a load of drivers so drop it. * ad7606 - fix an endian casting sparse warning. * ak8975 - fix a possible unitialized warning from gcc. - drop and unused field left over from earlier cleanups - fix a missing regulator_disable on exit. * at91-sama5d2 - typo and indentation - missing IOMEM dependency. - cleanup mode register usage by avoidling erasing whole thing when changing the sampling frequency. * bmc150 - use the core demux and available_scan_masks to simplify buffer handling - optimize the transfers in the trigger handler now we have a magic function to emulate bulk reads (under circumstances met here). This matters with some rather dumb i2c adapters in particular. - use a single regmap_conf for all bus types as they were all the same. * bmg160 - use the core demux and available_scan_masks to simplify the buffer handling - optimize the transfers in the trigger handler now we have a magic funciton to emulate bulk rads (under circumstances met here). - drop gpio interrupt probing from the driver (ACPI) as now handled by the ACPI core. * ina2xx-adc - update the CALIB register when RShunt changes. - fix scale for VShunt - in reality this error canceled out when used. * isl29028 - use regmap to retrieve the struct device instead of carrying a second copy of it around. * kxcjk-1013 - use core demux - optimize i2c transfers in the trigger handler. * mcp4531 - refactor to use a pointer to access model parameters instead of indexing into the array each time. * mma8452 - style fixes - avoid swtiching to active whenever the config changes - add missin i2c_device_id for mma8451 * mpu6050 - fix possible NULL dereference. - fix the name / chip_id used when ACPI used (otherwise reports as NULL). * ms5611 - fix a missing regulator_disable that left the regulator on during removal. * mxc4005 - drop gpio interrupt handling for ACPI case from driver as the core now handles this case. * st-sensors - note that there are only ever a maximum of 3 axis on current st-sensors so just allocate a fixed sized buffer big enough for that. * tpl0102 - change the i2c_check_functionality condition to bring it inline with other IIO users as EOPNOTSUPP. * tsl2563 - replace deprecated flush_scheduled_work
2016-04-03Staging: iio: ad7606: Fix sparse endian warningKsenija Stanojevic1-2/+3
Fix following sparse warning: warning: cast to restricted __be16 Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-28Staging: iio: Fix sparse endian warningKsenija Stanojevic1-2/+3
Fix following sparse warning: warning: cast to restricted __be16 Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16240: Improve readabilitySvetlana Orlik1-0/+50
Lines with #define interlaced with comment lines making a mess. Separate groups of #define-comment with blank lines. Separate section title comments with blank lines. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16220: Improve readabilitySvetlana Orlik1-0/+48
Lines with #define interlaced with comment lines making a mess. Separate groups of #define-comment with blank lines. Separate section title comments with blank lines. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16209: Improve readabilitySvetlana Orlik1-0/+39
Lines with #define interlaced with comment lines making a mess. Separate groups of #define-comment with blank lines. Separate section title comments with blank lines. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16201: Fix 'line over 80 characters' warningSvetlana Orlik1-39/+117
Many of the comments in the same lines with #define caused checkpatch warning 'line over 80 characters'. Move all such comments to line before #define. This style is already used in some other .h files in accel: Add blank lines after #define to improve readability. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16203: Fix 'line over 80 characters' warningSvetlana Orlik1-33/+99
Many of the comments in the same lines with #define caused checkpatch warning 'line over 80 characters'. Move all such comments to line before #define. This style is already used in some other .h files in accel: Add blank lines after #define to improve readability. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16204: Fix 'line over 80 characters' warningSvetlana Orlik1-41/+118
Many of the comments in the same lines with #define caused checkpatch warning 'line over 80 characters'. Move all such comments to line before #define. This style is already used in some other .h files in accel: Add blank lines after #define to improve readability. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: accel: adis16240: Replace 'unsigned' with 'unsigned int'Svetlana Orlik1-2/+2
Replace 'unsigned' with 'unsigned int' to avoid checkpatch warning. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: iio: ad9832: Replace 'unsigned' with 'unsigned int'Svetlana Orlik1-1/+1
Replace 'unsigned' with 'unsigned int' to avoid checkpatch.pl warning. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28staging: iio: use kernel preferred block commenting styleAlison Schofield7-17/+23
Use * on subsequent lines and trailing */ on a separate line in block comments. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>