Commit Graph

349748 Commits

Author SHA1 Message Date
H Hartley Sweeten 1b69a7577a staging: comedi: ni_mio_cs: remove cs_release()
This function simply calls pcmcia_disable_device(). Remove it and
just call pcmcia_disable_device() where needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten bea5b9035d staging: comedi: ni_mio_cs: move pcmcia_driver functions
For aesthetic reasons, move all the pcmcia_driver functions so they
are near the pcmcia_driver declaration. This also removes the need
for a couple forward declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:23 -05:00
H Hartley Sweeten 63e563af82 staging: comedi: ni_mio_cs: remove pcmcia_driver suspend/resume
The pcmcia_driver suspend and resume functions in this driver
don't do anything. Since they are optional just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten b8f4c930e0 staging: comedi: ni_mio_cs: remove setting dev->driver
The comedi core sets the dev->driver pointer before calling the
comedi_driver attach function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten a7538b8271 staging: comedi: ni_mio_cs: cleanup pcmcia_driver
For aesthetic reasons, reorder the pcmcia_driver variables and
add some whitespace.

Also, remove the unnecessary '&' before the function names. They
are already addresses.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten 27629c600d staging: comedi: ni_mio_cs: move MODULE_* info to end of file
For aesthetic reasons, move all the MODULE_* information to the end
of the file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:08:22 -05:00
H Hartley Sweeten b7c0afa4b6 staging: comedi: quatech_daqp_cs: cleanup subdevice init
Remove the dev_info() board attach noise.

For aesthetic reasons, add some whitespace to the subdevice init.

Remove the init of the s->len_chanlist for the subdevices that do
not support commands. It's not used by them and the comedi core
will handle initializing it properly in the postconfig.

Change the return after a successful attach to "0". The comedi
core expects a < 0 value to indicate an error and "0" is the
typical value returned to indicate success.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten c65c64d0f0 staging: comedi: quatech_daqp_cs: fix possible memory dereference issue
In daqp_attach(), the first options value passed in the comedi_devconfig
is used as an index to the private dev_table[] in this driver. This table
is used to pass the pcmcia_device to the comedi_driver.

Fix the code so that the index is checked before the table is accessed
so that we don't get a possible memory dereference BUG.

Change the error returned to the comedi core from -EIO to -ENODEV.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten e23fe9a1bf staging: comedi: quatech_daqp_cs: cleanup the comedi_lrange tables
For aesthetic reasons, cleanup the whitespace of the range_daqp_ai
table.

Remove the range_daqp_ao table and use the comedi core provided
range table for bipolar 5V (range_bipolar5).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 7b947d6116 staging: comedi: quatech_daqp_cs: remove #define pr_fmt
There are not pr_[level] uses in this file. Remove the pr_fmt
define.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 79a53df7fa staging: comedi: quatech_daqp_cs: remove debug functions
The functions daqp_dump() and hex_dump() are not used in this
driver. Just remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:41 -05:00
H Hartley Sweeten 90967d6626 staging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()
Remove all the pr_warn() noise in the sanity checks that make sure
the interrupt is for this device.

Simplify the sanity checks into one if() condition.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten b8319710de staging: comedi: quatech_daqp_cs: remove casts of void *
Casting a void * is not necessary.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten cdcc02291b staging: comedi: quatech_daqp_cs: cleanup daqp_cs_attach()
Absorb the code from daqp_cs_config() into this function and
properly return the error if the configuration fails.

Remove the dev_dbg() function trace messages.

Fix the kzalloc(). The preferred form for passing a size of a struct
is:

	p = kzalloc(sizeof(*p), ...);

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 86be5680f5 staging: comedi: quatech_daqp_cs: remove daqp_cs_release()
This function justs emits a dev_dbg() message then calls
pcmcia_disable_device(). The dev_dbg() is just added noise.

