summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel
AgeCommit message (Collapse)Author
2017-08-22staging:iio:accel: drop assignment of iio_info.driver_moduleJonathan Cameron
The equivalent this is now done via macro magic when the relevant register call is made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-04-14Staging: iio: accel: adis16203: fixed a brace coding style issueRené Hickersberger?=
Fixed a brace coding style issue. Signed-off-by: René Hickersberger <renehickersberger@gmx.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: accel: remove unneeded braces around single statementsMark Stenglein
Fixes three checkpatch warnings due to braces used when single statements are sufficient. Signed-off-by: Mark Stenglein <mark@stengle.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-23staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIASGargi Sharma
adis16203_read_raw does not need lock for IIO_CHAN_INFO_CALIBBIAS since adis_read_reg_16 is already atomic and nothing else needs to be protected. Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19staging: iio: adis16209: Remove mutex_lock() and mutex_unlock() callsNarcisa Ana Maria Vasile
The function adis16209_read_raw() is safe to be run in parallel. The call to adis_read_reg_16() is safe since adis_read_reg() uses the txrx_lock from struct adis to protect simultaneous changes. Remove mutex.h inclusion since it is no longer needed. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19staging: iio: accel: adis16201: remove iio_dev mlockAishwarya Pant
In the driver adis16201 read raw does not require an iio_dev->mlock for reads. It can run concurrently as adis_read_reg_16() is protected by a transaction lock. Signed-off-by: Aishwarya Pant <aishpant@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-18staging: iio: adis16240: Remove mutex_lock() and mutex_unlock() function call.Varsha Rao
Remove mutex_lock() and mutex_unlock() function calls, as the adis16240_spi_read_signed() function can be run parallel and safely multiple times. Also remove the mutex.h header file and comment, which are no longer required. As indio_dev is declared and initialized in adis16240_spi_read_signed(), again declaration to same type and initialization to same value is not required, remove it from adis16240_read_12bit_signed(). Simplify the return logic, by merging assignment and return into a single line. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16240: Group similar macros into enumsNarcisa Ana Maria Vasile
Group the scan indexes into an enum. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16209: Group similar macros into enumsNarcisa Ana Maria Vasile
Group the scan indexes into an enum. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16203: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16209: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16201: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-13staging: iio: adis16240: Remove exceptional & on function namesimran singhal
Remove & from function pointers to conform to the style found elsewhere in the file. Done using the following semantic patch // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-05staging: iio: accel: Rename source files and update MakefileNarcisa Ana Maria Vasile
Rename adis162xx_core.c files to adis162xx.c because these are the only source files for these drivers. Update Makefile to correspond to the new file names. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> rename drivers/staging/iio/accel/{adis16201_core.c => adis16201.c} (100%) rename drivers/staging/iio/accel/{adis16203_core.c => adis16203.c} (100%) rename drivers/staging/iio/accel/{adis16209_core.c => adis16209.c} (100%) rename drivers/staging/iio/accel/{adis16240_core.c => adis16240.c} (100%) Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04staging: iio: adis16240: Move contents of the header to the source fileNarcisa Ana Maria Vasile
The contents of the header file are used only by this single source file. Move content into .c file and remove header. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-04staging: iio: adis16209: Move contents of the header to the source fileNarcisa Ana Maria Vasile
The contents of the header file are used only by this single source file. Move content into .c file and remove header. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02staging: iio: adis16203: Move header file content to source file.Varsha Rao
The contents of the header file are used only by this single source file. Moved content into adis16203_core.c file and removed adis16203.h file. Arranged #include files in alphabetical order. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-02staging: iio: accel: adis16201: Move header file content to source filesimran singhal
The contents of the header file are used only by this single source file. Move content into .c and remove .h. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-02-18staging: iio: adis16240_core: Replace symbolic permission with octal permissionsayli karnik
The patch resolves following checkpatch issue: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-03iio: adis16203: Fix copyright yearReto Schneider
The copyright year can not be in the future. Signed-off-by: Reto Schneider <code@reto-schneider.ch> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-03iio: adis1620x: Fix mixed up device descriptionsReto Schneider
The module descriptions for the ADIS 16201, 16203 and 16209 drivers do not match the actual function of the devices. Update them accordingly to fix this. Signed-off-by: Reto Schneider <code@reto-schneider.ch> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-23staging:iio:accel:sca3000 Move out of staging.Jonathan Cameron
Now the driver is in a reasonable state, lets get it (finally) out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 kernel docify comments that were nearly kernel doc.Jonathan Cameron
Basic tidy up of comments to bring them into a standard style. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 small checkpatch fixes (alignment etc)Jonathan Cameron
Tidied up where checkpatch warning suppressions doesn't effect the readability of the code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Tidy up probe order to avoid a race.Jonathan Cameron
Previously the device was exposed to userspace and in kernel consumers before the interrupts had been configured. As nothing stopped them being enabled in the interval this could cause unhandled interrupts. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 replace non standard revision attr with dev_info ↵Jonathan Cameron
on probe There seems little point in being able to query the part revision number via sysfs. Hence just put it in the kernel logs during probe incase anyone ever wants to know. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Drop custom measurement mode attributesJonathan Cameron
This is now represented by the standard 3db filter frequency controls. Things get complex wrt to the sampling frequency as these modes change but that is fine under the IIO ABI where any value is allowed to effect any other. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Add write support to the low pass filter controlJonathan Cameron
Also includes an available attribute. The ordering of values appears a bit random, but as the ABI doesn't specify this and we already have both rising and falling lists I think this is fine. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000: Fix off by one error in axis due to IIO_NO_MODJonathan Cameron
Given the introduction of IIO_NO_MOD was prior to the first submission prior to IIO entering staging this has been broken for a while. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 add readback of the 3db low pass filter frequencyJonathan Cameron
Driving towards getting rid of the non standard mode control interface. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Clean up register defines.Jonathan Cameron
Introduce some more masks and generally drive towards consistent naming. Note the small indents used to indicate parts of registers + parts of multiplexed registers. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 use a 'fake' channel to handle freefall event ↵Jonathan Cameron
registration. This is an approach used in some newer drivers as it exposes the compound channel events to the core rather than hiding their control in sysfs attributes entirely via the driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 drop some unused variables.Jonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 move to hybrid hard / soft buffer design.Jonathan Cameron
In a similar fashion to other newer drivers (e.g. ti_am335x), instead of using the hardware buffer support in IIO to directly access the hardware fifo, insert a software fifo and feed that from the hardware one when interrupts occur. This gives a simpler structure to the data flows and allows more flexibility over how often data is shipped to userspace etc. This was also the only direct user of the simplistic generalization found in ring_hw.h so that header is removed. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Drop custom ABI for watersheds.Jonathan Cameron
For now we support only the 50% watershed interrupt and start and stop it as part of the buffer bring up. The 75% case may come back in future. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Fix clearing of flag + setting of size of scan.Jonathan Cameron
Not clearing the stuff_to_read flag can lead to a false flag being set on restarting the buffer if the data was not all read the previous time. The size of the scan is needed to ensure the function iio_buffer_read_first_n_outer actually tries to read the data. This stuff has been broken for some time so not stable material. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 drop sca3000_register_ring_funcsJonathan Cameron
This was needed when the buffer support was optional. Pointless wrapper now so drop it. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 merge files into one.Jonathan Cameron
In the early days of IIO we were much more inclined to keep the impact of the core IIO elements to the minimum. As time has moved on it has become clear that hardly any builds are done without buffer support and that it adds considerable complexity to the drivers. Hence merge down the buffer and non buffer elements of the sca3000 driver also allowing us to drop the header file used for the interfaces between the two. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-10-23staging:iio:accel:sca3000 Fix a use before setting of the indio_dev->buffer ↵Jonathan Cameron
pointer. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2016-09-22iio: accel: sca3000_core: avoid potentially uninitialized variableArnd Bergmann
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> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-18iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQIco Doornekamp
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-08-29staging: iio: accel: sca3000: remove extra spaceClifton Barnes
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-07-14Merge tag 'iio-for-4.8c' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next 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-04staging:iio:lis3l02dq drop separate driverJonathan Cameron
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-Hartman
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 Boirie
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 Bethencourt
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 Bethencourt
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-04-16staging:iio:adis16240: Set self_test_no_autoclear flagLars-Peter Clausen
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 Clausen
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>