openwrt/staging/blogic.git
11 years agostaging: comedi: ni_labpc_cs: remove labpc_release()
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:39 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: remove labpc_release()

The 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>
11 years agostaging: comedi: ni_labpc_cs: cleanup pcmcia_driver
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:22 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_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>
11 years agostaging: comedi: ni_labpc_cs: move MODULE_* info to end of file
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:06 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_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>
11 years agostaging: comedi: ni_mio_cs: cleanup the boardinfo declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:55 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: cleanup the boardinfo declaration

For aesthetic reasons, reformat the boardinfo declaration and
add some whitespace. Remove all the information that is set to
'0' as this is the default.

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>
11 years agostaging: comedi: ni_mio_cs: cleanup mio_cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:37 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: cleanup mio_cs_attach()

Remove the DPRINTK() function trace message as well as the #if 0'ed
out debug code that dumps the board "fingerprint".

Remove the need for the local variable that holds the link->irq
passed to request_irq(). Also, return the error code from that
function instead of assuming -EINVAL. Use the dev->board_name for
the resource string passed to request_irq() instead of the open
coded string "ni_mio_cs".

For aesthetic reasons, add some whitespace to the initializatio
of the devpriv values.

Just return the result of ni_E_init() instead of checking it for
an error, returning the error, or returning "0".

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>
11 years agostaging: comedi: ni_mio_cs: remove last forward declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:19 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: remove last forward declaration

Move the ni_getboardtype() function to remove the last forward
declaration in this 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>
11 years agostaging: comedi: ni_mio_cs: move mio_cs_detach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:35:02 +0000 (17:35 -0700)]
staging: comedi: ni_mio_cs: move mio_cs_detach()

For aesthetic reasons, move this function down so it's by the
comedi_driver declaration.

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>
11 years agostaging: comedi: ni_mio_cs: move comedi_driver declaration
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:45 +0000 (17:34 -0700)]
staging: comedi: ni_mio_cs: move comedi_driver declaration

Move the comedi_driver declaration down in the file. This gets
rid of the need for a couple forward declarations.

For aesthetic reasons, add some whitespace to the declaration.

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>
11 years agostaging: comedi: ni_mio_cs: cleanup cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:27 +0000 (17:34 -0700)]
staging: comedi: ni_mio_cs: cleanup cs_attach()

Absorb the code from mio_cs_config() into this function and
properly return the error if the configuration fails.