Remove the function and just call pcmcia_disable_device().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten d1db2a4134 staging: comedi: quatech_daqp_cs: remove forward declarations
Move some of the functions to remove the need for the forward
declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 433a0e2213 staging: comedi: quatech_daqp_cs: cleanup pcmcia_driver
For aesthetic reasons, reorder the pcmcia_driver variables and
add some whitespace.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
H Hartley Sweeten 04c5904155 staging: comedi: quatech_daqp_cs: move MODULE_* info to end of file
For aesthetic reasons, move all the MODULE_* information to the end
of the file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:06:40 -05:00
Greg Kroah-Hartman 83eaeec5b3 Second set of IIO new drivers, cleanups and fixes for the 3.9 cycle.
This second version is due to a little fixup for an include
 path being added to the tsl2563 move out of staging after
 a report from Fengguang Wu and the 0-day kernel build testing
 backend.
 
 Minor bits:
 1) A Kconfig dependency fix for the max1363 driver that
 has been causing some autobuilder fails in Linux Next.
 2) Removal of a stale makefile entry
 3) Fix an incorrect arguement for a sizeof call
 4) Duplicate code removal in tsl2x7x driver
 5) A missing spin lock init in hid-sensor-time
 
 New features:
 1) mxs adc driver gains support for touchscreen special functions
 2) mxs driver gainst supprot for the MX23 and dt entries added
 3) adis16400 gains adis16448 support and some additional bells and whistles
 
 Moves out of staging.
 1) adis16400 - a venerable driver gets a make over and moves
    out of staging.
 2) Kxsd9 moved out fo staging
 3) adis16080 gets cleaned up and moved out of staging
 4) tsl2563 gets a little cleaned up and move out of staging
 
 Removals
 1) sw_ring is killed off with all remaining drivers converted to kfifo.
    This has been scheduled for a long time since we switched to kfifo.
    There is demand for a high performance alternative, but this was
    never it and I'm glad to see this vestage of IIOs youth gone once
    and for all!
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRBWafAAoJEFSFNJnE9BaItLwP/2GaXlNcsN2rzlALMR13qffT
 cm8bWf5njuUCZ9RLxNMZ4I0hfuB3lZ3cV0jS8r748OnmRWCbS3Rxu+PmZcedQjfG
 L1puuJamQbSN+atussyHDZrOt7QGOQHEitfRKCMnw6aRDyi/l4UVjUQZN07QTD0a
 wN/FIpDHT9+LdY9S5zIoWRmBvyCQhiZqO6Pa0pgxOEuA87uKY2FzV/MCWoDOkpLj
 OdyrKHRBD5CtEGR0bIys3G1GW8HBYDHaS8Do3Kd7arBMvqg6CW1uSUAjz0XnDCnC
 81+oAsCLeO2Bl2bAv4km44LAsgMHBSlbZTB91R1oq9SzfpQ1CdRXdK4KdhCz0Olp
 x/OC7QzmoYxhiDBbKcYREB3/AKQbEHcj3F9FnvOn+wOSaq31Q/Seq5GlXirZWrpg
 Frpbxenf5SW3IpZJCBvh1rfcjTw33r569T6avizhrX/uokEhz/3WEb9FBAtJYWag
 VwubRkjkoakmYLdvEHi/DCNXPNsXrNrU3w3O18+ulucvCTojPIx/+sXE829dTqcK
 BG944B8o9lIfwmKqdoFsGtTBxzx8204p8RS9TLJH40pmjZ4eW6zGZXbBJvNIChI8
 1nOcksrcYVD9TOZ4GPm8jn2yCXiOHpfN2+p91rrgl5s4rfYNDZELnJMaOVup+ccR
 1uDMgKEoPBX5wCms1r//
 =kkCb
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-3.9b-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

	Second set of IIO new drivers, cleanups and fixes for the 3.9 cycle.

	This second version is due to a little fixup for an include
	path being added to the tsl2563 move out of staging after
	a report from Fengguang Wu and the 0-day kernel build testing
	backend.

	Minor bits:
	1) A Kconfig dependency fix for the max1363 driver that
	has been causing some autobuilder fails in Linux Next.
	2) Removal of a stale makefile entry
	3) Fix an incorrect arguement for a sizeof call
	4) Duplicate code removal in tsl2x7x driver
	5) A missing spin lock init in hid-sensor-time

	New features:
	1) mxs adc driver gains support for touchscreen special functions
	2) mxs driver gainst supprot for the MX23 and dt entries added
	3) adis16400 gains adis16448 support and some additional bells and whistles

	Moves out of staging.
	1) adis16400 - a venerable driver gets a make over and moves
	   out of staging.
	2) Kxsd9 moved out fo staging
	3) adis16080 gets cleaned up and moved out of staging
	4) tsl2563 gets a little cleaned up and move out of staging

	Removals
	1) sw_ring is killed off with all remaining drivers converted to kfifo.
	   This has been scheduled for a long time since we switched to kfifo.
	   There is demand for a high performance alternative, but this was
	   never it and I'm glad to see this vestage of IIOs youth gone once
	   and for all!
