GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
9 years agoMerge tag 'iio-for-3.20b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Sat, 31 Jan 2015 16:43:49 +0000 (08:43 -0800)]
Merge tag 'iio-for-3.20b' of git://git./linux/kernel/git/jic23/iio into staging-testing

Jonathan writes:

Second round of IIO new drivers, functionality and cleanups for the 3.20 cycle.

New drivers and device support:
* Capella cm3232 ambient light sensor driver.
* Freescale MMA9553 pedometer and activity monitor. Note this involved a
  refactor of the mma9551 driver to pull out shared elements.
* Samsung sensor hub (as used in the galaxy gear 2 watch) Core support
  and initial drivers (gyro and accelerometer) more to follow.
  An additional fix was applied on top of this for a build issue
  thrown up by the autobuilders on some platforms.
* Cosmic Circuits 10001 ADC driver
* Qualcomm SPMI PMIC voltage ADC driver (current adc merged a while back).
* Add binding for AK8963 (in capitals) as unfortunately there are bios'
  out there not using lower case.

New functionality
* Add newe operating mode to the core to allow for non triggered software
  buffers.  This is mostly semantics as previously drivers just claimed they
  had a hardware buffer (when they didn't).
* Add distance channel type.
* Add energy channel type.
* Add velocity channel type and IIO_MOD_ROOT_SUM_SQUARED (i.e. speed when
  our channel type is velocity).
* Add _debounce_count and _debounce_time filter attributes.  Only really
  make sense for counting types of measurements.  First use is for avoiding
  miss detection of steps prior to walking.
* Add change event type.   This replaces the briefly present INSTANCE type
  (which hadn't gained any users).  It is more generic as it allows for
  events say every 10 steps rather than every step.
* Add _calibweight attributes to the ABI (and core support).  Used by
  activity monitors to estimate energy use.  Can imagine there will be
  other uses for this one.

Driver new functionality
* mma9551 gains runtime pm support.
* hid-sensors gain PM support.

Cleanup
* Change calibheight unit to m from cm.  As there are no prior users
  and this was inconsistent with other distance units, it makes sense
  to fix it before hte mma9553 driver which uses it.
* mpu6050 cleanups and devm_ use.
* as3935 switch over to PM ops.
* Fix a few format strings for signed vs unsigned.
* Fix tcs3414 missindentation
* Typo in industrialio-event
* Stop requiring IIO_TRIGGER for IIO_KFIFO_BUF as we have drivers that don't
  need it. No one is quite sure why that dependency was there and it
  seems to not matter.

9 years agoiio:common:ssp_sensors fix warnings due to 32 bit instead of 64 bit passed to do_div
Jonathan Cameron [Sat, 31 Jan 2015 09:41:14 +0000 (09:41 +0000)]
iio:common:ssp_sensors fix warnings due to 32 bit instead of 64 bit passed to do_div

Also change to div64_u64 in one place to avoid loss of precision
(was dividing a 32 bit number by a 64 bit number, but casting this
to 64 bit divided by 32 bit)  Those divide functions certainly have
esoteric naming!

Fixes warnings with asm-generic/div64.h do_div such as:
   In file included from drivers/iio/common/ssp_sensors/ssp_iio.c:20:0:
   drivers/iio/common/ssp_sensors/ssp_iio_sensor.h: In function 'ssp_convert_to_freq':
>> drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:16: warning: comparison of distinct pointer types lacks a cast [enabled by default]
   drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:2: warning: right shift count >= width of type [enabled by default]
>> drivers/iio/common/ssp_sensors/ssp_iio_sensor.h:56:2: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
   include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'int *'
   drivers/iio/common/ssp_sensors/ssp_iio.c: In function 'ssp_common_process_data':
   include/linux/iio/buffer.h:142:32: warning: 'calculated_time' may be used uninitialized in this function [-Wuninitialized]
   drivers/iio/common/ssp_sensors/ssp_iio.c:83:10: note: 'calculated_time' was declared here

Fixed by using straight coded version as per the description in the
div64.h header, thus ensuring no issue with 32 bit integers.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: add driver for Freescale MMA9553
Irina Tirdea [Thu, 29 Jan 2015 18:45:10 +0000 (18:45 +0000)]
iio: add driver for Freescale MMA9553

Add support for Freescale MMA9553L Intelligent Pedometer Platform.

The following functionalities are supported:
 - step counter (counts the number of steps using a HW register)
 - step detector (generates an iio event at every step the user takes)
 - activity recognition (rest, walking, jogging, running)
 - speed
 - calories
 - distance

To get accurate pedometer results, the user's height, weight and gender
need to be configured.

The specifications can be downloaded from:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA955xLSWRM.pdf
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Documentation: Fix calibheight unit
Irina Tirdea [Tue, 27 Jan 2015 18:41:53 +0000 (20:41 +0200)]
iio: Documentation: Fix calibheight unit

Change calibheight unit from centimeters to meters
to follow iio guidelines of using SI units.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce IIO_CHAN_INFO_DEBOUNCE_COUNT and _TIME
Irina Tirdea [Tue, 27 Jan 2015 18:41:52 +0000 (20:41 +0200)]
iio: core: Introduce IIO_CHAN_INFO_DEBOUNCE_COUNT and _TIME

The pedometer needs to filter out false steps that might be generated by
tapping the foot, sitting, etc. To do that it computes the number of
steps that occur in a given time and decides the user is moving only
if this value is over a threshold. E.g.: the user starts moving only
if he takes 4 steps in 3 seconds. This filter is applied only when
the user starts moving.

A device that has such pedometer functionality is Freescale's MMA9553L:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf.

To export this feature, this patch introduces IIO_CHAN_INFO_DEBOUNCE_COUNT
and IIO_CHAN_INFO_DEBOUNCE_TIME. For the pedometer, in_steps_debounce_count
will specify the number of steps that need to occur in
in_steps_debounce_time seconds so that the pedometer decides the user is
moving.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: common: ssp_sensors: Add sensorhub gyroscope sensor
Karol Wrona [Wed, 28 Jan 2015 14:05:54 +0000 (15:05 +0100)]
iio: common: ssp_sensors: Add sensorhub gyroscope sensor

This patch adds gyroscope iio driver which uses sensorhub as data
provider.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: common: ssp_sensors: Add sensorhub accelerometer sensor
Karol Wrona [Wed, 28 Jan 2015 14:05:53 +0000 (15:05 +0100)]
iio: common: ssp_sensors: Add sensorhub accelerometer sensor

This patch adds accelerometer iio driver which uses sensorhub as data
provider.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: common: ssp_sensors: Add sensorhub iio commons
Karol Wrona [Wed, 28 Jan 2015 14:05:52 +0000 (15:05 +0100)]
iio: common: ssp_sensors: Add sensorhub iio commons

This patch adds common library for sensorhub iio drivers.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: sensorhub: Add sensorhub bindings
Karol Wrona [Wed, 28 Jan 2015 14:05:51 +0000 (15:05 +0100)]
iio: sensorhub: Add sensorhub bindings

Add sensorhub bindings for sensorhub on Galaxy Gear 2.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: common: ssp_sensors: Add sensorhub driver
Karol Wrona [Wed, 28 Jan 2015 14:05:50 +0000 (15:05 +0100)]
iio: common: ssp_sensors: Add sensorhub driver

Sensorhub  is MCU dedicated to collect data and manage several sensors.
Sensorhub is a spi device which provides a layer for IIO devices. It provides
some data parsing and common mechanism for sensorhub sensors.

Adds common sensorhub library for sensorhub driver and iio drivers
which uses sensorhub MCU to communicate with sensors.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: adc: Cosmic Circuits 10001 ADC driver
Phani Movva [Tue, 6 Jan 2015 20:47:35 +0000 (17:47 -0300)]
iio: adc: Cosmic Circuits 10001 ADC driver

This commit adds support for Cosmic Circuits 10001 10-bit ADC device.

Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Phani Movva <Phani.Movva@imgtec.com>
Signed-off-by: Naidu Tellapati <Naidu.Tellapati@imgtec.com>
[ezequiel: code style cleaning]
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agostaging: Remove logger and alarm-dev from android Makefile
John Stultz [Tue, 27 Jan 2015 15:22:21 +0000 (07:22 -0800)]
staging: Remove logger and alarm-dev from android Makefile

My previous patches deleting logger and alarm-dev from staging
missed the android Makefile.

This patch cleans up the Makefile to remove the now non-existent
files.

Cc: Rom Lemarchand <romlem@google.com>,
Cc: Mark Salyzyn <salyzyn@google.com>,
Cc: Kees Cook <keescook@chromium.org>,
Cc: Android Kernel Team <kernel-team@android.com>,
Cc: Valentin Rothberg <valentinrothberg@gmail.com>,
Cc: Greg Hackmann <ghackmann@google.com>,
Cc: Elliott Hughes <enh@google.com>,
Cc: Todd Poynor <toddpoynor@google.com>,
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: Remove the Android logger driver
John Stultz [Mon, 26 Jan 2015 20:07:32 +0000 (12:07 -0800)]
staging: Remove the Android logger driver

With the relase of Lollipop, Android no longer
requires the logger driver.

There are three patches which the android dev's
still need before they drop logger on all their
devices:

[PATCH v4 1/5] pstores: use scnprintf
[PATCH v2 2/5] pstore: remove superfluous memory size check
[PATCH 3/5] pstore: handle zero-sized prz in series
[PATCH v4 4/5] pstore: add pmsg
[PATCH 5/5] pstore: selinux: add security in-core xattr support for pstore and debugfs

But these seem to have been acked and are hopefully
queued for upstream.

So this patch removes the logger driver from staging.

Cc: Rom Lemarchand <romlem@google.com>,
Cc: Mark Salyzyn <salyzyn@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: remove redundant .owner
Heba Aamer [Wed, 28 Jan 2015 13:29:05 +0000 (15:29 +0200)]
staging: fbtft: remove redundant .owner

This patch fixes the following coccicheck warning:
No need to set .owner here. The core will do it.

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix trailing whitespace
Heba Aamer [Tue, 27 Jan 2015 20:46:25 +0000 (22:46 +0200)]
staging: fbtft: fix trailing whitespace

This patch fixes the following checkpatch.pl error:
fix trailing whitespace

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix do not initialise statics to 0 or NULL
Heba Aamer [Tue, 27 Jan 2015 20:42:59 +0000 (22:42 +0200)]
staging: fbtft: fix do not initialise statics to 0 or NULL

This patch fixes the following checkpatch.pl error:
fix do not initialise statics to 0 or NULL

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix Macros with complex values should be enclosed in parentheses
Heba Aamer [Tue, 27 Jan 2015 20:39:56 +0000 (22:39 +0200)]
staging: fbtft: fix Macros with complex values should be enclosed in parentheses

This patch fixes the following checkpatch.pl error:
fix Macros with complex values should be enclosed in parentheses

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix spaces required around that '<'
Heba Aamer [Tue, 27 Jan 2015 20:37:24 +0000 (22:37 +0200)]
staging: fbtft: fix spaces required around that '<'

This patch fixes the following checkpatch.pl error:
fix spaces required around that '<'

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix spaces required around that '='
Heba Aamer [Tue, 27 Jan 2015 20:35:30 +0000 (22:35 +0200)]
staging: fbtft: fix spaces required around that '='

This patch fixes the following checkpatch.pl error:
fix spaces required around that '='

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix space required after that ';'
Heba Aamer [Tue, 27 Jan 2015 20:33:03 +0000 (22:33 +0200)]
staging: fbtft: fix space required after that ';'

This patch fixes the following checkpatch.pl error:
fix space required after that ';'

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers/staging: use current->state helpers
Davidlohr Bueso [Mon, 26 Jan 2015 10:15:02 +0000 (02:15 -0800)]
drivers/staging: use current->state helpers

Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments,
keeping track of who changed the state.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: fix that open brace { should be on the previous line
Mariam Mohamed Fawzy [Mon, 26 Jan 2015 09:24:36 +0000 (11:24 +0200)]
staging: vt6655: fix that open brace { should be on the previous line

This patch fixes the following checkpatch.pl error:
fix that open brace { should be on the previous line

Signed-off-by: Mariam Mohamed Fawzy <maryammohamed61@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: flexfb: Remove initialization to 0
Mauro Stettler [Sun, 25 Jan 2015 11:26:17 +0000 (20:26 +0900)]
staging: flexfb: Remove initialization to 0

(the initial post had a typo in the short summary, reposting)

This fixes some of the code style issues in the flexfb driver by removing
unnecessary initializations of static variables to 0 or to NULL.

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Noralf Tronnes <notro@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.c: absorb raw_ioctl()
Ian Abbott [Tue, 27 Jan 2015 18:16:56 +0000 (18:16 +0000)]
staging: comedi: comedi_compat32.c: absorb raw_ioctl()

`comedi_compat_ioctl()` just calls static inline function `raw_ioctl()`
with the same parameters (although the former returns a `long` and the
latter returns an `int`).  Since `raw_ioctl()` is not called from
anywhere else, just absorb its body into `comedi_compat_ioctl()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.c: align some comments
Ian Abbott [Tue, 27 Jan 2015 18:16:55 +0000 (18:16 +0000)]
staging: comedi: comedi_compat32.c: align some comments

Align some comments attached to members of the 32-bit compatibility
structure definitions.  These comments describe the original pointer
types that are being represented by a `compat_uptr_t`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.c: reformat other block comments
Ian Abbott [Tue, 27 Jan 2015 18:16:54 +0000 (18:16 +0000)]
staging: comedi: comedi_compat32.c: reformat other block comments

Use the usual block comment style.  Combine some consecutive comments
into block comments.  Also remove part of a comment referring to
`ptr_to_compat()` not being implemented until kernel version 2.6.11 as
it's irrelevant.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.c: reformat copyright comment
Ian Abbott [Tue, 27 Jan 2015 18:26:55 +0000 (18:26 +0000)]
staging: comedi: comedi_compat32.c: reformat copyright comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.h: reformat copyright comment
Ian Abbott [Tue, 27 Jan 2015 18:16:52 +0000 (18:16 +0000)]
staging: comedi: comedi_compat32.h: reformat copyright comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_compat32.c: fix COMEDI_CMD copy back
Ian Abbott [Tue, 27 Jan 2015 18:16:51 +0000 (18:16 +0000)]
staging: comedi: comedi_compat32.c: fix COMEDI_CMD copy back

`do_cmd_ioctl()` in "comedi_fops.c" handles the `COMEDI_CMD` ioctl.
This returns `-EAGAIN` if it has copied a modified `struct comedi_cmd`
back to user-space.  (This occurs when the low-level Comedi driver's
`do_cmdtest()` handler returns non-zero to indicate a problem with the
contents of the `struct comedi_cmd`, or when the `struct comedi_cmd` has
the `CMDF_BOGUS` flag set.)

`compat_cmd()` in "comedi_compat32.c" handles the 32-bit compatible
version of the `COMEDI_CMD` ioctl.  Currently, it never copies a 32-bit
compatible version of `struct comedi_cmd` back to user-space, which is
at odds with the way the regular `COMEDI_CMD` ioctl is handled.  To fix
it, change `compat_cmd()` to copy a 32-bit compatible version of the
`struct comedi_cmd` back to user-space when the main ioctl handler
returns `-EAGAIN`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_usb.h: move USB stuff out of comedidev.h
Ian Abbott [Tue, 27 Jan 2015 17:49:09 +0000 (17:49 +0000)]
staging: comedi: comedi_usb.h: move USB stuff out of comedidev.h

Move the USB-specific stuff out of "comedidev.h" into "comedi_usb.h".
Comedi USB drivers now include "comedi_usb.h" instead of "comedidev.h",
which now gets pulled in indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: vmk80xx: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:08 +0000 (17:49 +0000)]
staging: comedi: vmk80xx: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxsigma: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:07 +0000 (17:49 +0000)]
staging: comedi: usbduxsigma: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:06 +0000 (17:49 +0000)]
staging: comedi: usbduxfast: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:05 +0000 (17:49 +0000)]
staging: comedi: usbdux: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_usb6501: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:04 +0000 (17:49 +0000)]
staging: comedi: ni_usb6501: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: dt9812: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:03 +0000 (17:49 +0000)]
staging: comedi: dt9812: include new "comedi_usb.h" header

Include the new "../comedi_usb.h" header instead of <linux/usb.h> and
"../comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_usb.c: include new "comedi_usb.h" header
Ian Abbott [Tue, 27 Jan 2015 17:49:02 +0000 (17:49 +0000)]
staging: comedi: comedi_usb.c: include new "comedi_usb.h" header

Include the new "comedi_usb.h" header instead of <linux/usb.h> and
"comedidev.h", which will now get included indirectly.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: add comedi_usb.h
Ian Abbott [Tue, 27 Jan 2015 17:49:01 +0000 (17:49 +0000)]
staging: comedi: add comedi_usb.h

Add a new header that Comedi USB drivers can include instead of
"comedidev.h".  Currently, it just pulls in <linux/usb.h> and
"comedidev.h", but the plan is to migrate the USB-specific stuff from
"comedidev.h" here.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: pcl812: fix logic error in pcl812_ai_setup_dma()
H Hartley Sweeten [Mon, 26 Jan 2015 21:20:15 +0000 (14:20 -0700)]
staging: comedi: pcl812: fix logic error in pcl812_ai_setup_dma()

commit 92afc2b229038d7b962ae69de5b07bc6c1cf51bf inroduced a logic error
in the DMA size calculation.

If the 'nsamples' is greater than the 'unread_samples' then DMA needs to
be restarted. The current code checks it agains the 'max_samples'.

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: addi_apci_1032: add comedi driver comment
Ian Abbott [Mon, 26 Jan 2015 14:28:56 +0000 (14:28 +0000)]
staging: comedi: addi_apci_1032: add comedi driver comment

Add a comedi driver comment in a form suitable for importing into
Comedilib documentation.  The information about the change-of-state
subdevice has been pulled from other comments in the driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8255.h: reformat copyright comment
Ian Abbott [Mon, 26 Jan 2015 13:25:25 +0000 (13:25 +0000)]
staging: comedi: 8255.h: reformat copyright comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8255.c: reformat remaining block comments
Ian Abbott [Mon, 26 Jan 2015 13:25:24 +0000 (13:25 +0000)]
staging: comedi: 8255.c: reformat remaining block comments

Use the usual block comment formatting style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8255.c: document subdev_8255_init() and _mm_init()
Ian Abbott [Mon, 26 Jan 2015 13:25:23 +0000 (13:25 +0000)]
staging: comedi: 8255.c: document subdev_8255_init() and _mm_init()

Add kerneldoc comments for the subdev_8255_init() and
subdev_8255_mm_init() functions and remove the other comment about how
to use this module in a comedi driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8255.c: reformat comedi driver comment
Ian Abbott [Mon, 26 Jan 2015 13:25:22 +0000 (13:25 +0000)]
staging: comedi: 8255.c: reformat comedi driver comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8255.c: reformat copyright comment
Ian Abbott [Mon, 26 Jan 2015 13:25:21 +0000 (13:25 +0000)]
staging: comedi: 8255.c: reformat copyright comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8253.h: use usual style for single-line comments
Ian Abbott [Mon, 26 Jan 2015 12:06:07 +0000 (12:06 +0000)]
staging: comedi: 8253.h: use usual style for single-line comments

Use one space after the opening and one space before the closing of the
comment.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8253.h: reformat other block comments
Ian Abbott [Mon, 26 Jan 2015 12:06:06 +0000 (12:06 +0000)]
staging: comedi: 8253.h: reformat other block comments

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8253.h: reformat copyright comment
Ian Abbott [Mon, 26 Jan 2015 12:06:05 +0000 (12:06 +0000)]
staging: comedi: 8253.h: reformat copyright comment

Use the usual block comment style.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: das16: introduce das16_ai_set_mux_range()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:21 +0000 (16:17 -0700)]
staging: comedi: das16: introduce das16_ai_set_mux_range()

Introduce a helper function to program the mux and gain for analog input
single channel (*insn_read) and multi-channel (*do_cmd) operations.

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: das16: fix DMA size for short transfers
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:20 +0000 (16:17 -0700)]
staging: comedi: das16: fix DMA size for short transfers

Currently this driver alwasy programs the DMA transfer to be the allocated
size of the DMA buffer. When the async command 'stop_src' is TRIG_COUNT its
possible (likely) for the last transfer to be less than the buffer size.

Introduce a helper function, das16_ai_setup_dma(), to calculate the actual
size of the DMA transfer based on the number of samples remaining and the
number of unread samples.

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: das16: use comedi_async 'scans_done' to detect EOA
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:19 +0000 (16:17 -0700)]
staging: comedi: das16: use comedi_async 'scans_done' to detect EOA

Refactor das16_interrupt() to use the comedi_async 'scans_done' member to
detect the End-of-Acquisition for the async command. Use the helper function
comedi_nsamples_left() to determine if DMA needs to be restarted.

This allows the removal of the private data 'adc_byte_count' and fixes a
possible integer overflow issue when that value is calculated.

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: das16: change type of private data 'timer_running'
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:18 +0000 (16:17 -0700)]
staging: comedi: das16: change type of private data 'timer_running'

This member of the private data is a true/false flag. For aesthetics,
change the type to an unsigned int bit-field 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: das16: introduce das16_ao_range()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:17 +0000 (16:17 -0700)]
staging: comedi: das16: introduce das16_ao_range()

Clarify the (*attach) a bit by introducing a helper function to handle the
setup of the analog output 'range_table'.

Some of the boards supported by this driver do not have programmable ranges.
The analog output subdevice can use optional range information provided by
the user during the attach of the driver. Currently this range data is
allocated and stored in the private data.

Use the subdevice private data member instead and allocate the memory with
comedi_alloc_spriv(). The comedi core will automatically free this memory
when the driver is detached. If the allocation fails set the 'range_table'
to 'range_unknown' instead of failing the driver attach.

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: das16: introduce das16_ai_range()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:16 +0000 (16:17 -0700)]
staging: comedi: das16: introduce das16_ai_range()

Clarify the (*attach) a bit by introducing a helper function to handle the
setup of the analog input 'range_table'.

Some of the boards supported by this driver do not have programmable ranges.
The analog input subdevice can use optional range information provided by
the user during the attach of the driver. Currently this range data is
allocated and stored in the private data.

Use the subdevice private data member instead and allocate the memory with
comedi_alloc_spriv(). The comedi core will automatically free this memory
when the driver is detached. If the allocation fails set the 'range_table'
to 'range_unknown' instead of failing the driver attach.

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: das16: absorb das16_ai_disable()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:15 +0000 (16:17 -0700)]
staging: comedi: das16: absorb das16_ai_disable()

This function is only called by das16_cancel(). Absorb it to clarify code.

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: das16: remove unnecessary das16_ai_disable()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:14 +0000 (16:17 -0700)]
staging: comedi: das16: remove unnecessary das16_ai_disable()

The das16_ai_disable() function disables interrupts and the pacer clock. This
function is called by the subdevice (*cancel) operation.

The comedi core will not call a subdevice (*insn_read) operation while an
async command is running due to the s->busy check in parse_insn(). Since all
async commands are terminated by a (*cancel), the das16_ai_disable() is not
necessary in das16_ai_insn_read(). Remove it.

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: das16: absorb das16_ai_enable()
H Hartley Sweeten [Mon, 26 Jan 2015 23:17:13 +0000 (16:17 -0700)]
staging: comedi: das16: absorb das16_ai_enable()

This function is only called by das16_cmd_exec(). Absorb it to clarify code.

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: rtl8192u: Use put_unaligned_le16 in rtl819x_BAProc.c
Vaishali Thakkar [Tue, 27 Jan 2015 18:11:13 +0000 (23:41 +0530)]
Staging: rtl8192u: Use put_unaligned_le16 in rtl819x_BAProc.c

This patch introduces the use of function put_unaligned_le16.

This is done using Coccinelle and semantic patch used is as follows:

@a@
typedef u16, __le16, uint16_t;
{u16,__le16,uint16_t} e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
type T;
@@

- tmp = cpu_to_le16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__le16)\|sizeof(uint16_t)\|sizeof(e16)\));
+ put_unaligned_le16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: Refactor heavy nesting
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:24 +0000 (15:45 +0000)]
staging: rtl8192u: Refactor heavy nesting

This patch fixes warnings raised by checkpatch.pl relating to heavily indented
lines in r8192U_dm.c by refactoring code to achieve the same outcome indented by
one less tab.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: remove redundant code
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:23 +0000 (15:45 +0000)]
staging: rtl8192u: remove redundant code

This patch fixes warnings/errors raised by checkpatch.pl relating to redundant
code in r8192U_dm.c.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: fix whitespace and alignment
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:22 +0000 (15:45 +0000)]
staging: rtl8192u: fix whitespace and alignment

This patch fixes warnings/errors raised by checkpatch.pl relating to whitespace
in r8192U_dm.c, removes inconsistent whitespace, and additionally fixes some
vertical alignment issues.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: fix comments
Lorenzo Stoakes [Sat, 24 Jan 2015 15:45:21 +0000 (15:45 +0000)]
staging: rtl8192u: fix comments

This patch fixes errors raised by checkpatch.pl relating to use of C99 comments
in r8192U_dm.c, and cleans up existing ANSI C comments.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
Kumar Amit Mehta [Mon, 26 Jan 2015 15:39:14 +0000 (16:39 +0100)]
staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference

In rtw_check_bcn_info(), check the return value of kzalloc() before
dereferencing it, to avoid NULL pointer dereference.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: remove useless printing line
Heba Aamer [Wed, 28 Jan 2015 10:00:22 +0000 (12:00 +0200)]
staging: rtl8712: remove useless printing line

This patch removes an unneeded call to printk.

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: rework signal remove/insert to avoid sparse lock warnings
Zachary Warren [Sat, 17 Jan 2015 11:39:53 +0000 (22:39 +1100)]
staging: unisys: rework signal remove/insert to avoid sparse lock warnings

Avoids the following warnings from sparse:
visorchannel_funcs.c:457:9: warning:
 context imbalance in 'visorchannel_signalremove' - different lock contexts for basic block
visorchannel_funcs.c:512:9: warning:
 context imbalance in 'visorchannel_signalinsert' - different lock contexts for basic

These warnings are false positives. Sparse can't track conditional contexts. The change
puts the lock/unlock into the same context by splitting the insert/remove functions each
into a wrapper function that does locking if necessary and an inner function that does the
insert/remove operation.

Signed-off-by: Zachary Warren <conflatulence@gmail.com>
Acked-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lustre: mdc: lproc_mdc.c: Fix for potential NULL pointer dereference
Kumar Amit Mehta [Mon, 26 Jan 2015 15:44:53 +0000 (16:44 +0100)]
staging: lustre: lustre: mdc: lproc_mdc.c: Fix for potential NULL pointer dereference

In mdc_kuc_write(), OBD_ALLOC(lh, len) may leave 'lh' to NULL as kmalloc
may fail to allocate memory. This fix adds a check to avoid, dereferencing
a NULL pointer.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lustre: obdclass: obd_mount.c: Fix NULL dereference
Kumar Amit Mehta [Mon, 26 Jan 2015 16:52:22 +0000 (17:52 +0100)]
staging: lustre: lustre: obdclass: obd_mount.c: Fix NULL dereference

OBD_ALLOC_PTR(uuid) invokes kmalloc, which may return NULL. This fix
adds a check before dereferencing such pointer.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: libcfs: nidstrings: Change type in printf format string
Rickard Strandqvist [Tue, 27 Jan 2015 21:29:59 +0000 (22:29 +0100)]
staging: lustre: libcfs: nidstrings: Change type in printf format string

Wrong type in printf format string, requires 'unsigned int'
but the argument type is 'int'

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoiio: vadc: Qualcomm SPMI PMIC voltage ADC driver
Stanimir Varbanov [Tue, 20 Jan 2015 10:15:22 +0000 (12:15 +0200)]
iio: vadc: Qualcomm SPMI PMIC voltage ADC driver

The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has
15bits resolution and register space inside PMIC accessible across
SPMI bus.

The vadc driver registers itself through IIO interface.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoDT: iio: vadc: document dt binding
Stanimir Varbanov [Tue, 20 Jan 2015 10:15:21 +0000 (12:15 +0200)]
DT: iio: vadc: document dt binding

Document DT binding for Qualcomm SPMI PMIC voltage ADC
driver.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: magnetometer: ak8975: Add AK8963
Srinivas Pandruvada [Fri, 9 Jan 2015 23:30:38 +0000 (15:30 -0800)]
iio: magnetometer: ak8975: Add AK8963

Added AK8963 in the id table. Unfortunately some commercial devices
using caps version ak8963.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoimu: inv_mpu6050: cleanup on error check
Varka Bhadram [Thu, 22 Jan 2015 03:38:04 +0000 (09:08 +0530)]
imu: inv_mpu6050: cleanup on error check

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoimu: inv_mpu6050: use devm_request_irq
Varka Bhadram [Thu, 22 Jan 2015 03:38:03 +0000 (09:08 +0530)]
imu: inv_mpu6050: use devm_request_irq

This patch use the devres API for requesting an IRQ.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoimu: inv_mpu6050: use devm_iio_trigger_alloc
Varka Bhadram [Thu, 22 Jan 2015 03:38:02 +0000 (09:08 +0530)]
imu: inv_mpu6050: use devm_iio_trigger_alloc

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: accel: mma9551: split driver to expose mma955x api
Irina Tirdea [Sun, 11 Jan 2015 19:10:15 +0000 (21:10 +0200)]
iio: accel: mma9551: split driver to expose mma955x api

Freescale has the MMA955xL family of devices that use the
same communication protocol (based on i2c messages):
http://www.freescale.com/files/sensors/doc/data_sheet/MMA955xL.pdf.

To support more devices from this family, we need to split the
mma9551 driver so we can export the common functions that will
be used by other mma955x drivers.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: accel: mma9551: Add runtime pm support
Irina Tirdea [Sun, 11 Jan 2015 19:10:14 +0000 (21:10 +0200)]
iio: accel: mma9551: Add runtime pm support

Add support for runtime pm to reduce the power consumed by the device
when not used.

If CONFIG_PM is not enabled, the device will be powered on at
init and only powered off on system suspend.

If CONFIG_PM is enabled, runtime pm autosuspend is used:
- for raw reads will keep the device on for a specified time
- for events it will keep the device on as long as we have at least
one event active

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Remove IIO_EV_TYPE_INSTANCE
Irina Tirdea [Sun, 11 Jan 2015 19:10:12 +0000 (21:10 +0200)]
iio: core: Remove IIO_EV_TYPE_INSTANCE

By introducing IIO_EV_TYPE_CHANGE, IIO_EV_TYPE_INSTANCE becomes redundant.
The effect of IIO_EV_TYPE_INSTANCE can be obtained by using IIO_EV_TYPE_CHANGE
with IIO_EV_INFO_VALUE set to 1.

Remove all instances of IIO_EV_TYPE_INSTANCE and replace them with
IIO_EV_TYPE_CHANGE where needed.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce CHANGE event type
Irina Tirdea [Sun, 11 Jan 2015 19:10:11 +0000 (21:10 +0200)]
iio: core: Introduce CHANGE event type

A step detector will generate an interrupt each time N step are detected.
A device that has such pedometer functionality is Freescale's MMA9553L:
http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf.

Introduce IIO_EV_TYPE_CHANGE event type for events that are generated
when the channel passes a threshold on the absolute change in value.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce IIO_CHAN_INFO_CALIBWEIGHT
Irina Tirdea [Sun, 11 Jan 2015 19:10:10 +0000 (21:10 +0200)]
iio: core: Introduce IIO_CHAN_INFO_CALIBWEIGHT

Some devices need the weight of the user to compute other
parameters. One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that needs the weight of the user to compute the number of calories burnt.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce IIO_VELOCITY and IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z
Irina Tirdea [Sun, 11 Jan 2015 19:10:09 +0000 (21:10 +0200)]
iio: core: Introduce IIO_VELOCITY and IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z

Some devices export the current speed value of the user.

One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the speed of the user based on the number of steps and
stride length.

Introduce a new channel type VELOCITY and a modifier for the magniture or
norm of the velocity vector, IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce DISTANCE channel type
Irina Tirdea [Sun, 11 Jan 2015 19:10:08 +0000 (21:10 +0200)]
iio: core: Introduce DISTANCE channel type

Some devices export an estimation of the distance the user has covered
since the last reset.

One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the distance based on the stride length and step rate.

Introduce a new channel type DISTANCE to export these values.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: core: Introduce ENERGY channel type
Irina Tirdea [Sun, 11 Jan 2015 19:10:07 +0000 (21:10 +0200)]
iio: core: Introduce ENERGY channel type

Human activity sensors report the energy burnt by the user.
One of this devices is Freescale's MMA9553L
(http://www.freescale.com/files/sensors/doc/ref_manual/MMA9553LSWRM.pdf)
that computes the number of calories based on weight and step rate.

Introduce a new channel type ENERGY to export these values.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: as3935: Switch to PM ops
Lars-Peter Clausen [Sun, 11 Jan 2015 14:37:04 +0000 (15:37 +0100)]
iio: as3935: Switch to PM ops

Switch from the legacy suspend/resume callbacks to device pm ops.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: Added Capella cm3232 ambient light sensor driver.
Kevin Tsai [Fri, 16 Jan 2015 01:41:04 +0000 (17:41 -0800)]
iio: Added Capella cm3232 ambient light sensor driver.

CM3232 is an advanced ambient light sensor with I2C protocol interface.
The I2C slave address is internally hardwired as 0x10 (7-bit).  Writing
to configure register is byte mode, but reading ALS register requests to
use word mode for 16-bit resolution.

Signed-off-by: Kevin Tsai <ktsai@capellamicro.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-press: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:56:00 +0000 (10:56 -0800)]
iio: hid-sensor-press: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-incl-3d: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:59 +0000 (10:55 -0800)]
iio: hid-sensor-incl-3d: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-magn-3d: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:58 +0000 (10:55 -0800)]
iio: hid-sensor-magn-3d: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-prox: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:57 +0000 (10:55 -0800)]
iio: hid-sensor-prox: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-als: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:56 +0000 (10:55 -0800)]
iio: hid-sensor-als: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-gyro-3d: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:55 +0000 (10:55 -0800)]
iio: hid-sensor-gyro-3d: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid-sensor-accel-3d: Introduce PM
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:54 +0000 (10:55 -0800)]
iio: hid-sensor-accel-3d: Introduce PM

Use common hid sensor iio pm functions. Also the poll time read and
wait is part of power up function of hid sensor iio pm function, so
remove from the client drivers.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: hid_sensor_hub: Common PM functions
Srinivas Pandruvada [Wed, 7 Jan 2015 18:55:53 +0000 (10:55 -0800)]
iio: hid_sensor_hub: Common PM functions

To improvement power and performance, both regular and run time callbacks
are introduced. Because of auto suspend delay, two consecutive read
don't have to go through full power on/off procedure. The auto suspend
time can be adjusted using regular power attributes of PM sysfs.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agostaging: iio: tsl2x7x_core: fix format string warnings
Asaf Vertz [Tue, 20 Jan 2015 09:27:58 +0000 (11:27 +0200)]
staging: iio: tsl2x7x_core: fix format string warnings

Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agostaging: iio: ad5933: fix format string warnings
Asaf Vertz [Tue, 20 Jan 2015 07:25:22 +0000 (09:25 +0200)]
staging: iio: ad5933: fix format string warnings

Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/impedance-analyzer/ad5933.c:363]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format string (no. 4)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agostaging: iio: tsl2583: fix format string warnings
Asaf Vertz [Tue, 20 Jan 2015 10:43:38 +0000 (12:43 +0200)]
staging: iio: tsl2583: fix format string warnings

Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoDT: Add a vendor prefix for Cosmic Circuits
Ezequiel Garcia [Tue, 6 Jan 2015 20:47:37 +0000 (17:47 -0300)]
DT: Add a vendor prefix for Cosmic Circuits

Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoDT: iio: adc: Add CC_10001 binding documentation
Phani Movva [Tue, 6 Jan 2015 20:47:36 +0000 (17:47 -0300)]
DT: iio: adc: Add CC_10001 binding documentation

Add the devicetree binding document for Cosmic Circuits 10001 ADC device.

Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Phani Movva <Phani.Movva@imgtec.com>
Signed-off-by: Naidu Tellapati <Naidu.Tellapati@imgtec.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: light: cm32181: Fix typo 's/claibscale/calibscale/'
Roberta Dobrescu [Thu, 15 Jan 2015 22:24:41 +0000 (00:24 +0200)]
iio: light: cm32181: Fix typo 's/claibscale/calibscale/'

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: light: tcs3414: Fix misindented lines
Roberta Dobrescu [Thu, 15 Jan 2015 22:25:02 +0000 (00:25 +0200)]
iio: light: tcs3414: Fix misindented lines

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
9 years agoiio: industrialio-event: Fix typo 's/dynically/dynamically/'
Roberta Dobrescu [Thu, 15 Jan 2015 22:24:14 +0000 (00:24 +0200)]
iio: industrialio-event: Fix typo 's/dynically/dynamically/'

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>