GitHub/moto-9609/android_kernel_motorola_exynos9610.git
9 years agoiio: adc: ad7793: removed unnecessary else.
Nizam Haider [Mon, 9 Nov 2015 12:50:45 +0000 (18:20 +0530)]
iio: adc: ad7793: removed unnecessary else.

Else is not generally useful after a break or return.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: adc: mxs-lradc: Prefer using the BIT macro
Nizam Haider [Mon, 9 Nov 2015 14:26:02 +0000 (19:56 +0530)]
iio: adc: mxs-lradc: Prefer using the BIT macro

Replaces bit shifting on 1 with the BIT(x) macro

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: ti-ads8688: Add DT binding documentation
Sean Nyekjaer [Mon, 9 Nov 2015 12:53:00 +0000 (13:53 +0100)]
iio: ti-ads8688: Add DT binding documentation

Adding binding documentation for Texas Instruments ADS8688 ADC.

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Reviewed-by: Martin Hundebøll <martin.hundeboll@prevas.dk>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: adc: Add TI ADS8688
Sean Nyekjaer [Mon, 9 Nov 2015 12:52:59 +0000 (13:52 +0100)]
iio: adc: Add TI ADS8688

This patch adds support for the Texas Intruments ADS8688 ADC.

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Reviewed-by: Martin Hundebøll <martin.hundeboll@prevas.dk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: added support for IIO_VAL_INT
Sean Nyekjaer [Mon, 9 Nov 2015 12:55:34 +0000 (13:55 +0100)]
iio: core: added support for IIO_VAL_INT

Added core support for IIO_VAL_INT in write_raw_get_fmt function.

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: st-accel: add support for lis2dh12
Giuseppe Barba [Thu, 12 Nov 2015 07:36:49 +0000 (08:36 +0100)]
iio: st-accel: add support for lis2dh12

This commit add support for STMicroelectronics lis2dh12 accelerometer.
Datasheet for this device can be found here:

http://www.st.com/st-web-ui/static/active/en/resource/technical/
document/datasheet/DM00091513.pdf

Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: imu: check sscanf return value
Ioana Ciornei [Sun, 1 Nov 2015 12:58:45 +0000 (14:58 +0200)]
iio: imu: check sscanf return value

This patch fixes the following checkpatch warning:
WARNING: unchecked sscanf return value

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: gyro: check sscanf return value
Ioana Ciornei [Sun, 1 Nov 2015 12:58:44 +0000 (14:58 +0200)]
iio: gyro: check sscanf return value

This patch fixes the checkpatch warnings:
WARNING: unchecked sscanf return value

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Reconcile operation order between iio_register/unregister and pm functions
Adriana Reus [Thu, 5 Nov 2015 14:25:29 +0000 (16:25 +0200)]
iio: Reconcile operation order between iio_register/unregister and pm functions

At probe, runtime pm should be setup before registering the sysfs interface so
that all the power attributes are accurate and functional when registering.
Also, when removing the device we should unregister first to make sure
that the interfaces that may result in wakeups are no longer available.

Fix this behaviour for the following drivers: bmc150, bmg160, kmx61,
kxcj-1013, mma9551, mma9553, rpr0521.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: light: pa12203001: Poweroff chip if register fails
Adriana Reus [Fri, 6 Nov 2015 09:10:37 +0000 (11:10 +0200)]
iio: light: pa12203001: Poweroff chip if register fails

Make sure we poweroff the chip if for any reason iio_register
returns an error.

Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: accel: add Freescale MMA7455L/MMA7456L 3-axis accelerometer driver
Joachim Eastwood [Sat, 31 Oct 2015 12:49:16 +0000 (13:49 +0100)]
iio: accel: add Freescale MMA7455L/MMA7456L 3-axis accelerometer driver

Add support for Freescale MMA7455L/MMA7456L 3-axis in 10-bit mode for
I2C and SPI bus. This rather simple driver that currently doesn't
support all the hardware features of MMA7455L/MMA7456L.

Tested on Embedded Artist's LPC4357 Dev Kit with MMA7455L on I2C bus.

Data sheets for the two devices can be found here:
http://cache.freescale.com/files/sensors/doc/data_sheet/MMA7455L.pdf
http://cache.freescale.com/files/sensors/doc/data_sheet/MMA7456L.pdf

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: light: lm3533-als: Print error message on invalid resistance
Bjorn Andersson [Fri, 30 Oct 2015 23:50:39 +0000 (16:50 -0700)]
iio: light: lm3533-als: Print error message on invalid resistance