2013-01-29 07:38:23 -08:00
Jonathan Cameron 9c2251dd4b iio:light:tsl2563 move out of staging
This driver is simple, uses the latest interfaces and contains few if
any controversial elements.  All of its interfaces have been in place
for a long time now.  Hence let's move it out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-27 17:37:24 +00:00
Jonathan Cameron af0b8ee32c staging:iio:tsl2563 drop pointless forward declaration
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26 10:37:02 +00:00
Jonathan Cameron a722dcca4d staging:iio:tsl2563 Simplify exit path on error in read_interrupt_config.
A rather over complicated exit path given there is only one exit
route and nothing much is done after it.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26 10:36:51 +00:00
Jonathan Cameron a9e244f65d staging:iio:light:tsl2563 clean comments up.
Fix formatting of some comments and drop a few generic information
free ones.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26 10:36:32 +00:00
Jonathan Cameron 5ade7633ac staging:iio:light:tsl2563 drop unnecessary brackets around constants.
Not sure why these were ever there.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-01-26 10:34:56 +00:00
Lars-Peter Clausen a9fbbee8a2 staging:iio:adis16080: Move out of staging
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-26 10:30:23 +00:00
Lars-Peter Clausen 668cce2496 staging:iio:adis16080: Add scale and offset attributes
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-26 10:30:05 +00:00
Lars-Peter Clausen 61992d993b staging:iio:adis16080: Remove unnecessary lock
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-26 10:29:59 +00:00
Lars-Peter Clausen 3c80372dae staging:iio:adis16080: be16 cleanups
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-26 10:28:28 +00:00
Lars-Peter Clausen 9ab82f0711 staging:iio:adis16080: Cleanup SPI transfer
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-26 10:22:04 +00:00
Lars-Peter Clausen c21ab70051 staging:iio:adis16080: Add device id table entry for the adis16100
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-26 10:14:07 +00:00
Marek Vasut 1f45188c40 ARM: mxs: Add OF props for MX23 LRADC
Add interrupt mapping and compatible string for MX23 LRADC.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:54 +00:00
Marek Vasut 5e1f9aca0a iio: mxs: Add MX23 support into the IIO driver
This patch adds support for i.MX23 into the LRADC driver. The LRADC
block on MX23 is not much different from the one on MX28, thus this
is only a few changes fixing the parts that are specific to MX23.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:53 +00:00
Peter Huewe 232827fb81 staging/iio: Use correct argument for sizeof
found with coccicheck
sizeof when applied to a pointer typed expression gives the size of
the pointer

The semantic patch that makes this output is available
in scripts/coccinelle/misc/noderef.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:53 +00:00
Jonathan Cameron 81ca486fe5 iio:accel:kxsd9 move out of staging
This is a very simple driver giving basic access to this part over an
spi bus.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:53 +00:00
Jonathan Cameron d526e513c7 staging:iio:accel:kxsd9
Remove an unneeded initialization and trivial reorder to ensure
the device is ready when the device is registered.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:53 +00:00
Axel Lin b775dce996 rtc: hid-sensor-time: Add missing spin_lock_init
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:52 +00:00
Jonathan Cameron df2e8f78e7 staging:iio: drop sw_ring buffer implementation.
Whilst this is IIO's oldest buffer implementation it is messy, poorly
implemented and whilst it works, no one is entirely sure it always will.

New IIO drivers have not been using this for some time and now all remaining
old users have been converted to use the kfifo based alternative.

Clearly a fifo isn't the same as a ring buffer but in many use cases it
really doesn't matter.  We also loose the watershed based poll implementation.
However having poll effectively report data only when the buffer was half
full was at best an 'unusual' use of the interface.

