openwrt/staging/blogic.git
11 years agostaging: comedi: disallow COMEDI_DEVCONFIG on non-board minors
Ian Abbott [Mon, 28 Jan 2013 16:14:31 +0000 (16:14 +0000)]
staging: comedi: disallow COMEDI_DEVCONFIG on non-board minors

Comedi has two sorts of minor devices:
(a) normal board minor devices in the range 0 to
COMEDI_NUM_BOARD_MINORS-1 inclusive; and
(b) special subdevice minor devices in the range COMEDI_NUM_BOARD_MINORS
upwards that are used to open the same underlying comedi device as the
normal board minor devices, but with non-default read and write
subdevices for asynchronous commands.

The special subdevice minor devices get created when a board supporting
asynchronous commands is attached to a normal board minor device, and
destroyed when the board is detached from the normal board minor device.
One way to attach or detach a board is by using the COMEDI_DEVCONFIG
ioctl.  This should only be used on normal board minors as the special
subdevice minors are too ephemeral.  In particular, the change
introduced in commit 7d3135af399e92cf4c9bbc5f86b6c140aab3b88c ("staging:
comedi: prevent auto-unconfig of manually configured devices") breaks
horribly for special subdevice minor devices.

Since there's no legitimate use for the COMEDI_DEVCONFIG ioctl on a
special subdevice minor device node, disallow it and return -ENOTTY.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fix endian issue in unit directory
Peter Hurley [Tue, 29 Jan 2013 14:10:30 +0000 (09:10 -0500)]
staging/fwserial: Fix endian issue in unit directory

Reported-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: add diagnostic for buffer overflow
Peter Hurley [Tue, 29 Jan 2013 03:34:43 +0000 (22:34 -0500)]
staging/fwserial: add diagnostic for buffer overflow

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Remove reference to removed constant
Peter Hurley [Tue, 29 Jan 2013 03:34:42 +0000 (22:34 -0500)]
staging/fwserial: Remove reference to removed constant

FWSERIAL_TTY_START_MINOR was removed. The minor_start is allocated
by tty_alloc_driver().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Don't use deprecated alloc_tty_driver()
Peter Hurley [Tue, 29 Jan 2013 03:34:41 +0000 (22:34 -0500)]
staging/fwserial: Don't use deprecated alloc_tty_driver()

Use tty_alloc_driver() instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Factor unstable stats/debug/status info to debugfs
Peter Hurley [Tue, 29 Jan 2013 03:34:40 +0000 (22:34 -0500)]
staging/fwserial: Factor unstable stats/debug/status info to debugfs

Add the following file hierarchy to debugfs:

  <debugfs>-+
            +- firewire_serial -+- <unit> -+- peers
                                |          +- stats
                                |
                                +- <unit> -+- peers
                                           +- stats

The 'peers' file (read-only) contains status and configuration
info for attached peers for the given fwserial unit.

The 'stats' file (read-only) contains statistics and data profiling
information for each tty port for the given fwserial unit.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Cleanup /proc/tty/driver/ file
Peter Hurley [Tue, 29 Jan 2013 03:34:39 +0000 (22:34 -0500)]
staging/fwserial: Cleanup /proc/tty/driver/ file

Factor out extra stats, data profiles, debugging info and peer info
from procfs file in preparation for using debugfs instead.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Create loop device the 'tty' way
Peter Hurley [Tue, 29 Jan 2013 03:34:38 +0000 (22:34 -0500)]
staging/fwserial: Create loop device the 'tty' way

Register a second tty driver to create loopback devices for
each firewire node. Note that the loopback devices are numbered
from 0; the tty->index is transformed when used to index the
port table.

Remove the hack that previously enabled this.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fix sparse build warnings
Peter Hurley [Tue, 29 Jan 2013 03:34:37 +0000 (22:34 -0500)]
staging/fwserial: Fix sparse build warnings

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Release port regardless of unplug response code
Peter Hurley [Tue, 29 Jan 2013 03:34:36 +0000 (22:34 -0500)]
staging/fwserial: Release port regardless of unplug response code

After sending the unplug response, release the port even if an
error occurred.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Only reset port status for attached peers
Peter Hurley [Tue, 29 Jan 2013 03:34:35 +0000 (22:34 -0500)]
staging/fwserial: Only reset port status for attached peers

When a port has been reserved in an attempt to connect to a peer
but that attempt does not succeed, releasing the port should not
reset the port line status. Although resetting is functionally
harmless, it can appear as if a remote peer dropped carrier to a
port it was not attached to (which can be confusing).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Drop suggestion for helper fn integration
Peter Hurley [Tue, 29 Jan 2013 01:57:49 +0000 (20:57 -0500)]
staging/fwserial: Drop suggestion for helper fn integration

The firewire core does not require or want the suggested helper fns;
drop suggestion from TODO file.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Assume firmware is OHCI-complaint
Peter Hurley [Tue, 29 Jan 2013 01:57:48 +0000 (20:57 -0500)]
staging/fwserial: Assume firmware is OHCI-complaint

Devices which are OHCI v1.0/ v1.1/ v1.2-draft compliant or
RFC 2734 compliant are required by specification to support
max_rec of 8 (512 bytes) or more. Accept reported value.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Fold constant MAX_ASYNC_PAYLOAD
Peter Hurley [Tue, 29 Jan 2013 01:57:47 +0000 (20:57 -0500)]
staging/fwserial: Fold constant MAX_ASYNC_PAYLOAD

Since peer->max_payload is now limited to 1394-2008 spec maximum
of 4096, the port->max_payload limit can now be simplified.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Simplify max payload calculation
Peter Hurley [Tue, 29 Jan 2013 01:57:46 +0000 (20:57 -0500)]
staging/fwserial: Simplify max payload calculation

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Refer to fw_device as "node"
Peter Hurley [Tue, 29 Jan 2013 01:57:45 +0000 (20:57 -0500)]
staging/fwserial: Refer to fw_device as "node"

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/fwserial: Remove bandwidth limit logic
Peter Hurley [Tue, 29 Jan 2013 01:57:44 +0000 (20:57 -0500)]
staging/fwserial: Remove bandwidth limit logic

Self-limiting asynchronous bandwidth (via reducing the payload)
is not necessary and does not work, because
 1) asynchronous traffic will absorb all available bandwidth (less that
    being used for isochronous traffic)
 2) isochronous arbitration always wins.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging:ozwpan: Fix following warning.