Print an error message to indicate that invalid configuration data was
provided in the platform_data, rather than just aborting initialization.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Add a DMAengine framework based buffer
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:29 +0000 (18:10 +0200)]
iio: Add a DMAengine framework based buffer

Add a generic fully device independent DMA buffer implementation that uses
the DMAegnine framework to perform the DMA transfers. This can be used by
converter drivers that whish to provide a DMA buffer for converters that
are connected to a DMA core that implements the DMAengine API.

Apart from allocating the buffer using iio_dmaengine_buffer_alloc() and
freeing it using iio_dmaengine_buffer_free() no additional converter driver
specific code is required when using this DMA buffer implementation.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Add generic DMA buffer infrastructure
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:28 +0000 (18:10 +0200)]
iio: Add generic DMA buffer infrastructure

The traditional approach used in IIO to implement buffered capture requires
the generation of at least one interrupt per sample. In the interrupt
handler the driver reads the sample from the device and copies it to a
software buffer. This approach has a rather large per sample overhead
associated with it. And while it works fine for samplerates in the range of
up to 1000 samples per second it starts to consume a rather large share of
the available CPU processing time once we go beyond that, this is
especially true on an embedded system with limited processing power. The
regular interrupt also causes increased power consumption by not allowing
the hardware into deeper sleep states, which is something that becomes more
and more important on mobile battery powered devices.

And while the recently added watermark support mitigates some of the issues
by allowing the device to generate interrupts at a rate lower than the data
output rate, this still requires a storage buffer inside the device and
even if it exists it is only a few 100 samples deep at most.

DMA support on the other hand allows to capture multiple millions or even
more samples without any CPU interaction. This allows the CPU to either go
to sleep for longer periods or focus on other tasks which increases overall
system performance and power consumption. In addition to that some devices
might not even offer a way to read the data other than using DMA, which
makes DMA mandatory to use for them.

The tasks involved in implementing a DMA buffer can be divided into two
categories. The first category is memory buffer management (allocation,
mapping, etc.) and hooking this up the IIO buffer callbacks like read(),
enable(), disable(), etc. The second category of tasks is to setup the
DMA hardware and manage the DMA transfers. Tasks from the first category
will be very similar for all IIO drivers supporting DMA buffers, while the
tasks from the second category will be hardware specific.

This patch implements a generic infrastructure that take care of the former
tasks. It provides a set of functions that implement the standard IIO
buffer iio_buffer_access_funcs callbacks. These can either be used as is or
be overloaded and augmented with driver specific code where necessary.

For the DMA buffer support infrastructure that is introduced in this series
sample data is grouped by so called blocks. A block is the basic unit at
which data is exchanged between the application and the hardware. The
application is responsible for allocating the memory associated with the
block and then passes the block to the hardware. When the hardware has
captured the amount of samples equal to size of a block it will notify the
application, which can then read the data from the block and process it.
The block size can freely chosen (within the constraints of the hardware).
This allows to make a trade-off between latency and management overhead.
The larger the block size the lower the per sample overhead but the latency
between when the data was captured and when the application will be able to
access it increases, in a similar way smaller block sizes have a larger per
sample management overhead but a lower latency. The ideal block size thus
depends on system and application requirements.

For the time being the infrastructure only implements a simple double
buffered scheme which allocates two blocks each with half the size of the
configured buffer size. This provides basic support for capturing
continuous uninterrupted data over the existing file-IO ABI. Future
extensions to the DMA buffer infrastructure will give applications a more
fine grained control over how many blocks are allocated and the size of
each block. But this requires userspace ABI additions which are
intentionally not part of this patch and will be added separately.

Tasks of the second category need to be implemented by a device specific
driver. They can be hooked up into the generic infrastructure using two
simple callbacks, submit() and abort().

The submit() callback is used to schedule DMA transfers for blocks. Once a
DMA transfer has been completed it is expected that the buffer driver calls
iio_dma_buffer_block_done() to notify. The abort() callback is used for
stopping all pending and active DMA transfers when the buffer is disabled.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Add buffer enable/disable callbacks
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:27 +0000 (18:10 +0200)]
iio: Add buffer enable/disable callbacks

This patch adds a enable and disable callback that is called when the
buffer is enabled/disabled. This can be used by buffer implementations that
need to do some setup or teardown work. E.g. a DMA based buffer can use
this to start/stop the DMA transfer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Add support for indicating fixed watermarks
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:26 +0000 (18:10 +0200)]
iio: Add support for indicating fixed watermarks

For buffers which have a fixed wake-up watermark the watermark attribute
should be read-only. Add a new FIXED_WATERMARK flag to the
struct iio_buffer_access_funcs, which can be set by a buffer
implementation.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio:iio_buffer_init(): Only set watermark if not already set
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:25 +0000 (18:10 +0200)]
iio:iio_buffer_init(): Only set watermark if not already set

