summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
2013-01-09staging:iio:adis16080: Perform sign extensionLars-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>
2013-01-09iio: mxs-lradc: indexes are unsignedFabio Estevam
Fix the following warning when building with W=1 option: drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_trigger_handler': drivers/staging/iio/adc/mxs-lradc.c:244:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marek Vasut <marex@denx.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-30staging:iio: Move ad7793 driver out of stagingLars-Peter Clausen
The driver does not expose any custom API to userspace and none of the standard static code checker tools report any issues, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Implement stricter id checkingLars-Peter Clausen
Instead of checking whether the id of the current device matches the id of any device supported by the driver, check whether it matches the id of the device which the driver was instantiated for. This makes sure that the driver is not accidentally instantiated for the wrong device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Move register definitions from header to sourceLars-Peter Clausen
The only user of the register definitions is the driver itself, so move them from the header file to the driver source file. The header file now only contains the platform data struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Rework regulator handlingLars-Peter Clausen
Rework the regulator handling of the driver to match more closely what we do in other drivers. Make the regulator non-optional if a external reference is used. Also dispose the option of specifying the reference voltage via platform data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Rework platform dataLars-Peter Clausen
Currently the platform data for the ad7793 consist just out of the raw default register settings. This has some downsides, for one we actually don't want to make all bits configurable and secondly not all register settings are actually valid. This patch exposes all the options which should be configurable via platform data as induvidual platform data struct fields. This also allows us to document the different settings via proper kernel doc. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Use kstrtol instead of strict_strtolLars-Peter Clausen
strict_strtol is deprecated in favor of kstrtol. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Use usleep_range instead of msleepLars-Peter Clausen
It is recommended to use usleep_range instead of msleep for durations smaller than a 20ms. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Fix temperature scaleLars-Peter Clausen
The temperature scale was off by a factor of 1000. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-30staging:iio:ad7793: Fix VDD monitor scaleLars-Peter Clausen
The VDD monitor scale was off by a factor of 10. 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 the ad7298 driver out of stagingLars-Peter Clausen
The driver does not expose any custom API to userspace and none of the standard static code checker tools report any issues, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:ad7298: Squash everything into one fileLars-Peter Clausen
The recent cleanups have decimated the drivers code size by quite a bit. It is only a few hundred lines in total now. Putting everything into one file also allows to reduce the code size a bit more by removing a few lines of boilerplate code. The only functional change made by this patch is that we now always include buffer support, instead of making it optional. This is more consistent with what we do for other drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:ad7298: Fix temperature scale and offsetLars-Peter Clausen
The temperature scale and offset depend on the reference voltage, the current formula used in the driver assumes a 2.5V reference. This patch modifies the code to report the unprocessed value for the temperature channel "raw" property and to provide proper "scale" and "offset" properties which depend on the selected reference voltage. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:ad7298: Rework regulator handlingLars-Peter Clausen
Rework the regulator handling of the driver to match more closely what we do in other drivers. Make the regulator non-optional if a external reference is used. Also dispose the option of specifying the reference voltage via platform data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:ad7298: Do not perform endianness conversion in buffered modeLars-Peter Clausen
For buffered mode we do not want to perform endianness conversion in the kernel, but rather offload it to user space, since it is not always required to do a conversion at all. It also greatly simplifies the kernel code since no post-processing has to be done and may allow future optimizations like streaming data directly to a storage device or over the network via DMA. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.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>
2012-11-19staging:iio:adis: Preallocate transfer messageLars-Peter Clausen
Currently the driver reads out all sample registers of the device and throws away those which it does not need. Furthermore the SPI message is constructed each time the trigger handler is run, although it will be the same each time. This patch preallocates and pre-constructs the SPI message in the "update_scan_mode" callback. Only those register which are actually selected for sampling are included in the message. The patch also gets rid of the conversion of the sample data from big endian to the native endianness and instead marks the channel as big endian in its scan type. This allows to directly push the SPI transfer buffer to the IIO buffer without the need to post-process it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis_lib: Use triggered buffer setup helper functionLars-Peter Clausen
Use the triggered buffer helper functions to setup and tear down the buffer for the adis library instead of doing this manually. This also means that we switch away from the deprecated sw_ring buffer and use the kfifo buffer now instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16260: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16260 driver. This allows us to completely scrap the adis16260 buffer and trigger code and about half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16240: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16240 driver. This allows us to completely scrap the adis16240 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16220: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16220 driver. The adis16220 driver is a bit special and so we can only make use of the generic register access and control functions for now. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16209: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16209 driver. This allows us to completely scrap the adis16209 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16204: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16204 driver. This allows us to completely scrap the adis16204 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16203: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16203 driver. This allows us to completely scrap the adis16203 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio:adis16201: Use adis libraryLars-Peter Clausen
Use the new adis library for the adis16201 driver. This allows us to completely scrap the adis16201 buffer and trigger code and more than half of the core driver code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19staging:iio: Add common ADIS libraryLars-Peter Clausen
A lot of the devices from the ADIS family use the same methods for accessing registers, sampling data and trigger handling. They also have similar register layout for the control registers. This patch adds a common library for these devices. The library implements functions for reading and writing registers as buffer and trigger management. It also provides a set functions for accessing the control registers and for running the devices internal self-test. Having this common library code will allow us to remove a lot of duplicated code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-19iio: isl29018: fix to return error or 0 in isl29018_write_raw()Wei Yongjun
We had assigned the return value to 'ret' but ignored it when return from isl29018_write_raw(), it's better to return 'ret' instead of 0. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-17tsl2563: fixed bug with disabling interruptsDerek Basehore
In tsl_2563_write_interrupt_config and tsl2562_remove, interrupts are not disabled where they should be. This seems to be from a mistake of using |= instead of &= in 2 lines of code. Signed-off-by: Derek Basehore <dbasehore@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-17staging:iio:adt7410: Fix adt7410_set_mode return valueLars-Peter Clausen
The function is expected to return the number of bytes consumed and as long as not all bytes have been consumed the function will be called again. Currently the function returns 'ret', which will always be 0 in this case, so we end up in a endless loop since the caller will assume that no bytes have been consumed. So instead return len as it is supposed to. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10iio:adc:max1363 move from staging.Jonathan Cameron
Now this driver is using kfifo we can move it out of staging. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 cleanup regulator handling.Jonathan Cameron
For historical reasons the regulator handling was a little clunky. This patch brings it inline with a more standard ordering wrt to allocation of the iio_device. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 white space cleanupJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 make docs match the contents of max1363_chip_infoJonathan Cameron
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 drop references to 'ring' given now using a fifoJonathan Cameron
Seems worth clearing the old naming out to avoid any confusion in the future. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 consolidate files.Jonathan Cameron
For a long while now the max1363 core has selected the buffer anyway. For a while I meant to make the separation work again, but given how long it has been it is probably time to conclude it will never happen and settle for tidying up what we have. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio:adc:max1363 ring_sw->kfifo conversionJonathan Cameron
We are moving towards scrapping ring_sw so this move is necessary. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10staging:iio: Add support for multiple buffersJonathan Cameron
Route all buffer writes through the demux. Addition or removal of a buffer results in tear down and setup of all the buffers for a given device. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
2012-11-05staging:iio: Move the ad7887 driver out of stagingLars-Peter Clausen
The driver does not expose any custom API to userspace and none of the standard static code checker tools report any issues, so move it out of staging. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Use passed in chan spec in ad7887_read_rawLars-Peter Clausen
Use the passed in chan spec in ad7887_read_raw instead of alawys using the first chan spec entry from the chip info data. Since all channels have the same shift and realbits from a functional point of view it does not matter which chan spec is used, but the patch makes the a bit more clear. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Allow to use internal ref in two channel modeLars-Peter Clausen
While it is not recommended to use the internal reference in two channel mode in order to obtain optimal performance it is still possible to use it. While we are at it also get rid of the duplicate tx_cmd_buf entries. There are only two unique entries. One for channel 1 and one for channel 2. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Use proper kernel docLars-Peter Clausen
Use proper kernel doc to document the platform data struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Squash everything into one fileLars-Peter Clausen
The recent cleanups have decimated the drivers code size by quite a bit. It is only a few hundred lines in total now and we also always build buffer support, so there really is no need to spread the driver out over multiple files. Putting everything into one file also allows to reduce the code size a bit more by removing a few lines of boilerplate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Rework regulator handlingLars-Peter Clausen
Rework the regulator handling of the ad7887 driver to match more closely what we do for other drivers. Only request the regulator if a external reference is used, but treat it as an error if requesting the regulator fails. Also remove the possibility to specify the reference voltage via platform data and always use the regulator for this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-05staging:iio:ad7887: Preallocate sample bufferLars-Peter Clausen
We know that the sample buffer will at most need to hold two 16 bit samples and the 64 bit aligned 64 bit timestamp. Preallocate a buffer large enough to hold this instead of allocating and freeing it each time a sample is read. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04staging:iio:adis16400: Set the PROD_ID flag for the adis16334Lars-Peter Clausen
The adis16334 has the PROD_ID register so set the PROD_ID flag in its chip info. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>