Ana Calinov [Wed, 8 Jul 2015 12:44:42 +0000 (05:44 -0700)]
iio: accel: kxcjk-1013: Remove blank lines
This patch fixes the the following errors given by
checkpatch.pl with --strict:
Please don't use multiple blank lines.
Blank lines aren't necessary after an open brace '{'.
Signed-off-by: Ana Calinov <ana.calinov@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch renames the top half handler and the bottom half handler
of iio_triggered_buffer_setup() in accordance with their usage.
The bottom half has been renamed to reflect the fact that it is a
thread based call, compliant with iio_alloc_pollfunc().
The names of the parameters were swapped, thus creating confusion.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Tiberiu Breana [Wed, 24 Jun 2015 14:01:48 +0000 (17:01 +0300)]
iio: accel: Add buffer mode for Sensortek STK8312
Added triggered buffer mode support for the STK8312 accelerometer.
Additional changes:
- set_mode now sets operation mode directly, no longer masking
the register's previous value
- read_accel now returns raw acceleration data instead of the
sign_extend32 value
- read_raw will now enable/disable the sensor with each reading
Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Tiberiu Breana [Wed, 24 Jun 2015 13:54:46 +0000 (16:54 +0300)]
iio: accel: Add trigger support for STK8BA50
Add data-ready interrupts and trigger support for STK8BA50.
Additional changes:
- read_accel now returns raw acceleration data instead of the
sign_extend32 value
- read_raw will now enable/disable the sensor with each reading
Change-Id: I9c2d7be4256b2dcc5546e4432308ea54f8004333 Signed-off-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Tomasz Duszynski [Tue, 23 Jun 2015 18:45:48 +0000 (20:45 +0200)]
iio: pressure: ms5611: add support for MS5607 temperature and pressure sensor
MS5607 is temperature and pressure sensor which hardware is similar to MS5611.
Both sensors share command protocol and support both I2C and SPI serial
protocols. They only differ in compensation algorithms.
Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Tomasz Duszynski [Tue, 23 Jun 2015 18:45:47 +0000 (20:45 +0200)]
iio: pressure: ms5611: remove IIO_CHAN_INFO_SCALE from mask
IIO_CHAN_INFO_SCALE is useful whenever conversion to standard units is done
in userspace. In this case conversion is handled by driver so this bit
is unnecessary.
Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Antonio Borneo [Tue, 23 Jun 2015 14:52:28 +0000 (22:52 +0800)]
iio: ssp_sensors: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus
field of an spi_driver to spi_bus_type. These days this is done in
spi_register_driver(), so we can drop the manual assignment.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
To: Karol Wrona <k.wrona@samsung.com>
To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Karol Wrona <k.wrona@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Hartmut Knaack [Sun, 21 Jun 2015 10:18:09 +0000 (12:18 +0200)]
iio:adc:Kconfig: rework help descriptions
Rework the help text of several ADCs to make sure that:
- the module name is mentioned, if the driver can be built as a module
- "If unsure, say N" messages are dropped
- right indentation is maintained
Vlad Dogaru [Fri, 12 Jun 2015 08:31:39 +0000 (11:31 +0300)]
iio: magn: bmc150: add support for bmc156
The BMC156 is a slightly less capable version of BMC150 which lacks
support for magnetometer thresholds. Since this driver does not support
those anyway, adding support is trivial.
Datasheet is available at
https://ae-bst.resource.bosch.com/media/products/dokumente/bmc156_1/BST-BMC156-DS000-01.pdf
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: allow userspace to flush the hwfifo with non-blocking reads
This patch changes the semantics of non-blocking reads so that a
hardware fifo flush is triggered if the available data in the device
buffer is less then the requested size.
This allows userspace to accurately generate hardware fifo flushes, by
doing a non-blocking read with a size greater then the sum of the
device buffer and hardware fifo size.
Hartmut Knaack [Mon, 15 Jun 2015 21:48:26 +0000 (23:48 +0200)]
iio:accel:bmc150-accel: code style cleanup
Apply the following coding style changes as indicated by checkpatch.pl in
strict mode:
- Please don't use multiple blank lines
- braces {} should be used on all arms of this statement (if/else)
- Alignment should match open parenthesis
- Please don't use multiple blank lines
- Blank lines aren't necessary after an open brace '{'
- Missing a blank line after declarations
- No space is necessary after a cast
Also wrap/consolidate error messages to fit 80 characters per line and
rework a comment.
Hartmut Knaack [Mon, 15 Jun 2015 21:48:25 +0000 (23:48 +0200)]
iio:accel:bmc150-accel: make use of mask definition
BMC150_ACCEL_SLOPE_THRES_MASK was defined some time ago, but its 'magic'
value got used instead in bmc150_accel_write_event(). Make use of it for
improved readability.
Hartmut Knaack [Wed, 17 Jun 2015 22:32:03 +0000 (00:32 +0200)]
iio:light:cm3323: replace unneeded variable
In cm3323_read_raw() i is used as return variable for the integration time
index. The also existing return variable ret however is unused in this
case, although appropriate. Replace i with ret and drop it.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: accel: mma9551_core: use size in words for word buffers
Change the prototype for the mma9551_read/write_*_words functions
to receive the length of the buffer in words (instead of bytes) since
we are using a word buffer. This will prevent users from sending an
odd number of bytes for a word array.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Naidu Tellapati [Thu, 7 May 2015 21:24:02 +0000 (18:24 -0300)]
iio: adc: cc10001: Power-up the ADC at probe time when used remotely
The ADC is typically shared with remote CPUs not running Linux.
However, there is only one register to power-up/power-down. Remote CPUs
aren't able to power-up the ADC, and rely in Linux doing it instead.
This commit uses the adc-reserved-channels devicetree property to
distinguish shared usage. In this case, the ADC is powered up at
probe time.
If the ADC is used only by the CPU running Linux, power-up/down
at runtime, only when neeeded.
James Simmons [Thu, 11 Jun 2015 19:18:12 +0000 (15:18 -0400)]
staging:lustre: separate kernel and user land defines in the LNet headers
Currently the lnet headers used by user land contain various internal
LNet structures that are only used by kernel space. Move the user land
structures to headers used by user land. The kernel structures are
relocated to headers that are never exposed to user land.
Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Simmons [Thu, 11 Jun 2015 19:18:11 +0000 (15:18 -0400)]
staging:lustre: move LNet NID macros to LNet layer
Currently several special macros LNet NID macros exist
in libcfs.h and libcfs_private.h. Move those macros
out to the lnet header types.h. The new lnet header
nidstr.h contains LNet NID string data that can be
used by user land LNet utilities and the LNet kernel
drivers.
Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Thu, 11 Jun 2015 19:18:10 +0000 (15:18 -0400)]
staging:lustre: merge socklnd_lib-linux.h into socklnd.h
Originally socklnd_lib-linux.h contained linux specific
wrappers and defines but since the linux kernel is the
only supported platform now we can merge what little
remains in the header into socklnd.h. This is broken
out of the original patch 12932 that was merged to the
Intel/OpenSFS branch.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/12932 Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Thu, 11 Jun 2015 19:18:09 +0000 (15:18 -0400)]
staging:lustre: rename socklnd_lib-linux.c
With the move to support only the linux kernel their is
no need to keep "linux" in the socklnd source file names.
This is broken out of the original patch 12932 that was
merged to the Intel/OpenSFS branch.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/12932 Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Oleg Drokin [Thu, 11 Jun 2015 05:37:51 +0000 (01:37 -0400)]
staging/lustre/llite: fix ll_getname user buffer copy
strncpy_from_user could return negative values on error,
so need to take those into account.
Since ll_getname is used to get a single component name from userspace
to transfer to server as-is, there's no need to allocate 4k buffer
as done by __getname. Allocate NAME_MAX+1 buffer instead to ensure
we have enough for a null terminated max valid length buffer.
This was discovered by Al Viro in https://lkml.org/lkml/2015/4/11/243
It uses getname in unsafe manner and since it's to deal with corrupted
or inconsistent filesystem, we are probably better to deal with
it from lfsck anyway.
Merge tag 'iio-for-v4.2c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Third round of new IIO drivers, cleanups and functionality for the 4.2 cycle.
Given Linus announced a 4.8rc coming up, hopefully time for one more
lot of IIO patches this cycle. Some of these are actually
improvements / fixes for patches earlier in the cycle.
New device support
* st_accel driver - support devices with 8 bit channels.
Cleanup
* A general cleanup of the iio tools under /tools/ from Hartmut.
I'm more than a little embarassed by how bad some of these were! Are well,
much more refined and less bug prone now.
These cover lots of stuff like unhandled error returns, memory leaks as
well as general refactoring to tidy the code up.
* iio_simple_dummy - fix memory leaks in the init functions, drop some
pointless error returns from functions that never generate errors and
make the module parameter explicitly unsigned.
* More buffer handling reworks from Lars-Peter, this time targetting hardware
buffers (a little used corner that looks likely to get more use in the near
future). Specifically:
- Always compute the masklength as inkernel buffer users may need it.
- Add a means of labeling which buffer modes a given buffer implementation
supports.
- In the case of hardware buffers, require strict scan matching rather than
matching to a superset. Currently the demux is bypassed by these drivers
(this may well not change for efficiency reasons) so allowing a superset
of channels to be selected would otherwise lead to more data than requested
confusing userspace.
Driver funcationality improvments
* mmc35240 - adds a compensation to the raw values as borrowed form Memsic's
own input driver.
* mma8452
- event support
- event debouncing
- high pass filter configuration
- triggers
* vf610 - allow conversion mode to be adjusted
Fixlets
* mmc35240
- Off by one error that by coincidence had no real effect.
- i2c_device_name should be lowercase.
- Lack of null terminator at end of attributes array.
- Avoid computing the fractional part of the magnetic field by moving
the scaling into userspace where floating point is available to simplify
the maths.
- Use a smaller sleep before assuming the measurement is done. This is
safe and improves the possible polling rate.
- Fix sensitivity on z-axis - datasheet disagrees with Memsic's releasedd
code and the value used in the code seems to be correct.
* stk3310 - make a local variable signed to ensure error handling works.
* twl4030
- fix calculation of the temperature sense current - bug unlikely
to have ever been noticed as the difference is small.
- Fix errors in descriptions.
staging: rtl8188eu: eliminate spaces before commas
Eliminate "space prohibited before that ','" errors found by checkpatch,
but do this only to lines which after the patch is applied do not
exceed 80 characters. Out of that only those lines are changed, whose
context does not exceed 80 characters in each line. In other words the
changes are limited to cases where the patch generated is itself
checkpatch-correct.
Zoltán Lajos Kis [Wed, 10 Jun 2015 20:00:17 +0000 (22:00 +0200)]
Staging: lustre: fix space before and after comma in dt_object.c
Fixes a space prohibited before that ',' and space required after
that ',' error in lustre/lustre/obdclass/dt_object.c that were
found by the checkpatch.pl tool.
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Zoltán Lajos Kis [Wed, 10 Jun 2015 20:00:16 +0000 (22:00 +0200)]
Staging: lustre: fix braces are not necessary in dt_object.c
Fixes a braces {} are not necessary for any arm of this statement
warning in lustre/lustre/obdclass/dt_object.c that was found by
the checkpatch.pl tool.
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Simmons [Tue, 9 Jun 2015 02:27:11 +0000 (22:27 -0400)]
staging:lustre: use available kernel wrappers in lib-socket.c
Instead of handling calls to struct proto ourselves we can use
equivalent kernel wrappers. No wrapper exist for unlocked ioctl
handling so we create one here for our use. I expect some day
that function will be integrated into sock.c.
Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Simmons [Tue, 9 Jun 2015 02:27:10 +0000 (22:27 -0400)]
staging:lustre: rename tcpip handling functions to lnet_* prefix
With all the TCPIP handling done in the lnet layer we should
rename all the functions with the prefix lnet_*. One other
change done was changing the remove argument of lnet_sock_getaddr
from a int to a bool.
Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Another one of those silly one line wrappers which is not
needed. Replace libcfs_sock_abort_accept wrapper with a
direct call to wake_up_all on the lnet_acceptor_state sock.
Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: wilc1000: fix build warning related to time_after_eq macro
This patch fixes a build warning related to the use of the time_after_eq
macro.Adding a typecast to the second argument suppresses the
warning.This warning was created by one my previous patch.
Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The code is actually correct, it's just that these lines were pushed in
an extra indent level by mistake in 35e33b0468ab ('staging: rtl8192e:
Fix LONG_LINE warnings').
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>