Only initialize the watermark field if it is still 0. This allows drivers
to provide a custom default watermark value. E.g. some driver might have a
fixed watermark or can only support watermarks within a certain range and
the initial value for the watermark should be within this range.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Set device watermark based on watermark of all attached buffers
Lars-Peter Clausen [Tue, 13 Oct 2015 16:10:24 +0000 (18:10 +0200)]
iio: Set device watermark based on watermark of all attached buffers

Currently the watermark of the device is only set based on the watermark
that is set for the user space buffer. This doesn't consider the watermarks
set on any attached in-kernel buffers.

Change this so that the watermark of the device should be the minimum of
the watermarks over all attached buffers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: adc: mcp320x: Add compatible with vendor prefix to OF table
Javier Martinez Canillas [Wed, 14 Oct 2015 12:54:39 +0000 (14:54 +0200)]
iio: adc: mcp320x: Add compatible with vendor prefix to OF table

The driver Device Tree binding now documents compatible strings that have
a vendor prefix, so add these to the OF device ID table to match and mark
the old ones as deprecated explaining that should not be used anymore.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: adc: mcp320x: Deprecated compatible strings with no vendor prefix
Javier Martinez Canillas [Wed, 14 Oct 2015 12:54:38 +0000 (14:54 +0200)]
iio: adc: mcp320x: Deprecated compatible strings with no vendor prefix

The Microchip Analog to Digital Converter (ADC) Device Tree binding
documents compatible strings with no vendor prefix. Since it should
compatible strings with also a vendor, add these to the binding doc
and mark the old ones as deprecated.

The driver says that the device is from Microchip Technology which
is listed in Documentation/devicetree/bindings/vendor-prefixes.txt
so use the documented prefix.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Move IIO Dummy Driver out of staging
Cristina Opriceana [Fri, 9 Oct 2015 13:31:28 +0000 (16:31 +0300)]
iio: Move IIO Dummy Driver out of staging

This patch moves the reference IIO dummy driver from drivers/staging/iio
into a separate folder, drivers/iio/dummy and adds the proper Kconfig
and Makefile for it.

A new config menu entry called IIO dummy driver has also been added
in the Industrial I/O support menu, corresponding to this driver.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio:adc:palmas: add DT support
Marek Belisko [Fri, 16 Oct 2015 12:53:39 +0000 (14:53 +0200)]
iio:adc:palmas: add DT support

Code was found at:
https://android.googlesource.com/kernel/tegra/+/a90856a6626d502d42c6e7abccbdf9d730b36270%5E%21/#F1

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Marek Belisko <marek@goldelico.com> [Fixed minor typos + add channels list to documentation]
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio:adc: add iio driver for Palmas (twl6035/7) gpadc
H. Nikolaus Schaller [Fri, 16 Oct 2015 12:53:38 +0000 (14:53 +0200)]
iio:adc: add iio driver for Palmas (twl6035/7) gpadc

This driver code was found as:

https://android.googlesource.com/kernel/tegra/+/aaabb2e045f31e5a970109ffdaae900dd403d17e/drivers/staging/iio/adc

Fixed various compilation issues and test this driver on omap5 evm.

Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Marek Belisko <marek@goldelico.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: accel: add support for Memsic MXC6255XC sensor
Teodora Baluta [Thu, 22 Oct 2015 12:44:50 +0000 (15:44 +0300)]
iio: accel: add support for Memsic MXC6255XC sensor

This patch adds a minimal implementation for the Memsic MXC6255XC
orientation sensing accelerometer. The supported operations are reading
raw acceleration values for X/Y axis that can be scaled using the
exposed scale.

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: mma8452: support either of the available interrupt pins
Martin Kepplinger [Thu, 15 Oct 2015 13:10:32 +0000 (15:10 +0200)]
iio: mma8452: support either of the available interrupt pins

This change is important in order for everyone to be easily able to use the
driver for one of the supported accelerometer chips!

Until now, the driver blindly assumed that the INT1 interrupt line is wired
on a user's board. But these devices have 2 interrupt lines and can route
their interrupt sources to one of them. Now, if "INT2" is found and matches
i2c_client->irq, INT2 will be used.

The chip's default actually is INT2, which is why probably many boards will
have it wired and can make use of this.

Of course, this also falls back to assuming INT1, so for existing users
nothing will break. The new functionality is described in the bindings doc.

Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
For the binding: Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agostaging: IB/hfi1: use TASK_COMM_LEN in hfi1_ctxtdata
Geliang Tang [Fri, 9 Oct 2015 05:04:26 +0000 (22:04 -0700)]
staging: IB/hfi1: use TASK_COMM_LEN in hfi1_ctxtdata

