aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/adis16480.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-08imu:adis16480: fix debugfs_simple_attr.cocci warningsVenkat Prashanth B U1-12/+16
Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-25Merge tag 'iio-for-4.15a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman1-1/+0
Jonathan writes: Round one of new device support, features and cleanup for IIO in the 4.15 cycle. Note there is a misc driver drop in here given we have support in IIO and the feeling is no one will care. A large part of this series is a boiler plate removal series avoiding the need to explicitly provide THIS_MODULE in various locations. It's very dull but touches all drivers. New device support * ad5446 - add ids to support compatible parts DAC081S101, DAC101S101, DAC121S101. - add the dac7512 id and drop the misc driver as feeling is no one is using it (was introduced for a board that is long obsolete) * mt6577 - add bindings for mt2712 which is fully compatible with other supported parts. * st_pressure - add support for LPS33HW and LPS35HW with bindings (ids mostly). New features * ccs811 - Add support for the data ready trigger. * mma8452 - remove artifical restriction on supporting multiple event types at the same time. * tcs3472 - support out of threshold events Core and tree wide cleanup * Use macro magic to remove the need to provide THIS_MODULE as part of struct iio_info or struct iio_trigger_ops. This is similar to work done in a number of other subsystems (e.g. i2c, spi). All drivers are fixed and then the fields in these structures are removed. This will cause build failures for out of tree drivers and any new drivers that cross with this work going into the kernel. Note mostly done with a coccinelle patch, included in the series on the mailing list but not merged as the fields no longer exist in the structures so the any hold outs will cause a build failure. Cleanups * ads1015 - avoid writing config register when it doesn't change. - add 10% to conversion wait time as it seems it is sometimes a little small. * ade7753 - replace use of core mlock with a local lock. This is part of a long term effort to make the use of mlock opaque and single purpose. * ade7759 - expand the use of buf_lock to cover previous mlock cases. This is a slightly nicer solution to the same issue as in ade7753. * cros_ec - drop an unused variable * inv_mpu6050 - add a missing break in a switch for consistency - not actual bug, - make some local arrays static to save on object code size. * max5481 - drop manual setting of the spi module owner as handled by the spi core. * max5487 - drop manual setting of the spi module owner as handled by the spi core. * max9611 - drop explicit setting of the i2c module owner as handled by the i2c core. * mcp320x - speed up reads on single channel devices, - drop unused of_device_id data elements, - document the struct mcp320x, - improve binding docs to reflect restrictions on spi setup and to make it explicit that the reference regulator is needed. * mma8452 - symbolic to octal permissions, - unsigned to unsigned int. * st_lsm6dsx - avoid setting odr values multiple times, - drop config of LIR as it is only ever set to the existing defaults, - drop rounding configuration as it only ever matches the defaults. * ti-ads8688 - drop manual setting of the spi module owner as handled by the spi core. * tsl2x7x - constify the i2c_device_id, - cleanup limit checks to avoid static checker warnings (and generally have nicer code).
2017-08-22iio:imu: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-1/+0
The equivalent of both of these are now done via macro magic when the relevant register calls are 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-08-20iio: imu: adis16480: Fix acceleration scale factor for adis16480Dragos Bogdan1-1/+1
According to the datasheet, the range of the acceleration is [-10 g, + 10 g], so the scale factor should be 10 instead of 5. Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2015-12-01Merge tag 'iio-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman1-1/+3
Jonathan writes: First set of new device support, features and cleanups for IIO in the 4.5 cycle Usual mixed bag, but the big item perhaps in this series is the DMA buffer support added by Lars-Peter Clausen. It's been in the works for a long time and it will be interesting to see what hardware support shows up now that this is available. New core features + associate cleanup. * Add generic DMA buffer infrastructure * Add a DMAengine framework based buffer Also associated minor changes. - Set the device buffer watermark based on the minimum watermark for all attached buffers rather than just the 'primary' one. - iio_buffer_init - only set the watermark default if one hasn't already been provided. This allows simple support for devices with a fixed watermark. - read only attribute for watermark on fixed watermark devices. - add explicit buffer enable/disable callbacks to allow the buffer to do more than trivial actions when it is being turned on and off. * IIO_VAL_INT support in write_raw_get_fmt function. New device support * Freescale MMA7455/7456L accelerometers * Memsic MXC6255XC accelerometer * ST lis2dh12 accelerometer * TI ADS8688 ADC * TI Palamas (twl6035/7) gpadc New driver features * mma8452 - support either of the available interrupt pins to cope with the case where board layout has lead to a particular one being connected. Staging graduation * Dummy driver - this driver acts as both an example and a test device for those with out hardware to develop userspace code against. Cleanups and minor bits and bobs. * treewide - Sort out the ordering of iio_device_register/unregister vs runtime pm function calls so that it's all nice and consistent and not race prone. - Check sscanf return values. None of the cases will actually happen as the strings are supplied internally, but best to be consistent on this. * ad7780 - switch over to the gpio descriptor interface and remove the now unused platform data which gets rid of a header entirely. * ad7793 - drop a pointless else statement. * at91_adc - Swap kmalloc_array in for a kmalloc doing the same job. * dummy - get rid of some commented out lines that snuck in during the move of the driver. * lm3533-als - Print an error message on provision of an invalid resistance. * mcp320x - Add compatible strings with vendor prefix and deprecate those with no vendor prefix. * mxs-lradc - Use BIT macro in various places rather than shifted ones. * pa12203001 - Power off the chip if the registration fails. * pulsedlight-lidar-lite - add runtime PM support. * xilinx XADC - constify an iio_buffer_setup_ops structure.
2015-11-08iio: imu: check sscanf return valueIoana Ciornei1-1/+3
This patch fixes the following checkpatch warning: WARNING: unchecked sscanf return value Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis1-1/+0
An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-08iio: adis16480: Fix scale factorsLars-Peter Clausen1-6/+33
The different devices support by the adis16480 driver have slightly different scales for the gyroscope and accelerometer channels. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07iio: imu: adis16480 switch sampling frequency attr to core supportJonathan Cameron1-60/+22
By using the info_mask_shared_by_all element of the channel spec, access to the sampling frequency becomes available to in kernel users of the driver. It also shortens and simplifies the code. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-08-03iio: imu: adis16480: Use devm_iio_device_allocSachin Kamat1-7/+3
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:imu:adis16480 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-16/+16
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2012-11-30iio: imu: adis16480: remove duplicated include from adis16480.cWei Yongjun1-1/+0
Remove duplicated include. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30iio:imu: adis16480: show_firmware() buffer too smallDan Carpenter1-2/+2
Smatch complains that snprintf() returns the number of characters, not counting the NUL terminator, which *would* have been printed if there were enough space. In other words the return value could be more than sizeof(buf). In this case, we are printing something like "ff.ff\n" which is at most 6 characters and a NUL so that's not an issue. I changed snprintf() to scnprintf() to silence the warning. But since the buffer doesn't include space for the NUL terminator, we need to make it bigger or the "\n" will be truncated off. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-By: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-20iio:imu: Add support for the ADIS16480 and similar IMUsLars-Peter Clausen1-0/+925
This patch adds support for the ADIS16375, ADIS16480, ADIS16485, ADIS16488 6 degree to 10 degree of freedom IMUs. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>