Rupesh Gujare [Tue, 29 Jan 2013 17:00:55 +0000 (17:00 +0000)]
staging:ozwpan: Fix following warning.

The patch ae926051d7eb: "staging: ozwpan: Added USB HCD
implementation" from Feb 20, 2012, leads to the following warning:
drivers/staging/ozwpan/ozhcd.c:1094 oz_hcd_heartbeat()
 warn: what is this condition about? 'ep->buffered_units * 50'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: cleanup the string mess
Marc Dietrich [Sun, 27 Jan 2013 16:43:43 +0000 (17:43 +0100)]
staging: nvec: cleanup the string mess

Replace the various command strings by named constants.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: fix mouse suspend/resume calls
Marc Dietrich [Sun, 27 Jan 2013 16:43:42 +0000 (17:43 +0100)]
staging: nvec: fix mouse suspend/resume calls

The EC command for enable/disable is not an EC command. Instead it needs
to be send to the mouse.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: move toggle global event reporting to its own function
Marc Dietrich [Sun, 27 Jan 2013 16:43:41 +0000 (17:43 +0100)]
staging: nvec: move toggle global event reporting to its own function

Cleanup toggle of global event reporting by moving it to its own function.
This simplifies the following cleanup.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: Fix TLB coherency and build problem
Minchan Kim [Mon, 28 Jan 2013 01:00:08 +0000 (10:00 +0900)]
staging: zsmalloc: Fix TLB coherency and build problem

Recently, Matt Sealey reported he fail to build zsmalloc caused by
using of local_flush_tlb_kernel_range which are architecture dependent
function so !CONFIG_SMP in ARM couldn't implement it so it ends up
build error following as.

  MODPOST 216 modules
  LZMA    arch/arm/boot/compressed/piggy.lzma
  AS      arch/arm/boot/compressed/lib1funcs.o