Use comm[TASK_COMM_LEN] instead of comm[16].

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8188eu: Add _enter_critical_mutex() error handling
Alexey Khoroshilov [Sat, 17 Oct 2015 21:33:09 +0000 (00:33 +0300)]
staging: r8188eu: Add _enter_critical_mutex() error handling

_enter_critical_mutex() is a simple call to mutex_lock_interruptible(),
but there is no error handling code for it.

The patch removes wrapper _enter_critical_mutex() and
adds error handling for mutex_lock_interruptible().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-ethernet: move cvm_oct_xaui_open()
Aaro Koskinen [Sat, 17 Oct 2015 19:28:56 +0000 (22:28 +0300)]
staging: octeon-ethernet: move cvm_oct_xaui_open()

cvm_oct_xaui_open() is trivial and does not need a dedicated file.
Move it to the main file.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-ethernet: drop poll_now parameter from cvm_oct_common_open
Aaro Koskinen [Sat, 17 Oct 2015 19:28:55 +0000 (22:28 +0300)]
staging: octeon-ethernet: drop poll_now parameter from cvm_oct_common_open

Drop redundant poll_now parameter from cvm_oct_common_open.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon-ethernet: rgmii: poll link status on open
Aaro Koskinen [Sat, 17 Oct 2015 19:28:54 +0000 (22:28 +0300)]
staging: octeon-ethernet: rgmii: poll link status on open

Get the initial link status already on open instead of postponing
it to the periodic poll task. This unifies the behaviour with
other interfaces types.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Added serialization to mc_send_command()
J. German Rivera [Sat, 17 Oct 2015 20:33:15 +0000 (15:33 -0500)]
staging: fsl-mc: Added serialization to mc_send_command()

When the same portal is used to call mc_send_command() from two
different threads or a thread and an interrupt handler, serialization
is required, as the MC only supports one outstanding command per MC
portal. Thus, a new command should not be sent to the MC until the
last command sent has been responded by the MC.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc:Added support for atomic portals
J. German Rivera [Sat, 17 Oct 2015 20:33:14 +0000 (15:33 -0500)]
staging: fsl-mc:Added support for atomic portals

Refactored mc_send_command() to support two flavors of polling:
- preemptible (for non-atomic portals), which was already supported.
  It calls usleep_range() between polling iterations.
- non-preemptible (for atomic portals), which is needed when
  mc_send_command() is called with interrupts disabled.
  It calls udelay() between polling iterations.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: refactored mc_send_command()
J. German Rivera [Sat, 17 Oct 2015 20:33:13 +0000 (15:33 -0500)]
staging: fsl-mc: refactored mc_send_command()

Moved wait logic in mc_send_command() to its own function

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: changed timeout units for MC cmd completion
J. German Rivera [Sat, 17 Oct 2015 20:33:12 +0000 (15:33 -0500)]
staging: fsl-mc: changed timeout units for MC cmd completion

Changed units for the timeout to wait for completion
of MC command, from jiffies to milliseconds.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Added missing initializer in fsl_mc_bus_driver
J. German Rivera [Sat, 17 Oct 2015 16:18:24 +0000 (11:18 -0500)]
staging: fsl-mc: Added missing initializer in fsl_mc_bus_driver

owner needs to be initialized as THIS_MOUDLE.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: fixed bug in uninitialized root dprc irq count
J. German Rivera [Sat, 17 Oct 2015 16:18:23 +0000 (11:18 -0500)]
staging: fsl-mc: fixed bug in uninitialized root dprc irq count

When initializing the object attributes for the root dprc, the
irq_count was uninitialized. Initialize it to 1.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_device
J. German Rivera [Sat, 17 Oct 2015 16:18:22 +0000 (11:18 -0500)]
staging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_device

Check that resource is not NULL before de-referencing it.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: refactored error exit in allocator probe/remove
J. German Rivera [Sat, 17 Oct 2015 16:18:21 +0000 (11:18 -0500)]
staging: fsl-mc: refactored error exit in allocator probe/remove

Replaced error gotos with direct returns in fsl_mc_allocator_probe()
and fsl_mc_allocator_remove(), since the only error handling done
in those functions is to exit.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Fixed bug in fsl_mc_allocator_remove
J. German Rivera [Sat, 17 Oct 2015 16:18:20 +0000 (11:18 -0500)]
staging: fsl-mc: Fixed bug in fsl_mc_allocator_remove

