summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/gyro
AgeCommit message (Collapse)Author
2014-10-20Staging: iio: gyro: Added description for config symbol.Heena Sirwani
The following patch fixes the checkpatch.pl warning by adding description for a config symbol. WARNING: please write a paragraph that describes the config symbol fully. Signed-off-by: Heena Sirwani <heenasirwani@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-07staging: iio: adis16060: Fix coding style problemOussama Jabbari
This patch fixes a warning from checkpatch.pl script : "WARNING: Missing a blank line after declarations" Signed-off-by: Oussama Jabbari <oussama.jabbari@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-24staging: iio: adis16060: Use devm_iio_device_registerSachin Kamat
devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-17iio: gyro: adis16060_core: Use devm_iio_device_allocSachin Kamat
Using devm_iio_device_alloc makes code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Move out of stagingLars-Peter Clausen
The drivers is in more or less good shape, conforms to the IIO ABI and none of the default static code checker report any problems, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Remove sampling_frequency_available attributeLars-Peter Clausen
The values presented here are completely bogus. Also ..._available attributes are supposed to be used for properties that only support discrete sets of values, but we accept continuous values and will round to the next supported frequency. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Add proper range checks to write_frequency()Lars-Peter Clausen
A negative sampling frequency is obviously invalid, so use kstrtouint() instead of strict_strtoul. Also when setting a sampling frequency smaller than the minimum supported frequency set the frequency to the minimum supported frequency instead of just cutting off the upper bits of the raw register value. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Remove unused includesLars-Peter Clausen
Remove some unused includes from the driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Add scale for the inclination channelLars-Peter Clausen
While the inclination channel claims to support reading the scale the driver did not implement this, so trying to read the scale results in a -EINVAL. This patch fixes it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Remove 'SPS' suffix from samplerate attributeLars-Peter Clausen
This is not part of the ABI. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Fix minor style issueLars-Peter Clausen
Delete some extra whitespace. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Simplify calibscale and caliboffset readingLars-Peter Clausen
All channels for this device have the same number of bits for calibscale and caliboffset, there is no need to determine it dynamically based on the channel type. Also there is no locking required since adis_read_reg_16() will take care of proper locking on its own. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Use sign_extend32() instead of open-coding itLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Add value range check for calibscale/-biasLars-Peter Clausen
Instead of just cutting of the upper bits of the value make sure that the value is in the valid range and return an error if it is not. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Remove separate headerLars-Peter Clausen
The header is only used by a single C file, just put the register defines directly into that C file and remove the header. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Don't set default scan maskLars-Peter Clausen
The recomentation for IIO driver is to leave all scan elements off by default and let userspace decide which channels need to be enabled. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Remove support for orientation mappingLars-Peter Clausen
The adis16260 driver implements a unique feature in that it allows to change the orientation of the gyroscope channel by specifying the orientation in platform data. This feature is as far as I can see unused though and makes the driver unnecessarily complex. So this patch removes the support for it. If it turns out we need this, the cleanest approach to implement it is by adding support for orientation mapping inside the IIO core so it is available to all drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Drop unused 'negate' propertyLars-Peter Clausen
Remove the unused 'negate' property from the driver state struct. This also means we can now use the adis struct directly as the driver data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03staging:iio:adis16260: Fix reading calibscaleLars-Peter Clausen
Return the actual value read from the device and not just the mask. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Move out of stagingLars-Peter Clausen
The adis16130 driver is fairly simple and it a good shape now, so move it out of staging. Remove an outdated FIXME along the way. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Report scale and offsetLars-Peter Clausen
Report scale and offset for the temperature and voltage channels. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Fix sample readingLars-Peter Clausen
The driver first does a proper read of the data register, but right after that it does a spi_read, which will overwrite the initial result. It looks as if the extra spi_read was accidentally introduced in commit a5e7363ca ("staging:iio:gyro:adis16130 drop control of adc resolution."), quite likely due to a bad rebase. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-06-11staging:iio:adis16130: Remove unused includesLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17staging:iio:gyro:adis16130 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:gyro:adis16060 move to info_mask_(shared_by_type/separate)Jonathan Cameron
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-03-17staging:iio:accel:adis move to info_mask_(shared_by_type/separate)Jonathan Cameron
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>
2013-02-02staging:iio: Move adxrs450 driver out of stagingLars-Peter Clausen
The adxrs450 is in a reasonable shape now. It follows the IIO ABI and non of the standard code checker tools report any issue, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Move header file contents to main fileLars-Peter Clausen
The contents of the adxrs450 header file is not used outside the main drivers file, so just move the contents from the header file into the drivers main file. Also rename the adxrs450 driver file from adxrs450_core.c to adxrs450.c. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Fixup kernel doc commentsLars-Peter Clausen
Fix the name of the iio_device parameter for a few functions and add documentation for one missing function parameter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Use usleep_range for the sequential transfer dealyLars-Peter Clausen
The adxrs450 requires a delay of at least 0.1 ms between register writes. Using msleep() for such small delays is not recommended. So use usleep_range instead. Fixes the following checkpatch warning: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt + msleep(1); Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Don't split string across multiple linesLars-Peter Clausen
This is one of the exceptions to the 80 chars per line rule since breaking the string in half it badly affects the grep-ability. Fixes the following checkpatch warning: WARNING: quoted string split across lines #203: FILE: staging/iio/gyro/adxrs450_core.c:203: + dev_warn(&st->us->dev, "The initial power on response " + "is not correct! Restart without reset?\n"); Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Reflow overlong linesLars-Peter Clausen
Reflow two lines to meet the 80 characters per line limit. Fixes the following checkpatch warnings: WARNING: line over 80 characters #29: FILE: staging/iio/gyro/adxrs450_core.c:29: + * @reg_address: the address of the lower of the two registers,which should be an even address, WARNING: line over 80 characters #81: FILE: staging/iio/gyro/adxrs450_core.c:81: + * @reg_address: the address of the lower of the two registers,which should be an even address, Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Don't spam the bootlogLars-Peter Clausen
Don't spam the bootlog with the devices part id and serial number. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Reject out of range calibscale valuesLars-Peter Clausen
Instead of silently discarding the upper bits reject out of range values for the calibscale property. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Perform sign extension for the calibbias registerLars-Peter Clausen
The calibbias (DNC) register contains a 10-bit twos complement value. Perform a proper sign extension when reading the register, otherwise negative will incorrectly be displayed as large positive values. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02staging:iio:adxrs450: Make transfer buffers __be32Lars-Peter Clausen
Fixes the following sparse warnings: drivers/staging/iio/gyro/adxrs450_core.c:46:15: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:62:17: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:89:15: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:129:17: warning: cast to restricted __be32 drivers/staging/iio/gyro/adxrs450_core.c:168:16: warning: cast to restricted __be32 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-02Partially revert "staging:iio:gyro:adxrs450 make more use of spi_read and ↵Lars-Peter Clausen
spi_write." This partially reverts commit cb4496876f03631eff913b3c608c964d48d61eb9. There is no apparent reason why we should split a transaction which consists out of multiple transfers into multiple transactions each having one transfer. While this works it introduces a bunch of unnecessary context switch and additional setup costs. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Move out of stagingLars-Peter Clausen
The driver is rather simple and in a good shape. It follows the IIO ABI and the standard codechecker tools do not report any issues, so move it out of staging. While moving it also remove one outdated 'fixme' comment. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Add scale and offset attributesLars-Peter Clausen
Report scale and offset for the velocity, voltage and temperature channels. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Remove unnecessary lockLars-Peter Clausen
All sections in which the transfer buffer is accessed are already protected by the IIO device's mlock. So we do not need the extra mutex protecting the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: be16 cleanupsLars-Peter Clausen
The sample buffer contains big endian 16bit words. So use the be16 datatype for the buffer and use the proper helper functions for endianness conversion instead of openconding it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Cleanup SPI transferLars-Peter Clausen
During sampling the driver currently does a spi_read followed by a spi_write. This is not a problem per se, since CS needs to be deasserted between the two transfers. So even if another device claims the bus between the two transfers we should still get a result. But the code is actually spread out over multiple functions. E.g. the spi_read happens in one function the spi_write in another, this makes the code harder to follow. This patch re-factors the code to just use a single spi transaction to do both the read and the write transfer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:adis16080: Add device id table entry for the adis16100Lars-Peter Clausen
The adis16100 is very similar to the adis16080. The driver description already states that the driver supports the adis16100 as-well. But so far the there is no device id table for the adis16100 and the drivers does not bind to a device named adis16100. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26staging:iio:gyro: Remove stale Makefile entryLars-Peter Clausen
Commit a301d425e ("staging:iio:gyro remove adis16251 driver as now supported by adis16260 driver") removed the adis16251, but left its Makefile entry intact. This patch removes the unused Makefile entry. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-09staging:iio:adis16080: Perform sign extensioniio-fixes-for-3.8bLars-Peter Clausen
The adis16080 reports sample values in twos complement. So we need to perform a sign extension on the result, otherwise negative values will be reported incorrectly as large positive values. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-12-27staging:iio:adis16260: Select adislibLars-Peter Clausen
Commit 9d5e9fdf ("staging:iio:adis16260: Use adis library") switched over the adis16260 driver to use the common adis library but neglected to update the Kconfig entry to reflect the change. This leads to the following compile error if no other driver selects the adis library: drivers/built-in.o: In function `adis16260_write_frequency': adis16260_core.c:(.text+0x5a83bf): undefined reference to `adis_write_reg_8' drivers/built-in.o: In function `adis16260_read_frequency': adis16260_core.c:(.text+0x5a8433): undefined reference to `adis_read_reg_16' drivers/built-in.o: In function `adis16260_write_raw': adis16260_core.c:(.text+0x5a8538): undefined reference to `adis_write_reg_16' adis16260_core.c:(.text+0x5a856b): undefined reference to `adis_write_reg_16' drivers/built-in.o: In function `adis16260_read_raw': adis16260_core.c:(.text+0x5a85d3): undefined reference to `adis_single_conversion' adis16260_core.c:(.text+0x5a873e): undefined reference to `adis_read_reg_16' adis16260_core.c:(.text+0x5a87fb): undefined reference to `adis_read_reg_16' drivers/built-in.o: In function `adis16260_probe': adis16260_core.c:(.devinit.text+0x5c6b8): undefined reference to `adis_init' adis16260_core.c:(.devinit.text+0x5c799): undefined reference to `adis_initial_startup' drivers/built-in.o: In function `adis16260_remove': adis16260_core.c:(.devexit.text+0x9943): undefined reference to `adis_write_reg_16' This patch updates the adis16260 Kconfig entry to select the adis library. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-21staging: iio: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: iio: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-19staging:iio: Move adis library out of stagingLars-Peter Clausen
Now that the adis library no longer depends on the sw_ring buffer implementation we can move it out of staging. While we are at it also sort the entries in the iio Kconfig and Makefile to be in alphabetical order. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>