At somepoint in the future we may bring watersheds back on a different
buffer implementation, but then we will think a lot more about how to do
the interface first.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:52 +00:00
Jonathan Cameron 94f3c7cd82 staging:iio:meter:ade7758 switch from sw_ring to kfifo
sw ring is going away so switch over to kfifo based buffer implementation.
The only real change is that poll will return on some data there rather than
buffer 50% full.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:52 +00:00
Jonathan Cameron 032658a446 staging:iio:impedance-analyzer switch from sw_ring to kfifo.
sw_ring buffer implementation is going away so switch to the
kfifo based alternative.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:52 +00:00
Jonathan Cameron a819a0df8a staging:iio:accel:lis3l02dq remove sw_ring support.
The sw_ring buffer is being removed in favour of the kfifo version.
This is one of only a couple of driver still supporting its use.

This driver will hopefully also be removed in favour of supporting the
part in the unified ST accelerometer driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:51 +00:00
Lars-Peter Clausen 76ada52f7f iio:adis16400: Add support for the adis16448
The adis16448 is more or less from the same family of devices as supported by
this driver. It features three acceleration channels, three angular velocity
channels, three magnetometer channels, one temperature channels and one
barometric pressure channel.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:51 +00:00
Lars-Peter Clausen 1db18bb4c2 iio:adis16400: Expose some debug information in debugfs
Expose some information useful for debugging a device in debugfs. This includes
for now the flash count, the product id and the serial number and raw register
access.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:51 +00:00
Lars-Peter Clausen 7ba8a04dcd iio:adis16400: Add support for the 52.85 Hz base sampling rate
The adis16400 and similar have two different base sampling rate available, from
which the actual sampling rate is derived. 1638 Hz and 52.85 Hz, switching to
the lower base sampling rate allows to support lower sampling rates.

This patch adds support for switching to the lower base sampling rate if the
requested sampling frequency is outside of the range which can be supported by
the higher base sampling rate.

The function which is used to read the current sampling rate already has support
for the lower sampling rate, so no changes are required there.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:50 +00:00
Lars-Peter Clausen b24150e31a iio:adis16400: Increase samplerate precession
The devices supported by this drivers support sample rates with less than one
sample per second. To support this increase the samplerate precession to allow
setting (and reading) the samplerate with a milli-HZ precession.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:50 +00:00
Lars-Peter Clausen d6b09bd85d staging:iio: Move adis16400 out of staging
This adis16400 driver is in pretty good shape now, so move it out of staging.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:50 +00:00
Lars-Peter Clausen f4c6d64bcf staging:iio:adis16400: Code style cleanup
Do a set of minor miscellaneous code style cleanups for the adis16400 before
moving it out of staging. Delete outdated comments, removed excess whitespace,
add missing whitespace, replace u{8,16} with uint{8,16}_t.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:49 +00:00
Lars-Peter Clausen 6634ccae6f staging:iio:adis16400: Remove samplerate_available attribute
While the samplerate supported by the devices which are supported by this driver
is not continuous it supports a wide range, much more than currently listed in
the samplerate_available attribute. Also it accepts all values written to the
samplerate attribute and will round-up them to the nearest supported sample
rate. So remove the samplerate_available attribute.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:49 +00:00
Lars-Peter Clausen 5eaf4ad9d7 staging:iio:adis16400: Remove unit suffix from samplerate attribute
To be compliant to the IIO specification we should not include the "SPS" suffix
in the "samplerate" attribute contents.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:48 +00:00
Lars-Peter Clausen 5eda3550a3 staging:iio:adis16400: Preallocate transfer message
Similar to like we already did for the generic adis library preallocate and
pre-construct the SPI transfer message for the adis16400. For devices which do
not support burst mode sampling does not differ from other adis devices and so
we use the generic functions of the adis library in this case. In burst mode we
can only sample all channels at once, so use the IIO cores demux facility
instead of doing this manually.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:48 +00:00
Lars-Peter Clausen 599acfbb97 staging:iio:adis16400: Add helper macros for channel declaration
Most of the channels declared in the adis16400 driver look quite similar. This
patch adds a bunch of helper macros to initialize the channel spec for this
driver. This allows us to drastically reduce the number of lines of code needed
for the channel spec declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-26 10:07:48 +00:00