Call fsl_mc_resource_pool_remove_device() only if mc_dev->resource
is not NULL.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Fixed alignment of copyright comment
J. German Rivera [Sat, 17 Oct 2015 16:18:19 +0000 (11:18 -0500)]
staging: fsl-mc: Fixed alignment of copyright comment

Whitespace cleanup-- add missing spaces in column 1 of copyright

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Removed unused DPMCP macros
J. German Rivera [Sat, 17 Oct 2015 16:18:18 +0000 (11:18 -0500)]
staging: fsl-mc: Removed unused DPMCP macros

The macros were a left-over from a previous implementation
of the dpmcp APIs and are no longer used.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Changed types of flags, portal size in
J. German Rivera [Sat, 17 Oct 2015 16:18:17 +0000 (11:18 -0500)]
staging: fsl-mc: Changed types of flags, portal size in

Changed these two fields from 32-bit integers to 16-bit integers in
struct fsl_mc_io, as 32 bits is too much for these fields. This
change does not affect other components since fsl_mc_io is an opaque
type.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Changed dev_info() calls to dev_dbg()
J. German Rivera [Sat, 17 Oct 2015 16:18:16 +0000 (11:18 -0500)]
staging: fsl-mc: Changed dev_info() calls to dev_dbg()

Changed dev_info() calls to dev_dbg() in
fsl_mc_allocator_probe/fsl_mc_allocator_remove, as they
are useful only for debugging.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: dpmcp opening/closing refactoring
J. German Rivera [Sat, 17 Oct 2015 16:18:15 +0000 (11:18 -0500)]
staging: fsl-mc: dpmcp opening/closing refactoring

Before, we were opening and closing a mc_io's dpmcp object
in fsl_mc_portal_reset(), since that was the only function that was
calling dpmcp MC operations. However, it is better for maintainability
to open the dpmcp object when it gets associated with an mc_io object,
and close it when this association is terminated. This way, we are free
to call dpmcp operations on a mc_io's dpmcp object at any time, without
having to check if the dpmcp object is opened or not.

Consequently, the creation/teardown of the association between
an mc_io object and a dpmcp is now encapsulated in two functions:
fsl_mc_io_set_dpmcp()/fsl_mc_io_unset_dpmcp(). Besides, setting
the corresponding pointers for the association, these functions
open and close the dpmcp object respectively.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: fsl_mc_io object refactoring
J. German Rivera [Sat, 17 Oct 2015 16:18:14 +0000 (11:18 -0500)]
staging: fsl-mc: fsl_mc_io object refactoring

Each fsl_mc_io object is associated with an fsl_mc_device object
of type "dpmcp" representing the MC portal associated with the
fsl_mc_io object. Before, we were representing this association with
an fsl_mc_resource pointer. To enhance code clarity, it is more
straight forward to use an fsl_mc_device pointer instead.
So, this change replaces the 'resource' field in the fsl_mc_io
object with 'dpmcp_dev'. Also, it changes parameter 'resource' of
fsl_create_mc_io() to be an fsl_mc_device pointer instead.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: Naming cleanup in fsl_mc-portal_allocate
J. German Rivera [Sat, 17 Oct 2015 16:18:13 +0000 (11:18 -0500)]
staging: fsl-mc: Naming cleanup in fsl_mc-portal_allocate

mc_adev is a local variable for the allocated dpmcp object.
Renamed mc_adev as dpmcp_dev for clarity.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: move * to be adjacent to pointer name
Alison Schofield [Sat, 17 Oct 2015 16:19:46 +0000 (18:19 +0200)]
staging: r8723au: move * to be adjacent to pointer name

Move * in pointer types to be adjacent to pointer names per Linux
coding style.

Addresses checkpatch.pl: ERROR: "foo*    bar" should be "foo *bar"

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: include : Remove unused macros
Ksenija Stanojevic [Sat, 17 Oct 2015 16:19:46 +0000 (18:19 +0200)]
Staging: lustre: include : Remove unused macros

These macro are not used anymore, therefore remove them.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: include: Convert macro class_export_lock_put into static inline...
Ksenija Stanojevic [Sat, 17 Oct 2015 16:19:46 +0000 (18:19 +0200)]
Staging: lustre: include: Convert macro class_export_lock_put into static inline function

Static inline functions are preferred over macros. This change is safe
because the types of arguments at all the call sites are same.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: include: Convert macro class_export_lock_get into static inline...
Ksenija Stanojevic [Sat, 17 Oct 2015 16:18:34 +0000 (18:18 +0200)]
Staging: lustre: include: Convert macro class_export_lock_get into static inline function

