When a hid sensor module is removed and modprobed again we see
error for unbalanced pm_runtime. This issue is caused by not
deactivating runtime PM on removal. So on modprobe again when
activated again, this will print this error.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fabrice Gasnier [Fri, 31 Mar 2017 12:32:38 +0000 (14:32 +0200)]
iio: adc: stm32: add dt option to set resolution
stm32 adc supports several resolution. Add 'assigned-resolution-bits'
dt optional property to set it. Default to maximum resolution in case
it isn't set.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Merge tag 'iio-for-4.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Third set of new device support, cleanups and features for IIO in the 4.12 cycle
Somewhat dominated in patch numbers of last of the outreachy application
window related patches (they are still coming, despite window being closed
which is good to see!)
Good set of new drivers as well.
New device support
* ASPEED ADC
- new driver
* cpcap PMIC ADC
- new driver
* hid-humidity
- driver for HID compatible humidity sensors.
* ltc2497 ADC
- new driver
* mpu6050
- bring bindings up to date and add trivial support for 9250
* rockchip-saradc
- update bindings to cover rk3328
* vl6180 light, proximity and time of flight sensor.
- new driver
Features
* meson-saradc
- add calibration
Cleanup and minor fixes
* ad5504
- constify attribute_group structure
- drop casting of void *
* ad7150
- replace some shifts of 1 by BIT macro usage
* ad7152
- blank lines between function definitions
* ad7280a
- octal permissions.
* ad7606
- replace use of core mlock mutex with a local lock
* ad7746
- replace some shifts of 1 by BIT macro usage
- function parameter alignment
- drop some excessive brackets (introduced in last pull request)
* ad7753
- white space cleanup
* ad7754
- includes in alphabetical order and groupped appropriately.
- change from missuse of internal mlock mutex to using the buffer lock to
also protect values during frequency update.
* ad779x
- constify attribute_group structures
* ad9832
- octal permissions
* adis16060
- remove use of core mlock mutex in favour of adding a local
_spi_write_then_read which can use the local buffer protection lock.
- fix naming of above function.
* adis16203
- remove locking during reads of calibbias that doesn't protect anything
not protected elsewhere.
* adis16209
- remove unnecessary braces in single statement if
* adis16240
- remove unnecessary braces in single statement if
* adt7136
- drop excess blank lines and put some in between functions.
* ams-iaq
- replace comma with semi colon. Not actual bug, just unusual syntax.
* apds9960
- constify attribute group structure
* as3935
- constify attribute group structure
* bm1750
- constify attribute group structure
* cros_ec
- devm version of triggered buffer setup to simplify code.
* exynos
- drop casting of void *
* hdc100x
- constify attribute_group structure
* hid-accel
- fix wrong scale for newly introduced gravity sensor.
* hts221
- drop casting of void *
* hx711
- constify attribute_group structure
* imx7d_adc
- drop casting of void *
* lm35333
- constify attribute_group structure
* lsm6dsx
- drop casting of void *
- hold ODR configuration until enabling to avoid a race condition.
* max1027
- drop casting of void *
* max11100
- fix a comma where semicolon was intended (no actual bug, just odd)
* max1363
- constify attribute_group structure
* ms sensors
- drop casting of void *
* rockchip_saradc
- drop casting of void *
* sun4i-gpadc
- fix missing dependency on THERMAL or presence of stubs (issue only
introduced in pervious set)
- drop casting of void *
* tsl2x7x
- fix wrong standard deviation calc. Note these aren't actually used for
anything at the moment so bug didn't really matter.
- constify attribute group structure.
* vf610adc
- drop casting of void *
* vz89x
- replace comma with semicolon. Not actual bug, just odd syntax.
* zpa2326
- drop casting of void *
iio: imu: st_lsm6dsx: do not apply ODR configuration in write_raw handler
This patch allows to avoid a transitory that occurs when a given sensor
has been already enabled (e.g. gyroscope) and the user is configuring
the sample frequency of the other one (e.g. accelerometer).
The transitory lasts until the accelerometer is enabled.
During that time slice the gyroscope ODR is incorrectly modified as well.
At the end of the transitory both sensors work at the right frequency.
Fix it introducing st_lsm6dsx_check_odr() routine to check ODR consistency
in write_raw handler in order to apply frequency configuration just
in st_lsm6dsx_set_odr()
Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Arnd Bergmann [Tue, 28 Mar 2017 10:07:23 +0000 (12:07 +0200)]
iio: adc: sun4i: add THERMAL dependency
With CONFIG_THERMAL=m and CONFIG_SUN4I_GPADC=y, we get a link error
from calling devm_thermal_zone_of_sensor_register:
drivers/iio/built-in.o: In function `sun4i_gpadc_probe':
:(.text+0x1c284): undefined reference to `devm_thermal_zone_of_sensor_register'
This adds a Kconfig dependency to ensure we can only have the ADC
driver as built-in when this function is also built-in, or when
we see the empty stub implementation. When the thermal code is
a module, we can still build the adc driver as a module, too.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d1caa99055382 ("iio: adc: add support for Allwinner SoCs ADC") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds support for the Analog Devices / Linear Technology
LTC2497 ADCs. The LTC2497 is a 16-channel (eight differential),
16-bit, high precision, delta-sigma ADC with an automatic, differential,
input current cancellation front end and a 2-wire, I2C interface.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Jonathan Cameron [Sun, 26 Mar 2017 11:11:00 +0000 (12:11 +0100)]
iio:imu:mpu6050 add explicit mpu9250 support
The mpu9250 is a SIP containing an mpu6500 and an ak8975. If this was all
there was too it there would be no need for explicit handling in the driver.
Arguably the bindings would also only reflect the presence of an mpu6500 with
the ak8975 hanging off it, as the kernel doesn't care that they are in one
package.
However, the WHOAMI value changes as well so best to add explicit support.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Jonathan Cameron [Sun, 26 Mar 2017 11:10:59 +0000 (12:10 +0100)]
iio:imu:mpu6050 update i2c bindings to reflect i2c-gate and supported parts
These bindings are somewhat lagging the state of the driver. The i2c-gate
bindings are documented elsewhere, but it seems sensible to at least have
an example and cross reference in here. SPI bindings will need to be the
subject of a future patch.
Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Rob Herring <robh@kernel.org>
iio: pressure: zpa2326: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: imu: st_lsm6dsx: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: humidity: hts221: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: dac: ad5504: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: common: ms_sensors: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T*)x)->f
|
- (T*)
e
)
Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:
Rick Altherr [Tue, 28 Mar 2017 21:52:59 +0000 (14:52 -0700)]
iio: Aspeed ADC
Aspeed BMC SoCs include a 16 channel, 10-bit ADC. Low and high threshold
interrupts are supported by the hardware but are not currently implemented.
Signed-off-by: Rick Altherr <raltherr@google.com> Tested-by: Xo Wang <xow@google.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Rick Altherr [Tue, 28 Mar 2017 21:52:58 +0000 (14:52 -0700)]
Documentation: dt-bindings: Document bindings for Aspeed ADC
Signed-off-by: Rick Altherr <raltherr@google.com> Acked-by: Joel Stanley <joel@jms.id.au> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:
Tony Lindgren [Fri, 24 Mar 2017 03:38:42 +0000 (20:38 -0700)]
iio: adc: cpcap: Add minimal support for CPCAP PMIC ADC
On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC
has ADCs that are used for battery charging and USB PHY VBUS and ID pin
detection.
Unfortunately the only documentation for this ADC seems to be the
Motorola mapphone Linux kernel tree. I have tested that reading raw and
scaled values works, but I have not used the timed sampling that the ADC
seems to support.
Let's add a minimal support for it so we can eventually provide IIO
channels for the related battery charging and USB PHY drivers.
Cc: devicetree@vger.kernel.org Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Gargi Sharma [Thu, 30 Mar 2017 09:33:46 +0000 (15:03 +0530)]
staging: iio: update locking method during frequency writes
The driver needs to insure atomicity during frequency
changes of bus and device. The iiodev->mlock as used
was not doing that. Replace it with the drivers existing
buffer lock and introduce an auxiliary spi_write() that does
not hold the lock.
Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Arushi Singhal [Thu, 30 Mar 2017 12:41:22 +0000 (18:11 +0530)]
drivers: iio: chemical: replace comma with a semicolon
Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Arushi Singhal [Thu, 30 Mar 2017 12:46:03 +0000 (18:16 +0530)]
iio: adc: replace comma with a semicolon
Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant.
Done using coccinelle:
Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:
Check for attribute_group structures that are only stored in the
event_attrs filed of iio_info structure. As the event_attrs field of
iio_info structures is constant, so these attribute_group structures can
also be declared constant. Done using coccinelle:
Tobin C. Harding [Mon, 27 Mar 2017 23:28:37 +0000 (10:28 +1100)]
staging: dgnc: remove unnecessary comments
TODO file lists task to remove unnecessary comments.
Make initial attempt at removing unnecessary comments. Choose not to
be to vicious in removal. We can remove more once the driver is
cleaned up/tested some more.
For functions with internal linkage, reduce the function comment where
possible. For functions with external linkage, migrate the function
comment to kernel doc format.
Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tobin C. Harding [Mon, 27 Mar 2017 23:28:36 +0000 (10:28 +1100)]
staging: dgnc: remove double underscore
Pre-processor header guards use double underscore, typically kernel
code uses single underscore when defining header guards. 'endif'
statement should include what is ending as a comment string.
Remove double underscore, add comment string to 'endif'
Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:35:01 +0000 (09:35 -0400)]
staging: unisys: visorbus: Have unisys_vmcall return Linux error instead of VMCALL error
The function unisys_vmcall was returning VMCALL specific errors and the
calling code was ignoring which error was actually returned. Instead we
should be mapping the VMCALL error into a proper Linux error and then
returning that, since we now have an error we know what to do with, we
don't have to drop it but we can send it up the stack.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The comment at the beginning of the vmcallinterface.h file references IO
Virtualization. It should be more specific that it is referencing s-Par
Virtualization.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:54 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling to chipset_device_pause/resume
If there is an error in chipset_device_pause/resume don't try to respond,
error out and let the calling functions respond to this error just like
any other error they encounter.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:46 +0000 (09:34 -0400)]
staging: unisys: visorbus: get rid of create_bus_type.
Create bus_type was just calling register_bustype. Since we control how
many times we call create_bus_type it was extraneous keeping a counter if
the bus was already registered, so the functions were no longer needed.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:40 +0000 (09:34 -0400)]
staging: unisys: visorbus: move vbuschannel_print_devinfo from .h to .c file
Move vbuschannel_print_devinfo from vbuchannel.h to visorbus_main.c since
it is only referenced in visorbus_main.c. Since it is in a .c file, get
rid of the inline for it.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:38 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling for chipset_device_create
Adds error handling to the chipset_device_create message. If it returns
a failure, it is assumed it has not signaled the s-Par firmware of the
failure and the caller must do that.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:37 +0000 (09:34 -0400)]
staging: unisys: visornic: add error handling for visorchannel_signalinsert/remove
Since signalinsert/remove now return valid error codes, we need to check
them when we call them in visornic. The error codes need to propagate out
to the calling functions.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:29 +0000 (09:34 -0400)]
staging: unisys: visorbus: remove invalid comment, we are one driver.
Removed a comment that was describing the relationship between the
visorchipset driver and the visorbus driver. Since they are now one
driver the comment no longer makes sense.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:28 +0000 (09:34 -0400)]
staging: unisys: visorbus: move bus_device_info_init to visorbus_main.c
The function bus_device_info_init was defined in visorbus_private.h. The
only file that uses it is visorbus_main.c so move the function into the .c
file instead.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Kershner [Tue, 28 Mar 2017 13:34:21 +0000 (09:34 -0400)]
staging: unisys: visorbus: add error handling for parahotplug_request_kickoff
The function kobject_uevent_env returns an error we shouldn't just drop it
on the floor but we should report it back to the caller. Since it now
returns an error, need to add proper error handling to
parahotplug_process_message.
Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Cox [Mon, 27 Mar 2017 15:14:07 +0000 (16:14 +0100)]
atomisp: kill another define
We don't need an ifdef for the sake of 8-12 bytes. Avoid the ifdef added by fde469701c7efabebf885e785edf367bfb1a8f3f. Instead turn it into a single const
string array at a fixed location thereby saving even more memory.
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arushi Singhal [Fri, 24 Mar 2017 11:29:59 +0000 (16:59 +0530)]
staging: speakup: Remove the explicit NULL comparison
Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.