dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

1288 Commits

Author SHA1 Message Date
Bill Pemberton e543acf07d staging: iio: remove use of __devexit_p
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-21 15:02:23 -08:00
Bill Pemberton 447d4f29ee staging: iio: remove use of __devexit
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-21 14:59:37 -08:00
Bill Pemberton 4ae1c61ff2 staging: iio: remove use of __devinit
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-21 14:31:41 -08:00
Lars-Peter Clausen 709ab36e95 staging:iio: Move the ad7298 driver out of staging
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-19 22:22:15 +00:00
Lars-Peter Clausen dc4871adf9 staging:iio:ad7298: Squash everything into one file
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-19 22:22:14 +00:00
Lars-Peter Clausen 01a10e04f8 staging:iio:ad7298: Fix temperature scale and offset
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-19 22:22:14 +00:00
Lars-Peter Clausen 2e33460098 staging:iio:ad7298: Rework regulator handling
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-19 22:22:13 +00:00
Lars-Peter Clausen ca654638f2 staging:iio:ad7298: Do not perform endianness conversion in buffered mode
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-19 22:22:13 +00:00
Lars-Peter Clausen ec04cb048d staging:iio: Move adis library out of staging
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-19 22:22:12 +00:00
Lars-Peter Clausen aacff892cb staging:iio:adis: Preallocate transfer message
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-19 22:22:11 +00:00
Lars-Peter Clausen a458c55c10 staging:iio:adis_lib: Use triggered buffer setup helper function
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-19 22:22:10 +00:00
Lars-Peter Clausen 9d5e9fdf0f staging:iio:adis16260: Use adis library
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-19 22:22:09 +00:00
Lars-Peter Clausen 5cb7cb1191 staging:iio:adis16240: Use adis library
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-19 22:22:08 +00:00
Lars-Peter Clausen edcf600912 staging:iio:adis16220: Use adis library
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-19 22:22:07 +00:00
Lars-Peter Clausen 511fb29e35 staging:iio:adis16209: Use adis library
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-19 22:22:06 +00:00
Lars-Peter Clausen 5bd22f516e staging:iio:adis16204: Use adis library
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-19 22:22:06 +00:00
Lars-Peter Clausen 3bff7eb06d staging:iio:adis16203: Use adis library
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-19 22:22:05 +00:00
Lars-Peter Clausen 6d78e862ac staging:iio:adis16201: Use adis library
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-19 22:22:05 +00:00
Lars-Peter Clausen ccd2b52f4a staging:iio: Add common ADIS library
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-19 22:22:04 +00:00
Wei Yongjun 6dc973d4fd iio: isl29018: fix to return error or 0 in isl29018_write_raw()
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-19 22:22:04 +00:00
Derek Basehore 95273f8952 tsl2563: fixed bug with disabling interrupts
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-17 10:17:24 +00:00
Lars-Peter Clausen e8f45e3341 staging:iio:adt7410: Fix adt7410_set_mode return value
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-17 10:17:17 +00:00
Jonathan Cameron 168c9d95a9 iio:adc:max1363 move from staging.
Now this driver is using kfifo we can move it out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:31 +00:00
Jonathan Cameron b77b8f8c20 staging:iio:adc:max1363 cleanup regulator handling.
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-10 10:17:30 +00:00
Jonathan Cameron 0d9fa2ce93 staging:iio:adc:max1363 white space cleanup
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:30 +00:00
Jonathan Cameron 2593b13a62 staging:iio:adc:max1363 make docs match the contents of max1363_chip_info
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:29 +00:00
Jonathan Cameron ec44372865 staging:iio:adc:max1363 drop references to 'ring' given now using a fifo
Seems worth clearing the old naming out to avoid any confusion in the future.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:29 +00:00
Jonathan Cameron b3bcbfcfec staging:iio:adc:max1363 consolidate files.
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-10 10:17:28 +00:00
Jonathan Cameron 0d331e4fd2 staging:iio:adc:max1363 ring_sw->kfifo conversion
We are moving towards scrapping ring_sw so this move
is necessary.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-11-10 10:17:28 +00:00
Jonathan Cameron 84b36ce5f7 staging:iio: Add support for multiple buffers
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-10 10:17:21 +00:00
Lars-Peter Clausen 4eb3ccf157 staging:iio: Move the ad7887 driver out of staging
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-05 20:39:54 +00:00
Lars-Peter Clausen 98efb70add staging:iio:ad7887: Use passed in chan spec in ad7887_read_raw
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-05 20:39:53 +00:00
Lars-Peter Clausen fce7c3eac7 staging:iio:ad7887: Allow to use internal ref in two channel mode
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-05 20:39:53 +00:00
Lars-Peter Clausen 5daa751f89 staging:iio:ad7887: Use proper kernel doc
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-05 20:39:52 +00:00
Lars-Peter Clausen 65dd3d3d7a staging:iio:ad7887: Squash everything into one file
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-05 20:39:52 +00:00
Lars-Peter Clausen bf5d2613c9 staging:iio:ad7887: Rework regulator handling
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-05 20:39:52 +00:00
Lars-Peter Clausen bd6880477a staging:iio:ad7887: Preallocate sample buffer
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-05 20:39:51 +00:00
Lars-Peter Clausen 3c7f0c2b11 staging:iio:adis16400: Set the PROD_ID flag for the adis16334
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-04 15:55:44 +00:00
Lars-Peter Clausen a7462e640d staging:iio:adis16400: Remove now duplicated chip_table entry
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-04 15:55:40 +00:00
Lars-Peter Clausen fc8850c0a1 staging:iio:adis16400: Fix product id check
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-04 15:55:37 +00:00
Lars-Peter Clausen ea2ccb3e02 staging:iio:adis16400: Fix adis16334 sampling frequency control
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-04 15:55:32 +00:00
Bryan Freed 1e45cf3c49 iio: isl29018: Support suspend and resume.
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-02 09:50:59 +00:00
Kumar Amit Mehta fad109452e staging: iio: adc: ad7280a.c: fixed macro coding style
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-11-02 09:30:19 +00:00
Lars-Peter Clausen 2b0c856ad9 staging:iio: Consolidate adt7310 and adt7410 driver
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-31 10:40:34 +00:00
Greg Kroah-Hartman cb1f6268ac Merge 3.7-rc3 into staging-next
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-29 08:37:12 -07:00
Lars-Peter Clausen 6c724cb0ad staging:iio:lpc32xx_adc: Use resource_size instead of opencoding it
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-19 16:25:31 +01:00
Lars-Peter Clausen 2e132e4692 staging:iio:adis16400: Fixup adis16336 temp channel attributes
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-19 16:23:34 +01:00
Lars-Peter Clausen 760ebc0d2a staging:iio:adis16400: Report correct temperature scale and offset
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-19 16:23:34 +01:00
Lars-Peter Clausen 1cf8c97f94 staging:iio: Fix adis16400 channel offsets and scales
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-19 16:23:33 +01:00
Lars-Peter Clausen 7e72a54c08 staging:iio: Fix adis16260 channel offsets and scales
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>
2012-10-19 16:23:33 +01:00