Static inline functions are preferred over macros. This change is safe
because the types of arguments at all the call sites are same.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: include: Move function prototypes
Ksenija Stanojevic [Sat, 17 Oct 2015 16:17:05 +0000 (18:17 +0200)]
Staging: lustre: include: Move function prototypes

Functions:
struct obd_export *class_export_get(struct obd_export *exp);
void class_export_put(struct obd_export *exp)
are being used in macros that are converted into static inline
functions, therefore move function prototypes to avoid build
error in later patches.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: card.c rename pDevice with priv
Malcolm Priestley [Sat, 17 Oct 2015 10:33:02 +0000 (11:33 +0100)]
staging: vt6655: card.c rename pDevice with priv

Removing camel case.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: rename pOpts and sOpts to opts.
Malcolm Priestley [Sat, 17 Oct 2015 10:33:01 +0000 (11:33 +0100)]
staging: vt6655: rename pOpts and sOpts to opts.

bring pointers and members into line.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: remove static inline alloc_td_info.
Malcolm Priestley [Sat, 17 Oct 2015 10:33:00 +0000 (11:33 +0100)]
staging: vt6655: remove static inline alloc_td_info.

Since this only contains one function and used only twice remove
inline altogether.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: remove static inline alloc_rd_info.
Malcolm Priestley [Sat, 17 Oct 2015 10:32:59 +0000 (11:32 +0100)]
staging: vt6655: remove static inline alloc_rd_info.

Since this only contains one function and only used twice
remove inline altogether.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: replace typedef struct __device_opt
Malcolm Priestley [Sat, 17 Oct 2015 10:32:58 +0000 (11:32 +0100)]
staging: vt6655: replace typedef struct __device_opt

with struct vnt_options and members
rx_descs0 for nRxDescs0
rx_descs1 for nRxDescs1
tx_descs for nTxDescs
int_works
short_retry
long_retry
bbp_type
flags

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: device.h remove typedef enum
Malcolm Priestley [Sat, 17 Oct 2015 10:32:57 +0000 (11:32 +0100)]
staging: vt6655: device.h remove typedef enum

Covert values to macros.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: device.h remove unsed headers.
Malcolm Priestley [Sat, 17 Oct 2015 10:32:56 +0000 (11:32 +0100)]
staging: vt6655: device.h remove unsed headers.

Most of these headers rate to old api that are no longer used
in driver.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: device.h remove unused macros.
Malcolm Priestley [Sat, 17 Oct 2015 10:32:55 +0000 (11:32 +0100)]
staging: vt6655: device.h remove unused macros.

None of these are used in driver anymore.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: device_main Replace uIdx with idx.
Malcolm Priestley [Sat, 17 Oct 2015 10:32:54 +0000 (11:32 +0100)]
staging: vt6655: device_main Replace uIdx with idx.

Removing camel case.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: Prefer using BIT Macro
Amitoj Kaur Chawla [Sat, 17 Oct 2015 15:50:00 +0000 (21:20 +0530)]
staging: sm750fb: Prefer using BIT Macro

Replace bit shifting on 1 with the BIT(x) Macro
Problem found using checkpatch.pl
WARNING: 'Prefer using the BIT macro'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: mt29f_spinand: Remove space after a cast
Eva Rachel Retuya [Sat, 17 Oct 2015 15:52:26 +0000 (23:52 +0800)]
Staging: mt29f_spinand: Remove space after a cast

Modify retval to reflect removal of space during cast operation.
Checkpatch found this issue.

CHECK: No space is necessary after a cast

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: Remove unnecessary parentheses
Aybuke Ozdemir [Sat, 17 Oct 2015 12:25:35 +0000 (15:25 +0300)]
Staging: wilc1000: Remove unnecessary parentheses

Problem found using checkpatch.pl:
CHECK: Unnecessary parentheses around pstrNetworkInfo->u8SsidLen

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: Remove unnecessary else after return
Aybuke Ozdemir [Sat, 17 Oct 2015 12:25:34 +0000 (15:25 +0300)]
Staging: wilc1000: Remove unnecessary else after return

Problem found using checkpatch.pl:
WARNING: else is not generally useful after a break or return

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: Remove multiple blank lines
Aybuke Ozdemir [Sat, 17 Oct 2015 12:25:33 +0000 (15:25 +0300)]
Staging: wilc1000: Remove multiple blank lines

Remove multiple blank lines. Problem found using checkpatch.pl
CHECK: Please don't use multiple blank lines.

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: remove unneeded variable
Greg Kroah-Hartman [Sat, 17 Oct 2015 15:55:15 +0000 (08:55 -0700)]
Staging: lustre: remove unneeded variable