Remove the DPRINTK() function trace message.

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>
11 years agostaging: comedi: ni_mio_cs: remove cs_release()
H Hartley Sweeten [Sat, 26 Jan 2013 00:34:10 +0000 (17:34 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: move pcmcia_driver functions
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:54 +0000 (17:33 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: remove pcmcia_driver suspend/resume
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:37 +0000 (17:33 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: remove setting dev->driver
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:17 +0000 (17:33 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: cleanup pcmcia_driver
H Hartley Sweeten [Sat, 26 Jan 2013 00:33:00 +0000 (17:33 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: move MODULE_* info to end of file
H Hartley Sweeten [Sat, 26 Jan 2013 00:32:42 +0000 (17:32 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: cleanup subdevice init
H Hartley Sweeten [Fri, 25 Jan 2013 22:02:28 +0000 (15:02 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: fix possible memory dereference issue
H Hartley Sweeten [Fri, 25 Jan 2013 22:02:06 +0000 (15:02 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: cleanup the comedi_lrange tables
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:46 +0000 (15:01 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: remove #define pr_fmt
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:25 +0000 (15:01 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: remove debug functions
H Hartley Sweeten [Fri, 25 Jan 2013 22:01:06 +0000 (15:01 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()
H Hartley Sweeten [Fri, 25 Jan 2013 22:00:48 +0000 (15:00 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: remove casts of void *
H Hartley Sweeten [Fri, 25 Jan 2013 22:00:22 +0000 (15:00 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: cleanup daqp_cs_attach()
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:56 +0000 (14:59 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: remove daqp_cs_release()
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:36 +0000 (14:59 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: remove forward declarations
H Hartley Sweeten [Fri, 25 Jan 2013 21:59:17 +0000 (14:59 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: cleanup pcmcia_driver
H Hartley Sweeten [Fri, 25 Jan 2013 21:58:58 +0000 (14:58 -0700)]
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>
11 years agostaging: comedi: quatech_daqp_cs: move MODULE_* info to end of file
H Hartley Sweeten [Fri, 25 Jan 2013 21:58:36 +0000 (14:58 -0700)]
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>
11 years agoMerge tag 'iio-for-3.9b-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Tue, 29 Jan 2013 15:38:23 +0000 (07:38 -0800)]
Merge tag 'iio-for-3.9b-v2' of git://git./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!

11 years agoiio:light:tsl2563 move out of staging
Jonathan Cameron [Sat, 12 Jan 2013 10:35:00 +0000 (10:35 +0000)]
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>
11 years agostaging:iio:tsl2563 drop pointless forward declaration
Jonathan Cameron [Sat, 12 Jan 2013 10:35:00 +0000 (10:35 +0000)]
staging:iio:tsl2563 drop pointless forward declaration

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Peter Meerwald <pmeerw@pmeerw.net>
11 years agostaging:iio:tsl2563 Simplify exit path on error in read_interrupt_config.
Jonathan Cameron [Sat, 12 Jan 2013 10:35:00 +0000 (10:35 +0000)]
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>
11 years agostaging:iio:light:tsl2563 clean comments up.
Jonathan Cameron [Sat, 12 Jan 2013 10:35:00 +0000 (10:35 +0000)]
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>
11 years agostaging:iio:light:tsl2563 drop unnecessary brackets around constants.
Jonathan Cameron [Sat, 12 Jan 2013 10:35:00 +0000 (10:35 +0000)]
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>
11 years agostaging:iio:adis16080: Move out of staging
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agostaging:iio:adis16080: Add scale and offset attributes
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agostaging:iio:adis16080: Remove unnecessary lock
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agostaging:iio:adis16080: be16 cleanups
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agostaging:iio:adis16080: Cleanup SPI transfer
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agostaging:iio:adis16080: Add device id table entry for the adis16100
Lars-Peter Clausen [Wed, 9 Jan 2013 14:01:00 +0000 (14:01 +0000)]
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>
11 years agoARM: mxs: Add OF props for MX23 LRADC
Marek Vasut [Mon, 21 Jan 2013 20:05:00 +0000 (20:05 +0000)]
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>
11 years agoiio: mxs: Add MX23 support into the IIO driver
Marek Vasut [Mon, 21 Jan 2013 20:05:00 +0000 (20:05 +0000)]
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>
11 years agostaging/iio: Use correct argument for sizeof
Peter Huewe [Mon, 21 Jan 2013 21:14:00 +0000 (21:14 +0000)]
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>
11 years agoiio:accel:kxsd9 move out of staging
Jonathan Cameron [Sun, 6 Jan 2013 15:10:00 +0000 (15:10 +0000)]
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>
11 years agostaging:iio:accel:kxsd9
Jonathan Cameron [Sun, 6 Jan 2013 15:10:00 +0000 (15:10 +0000)]
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>
11 years agortc: hid-sensor-time: Add missing spin_lock_init
Axel Lin [Thu, 17 Jan 2013 01:49:00 +0000 (01:49 +0000)]
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>
11 years agostaging:iio: drop sw_ring buffer implementation.
Jonathan Cameron [Fri, 30 Nov 2012 14:22:00 +0000 (14:22 +0000)]
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>
11 years agostaging:iio:meter:ade7758 switch from sw_ring to kfifo
Jonathan Cameron [Fri, 30 Nov 2012 14:22:00 +0000 (14:22 +0000)]
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>
11 years agostaging:iio:impedance-analyzer switch from sw_ring to kfifo.
Jonathan Cameron [Fri, 30 Nov 2012 14:22:00 +0000 (14:22 +0000)]
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>
11 years agostaging:iio:accel:lis3l02dq remove sw_ring support.
Jonathan Cameron [Fri, 30 Nov 2012 14:22:00 +0000 (14:22 +0000)]
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>
11 years agoiio:adis16400: Add support for the adis16448
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agoiio:adis16400: Expose some debug information in debugfs
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agoiio:adis16400: Add support for the 52.85 Hz base sampling rate
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agoiio:adis16400: Increase samplerate precession
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio: Move adis16400 out of staging
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Code style cleanup
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Remove samplerate_available attribute
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Remove unit suffix from samplerate attribute
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Preallocate transfer message
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Add helper macros for channel declaration
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
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>
11 years agostaging:iio:adis16400: Use triggered buffer setup helper function
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
staging:iio:adis16400: Use triggered buffer setup helper function

Use the triggered buffer helper functions to setup and tear down the buffer for
the adis16400 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>
11 years agostaging:iio:adis16400: Use adis library
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
staging:iio:adis16400: Use adis library

Use the new adis library for the adis16400 driver. This allows us to completely
scrap the adis16400 trigger code and more than half of the core driver code. For
now we can not make use of the generic adis buffer implementation since the
adis16400 driver has special requirements due to its burst mode support. But
we will eventually get to this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adis16400: Remove unused default_scan_mask
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
staging:iio:adis16400: Remove unused default_scan_mask

The chip_info struct for contains a defaul_scan_mask field. But it is never
actually used in the code, so remove it from the chip_info struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adis16400: Fix and cleanup 3db filter setting
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
staging:iio:adis16400: Fix and cleanup 3db filter setting

The 3db divisors table is partially wrong and incomplete. Also the code rounds
up to the next higher frequency if the requested frequency would matches one of
the available frequencies. These two issues are fixed by this patch. The patch
also changes the driver to round down the filter frequency if it is larger than
the largest supported frequency instead of rejecting it as an invalid value.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:adis16400: Don't pass 0 to ilog2
Lars-Peter Clausen [Wed, 16 Jan 2013 12:48:00 +0000 (12:48 +0000)]
staging:iio:adis16400: Don't pass 0 to ilog2

ilog2 is not defined for 0, so we need to handle the case where the requested
frequency is larger than the base sampling rate. In this case we'll round down
and set the sampling rate to the base sampling rate.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:tsl2x7x: Use iio_str_to_fixedpoint instead of open-coding it
Lars-Peter Clausen [Thu, 10 Jan 2013 16:18:00 +0000 (16:18 +0000)]
staging:iio:tsl2x7x: Use iio_str_to_fixedpoint instead of open-coding it

The tsl2x7x driver has a copy'n'pasted version of the iio_str_to_fixedpoint()
function from the IIO core. Replace this custom copy and use
iio_str_to_fixedpoint instead.

The patch also introduces a slight functional change in that it makes sure that
in case of a parsing error the error is reported back to userspace instead of
silently ignoring it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jon Brenner <jon.brenner@ams.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: mxs: Implement support for touchscreen
Marek Vasut [Fri, 11 Jan 2013 23:35:00 +0000 (23:35 +0000)]
iio: mxs: Implement support for touchscreen

This patch implements support for sampling of a touchscreen into
the MXS LRADC driver. The LRADC block allows configuring some of
it's channels into special mode where they either output the drive
voltage or sample it, allowing it to operate a 4-wire or 5-wire
resistive touchscreen.

In case the touchscreen mode is enabled, the LRADC slot #7 is
reserved for touchscreen only, therefore it is not possible to
sample 8 LRADC channels at time, but only 7 channels.

The touchscreen controller is configured such that the PENDOWN event
disables touchscreen interrupts and triggers execution of worker
thread, which then polls the touchscreen controller for X, Y and
Pressure values. This reduces the overhead of interrupt-driven
operation. Upon the PENUP event, the worker thread re-enables the
PENDOWN detection interrupt and exits.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging:iio:gyro: Remove stale Makefile entry
Lars-Peter Clausen [Fri, 11 Jan 2013 10:49:00 +0000 (10:49 +0000)]
staging:iio:gyro: Remove stale Makefile entry

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>
11 years agoiio: fix Kconfig for max1363
Peter Meerwald [Thu, 10 Jan 2013 17:29:00 +0000 (17:29 +0000)]
iio: fix Kconfig for max1363

ERROR: "iio_triggered_buffer_setup" [drivers/iio/adc/max1363.ko] undefined!
ERROR: "iio_triggered_buffer_cleanup" [drivers/iio/adc/max1363.ko] undefined!

add select IIO_TRIGGERED_BUFFER

IIO_TRIGGERED_BUFFER in turn selects IIO_TRIGGER and IIO_KFIFO_BUF, so drop those
MAX1363_RING_BUFFER is not used anymore

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoMerge 3.8-rc5 into staging-next
Greg Kroah-Hartman [Sat, 26 Jan 2013 05:25:02 +0000 (21:25 -0800)]
Merge 3.8-rc5 into staging-next

This resolves a merge issue with a iio driver, and the zram code.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: addi_watchdog: all i/o registers are 32-bit
H Hartley Sweeten [Thu, 24 Jan 2013 00:02:31 +0000 (17:02 -0700)]
staging: comedi: addi_watchdog: all i/o registers are 32-bit

All the i/o registers used by the watchdog device on the addi-data
boards are 32-bit. Make sure all the i/o commands use outl/inl to
access the registers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: addi_apci_1516: use addi_watchdog module
H Hartley Sweeten [Wed, 23 Jan 2013 23:51:01 +0000 (16:51 -0700)]
staging: comedi: addi_apci_1516: use addi_watchdog module

Use the addi_watchdog module to provide support for the watchdog
subdevice.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove
Peter Huewe [Tue, 22 Jan 2013 22:40:03 +0000 (23:40 +0100)]
staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove

(Almost) all comedi pci drivers have some wrapper for their
pci_driver.remove function which simply calls comedi_pci_auto_unconfig
which has the same function prototype as the wrapper.

-> we can remove these wrappers and call comedi_pci_auto_unconfig
directly. This removes a lot some boilerplate code and saves some bytes.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/comedi: Move comedi_pci_auto_unconfig to drivers.c
Peter Huewe [Tue, 22 Jan 2013 23:03:30 +0000 (00:03 +0100)]
staging/comedi: Move comedi_pci_auto_unconfig to drivers.c

Since comedi_pci_auto_unconfig cannot be inlined anymore after
 staging/comedi: Use comedi_pci_auto_unconfig directly for
 pci_driver.remove
is applied, it makes sense to move it drivers.c

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: addi_apci_3501: cleanup comments in hwdrv_apci3501.c
H Hartley Sweeten [Wed, 23 Jan 2013 19:46:45 +0000 (12:46 -0700)]
staging: comedi: addi_apci_3501: cleanup comments in hwdrv_apci3501.c

The watchdog/timer subdevice in this driver is basically broke. The
subdevice functions abuse the comedi API and the (*insn_config)
simply doesn't work due to it's treating data[0] as a parameter and
not as the config "instruction".

For now, cleanup the comments for the functions so they are at least
readable. Then we can figure out how to fix the subdevice.

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>
11 years agostaging: comedi: addi_apci_3501: define the timer i/o registers
H Hartley Sweeten [Wed, 23 Jan 2013 19:46:22 +0000 (12:46 -0700)]
staging: comedi: addi_apci_3501: define the timer i/o registers

Create, and use, defines for the i/o registers used with the timer
subdevice.

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>
11 years agostaging: comedi: addi_apci_3501: change the MODULE_DESCRIPTION
H Hartley Sweeten [Wed, 23 Jan 2013 19:46:01 +0000 (12:46 -0700)]
staging: comedi: addi_apci_3501: change the MODULE_DESCRIPTION

Change the MODULE_DESCRIPTION to something more useful than the
generic "Comedi low-level driver" so that modinfo provides a
better description of the driver.

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>
11 years agostaging: comedi: addi_apci_3501: move the copyright information
H Hartley Sweeten [Wed, 23 Jan 2013 19:45:42 +0000 (12:45 -0700)]
staging: comedi: addi_apci_3501: move the copyright information

Move the copyright information from hwrdv_apci3501.c to the main
driver file. Reformat it to fix the > 80 char lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: addi_apci_3501: rewrite the analog output support
H Hartley Sweeten [Wed, 23 Jan 2013 19:45:21 +0000 (12:45 -0700)]
staging: comedi: addi_apci_3501: rewrite the analog output support

Currently the analog output subdevice has two support functions:
  (*insn_config) - i_APCI3501_ConfigAnalogOutput()
  (*insn_write)  - i_APCI3501_WriteAnalogOutput()

The (*insn_config) function is used to configure the analog outputs
in either bipolar or unipolar mode. This function abuses the comedi
API since it treats the data[0] value as a parameter instead of as
the config "instruction".

The (*insn_write) function then writes a single value to the desired
analog output channel after doing some sanity checking on the channel
number. The sanity checking is not required since the comedi core has
already done it. Also, the (*insn_write) functions are supposed to
write all the data, indicated by insn->n, to the channel not just a
single value.

Rewrite the support code so it works properly with the comedi API.

The bipolar/unipolar configuration can be determine in the (*insn_write)
by checking the passed insn->chanspec.

Since the unipolar configuration only has 13-bit resolution, we need
to check that the data is in range because the subdevice 'maxdata' is
set to 14-bits for the bipolar mode. If the data is out of range,
output a dev_warn() and return -EINVAL.

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>
11 years agostaging: comedi: addi_apci_3501: cleanup apci3501_reset()
H Hartley Sweeten [Wed, 23 Jan 2013 19:45:01 +0000 (12:45 -0700)]
staging: comedi: addi_apci_3501: cleanup apci3501_reset()

Rename the CamelCase local variables.

Refactor the code a bit to remove the need for some of the local
variables.

Add a couple defines to the register map to help make the code
more concise.

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>
11 years agostaging: comedi: addi_apci_3501: introduce apci3501_wait_for_dac()
H Hartley Sweeten [Wed, 23 Jan 2013 19:44:40 +0000 (12:44 -0700)]
staging: comedi: addi_apci_3501: introduce apci3501_wait_for_dac()

Refactor the code that waits for the DAC to be ready into a helper
function.

A timeout of some sort should be added to this helper so code the
users to expect the error condition. In i_APCI3501_WriteAnalogOutput()
just return the error and don't actually write the new value to the
DAC. In apci3501_reset() output a dev_warn() that the DAC was not
ready.

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>
11 years agostaging: comedi: addi_apci_3501: move range_apci3501_ao to driver
H Hartley Sweeten [Wed, 23 Jan 2013 19:44:17 +0000 (12:44 -0700)]
staging: comedi: addi_apci_3501: move range_apci3501_ao to driver

Move the analog output range definition from hwdrv_apci3501.c into
the main driver file.

For aesthetic reasons, rename the range table so it has namespace
associated with the driver.

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>
11 years agostaging: comedi: addi_apci_3501: reorder code a bit
H Hartley Sweeten [Wed, 23 Jan 2013 19:43:55 +0000 (12:43 -0700)]
staging: comedi: addi_apci_3501: reorder code a bit

Move the private struct definition and the #include of the
low-level support code to prepare for merging the code in
hwdrv_apci3501.c into the driver.

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>
11 years agostaging: comedi: addi_apci_3501: start defining i/o map
H Hartley Sweeten [Wed, 23 Jan 2013 19:43:35 +0000 (12:43 -0700)]
staging: comedi: addi_apci_3501: start defining i/o map

Create, and use, defines for the analog output and digital i/o
registers.

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>
11 years agostaging: comedi: addi_apci_3501: remove dependency on addi_common.h
H Hartley Sweeten [Wed, 23 Jan 2013 19:43:14 +0000 (12:43 -0700)]
staging: comedi: addi_apci_3501: remove dependency on addi_common.h

Create a struct to hold the private data still used by this driver.
This removes the last dependencies on the addi-data "common" code
so we can also remove the #include of addi_common.h.

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>
11 years agostaging: comedi: addi_apci_3501: only allocate needed subdevices
H Hartley Sweeten [Wed, 23 Jan 2013 19:42:39 +0000 (12:42 -0700)]
staging: comedi: addi_apci_3501: only allocate needed subdevices

The addi-data "common" code always allocated 7 subdevices. This
driver only uses 5. Change the allocation and remove the unused
subdevices.

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>
11 years agostaging: comedi: addi_apci_3501: remove boardinfo
H Hartley Sweeten [Wed, 23 Jan 2013 19:42:20 +0000 (12:42 -0700)]
staging: comedi: addi_apci_3501: remove boardinfo

With the eeprom support code now local to this driver, we can
remove the boardinfo since it's 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>
11 years agostaging: comedi: addi_apci_3501: simplify reading the eeprom
H Hartley Sweeten [Wed, 23 Jan 2013 19:42:02 +0000 (12:42 -0700)]
staging: comedi: addi_apci_3501: simplify reading the eeprom

The only value in the eeprom that is used by this driver is the
number of analog output channels.

Copy the necessary code from addi_eeprom.c to this driver and
refactor it so that we can get the value 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>
11 years agostaging: comedi: addi_apci_3501: board has an eeprom
H Hartley Sweeten [Wed, 23 Jan 2013 19:41:36 +0000 (12:41 -0700)]
staging: comedi: addi_apci_3501: board has an eeprom

The board supported by this driver has an on-board eeprom. Since
we need to read it to get the number of analog output channels,
expose the eeprom as a readable subdevice to the user.

Rename the i_ADDIDATA_InsnReadEeprom() function to give it namespace
associated with the driver.

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>
11 years agostaging: comedi: addi_apci_3501: remove analog output boardinfo
H Hartley Sweeten [Wed, 23 Jan 2013 19:41:16 +0000 (12:41 -0700)]
staging: comedi: addi_apci_3501: remove analog output boardinfo

There is not need to pass the analog output subdevice information
in the boardinfo. Just initialize the subdevice directly.

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>
11 years agostaging: comedi: addi_apci_3501: analog output resolution is fixed
H Hartley Sweeten [Wed, 23 Jan 2013 19:40:50 +0000 (12:40 -0700)]
staging: comedi: addi_apci_3501: analog output resolution is fixed

The analog outputs of this board are always 14-bit. Remove this
information from the boardinfo and just set the 'maxdata' directly
in the subdevice init. Initialize with a hex value as that is more
standard in the comedi drivers.

Since devpriv->s_EeParameters.i_AoMaxdata is not longer being used,
don't bother initializing it.

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>
11 years agostaging: comedi: addi_apci_3501: don't read the unused PCI bars
H Hartley Sweeten [Wed, 23 Jan 2013 19:40:28 +0000 (12:40 -0700)]
staging: comedi: addi_apci_3501: don't read the unused PCI bars

This driver only uses PCI bar 0 and 1, don't bother reading the
unused PCI bars.

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>
11 years agostaging: comedi: addi_apci_3501: board does not support dma
H Hartley Sweeten [Wed, 23 Jan 2013 19:40:07 +0000 (12:40 -0700)]
staging: comedi: addi_apci_3501: board does not support dma

The board supported by this driver does not use dma. Remove the
unnecessary initialization of devpriv->s_EeParameters.i_Dma.

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>
11 years agostaging: comedi: addi_apci_3501: remove devpriv->iobase usage
H Hartley Sweeten [Wed, 23 Jan 2013 19:39:47 +0000 (12:39 -0700)]
staging: comedi: addi_apci_3501: remove devpriv->iobase usage

The iobase address stored in devpriv->iobase is also stored in
dev->iobase. Use that instead.

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>
11 years agostaging: comedi: addi_apci_3501: simplify the PCI bar reading
H Hartley Sweeten [Wed, 23 Jan 2013 19:39:27 +0000 (12:39 -0700)]
staging: comedi: addi_apci_3501: simplify the PCI bar reading

The board supported by this driver has an eeprom connected to an
AMCC S5933 PCI controller chip. Knowing this, we can simplify the
code that reads the PCI bars to get the iobase addresses used in
the driver.

Also, since the dw_AiBase is not ioremap'ed, we can remove the
iounmap in the detach.

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>
11 years agostaging: comedi: addi_apci_3501: simplify eeprom read
H Hartley Sweeten [Wed, 23 Jan 2013 19:39:06 +0000 (12:39 -0700)]
staging: comedi: addi_apci_3501: simplify eeprom read

This driver needs to read the on-board eeprom to determine the
number of analog output channels (4 or 8) on the board. But,
sinde we know the board has an eeprom and the PCI controller
chip is an AMCC S5933, we can simplify the code and remove the
code that sets the extra wait state neede for the AMCC S5920.

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>
11 years agostaging: comedi: addi_apci_3501: absorb v_APCI3501_Interrupt()
H Hartley Sweeten [Wed, 23 Jan 2013 19:38:44 +0000 (12:38 -0700)]
staging: comedi: addi_apci_3501: absorb v_APCI3501_Interrupt()

This driver only has one 'interrupt' function. Absorb the
v_APCI3501_Interrupt() function from hwdrv_apci3501.c into
the driver.

Rename v_ADDI_Interrupt() to apci3501_interrupt() so that the
function has namespace associated with the driver.

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>
11 years agostaging: comedi: addi_apci_3501: absorb i_APCI3501_Reset()
H Hartley Sweeten [Wed, 23 Jan 2013 19:38:21 +0000 (12:38 -0700)]
staging: comedi: addi_apci_3501: absorb i_APCI3501_Reset()

This driver only has one 'reset' function. Absorb the i_APCI3501_Reset()
function from hwdrv_apci3501.c into the driver.

Rename i_ADDI_Reset() to apci3501_reset() so that the function has
namespace associated with the driver.

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>
11 years agostaging: comedi: addi_apci_3501: board does not have analog inputs
H Hartley Sweeten [Wed, 23 Jan 2013 19:37:59 +0000 (12:37 -0700)]
staging: comedi: addi_apci_3501: board does not have analog inputs

The board supported by this driver does not have analog inputs. Remove
the subdevice init for it.

Since the devpriv->s_EeParameters for the analog input subdevice are
not used, remove the initialization of them also.

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>
11 years agostaging: comedi: addi_apci_3501: cleanup the digital input subdevice
H Hartley Sweeten [Wed, 23 Jan 2013 19:37:38 +0000 (12:37 -0700)]
staging: comedi: addi_apci_3501: cleanup the digital input subdevice

The board supported by this driver has 2 digital input. Remove the
conditional and always init the subdevice.

Also, move the subdevice insn_bits function pointer as well as the
n_chan out of the boardinfo and use them to initialize the subdevice
directly.

Since devpriv->s_EeParameters.i_NbrDiChannel for the digital input
subdevice is no longer being used, remove initialization of it also.

Copy the apci3501_di_insn_bits() function from hwrdv_apci3501.c into
the main driver file.

Fix the subdev_flags for the subdevice. The only required flag is
SDF_READABLE. The SDF_GROUND and SDF_COMMON flags only have meaning
for analog subdevices.

Remove the len_chanlist initialization, it only has meaning for subdevices
that support commands.

Remove the io_bits initialization, it only has meaning for digital i/o
subdevices that have configurable outputs.

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>
11 years agostaging: comedi: addi_apci_3501: cleanup the digital output subdevice
H Hartley Sweeten [Wed, 23 Jan 2013 19:37:16 +0000 (12:37 -0700)]
staging: comedi: addi_apci_3501: cleanup the digital output subdevice

The board supported by this driver has 2 digital outputs. Remove the
conditional and always init the subdevice.

Also, move the subdevice insn_bits function pointer as well as the
n_chan out of the boardinfo and use them to initialize the subdevice
directly.

Since devpriv->s_EeParameters for the digital output subdevice are no
longer being used, remove initialization of them also.

Copy the apci3501_do_insn_bits() function from hwrdv_apci3501.c into
the main driver file.

Fix the subdev_flags for the subdevice. The only required flag is
SDF_WRITEABLE. The SDF_GROUND and SDF_COMMON flags only have meaning
for analog subdevices and the SDF_READABLE flag is not required.

Fix the maxdata for the subdevice. Digital outputs can only be 1 or 0.

Remove the len_chanlist initialization, it only has meaning for subdevices
that support commands.

Remove the io_bits initialization, it only has meaning for digital i/o
subdevices that have configurable outputs.

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>