Philipp Zabel [Wed, 19 Jul 2017 15:25:35 +0000 (17:25 +0200)]
iio: adc: rockchip_saradc: explicitly request exclusive reset control
Commit
a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-iio@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Philipp Zabel [Wed, 19 Jul 2017 15:25:36 +0000 (17:25 +0200)]
iio: dac: stm32-dac-core: explicitly request exclusive reset control
Commit
a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:27 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add threshold event support
The ADS1015 device provides programmable comparator that can issue an
interrupt on the ALERT pin. This change adds the iio threshold event
support for that feature.
The ADS1015 device only have a single config register which contains an
input multiplexer selection, comparator settings, and etc. So only a
single event channel can be enabled at a time. Also enabling both buffer
and event are prohibited for simplicity.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:26 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: use iio_device_claim_direct_mode()
While the iio buffer for the ti-ads1015 driver is enabled, reading the
raw ADC channel data is restricted. We usually use the
iio_device_claim_direct_mode()/iio_device_release_direct_mode() pair for
that.
This change consequently reverses the locking order for the driver's
private lock and indio_dev->mlock which acquired by
iio_device_claim_direct_mode() internally. But it's safe because there is
no other dependency between these locks.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:25 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: use devm_iio_triggered_buffer_setup
Use devm_iio_triggered_buffer_setup to simplify the error path in the
probe() and remove() function.
This changes the remove order, but the end result of remove function
actually does the reverse of probe.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:24 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add helper to set conversion mode
This adds a helper function to set conversion mode as there are a fair
number of users.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:23 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: remove unnecessary config register update
The ti-ads1015 driver has eight iio voltage channels and each iio channel
can hold own scale information.
The ADS1015 device only have a single config register which contains an
input multiplexer selection, PGA and data rate settings. So the driver
should load the correct settings when the input multiplexer selection is
changed.
However, regardless of which channlel is currently selected, changing any
iio channel's scale information immediately overwrites the current PGA
setting in the config register.
It is harmless because the correct PGA settings are reloaded just before
getting adc result anyway. But it is unnecessary register update and
should be removed.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:22 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add adequate wait time to get correct conversion
This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously. So this driver
inserts a wait time before reading the conversion register if the
configuration is changed from a previous request.
Currently, the wait time is only the period required for a single
conversion that is calculated as the reciprocal of the sampling frequency.
However we also need to wait for the the previous conversion to complete.
Otherwise we probably get the conversion result for the previous
configuration when the sampling frequency is lower.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:21 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks
pm_runtime_get_sync() and pm_runtime_put_autosuspend() return 0 on
success, 1 if the device's runtime PM status was already requested status
or error code on failure. So a positive return value doesn't indicate an
error condition.
However, any non-zero return values from buffer preenable and postdisable
callbacks are recognized as an error and this driver reuses the return
value from pm_runtime_get_sync() and pm_runtime_put_autosuspend() in
these callbacks. This change fixes the false error detections.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:20 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: avoid getting stale result after runtime resume
This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously. So this driver
doesn't insert a wait time before reading the conversion register if the
configuration is not changed from a previous request.
This assumption is broken if the device is runtime suspended and entered
a power-down state. The forthcoming request causes reading a stale result
from the conversion register as the device is runtime resumed just before.
Fix it by adding a flag to detect that condition and insert a necessary
wait time.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:19 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set
The ADS1015 device have two operating modes, continuous conversion mode
and single-shot mode. This driver assumes that the continuous conversion
mode is selected by runtime resume callback when the ADC result is
requested.
If CONFIG_PM is disabled, the device is always in the default single-shot
mode and no one begins a single conversion. So the conversion register
doesn't contain valid ADC result. Fix it by changing the continuous mode
in probe function.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:18 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: fix scale information for ADS1115
The ti-ads1015 driver supports ADS1015 and ADS1115 devices. The same
scale information is used for both devices in this driver, however they
have actually different values and the ADS1115's one is not correct.
These devices have the same full-scale input voltage range for each PGA
selection. So instead of adding another hardcoded scale information,
compute a correct scale on demand from each device's resolution.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Akinobu Mita [Thu, 20 Jul 2017 15:24:17 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: fix incorrect data rate setting update
The ti-ads1015 driver has eight iio voltage channels and each iio channel
can hold own sampling frequency information.
The ADS1015 device only have a single config register which contains an
input multiplexer selection, PGA and data rate settings. So the driver
should load the correct settings when the input multiplexer selection is
changed.
However, regardless of which channlel is currently selected, changing any
iio channel's sampling frequency information immediately overwrites the
current data rate setting in the config register.
It breaks the current data rate setting if the different channel's sampling
frequency information is changed because the data rate setting is not
reloaded when the input multiplexer is switched.
This removes the unexpected config register update and correctly load the
data rate setting before getting adc result.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andy Shevchenko [Fri, 28 Jul 2017 22:20:14 +0000 (01:20 +0300)]
iio: adc: ti-ads7950: Allow to use on ACPI platforms
ACPI enabled platforms do not have a mean of regulators. Instead we use
hard coded voltage value for reference pin. When value is 0 (default) we
fall back to request a regulator.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Michał Mirosław [Thu, 17 Aug 2017 13:56:12 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: debug AMI306 calibration data
Use AMI306 calibration data for randomness and debugging.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Michał Mirosław [Thu, 17 Aug 2017 13:56:11 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: mark INT_CLEAR as precious
Reading INT_CLEAR has side effects - disallow reading it via debugfs.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Michał Mirosław [Thu, 17 Aug 2017 13:56:11 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: add_device_randomness (serial number)
Mix device-specific data into randomness pool.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Michał Mirosław [Thu, 17 Aug 2017 13:56:10 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: support AMI306 variant
Add support for AMI306 magnetometer - very similar to AMI305.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Arvind Yadav [Sat, 19 Aug 2017 18:47:38 +0000 (00:17 +0530)]
iio: light: tsl2583: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Arvind Yadav [Sat, 19 Aug 2017 18:47:37 +0000 (00:17 +0530)]
iio: light: apds9300: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Arvind Yadav [Sat, 19 Aug 2017 18:47:36 +0000 (00:17 +0530)]
iio: accel: bma180: constify i2c_device_id
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Narcisa Ana Maria Vasile [Thu, 17 Aug 2017 11:34:29 +0000 (14:34 +0300)]
iio: chemical: ccs811: Add triggered buffer support
A software trigger such as hrtimer can be used to capture the data
that will be stored in the buffer.
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andreas Klinger [Wed, 16 Aug 2017 19:34:54 +0000 (21:34 +0200)]
iio: srf08: add support for srf02 in i2c mode
srf02 added with support for i2c interface
Attributes for setting max range or sensitivity are omitted for the case of
srf02 type sensor, because they are not supported by the hardware.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andreas Klinger [Wed, 16 Aug 2017 19:34:23 +0000 (21:34 +0200)]
iio: srf08: add sensor type srf10
Ultrasonic sensor srf10 is quite similar to srf08 and now also supported by
the driver as device tree compatible string.
It was necessary to prepare the source for supplementary sensors. This is
done by enum srf08_sensor_type.
The most significiant difference between srf08 and srf10 is another range
and values of register gain (in the driver it's call sensitivity).
Therefore the array of it is extended and dependent of the sensor type.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andreas Klinger [Wed, 16 Aug 2017 19:34:06 +0000 (21:34 +0200)]
iio: srf08: add triggered buffer support
Add support for triggered buffers.
Data format is quite simple:
distance 16 Bit
alignment 48 Bit
timestamp 64 Bit
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andreas Klinger [Wed, 16 Aug 2017 19:33:47 +0000 (21:33 +0200)]
iio: srf08: add device tree table
Added MODULE_DEVICE_TABLE for device tree bindings.
It used to work without it by using the i2c_device_id table, but adding the
table makes everything clear and documented.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Wed, 16 Aug 2017 17:02:53 +0000 (19:02 +0200)]
dt-bindings: iio: magn: add LIS2MDL sensor device binding
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Wed, 16 Aug 2017 17:02:52 +0000 (19:02 +0200)]
iio: magnetometer: add support to LIS2MDL
add support to STMicroelectronics LIS2MDL magnetometer in
st_magn framework
http://www.st.com/resource/en/datasheet/lis2mdl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Arnd Bergmann [Tue, 15 Aug 2017 14:46:31 +0000 (16:46 +0200)]
iio: adc: select triggered buffer for sama5d2 adc
Without the triggered buffer code, we get a link error:
drivers/iio/adc/at91-sama5d2_adc.o: In function `at91_adc_probe':
at91-sama5d2_adc.c:(.text+0x938): undefined reference to `devm_iio_triggered_buffer_setup'
This adds a Kconfig 'select' statement like other ADC
drivers have it already.
Fixes:
5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Fri, 11 Aug 2017 19:44:14 +0000 (21:44 +0200)]
iio: accel: st_accel: fix data-ready line configuration
Remove int2 configuration parameter for LIS3DH, LSM303DLHC, LSM330D,
LSM330DL, LSM330DLC, LSM303AGR, LIS2DH12 and LNG2DM since these devices
export just int1 as data-ready line
Fixes:
23cde4d65cc7 (iio: Added platform data to select the DRDY pin)
Fixes:
dcdb0a78cab3 (iio: accel: st_accel: add support to lng2dm)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Fri, 11 Aug 2017 19:44:13 +0000 (21:44 +0200)]
iio: pressure: st_pressure: fix drdy configuration for LPS22HB and LPS25H
Remove int2 configuration parameter for LPS22HB and LPS25H since
these devices export just int1 as data-ready line
Fixes:
931878405b86 (iio:pressure: Add support for LPS25H pressure sensor)
Fixes:
e039e2f5b4da (iio:st_pressure:initial lps22hb sensor support)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Sai Krishna Potthuri [Thu, 10 Aug 2017 06:30:20 +0000 (08:30 +0200)]
iio: adc: xadc: Fix coding style violations
This patch fix following checkpatch warnings in xadc driver
1. prefer 'unsigned int' to bare use of 'unsigned'.
2. else is not generally useful after a break or return.
3. fill all function definition arguments with identifier name
Signed-off-by: Sai Krishna Potthuri <lakshmis@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Gustavo A. R. Silva [Wed, 9 Aug 2017 15:38:56 +0000 (10:38 -0500)]
staging: iio: adc: fix error return code in ad7606_par_probe()
platform_get_irq() returns an error code, but the ad7606_par driver
ignores it and always returns -ENODEV. This is not correct and,
prevents -EPROBE_DEFER from being propagated properly.
Print and propagate the return value of platform_get_irq on failure.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andy Yan [Wed, 2 Aug 2017 08:52:33 +0000 (16:52 +0800)]
dt-bindings: adc: add description for rv1108 saradc
Add device tree bindings document for saradc on
rockchip rv1108 soc.
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fabrice Gasnier [Thu, 3 Aug 2017 09:14:14 +0000 (11:14 +0200)]
iio: trigger: stm32-timer: add output compare triggers
Add output compare trigger sources available on some instances.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fabrice Gasnier [Thu, 3 Aug 2017 09:14:13 +0000 (11:14 +0200)]
iio: trigger: stm32-timer: add support for STM32H7
Add support for STM32H7 timer triggers:
- Add new valids_table
- Introduce compatible, with configuration data
- Extend up to 15 timers, available on STM32H7
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fabrice Gasnier [Thu, 3 Aug 2017 09:14:12 +0000 (11:14 +0200)]
dt-bindings: iio: timer: stm32: add support for STM32H7
STM32H7 has slightly different triggers than previous versions.
Introduce st,stm32h7-timer-trigger compatible to handle this new variant.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andy Shevchenko [Sat, 29 Jul 2017 00:36:05 +0000 (03:36 +0300)]
iio: tools: add install section
Allow user to call install target.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andy Shevchenko [Sat, 29 Jul 2017 00:36:04 +0000 (03:36 +0300)]
iio: tools: move to tools buildsystem
There is a nice buildsystem dedicated for userspace tools in Linux kernel tree.
Switch iio target to be built by it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andy Shevchenko [Fri, 28 Jul 2017 22:20:15 +0000 (01:20 +0300)]
iio: adc: ti-ads7950: Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
SPI device registered via OF will always match a legacy SPI device ID and
that the MODALIAS reported will always be of the form spi:<device>.
There is an ACPI method to enumerate such devices via specific ACPI ID
and use of compatible strings. It will not work for the drivers which
have no OF match ID table present.
Besides this could change in the future so the correct approach is to
have an OF device ID table if the devices are registered via OF.
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fabrice Gasnier [Mon, 24 Jul 2017 16:10:40 +0000 (18:10 +0200)]
iio: adc: stm32: add optional st,min-sample-time-nsecs
STM32 ADC allows each channel to be sampled with a different sampling time,
by setting SMPR registers. Basically, value depends on local electrical
properties. Selecting correct value for sampling time highly depends on
analog source impedance. There is a manual that may help in this process:
'How to get the best ADC accuracy in STM32...'
This patch allows to configure minimum sampling time via device tree,
either for:
- all channels at once:
st,min-sample-time-nsecs = <10000>;
- independently for each channel (must match "st,adc-channels" list):
st,adc-channels = <0 1>;
st,min-sample-time-nsecs = <5000 10000>;
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fabrice Gasnier [Mon, 24 Jul 2017 16:10:39 +0000 (18:10 +0200)]
dt-bindings: iio: adc: stm32: add optional st,min-sample-time-nsecs
STM32 ADC allows each channel to be sampled with a different sampling
time. There's an application note that deals with this: 'How to get
the best ADC accuracy in STM32...' It basically depends on analog input
signal electrical properties (depends on board).
Add optional 'st,min-sample-time-nsecs' property so this can be tuned
in dt.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Dan Carpenter [Tue, 18 Jul 2017 09:30:10 +0000 (12:30 +0300)]
staging: fbtft: array underflow in fbtft_request_gpios_match()
"val" can be negative, so we'd write before the start of the
par->gpio.db[] array.
Fixes:
c296d5f9957c ("staging: fbtft: core support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jacob von Chorus [Fri, 28 Jul 2017 21:06:18 +0000 (17:06 -0400)]
staging: gs_fpgaboot: return valid error codes
The return values on error are modified to be valid error codes. Theses
error codes are propagated back to the init function's return.
Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jacob von Chorus [Fri, 28 Jul 2017 21:06:17 +0000 (17:06 -0400)]
staging: gs_fpgaboot: change char to u8
The bitstream storage variables were changed from char to u8 arrays to
prevent issues such as negative lengths. This change makes the code
compatible with the "data" field in "struct firmware" which is of type
u8.
Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jacob von Chorus [Fri, 28 Jul 2017 21:06:16 +0000 (17:06 -0400)]
staging: gs_fpgaboot: add buffer overflow checks
Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
The amount of data read into these buffers is controlled by a length
field in the bitstream file read from userspace. If a corrupt or
malicious firmware file was supplied, kernel data beyond these buffers
can be overwritten arbitrarily.
This patch adds a check of the bitstream's length value to ensure it
fits within the bounds of the allocated buffers. An error condition is
returned from gs_read_bitstream if any of the reads fail.
Signed-off-by: Jacob von Chorus <jacobvonchorus@cwphoto.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dmytro Shynkevych [Fri, 28 Jul 2017 19:56:59 +0000 (22:56 +0300)]
staging: skein: move macros into header file
Move macro definitions from source file into respective header file
This concludes macro cleanup as outlined in TODO
Signed-off-by: Dmytro Shynkevych <dm.shynk@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Wed, 19 Jul 2017 09:36:16 +0000 (10:36 +0100)]
staging: vboxvideo: make a couple of symbols static
Module parameter vbox_modeset and structure vbox_bo_driver do not need to
be in global scope and hence can be made static.
Cleans up a couple of sparse warnings:
symbol 'vbox_modeset' was not declared. Should it be static?
symbol 'vbox_bo_driver' was not declared. Should it be static?
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paolo Cretaro [Sat, 22 Jul 2017 10:55:53 +0000 (12:55 +0200)]
staging: vboxvideo: remove unused variables
Fix compiler warnings:
vbox_mode.c:57:15: warning: variable ‘crtc_id’ set but not used
vbox_mode.c:581:25: warning: variable ‘vbox_connector’ set but not used
Signed-off-by: Paolo Cretaro <paolocretaro@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kepplinger [Mon, 24 Jul 2017 08:30:44 +0000 (10:30 +0200)]
staging: vboxvideo: Kconfig: Fix typos in help text
This fixes typos in vboxvideo's help text. Most notably, "to builtin
this module" becomes "to build this driver built-in to the kernel".
Signed-off-by: Martin Kepplinger <martink@posteo.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Tue, 25 Jul 2017 08:50:46 +0000 (10:50 +0200)]
staging: vboxvideo: select GENERIC_ALLOCATOR
The vboxvideo code uses various gen_pool_* functions, so it needs
lib/genalloc.c to be built. In some configs this is not happening,
so add select GENERIC_ALLOCATOR to the Kconfig file to enforce this.
Note all other Kconfig references to GENERIC_ALLOCATOR also use select.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann [Fri, 28 Jul 2017 13:23:12 +0000 (15:23 +0200)]
staging: pi433: use div_u64 for 64-bit division
I ran into this link error on an ARM OABI build:
drivers/staging/pi433/rf69.o: In function `rf69_set_frequency':
rf69.c:(.text+0xc9c): undefined reference to `__udivdi3'
No idea why I didn't see it with the default EABI configurations,
but the right solution here seems to be to use div_u64()
to get the external division implementation.
Fixes:
874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Derek Robson [Sat, 22 Jul 2017 03:50:50 +0000 (15:50 +1200)]
staging: pi433: Style fix - align block comments
Fixed the alignment of block comments
Found using checkpatch
Signed-off-by: Derek Robson <robsonde@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Tue, 18 Jul 2017 13:03:59 +0000 (14:03 +0100)]
staging: pi433: Make functions rf69_set_bandwidth_intern static
The function rf69_set_bandwidth_intern is local to the source
and do not need to be in global scope, so make it static. Also
break overly wide line.
Cleans up sparse warning:
symbol 'update_share_count' was not declared. Should it be static?
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joseph Wright [Sun, 16 Jul 2017 14:48:58 +0000 (14:48 +0000)]
Staging: pi433: check error after kthread_run()
Error should be checked with IS_ERR after calling kthread_run()
instead of comparing the returned pointer to an int.
Found by sparse warning:
incompatible types for operation (<)
left side has type struct task_struct *tx_task_struct
right side has type int
Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Tested-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Joseph Wright [Sun, 16 Jul 2017 14:48:57 +0000 (14:48 +0000)]
Staging: pi433: declare functions static
Declare functions static to fix sparse warnings:
warning: symbol 'pi433_receive' was not declared. Should it be static?
warning: symbol 'pi433_tx_thread' was not declared. Should it be static?
Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Randy Dunlap [Wed, 19 Jul 2017 23:58:28 +0000 (16:58 -0700)]
staging: pi433: depends on SPI
The pi433 driver uses SPI interfaces so it should depend on SPI.
Also, the "default n" can be removed since that is already the
default.
Fixes these build errors when SPI is not enabled:
drivers/staging/pi433/pi433_if.o: In function `pi433_probe':
pi433_if.c:(.text+0x1135): undefined reference to `spi_setup'
pi433_if.c:(.text+0x1177): undefined reference to `spi_write_then_read'
drivers/staging/pi433/pi433_if.o: In function `pi433_init':
pi433_if.c:(.init.text+0xb8): undefined reference to `__spi_register_driver'
drivers/staging/pi433/rf69.o: In function `rf69_read_fifo':
rf69.c:(.text+0x102): undefined reference to `spi_sync'
drivers/staging/pi433/rf69.o: In function `rf69_write_fifo':
rf69.c:(.text+0x248): undefined reference to `spi_sync'
drivers/staging/pi433/rf69.o: In function `rf69_read_reg':
rf69.c:(.text+0x290): undefined reference to `spi_write_then_read'
drivers/staging/pi433/rf69.o: In function `rf69_write_reg':
rf69.c:(.text+0x523): undefined reference to `spi_sync'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Marcus Wolf <linux@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dan.carpenter@oracle.com [Wed, 19 Jul 2017 09:51:40 +0000 (12:51 +0300)]
staging: pi433: return -EFAULT if copy_to_user() fails
copy_to_user() to user returns the number of bytes that weren't copied,
but we should be returning -EFAULT to the user.
Fixes:
874bcba65f9a ("staging: pi433: New driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suniel Mahesh [Thu, 20 Jul 2017 13:37:07 +0000 (19:07 +0530)]
staging: ccree: Fix unnecessary NULL check before kfree'ing it
kfree(NULL) is safe and their is no need for a NULL check. Pointed out
by checkpatch.
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef [Thu, 27 Jul 2017 10:43:17 +0000 (13:43 +0300)]
staging: ccree: remove func name from log messages
The SSI_LOG macros already add __func__ to log messages, so remove
log message that add them a second time in the log message itself.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:57 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_request_mgr.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:56 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_ivgen.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:55 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_cipher.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:54 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_buffer_mgr.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:53 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_hash.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simon Sandström [Tue, 18 Jul 2017 20:03:52 +0000 (22:03 +0200)]
staging: ccree: Fix alignment issues in ssi_aead.c
Fixes checkpatch.pl alignment warnings.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Armin Schoenlieb [Tue, 25 Jul 2017 19:14:26 +0000 (21:14 +0200)]
Staging: rtl8188eu: core: fix brace coding style issue in rtw_mlme_ext.c
This is a patch to the rtw_mlme_ext.c file that fixes up a brace error
found by the checkpatch.pl tool
Signed-off-by: Armin Schoenlieb <armetallica@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Mon, 24 Jul 2017 21:48:42 +0000 (22:48 +0100)]
staging: rtl8192u: fix spelling mistake: "Senondary" -> "Secondary"
Trivial fix to spelling mistake in IEEE80211_DEBUG message
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Fri, 21 Jul 2017 13:42:52 +0000 (14:42 +0100)]
staging: rtl8192u: fix incorrect mask and shift on u8 data
The cfg_action bit comes from the high bit of pmsg[4] so the
current mask and shift are in correct and always result in
zero. Fix this by using the correct mask and shif to get the
correct cfg_action bit value.
Detected by CoverityScan, CID#142890 ("Operands don't affect result")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Munir Contractor [Thu, 20 Jul 2017 01:41:25 +0000 (21:41 -0400)]
staging: rtl8188eu: Move { after function to new line
Fix an error detected by checkpatch.pl on line 75 and move the opening
brace after the function signature to a new line.
Signed-off-by: Munir Contractor <munircontractor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Deb McLemore [Wed, 26 Jul 2017 22:13:30 +0000 (17:13 -0500)]
staging: greybus: Fix coding style issue for column width
checkpatch.pl line over 80 characters so fix the formatting
for coding style compliance.
Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Amitoj Kaur Chawla [Thu, 27 Jul 2017 03:19:07 +0000 (23:19 -0400)]
staging: greybus: Remove unnecessary platform_set_drvdata
Unnecessary platform_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.
The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct platform_device *pdev;
@@
- platform_set_drvdata(pdev, NULL);
//</smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diwakar Sharma [Sun, 23 Jul 2017 17:51:46 +0000 (23:21 +0530)]
staging: greybus: fix parenthesis alignments
Parenthesis alignment issues reported by checkpatch,
fixed here.
Signed-off-by: Diwakar Sharma <sharmalxmail@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arvind Yadav [Tue, 18 Jul 2017 08:10:54 +0000 (13:40 +0530)]
staging: unisys: visorbus: Constify attribute_group structures.
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 28 Jul 2017 04:29:49 +0000 (21:29 -0700)]
Merge tag 'iio-for-4.14a' of git://git./linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First round of IIO new device support, features and cleanups for the 4.14 cycle.
4 completely new drivers in this set and plenty of other stuff.
One ABI change due to a silly mistake a long time back. Hopefully no
one will notice. It effects the numerical order of consumer device
channels which was the reverse of the obvious. It's going the slow
way to allow us some margin to spot if we have broken userspace or
not (seems unlikely)
New Device Support
* ccs811
- new driver for the Volatile Organic Compounds (VOC) sensor.
* dln2 adc
- new driver for the ADC on this flexible usb board.
* EP93xx
- new driver for this Cirrus logic SoC ADC.
* ltc2471
- new ADC driver support the ltc2471 and ltc2473
* st_accel
- add trivial table entries to support H3LIS331DL, LIS331DL, LIS3LV02DL.
* st_gyro
- add L3GD20H support (again) having fixed the various things that were
broken in the first try. Includes devicetree binding.
* stm32 dac
- add support for the DACs in the STM32F4 series
Features
* Documentation
- add missing power attribute documentation to the ABI docs.
* at91-sama5d2
- add hardware trigger and buffered capture support with bindings.
- suspend and resume functionality.
* bmc150
- support for the BOSC0200 ACPI device id seen on some tablets.
* hdc100x
- devicetree bindings
- document supported devices
- match table and device ids.
* hts221
- support active low interrupts (with bindings)
- open drain mode with bindings.
* htu21
- OF match table and bindings.
* lsm6dsx
- open drain mode with bindings
* ltc2497
- add support for board file based consumer mapping.
* ms5367
- OF match table and bindings.
* mt7622
- binding document and OF match table.
- suspend and resume support.
* rpr0521
- triggered buffer support.
* tsys01
- OF match table and bindings.
Cleanups and minor fixes
* core
- fix ordering of IIO channels to entry numbers when using
iio_map_array_register rather than reversing them.
- use the new %pOF format specifier rather than full name for the
device tree nodes.
* ad7280a
- fix potential issue with macro argument reuse.
* ad7766
- drop a pointless NULL value check as it's done in the gpiod code.
* adis16400
- unsigned -> unsigned int.
* at91 adc
- make some init data static to reduce code size.
* at91-sama5d2 ADC
- make some init data static to reduce code size.
* da311
- make some init data static to reduce code size.
* hid-sensor-rotation
- drop an unnecessary static.
* hts221
- refactor the write_with_mask code.
- move the BDU configuration to probe time as there is no reason for it
to change.
- avoid overwriting reserved data during power-down. This is a fix, but
the infrastructure need was too invasive to send it to mainline except
in a merge window. It's not a regression as it was always wrong.
- avoid reconfigure the sampling frequency multiple times by just
doing it in the write_raw function directly.
- refactor the power_on/off calls into a set_enable.
- move the dry-enable logic into trig_set_state as that is the only
place it was used.
* ina219
- fix polling of ina226 conversion ready flag.
* imx7d
- add vendor name in kconfig for consistency with similar parts.
* mcp3422
- Change initial channel to 0 as it feels more logical.
- Check for some errors in probe.
* meson-saradc
- add a check of of_match_device return value.
* mpu3050
- allow open drain for any interrupt type.
* rockchip adc
- add check on of_match_device return value.
* sca3000
- drop a trailing whitespace.
* stm32 adc
- make array stm32h7_adc_ckmodes_spec static.
* stm32 dac
- fix an error message.
* stm32 timers
- fix clock name in docs to match reality after changes.
* st_accel
- explicit OF table (spi).
- add missing entries to OF table (i2c).
- rename of_device_id table to drop the part name.
- adding missing lis3l02dq entry to bindings.
- rename H3LIS331DL_DRIVER_NAME to line up with similar entries in driver.
* st_gyro
- explicit OF table (spi).
* st_magn
- explicit OF table (spi).
- enable multiread for lis3mdl.
* st_pressure
- explicit OF table (spi).
* st_sensors common.
- move st_sensors_of_i2c_probe and rename to make it available for spi
drivers.
* tsc3472
- don't write an extra byte when writing the ATIME register.
- add a link to the datasheet.
* tsl2x7x - continued staging cleanups
- add of_match_table.
- drop redundant power_state sysfs attribute.
- drop wrapper tsl2x7x_i2c_read.
- clean up i2c calls made in tsl2x7x_als_calibrate.
- refactor the read and write _event_value callbacks to handle additional
elements.
- use usleep_range instead of mdelay.
- check return value from tsl2x7x_invoke_change.
* zpa2326
- add some newline to the end of logging macros.
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:05 +0000 (19:39 +0200)]
iio: humidity: hts221: move drdy enable logic in hts221_trig_set_state()
Move data-ready configuration in hts221_buffer.c since it is only related
to trigger logic
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:04 +0000 (19:39 +0200)]
dt-bindings: iio: humidity: hts221: support open drain mode
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:03 +0000 (19:39 +0200)]
iio: humidity: hts221: support open drain mode
Add open drain support in order to share requested IRQ line between
hts221 device and other peripherals
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Alexander Sverdlin [Mon, 24 Jul 2017 20:51:45 +0000 (22:51 +0200)]
iio: adc: New driver for Cirrus Logic EP93xx ADC
New driver adding support for ADC found on Cirrus Logic EP93xx series of SoCs.
Board specific code must take care to create plaform device with all necessary
resources.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Greg Kroah-Hartman [Mon, 24 Jul 2017 02:53:30 +0000 (19:53 -0700)]
Merge 4.13-rc2 into staging-next
This resolves a merge issue and gets the vmbox drm driver into this
branch to be able to start taking fixes for it...
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linus Torvalds [Sun, 23 Jul 2017 23:15:17 +0000 (16:15 -0700)]
Linux 4.13-rc2
Linus Torvalds [Sun, 23 Jul 2017 23:06:21 +0000 (16:06 -0700)]
Properly alphabetize MAINTAINERS file
This adds a perl script to actually parse the MAINTAINERS file, clean up
some whitespace in it, warn about errors in it, and then properly sort
the end result.
My perl-fu is atrocious, so the script has basically been created by
randomly putting various characters in a pile, mixing them around, and
then looking it the end result does anything interesting when used as a
perl script.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 23 Jul 2017 22:08:05 +0000 (15:08 -0700)]
Fix up MAINTAINERS file problems
Prepping for scripting the MAINTAINERS file cleanup (and possible split)
showed a couple of cases where the headers for a couple of entries were
bogus.
There's a few different kinds of bogosities:
- the X-GENE SOC EDAC case was confused and split over two lines
- there were four entries for "GREYBUS PROTOCOLS DRIVERS" that were all
different things.
- the NOKIA N900 CAMERA SUPPORT" was duplicated
all of which were more obvious when you started doing associative arrays
in perl to track these things by the header (so that we can alphabetize
this thing properly, and so that we might split it up by the data too).
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 23 Jul 2017 18:22:45 +0000 (11:22 -0700)]
Merge tag 'for-linus-4.13b-rc2-tag' of git://git./linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross:
"Some fixes and cleanups for running under Xen"
* tag 'for-linus-4.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/balloon: don't online new memory initially
xen/x86: fix cpu hotplug
xen/grant-table: log the lack of grants
xen/x86: Don't BUG on CPU0 offlining
Juergen Gross [Mon, 10 Jul 2017 08:10:45 +0000 (10:10 +0200)]
xen/balloon: don't online new memory initially
When setting up the Xenstore watch for the memory target size the new
watch will fire at once. Don't try to reach the configured target size
by onlining new memory in this case, as the current memory size will
be smaller in almost all cases due to e.g. BIOS reserved pages.
Onlining new memory will lead to more problems e.g. undesired conflicts
with NVMe devices meant to be operated as block devices.
Instead remember the difference between target size and current size
when the watch fires for the first time and apply it to any further
size changes, too.
In order to avoid races between balloon.c and xen-balloon.c init calls
do the xen-balloon.c initialization from balloon.c.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Juergen Gross [Wed, 5 Jul 2017 14:05:20 +0000 (16:05 +0200)]
xen/x86: fix cpu hotplug
Commit
dc6416f1d711eb4c1726e845d653235dcaae12e1 ("xen/x86: Call
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()")
introduced an error leading to a stack overflow of the idle task when
a cpu was brought offline/online many times: by calling
cpu_startup_entry() instead of returning at the end of xen_play_dead()
do_idle() would be entered again and again.
Don't use cpu_startup_entry(), but cpuhp_online_idle() instead allowing
to return from xen_play_dead().
Cc: <stable@vger.kernel.org> # 4.12
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Wengang Wang [Tue, 18 Jul 2017 07:40:35 +0000 (09:40 +0200)]
xen/grant-table: log the lack of grants
log a message when we enter this situation:
1) we already allocated the max number of available grants from hypervisor
and
2) we still need more (but the request fails because of 1)).
Sometimes the lack of grants causes IO hangs in xen_blkfront devices.
Adding this log would help debuging.
Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Vitaly Kuznetsov [Mon, 26 Jun 2017 16:39:30 +0000 (18:39 +0200)]
xen/x86: Don't BUG on CPU0 offlining
CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests
BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a
leftover from ancient times when CPU0 hotplug was impossible, it works
just fine for HVM.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Rob Herring [Tue, 18 Jul 2017 21:43:08 +0000 (16:43 -0500)]
iio: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-iio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Jaya Durga [Wed, 19 Jul 2017 12:25:57 +0000 (17:55 +0530)]
Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse
CHECK: Macro argument reuse 'addr' - possible side-effects?
convert AD7280A_DEVADDR to ad7280a_devaddr static function
to fix checkpath check
v3: small style changes
Signed-off-by: Jaya Durga <rjdurga@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:02 +0000 (19:39 +0200)]
dt-bindings: iio: humidity: hts221: support active-low interrupts
Update hts221 device binding with active-low interrupts support
(IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING).
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:01 +0000 (19:39 +0200)]
iio: humidity: hts221: support active-low interrupts
Add support for active low interrupts (IRQF_TRIGGER_LOW and
IRQF_TRIGGER_FALLING). Configure the device as active high or low
according to the requested irq line.
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:00 +0000 (19:39 +0200)]
iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:59 +0000 (19:38 +0200)]
iio: humidity: hts221: avoid useless ODR reconfiguration
Configure sensor ODR just in hts221_write_raw() in order to avoid
to set device sample rate multiple times.
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:58 +0000 (19:38 +0200)]
iio: humidity: hts221: do not overwrite reserved data during power-down
GENMASK(6, 3) in CTRL_REG1 and GENMASK(6, 2) in CTRL_REG2 are marked
reserved. Do not changed the original value (not declared in the
datasheet) during power-down/suspend routines.
Fixes:
e4a70e3e7d84 (iio: humidity: add support to hts221 rh/temp device)
Fixes:
b7079eeac5da (iio: humidity: hts221: add power management support)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:57 +0000 (19:38 +0200)]
iio: humidity: hts221: move BDU configuration in probe routine
Enable Block Data Update in hts221_probe() in order to avoid to reconfigure
it every time the sensor is enabled
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:56 +0000 (19:38 +0200)]
iio: humidity: hts221: refactor write_with_mask code
Move bit-shift in hts221_write_with_mask() instead of coding
the shift depth in the configured value. That change will be necessary
to fix an issue in device power-down procedure.
Simplify hts221_avg_list table management
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Narcisa Ana Maria Vasile [Mon, 17 Jul 2017 19:28:03 +0000 (22:28 +0300)]
iio: chemical: ccs811: Add support for AMS CCS811 VOC sensor
Add support for CCS811 VOC sensor. This patch adds support
for reading current and voltage across the sensor and TVOC
and equivalent CO2 values.
Scale and offset values have been computed according to datasheet:
- For current: raw value is in microamps
=> 0.001 scale to convert to milliamps
- For voltage: 1.65V = 1023, therefore 1650mV = 1023
=> 1650.0/1023 = 1.612903 scale to convert to millivolts
- For eCO2: raw value range is from 400ppm to 8192ppm.
=> (val - 400) * (100 - 0) / (8192 - 400) + 0 =
(val - 400) * 0.
01283367 => offset: -400, scale = 0.012834
to get a percentage value
-For TVOC: raw value range is from 0ppb to 1187ppb.
=> (val - 0) * 100 / (1187 - 0) + 0 = val * 0.0842459 =>
scale = 0.084246 for getting a percentage value
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Linus Torvalds [Sat, 22 Jul 2017 16:25:00 +0000 (09:25 -0700)]
Merge tag 'hwmon-for-linus-v4.13-rc2' of git://git./linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck:
"Avoid buffer overruns in applesmc driver"
* tag 'hwmon-for-linus-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (applesmc) Avoid buffer overruns
Linus Torvalds [Sat, 22 Jul 2017 16:00:24 +0000 (09:00 -0700)]
Merge tag 'tty-4.13-rc2' of git://git./linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH:
"Here are some small tty and serial driver fixes for 4.13-rc2. Nothing
huge at all, a revert of a patch that turned out to break things, a
fix up for a new tty ioctl we added in 4.13-rc1 to get the uapi
definition correct, and a few minor serial driver fixes for reported
issues.
All of these have been in linux-next for a while with no reported
issues"
* tag 'tty-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: Fix TIOCGPTPEER ioctl definition
tty: hide unused pty_get_peer function
tty: serial: lpuart: Fix the logic for detecting the 32-bit type UART
serial: imx: Prevent TX buffer PIO write when a DMA has been started
Revert "serial: imx-serial - move DMA buffer configuration to DT"
serial: sh-sci: Uninitialized variables in sysfs files
serial: st-asc: Potential error pointer dereference