ldlm_lock_enqueue() always returns ELDLM_OK, no matter what happens, so
removed the unneeded variable that this value was being stored in and
just return the value itself.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
9 years agostaging: comedi: cb_pcidas: rename handle_ao_interrupt()
H Hartley Sweeten [Wed, 14 Oct 2015 00:48:02 +0000 (17:48 -0700)]
staging: comedi: cb_pcidas: rename handle_ao_interrupt()

Rename this function so it has namespace associated with the
driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up analog input subdevice init
H Hartley Sweeten [Wed, 14 Oct 2015 00:48:01 +0000 (17:48 -0700)]
staging: comedi: cb_pcidas: tidy up analog input subdevice init

For aesthetics, add some whitespace to the subdevice initialization
and rename the subdevice functions to follow the normal form in
comedi drivers.

Async command support uses interrupts. For clarity, make sure the
driver has an IRQ before initializing command support.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up analog output subdevice init
H Hartley Sweeten [Wed, 14 Oct 2015 00:48:00 +0000 (17:48 -0700)]
staging: comedi: cb_pcidas: tidy up analog output subdevice init

For aesthetics, add some whitespace to the subdevice initialization
and rename the (*insn_write) functions to follow the normal form
in comedi drivers.

It's not possible to actually read the analog outpus. For convienence
the subdevice readback provided by the core is used to return the
last value written to the subdevice. Remove the SDF_READABLE flag
from the subdev_flags.

Async command support uses interrupts. For clarity, make sure the
driver has an IRQ before initializing command support.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: rename private data 's5933_intcsr_bits'
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:59 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: rename private data 's5933_intcsr_bits'

For aesthetics, rename this member of the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: rename private data 's5933_config'
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:58 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: rename private data 's5933_config'

For aesthetics, rename this member of the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: fix cb_pcidas_eeprom_insn_read()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:57 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: fix cb_pcidas_eeprom_insn_read()

The comedi core expects (*insn_read) operations to return insn->n
data values. Refactor this function to work like the core expects.

For aesthetics, nvram_read() and use the comedi_timeout() helper
to handle the busy wait for the eeprom to be "ready".

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up memory subdevice init
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:56 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up memory subdevice init

For aesthetics, add some whitespace to the initialization of this
subdevice.

Rename the (*insn_read) function so it has namespace associated with
the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up 8800 caldac calibration subdevice
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:55 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up 8800 caldac calibration subdevice

For aesthetics, add some whitespace to the subdevice init.

It's not possible to actually read from the caldac. For convienence
the subdevice readback provided by the core is used to return the
last value written to the subdevice. Remove the SDF_READABLE flag
from the subdev_flags.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up dac08_write()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:54 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up dac08_write()

Rename this function so it has namespace associated with the driver.
Also rename the 'value' parameter to avoid having to split the line
to keep it under 80 chars.

Remove the unnecessary masking on the 'value'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up dac08 calibration subdevice
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:53 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up dac08 calibration subdevice

For aesthetics, add some whitespace to the subdevice init.

It's not possible to actually read from the dac08. For convienence
the subdevice readback provided by the core is used to return the
last value written to the subdevice. Remove the SDF_READABLE flag
from the subdev_flags.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: refactor 'trimpot' boardinfo
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:52 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: refactor 'trimpot' boardinfo

Only the pci-das1602/16 boards have an AD8402 trimpot. The rest of
the boards supported by this driver have an AD7376 trimpot.

Replace the 'enum trimpot_module' in the boardinfo with a bit-field
flag 'has_ad8402' to save a bit of space.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up cb_pcidas_trimpot_write()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:51 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up cb_pcidas_trimpot_write()

All the boards supported by this driver have an AD7376 or AD8402
trimpot. Replace the switch () with and if () and remove the
unreachable dev_err() noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: absorb caldac/trimpot write functions
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:50 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: absorb caldac/trimpot write functions

These functions are all just wrappers for cb_pcidas_calib_write().
Remove them and absorb the code into the callers.

Remove the unnecessary masking of the 'chan'. It will always be in
range due to the subdevice initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: refactor write_calibration_bitstream()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:49 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: refactor write_calibration_bitstream()

Refactor this function to handle the common code used to select the
calibration device (trimpot or caldac) and latch the data after
sending the bitstream.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up caldac_8800_write()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:48 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up caldac_8800_write()

Rename this function so it has namespace associated with the driver.

For aesthetics, remove the 'static const' local variables. They don't
add any significant value.

Remove the 'bitstream' local variable. Change the type of the 'value'
param to match the callers type and write_calibration_bitstream()'s
type.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up trimpot_8402_write()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:47 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up trimpot_8402_write()

