summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
AgeCommit message (Collapse)Author
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>
2012-11-04staging:iio:adis16400: Remove now duplicated chip_table entryLars-Peter Clausen
The ADIS1360 and ADIS13605 are very similar and do have the same software interface. The only difference is the contents of the PROD_ID register. Since we now read the product id from the device name instead of the chip_info struct we can use the same chip_table entry for both the ADIS1360 and ADIS13605. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04staging:iio:adis16400: Fix product id checkLars-Peter Clausen
The product id check currently ANDs the read id with 0xF000 and compares the result to the product id from the chip info. Since none of the product ids in the chip info table end in 0x000 the check will always fail. Furthermore it is also wrong, the product id in the PROD_ID register will always match the part number of the device. Some of the ADIS16XXX devices are identical from a software point of view with the product id register having a different content. If we keep the current scheme of storing the product id in the chip info table this would require us to have multiple almost identical chip info table entries. So instead this patch changes the code to parse the product id from the device name. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-04staging:iio:adis16400: Fix adis16334 sampling frequency controlLars-Peter Clausen
Setting the sampling frequency for the adis16334 differs from the other devices. This patch introduces two new callback functions to the adis16400 chip_info struct which are used to specify how to read and write the current sample rate. The patch also introduces the proper implementations for these callbacks for the adis16334. Related to this is that the adis16334 has no slow mode and so we do not limit the SPI clock rate to 300kHz during initialization. The patch adds a new flag for devices which do have a slow mode. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-02iio: isl29018: Support suspend and resume.Bryan Freed
The driver leaves the device in power-down state anyway, so there is nothing to do on suspend. On resume, we just have to make sure the range and ADC values are updated in the device since it may have been powered down in suspend. Signed-off-by: Bryan Freed <bfreed@chromium.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-02staging: iio: adc: ad7280a.c: fixed macro coding styleKumar Amit Mehta
remove unnecessary semicolon from the macro definition Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-31staging:iio: Consolidate adt7310 and adt7410 driverLars-Peter Clausen
The adt7310 is the SPI version of the adt7410, so there is no need to have a separate driver for it. The register map layout is a bit different, i.e. the addresses of the register differ, but the individual register layouts are identical. We solve this by adding a small look-up table, which translates adt7410 register addresses to ad7310 register addresses. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-29Merge 3.7-rc3 into staging-nextGreg Kroah-Hartman
This resolves the conflict with: drivers/staging/comedi/drivers/amplc_dio200.c and syncs up the changes that happened in the staging directory for 3.7-rc3. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-19staging:iio:lpc32xx_adc: Use resource_size instead of opencoding itLars-Peter Clausen
Fixes the following error from coccicheck: drivers/staging/iio/adc/lpc32xx_adc.c:153:43-46: ERROR: Missing resource_size with res Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio:adis16400: Fixup adis16336 temp channel attributesLars-Peter Clausen
The temperature channel has a calibbias attribute which it should not have, but the offset attribute is missing. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio:adis16400: Report correct temperature scale and offsetLars-Peter Clausen
Temperature scale and offset differ between the different devices supported by this driver. Right now the driver always reports the temperature scale and offset of the adis16400 regardless of which chip variant is used. This patch adds two new attributes to the chip_info struct, one for the temperature scale and one for the temperature offset. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16400 channel offsets and scalesLars-Peter Clausen
Most of the channel offsets and scales in the adis16400 are incorrect: * Voltage scale is off by a factor of 1000 * Temperature scale is off by a factor of 1000 * Temperature offset is completely wrong * Some of the acceleration scales are either completely wrong or have the wrong unit * Some of the angular velocity scale are either completely wrong or have the wrong unit This patch fixes these issues. For consistency it also converts scales which are correct to use the IIO_G_TO_M_S_2 and IIO_DEGREE_TO_RAD macro. This makes it much easier to compare it to the value given in the datasheet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-10-19staging:iio: Fix adis16260 channel offsets and scalesLars-Peter Clausen
Most of the channel offsets and scales in the adis16260 are incorrect: * Temperature scale is off by a factor of 1000 * Voltage scale is off by a factor of 1000 * Temperature offset is completely wrong This patch fixes these issues. Also use the IIO_DEGREE_TO_RAD for the angle velocity since this makes it much easier to compare it to the value given in the datasheet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>