ERROR: "v7wbi_flush_kern_tlb_range"
[drivers/staging/zsmalloc/zsmalloc.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....

The reason we used that function is copy method by [1]
was really slow in ARM but at that time.

More severe problem is ARM can prefetch speculatively on other CPUs
so under us, other TLBs can have an entry only if we do flush local
CPU. Russell King pointed that. Thanks!
We don't have many choices except using flush_tlb_kernel_range.

My experiment in ARMv7 processor 4 core didn't make any difference with
zsmapbench[2] between local_flush_tlb_kernel_range and flush_tlb_kernel_range
but still page-table based is much better than copy-based.

* bigger is better.

1. local_flush_tlb_kernel_range: 3918795 mappings
2. flush_tlb_kernel_range : 3989538 mappings
3. copy-based: 635158 mappings

This patch replace local_flush_tlb_kernel_range with
flush_tlb_kernel_range which are avaialbe in all architectures
because we already have used it in vmalloc allocator which are
generic one so build problem should go away and performane loss
shoud be void.

[1] f553646, zsmalloc: add page table mapping method
[2] https://github.com/spartacus06/zsmapbench

Cc: stable@vger.kernel.org
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Reported-by: Matt Sealey <matt@genesi-usa.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/omapdrm: Use kmemdup rather than duplicating its implementation
Peter Huewe [Fri, 25 Jan 2013 23:40:13 +0000 (00:40 +0100)]
staging/omapdrm: Use kmemdup rather than duplicating its implementation

Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: zcache: remove unnecessary braces in zcache-main.c
Ryo Munakata [Sat, 26 Jan 2013 10:50:53 +0000 (19:50 +0900)]
Staging: zcache: remove unnecessary braces in zcache-main.c

This fixes a checkpatch.pl issue of
'braces {} are not necessary for single statement blocks'

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/csr: Use kmemdup rather than duplicating its implementation
Peter Huewe [Fri, 25 Jan 2013 23:19:19 +0000 (00:19 +0100)]
staging/csr: Use kmemdup rather than duplicating its implementation

Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE
Seth Jennings [Fri, 25 Jan 2013 17:46:18 +0000 (11:46 -0600)]
staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE

Right now ZS_SIZE_CLASS_DELTA is hardcoded to be 16.  This
creates 254 classes for systems with 4k pages. However, on
PPC64 with 64k pages, it creates 4095 classes which is far
too many.

This patch makes ZS_SIZE_CLASS_DELTA relative to PAGE_SIZE
so that regardless of the page size, there will be the same
number of classes.

Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/comedi/adl_pci8164: Don't assign string
Peter Huewe [Mon, 28 Jan 2013 23:36:39 +0000 (00:36 +0100)]
staging/comedi/adl_pci8164: Don't assign string

Assigning a string is really bad,
and since we only have 1 char strings here we
can simply use a char to store the value and change the format specifier.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: simplify comedi_set_hw_dev()
Ian Abbott [Tue, 29 Jan 2013 16:20:17 +0000 (16:20 +0000)]
staging: comedi: simplify comedi_set_hw_dev()

Since `get_device()` and `put_device()` can take a NULL device
parameter, `comedi_set_hw_dev()` can be simplified to always call
`get_device()` for the new, possibly NULL hardware device, and
`put_device()` for the old, possibly NULL hardware device.  As long as
we do it in that order, there shouldn't be any problem with
`kref_release()` getting called unexpectedly when the new hardware
device is the old hardware device.

Simplify `comedi_set_hw_dev()` and update the comment because the
function is used for additional purposes since the old comment was
written.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: don't override read/write subdevice if not supported
Ian Abbott [Tue, 29 Jan 2013 14:05:58 +0000 (14:05 +0000)]
staging: comedi: don't override read/write subdevice if not supported

For comedi devices that support asynchronous commands on some of their
subdevices, the comedi core creates extra device files for each of those
subdevices of the form "/dev/comedi%i_subd%i".  These use the same
comedi device as the corresponding "/dev/comedi%i" but override the
default "read" and "write" subdevice for the device.  Currently it
overrides both the read and write subdevice, but it only makes sense to
override the "read" subdevice if the subdevice supports "read" commands,
and to override the "write" subdevice if the subdevice supports "write"
commands.

In `comedi_alloc_subdevice_minor()`, only set `info->read_subdevice`
non-NULL if the subdevice has the `SDF_CMD_READ` flag set, and only set
`info->write_subdevice` non-NULL if the subdevice has the
`SDF_CMD_WRITE` flag set.  (`comedi_read_subdevice(info)` will use the
device's default read subdevice if `info->read_subdevice` is NULL.
`comedi_write_subdevice(info)` will use the device's default write
subdevice if `info->write_subdevice` is NULL.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_cs: remove '#undef LABPC_DEBUG'
H Hartley Sweeten [Sat, 26 Jan 2013 01:38:23 +0000 (18:38 -0700)]
staging: comedi: ni_labpc_cs: remove '#undef LABPC_DEBUG'

The LABPC_DEBUG define is not used in any of the code. Just
remove the #undef.

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 the boardinfo declaration
H Hartley Sweeten [Sat, 26 Jan 2013 01:38:04 +0000 (18:38 -0700)]
staging: comedi: ni_labpc_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_labpc_cs: remove thisboard macro
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:41 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: remove thisboard macro

The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable.

Replace the macro with a local variable and use the comedi_board()
helper to get the pointer.

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 comedi_driver declaration
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:27 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: move comedi_driver declaration

Move the comedi_driver declaration down in the file. This removes
the need for the forward declaration.

For aesthetic reasons, add some whitespace to the declaration and
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_labpc_cs: remove pcmcia_device private data
H Hartley Sweeten [Sat, 26 Jan 2013 01:37:06 +0000 (18:37 -0700)]
staging: comedi: ni_labpc_cs: remove pcmcia_device private data

The private data, struct local_info_t, is not being used in the
driver. Remove it as well as the kzalloc/kfree.

Also, don't set the 'pcmcia_cur_dev' variable unless the pcmcia
configuration is successful.

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 labpc_cs_attach()
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:50 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_cs: cleanup labpc_cs_attach()

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

Also, remove the dev_dbg() 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_labpc_cs: move pcmcia_driver functions
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:33 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_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 some of 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: ni_labpc_cs: remove pcmcia_driver suspend/resume
H Hartley Sweeten [Sat, 26 Jan 2013 01:36:16 +0000 (18:36 -0700)]
staging: comedi: ni_labpc_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_labpc_cs: remove 'stop' from private pcmcia data
H Hartley Sweeten [Sat, 26 Jan 2013 01:35:55 +0000 (18:35 -0700)]
staging: comedi: ni_labpc_cs: remove 'stop' from private pcmcia data

The pcmcia_driver suspend and remove functions set the 'stop' variable
and the resume function clears it. Nothing in the comedi_driver code
uses the 'stop' variable.

Just remove it so we can get rid of the suspend/resume.

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: 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>