Rename this function so it has namespace associated with the driver.
Change the return type to void, it always returns '0' and the return
value is never checked.

For aesthetics, remove the 'static const' local variables. They don't
add any significant value.

Remove the 'bitstream' local variable. The 'value' passed to this
function will always be in the correct range due to s->maxdata so
the masking is not necessary. Change the type of the 'value' param
to match the callers type and write_calibration_bitstream()'s type.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up trimpot_7376_write()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:46 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up trimpot_7376_write()

Rename this function so it has namespace associated with the driver.
Change the return type to void, it always returns '0' and the return
value is never checked.

For aesthetics, remove the 'static const' local variables. They don't
add any significant value.

Remove the 'bitstream' local variable. The 'value' passed to this
function will always be in the correct range due to s->maxdata so
the masking is not necessary. Change the type of the 'value' param
to match the callers type and write_calibration_bitstream()'s type.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up calibration trimpot subdevice
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:45 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up calibration trimpot subdevice

For aesthetics, add some whitespace to the subdevice init.

It's not possible to actually read from the trimpot. For convienence
the subdevice readback provided by the core is used to return the
last value written to the subdevice. Remove the SDF_READABLE flag
from the subdev_flags.

Move the comment about the channels from trimpot_8402_write() to
the subdevice init and fix the checkpatch.pl issue about:

WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: use preferred kernel types
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:44 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: use preferred kernel types

As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u8' over 'uint8_t'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up DAC control/status register
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:43 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up DAC control/status register

Rename this register and its bit defines so they have namespace
associated with the driver. Use the BIT macro to define the bits.

For aesthetics, rename the associated member of the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up calibration register
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:42 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up calibration register

Rename this register and its bit defines so they have namespace
associated with the driver. Use the BIT macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up trigger control/status register
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:41 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up trigger control/status register

Rename this register and its bit defines so they have namespace
associated with the driver. Use the BIT macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up ADC mux/control register
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:40 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up ADC mux/control register

Rename this register and its bit defines so they have namespace
associated with the driver. Use the BIT macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up interrupt/ADC FIFO register
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:39 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up interrupt/ADC FIFO register

Rename this register and its bit defines so they have namespace
associated with the driver. Use the BIT macro to define the bits.

For aesthetics, rename the associated member of the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: convert inline DAC bit helpers to macros
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:38 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: convert inline DAC bit helpers to macros

For aesthetics, convert the inline functions that return the bits
used to set the DAC range and enable bits to macros.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up PCI BAR2 register defines
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:37 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up PCI BAR2 register defines

Rename the defines for the PCI BAR2 register offsets so they have
namespace associated with the driver and convert the offsets to
hex.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up PCI BAR3 register defines
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:36 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up PCI BAR3 register defines

Rename the defines for the PCI BAR3 register offsets so they have
namespace associated with the driver and convert the offsets to
hex.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: use comedi_range_is_unipolar()
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:35 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: use comedi_range_is_unipolar()

Instead of relying on the IS_UNIPOLAR mask value, use the comedi
helper function to check if the range is unipolar.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: tidy up PCI BAR4 register defines
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:34 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: tidy up PCI BAR4 register defines

Convert the inline function DAC_DATA_REG() into a simple macro.

Rename the defines for the PCI BAR4 register offsets so they have
namespace associated with the driver and convert the offsets to
hex.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: rename private data 'ao_registers'
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:33 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: rename private data 'ao_registers'

This member of the private data holds the PCI BAR4 resource starting
address. For aesthetics, rename this member to 'pcibar4'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: rename private data 'adc_fifo'
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:32 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: rename private data 'adc_fifo'

This member of the private data holds the PCI BAR2 resource starting
address. For aesthetics, rename this member to 'pcibar2'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: rename private data 'control_status'
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:31 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: rename private data 'control_status'

This member of the private data holds the PCI BAR1 resource starting
address. For aesthetics, rename this member to 'pcibar1'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: refactor 'ranges' boardinfo
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:30 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: refactor 'ranges' boardinfo

All the boards, except the 'pci-das1001', use the normal analog input
range table 'cb_pcidas_ranges'. Convert the 'ranges' boardinfo into
a bit-field flag 'use_alt_range' to save a bit of space.

For aesthetics, reword the comments in the boardinfo for the bit-field
members so they align.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcidas: all boards have 16 analog input channels
H Hartley Sweeten [Wed, 14 Oct 2015 00:47:29 +0000 (17:47 -0700)]
staging: comedi: cb_pcidas: all boards have 16 analog input channels

All the boards supported by this driver have 16 analog input channels.
Remove this unnecessary information from the boardinfo.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>