linux-block.git
4 years agoiio: imu: st_lsm6dsx: add support to LSM6DSRX
Lorenzo Bianconi [Thu, 24 Oct 2019 15:42:33 +0000 (17:42 +0200)]
iio: imu: st_lsm6dsx: add support to LSM6DSRX

Add support to STM LSM6DSRX 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dsrx.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: st: Drop GPIO include
Linus Walleij [Wed, 23 Oct 2019 08:47:02 +0000 (10:47 +0200)]
iio: st: Drop GPIO include

None of the ST sensor drivers use any symbols from
<linux/gpio.h>, just drop the include from all of them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: hx711: optimize performance in read cycle
Andreas Klinger [Mon, 9 Sep 2019 12:37:48 +0000 (14:37 +0200)]
iio: adc: hx711: optimize performance in read cycle

Set gain in hx711_reset() to its default value after a reset cycle. This
omits one precautionary read cycle, because the read is performed in
hx711_set_gain_for_channel() anyway if gain has changed.

Check for DOUT low and if its high wait some time if it goes down
instead of doing a blind reset cycle when DOUT is not down.

This is a performance optimization which allows to query the sensor with
a higher frequency.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32-adc: fix kernel-doc warnings
Fabrice Gasnier [Fri, 20 Sep 2019 11:50:06 +0000 (13:50 +0200)]
iio: adc: stm32-adc: fix kernel-doc warnings

Fix the following warnings when documentation is built:
drivers/iio/adc/stm32-adc-core.c:62: warning: cannot understand function
 prototype: 'struct stm32_adc_common_regs '
drivers/iio/adc/stm32-adc-core.c:78: warning: cannot understand function
 prototype: 'struct stm32_adc_priv_cfg '
drivers/iio/adc/stm32-adc-core.c:123: warning: Function parameter or
 member 'pdev' not described in 'stm32f4_adc_clk_sel'
drivers/iio/adc/stm32-adc.c:219: warning: cannot understand function
 prototype: 'struct stm32_adc_regs '
drivers/iio/adc/stm32-adc.c:237: warning: cannot understand function
 prototype: 'struct stm32_adc_regspec '
drivers/iio/adc/stm32-adc.c:264: warning: cannot understand function
 prototype: 'struct stm32_adc_cfg '
drivers/iio/adc/stm32-adc.c:323: warning: Function parameter or member
 'difsel' not described in 'N'
drivers/iio/adc/stm32-adc.c:323: warning: Function parameter or member
 'pcsel' not described in 'stm32_adc'
drivers/iio/adc/stm32-adc.c:371: warning: cannot understand function
 prototype: 'const struct stm32_adc_regs stm32f4_sq[STM32_ADC_MAX_SQ + 1]
drivers/iio/adc/stm32-adc.c:417: warning: cannot understand function
 prototype: 'const struct stm32_adc_regs stm32f4_smp_bits[] = '
drivers/iio/adc/stm32-adc.c:508: warning: cannot understand function
 prototype: 'const struct stm32_adc_regs stm32h7_smp_bits[] = '
drivers/iio/adc/stm32-adc.c:1112: warning: Function parameter or member
 'indio_dev' not described in 'stm32_adc_get_trig_extsel'
drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member
 'indio_dev' not described in 'stm32_adc_debugfs_reg_access'
drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member
 'reg' not described in 'stm32_adc_debugfs_reg_access'
drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member
 'writeval' not described in 'stm32_adc_debugfs_reg_access'
drivers/iio/adc/stm32-adc.c:1420: warning: Function parameter or member
 'readval' not described in 'stm32_adc_debugfs_reg_access'

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: zpa2326: fix iio_triggered_buffer_postenable position
Alexandru Ardelean [Fri, 20 Sep 2019 08:03:48 +0000 (11:03 +0300)]
iio: pressure: zpa2326: fix iio_triggered_buffer_postenable position

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.

The iio_triggered_buffer_postenable() should be called before (to attach
the poll func) and then the

The iio_triggered_buffer_predisable() function is hooked directly without
anything, which is probably fine, as the postenable() version seems to also
do some reset/wake-up of the device.
This will mean it will be easier when removing it; i.e. it just gets
removed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: chemical: sgp30: drop excess semicolon
Jonathan Cameron [Sun, 13 Oct 2019 16:54:12 +0000 (17:54 +0100)]
iio: chemical: sgp30: drop excess semicolon

Suggested by coccinelle / coccicheck.

CHECK   drivers/iio/chemical/sgp30.c
drivers/iio/chemical/sgp30.c:486:2-3: Unneeded semicolon

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Andreas Brauchli <a.brauchli@elementarea.net>
4 years agoiio: adc: twl4030: Use false / true instead of 0 / 1 with booleans
Jonathan Cameron [Sun, 13 Oct 2019 16:37:54 +0000 (17:37 +0100)]
iio: adc: twl4030: Use false / true instead of 0 / 1 with booleans

Suggestion from coccinelle / coccicheck

CHECK   drivers/iio/adc/twl4030-madc.c
drivers/iio/adc/twl4030-madc.c:524:6-15: WARNING: Comparison of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:655:1-43: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:659:2-44: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:664:1-43: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:498:2-34: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:510:2-19: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:511:2-11: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:531:2-19: WARNING: Assignment of 0/1 to bool variable
drivers/iio/adc/twl4030-madc.c:532:2-11: WARNING: Assignment of 0/1 to bool variable

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
4 years agodt-bindings: iio: Add ltc2983 documentation
Nuno Sá [Fri, 11 Oct 2019 08:40:38 +0000 (10:40 +0200)]
dt-bindings: iio: Add ltc2983 documentation

Document the LTC2983 temperature sensor devicetree bindings.

Tweaked by Jonathan to take into account the lack of signed output
being maintained by dtc yaml output.  For now a comment added
that the unsigned array should actually be signed.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: temperature: Add support for LTC2983
Nuno Sá [Fri, 11 Oct 2019 08:40:37 +0000 (10:40 +0200)]
iio: temperature: Add support for LTC2983

The LTC2983 is a Multi-Sensor High Accuracy Digital Temperature
Measurement System. It measures a wide variety of temperature sensors and
digitally outputs the result, in °C or °F, with 0.1°C accuracy and
0.001°C resolution. It can measure the temperature of all standard
thermocouples (type B,E,J,K,N,S,R,T), standard 2-,3-,4-wire RTDs,
thermistors and diodes.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: bmp280: use devm action and remove labels from probe
Bartosz Golaszewski [Mon, 7 Oct 2019 02:41:31 +0000 (04:41 +0200)]
iio: pressure: bmp280: use devm action and remove labels from probe

We can drop some duplicate code if we use devm_action for disabling
regulators and pm and the managed variant of iio_device_register().

This allows us to completely remove all remove() callbacks from both
i2c and spi code.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: pressure: bmp280: use bulk regulator ops
Bartosz Golaszewski [Wed, 2 Oct 2019 08:57:56 +0000 (10:57 +0200)]
iio: pressure: bmp280: use bulk regulator ops

The vddd and vdda supplies are always operated on together. We can
shrink the code a bit by using the bulk regulator helpers.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: Add support for the FXOS8700 IMU
Robert Jones [Mon, 14 Oct 2019 18:49:21 +0000 (11:49 -0700)]
iio: imu: Add support for the FXOS8700 IMU

FXOS8700CQ is a small, low-power, 3-axis linear accelerometer and 3-axis
magnetometer combined into a single package. The device features a
selectable I2C or point-to-point SPI serial interface with 14-bit
accelerometer and 16-bit magnetometer ADC resolution along with
smart-embedded functions.

FXOS8700CQ has dynamically selectable accelerationfull-scale ranges of
±2 g/±4 g/±8 g and a fixed magnetic measurement range of ±1200 μT.
Output data rates (ODR) from 1.563 Hz to 800 Hz are selectable by the user
for each sensor. Interleaved magnetic and acceleration data is available
at ODR rates of up to 400 Hz. FXOS8700CQ is available in a plastic QFN
package and it is guaranteed to operate over the extended temperature
range of –40 °C to +85 °C.

TODO: Trigger and IRQ configuration support

Datasheet:
  http://cache.freescale.com/files/sensors/doc/data_sheet/FXOS8700CQ.pdf

Signed-off-by: Robert Jones <rjones@gateworks.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: imu: add fxos8700 imu binding
Robert Jones [Mon, 14 Oct 2019 18:49:20 +0000 (11:49 -0700)]
dt-bindings: iio: imu: add fxos8700 imu binding

This adds documentation for the Freescale FXOS8700 Inertial Measurement Unit
device-tree bindings.

Signed-off-by: Robert Jones <rjones@gateworks.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: iio: ad9834: add a check for devm_clk_get
Chuhong Yuan [Wed, 16 Oct 2019 14:25:40 +0000 (22:25 +0800)]
staging: iio: ad9834: add a check for devm_clk_get

ad9834_probe misses a check for devm_clk_get and may cause problems.
Add a check like what ad9832 does to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: xilinx-xadc: use devm_platform_ioremap_resource
Jonathan Cameron [Sun, 13 Oct 2019 16:48:48 +0000 (17:48 +0100)]
iio: adc: xilinx-xadc: use devm_platform_ioremap_resource

Reduces local boilerplate.
Suggested by coccinelle.
 CHECK   drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc-core.c:1184:1-11: WARNING: Use devm_platform_ioremap_resource for xadc -> base

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Manish Narani <manish.narani@xilinx.com>
Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>
4 years agoiio: temp: maxim thermocouple: Drop unneeded semi colon.
Jonathan Cameron [Sun, 13 Oct 2019 18:10:13 +0000 (19:10 +0100)]
iio: temp: maxim thermocouple: Drop unneeded semi colon.

Identified by coccinelle

CHECK   drivers/iio/temperature/maxim_thermocouple.c
drivers/iio/temperature/maxim_thermocouple.c:197:3-4: Unneeded semicolon

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
4 years agoiio: adc: cpcap-adc: Fix missing IRQF_ONESHOT as only threaded handler.
Jonathan Cameron [Sun, 13 Oct 2019 16:21:33 +0000 (17:21 +0100)]
iio: adc: cpcap-adc: Fix missing IRQF_ONESHOT as only threaded handler.

Coccinelle noticed:
CHECK   drivers/iio/adc/cpcap-adc.c
drivers/iio/adc/cpcap-adc.c:1009:9-34: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT

As far as I can see this is a simple case of it should be specified
but isn't.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Tony Lindgren <tony@atomide.com>
4 years agoiio: adc: meson_saradc: use devm_platform_ioremap_resource
Jonathan Cameron [Sun, 13 Oct 2019 15:37:59 +0000 (16:37 +0100)]
iio: adc: meson_saradc: use devm_platform_ioremap_resource

Avoid local boilerplate.
Suggested by coccinelle via coccicheck.
CHECK   drivers/iio/adc/meson_saradc.c
drivers/iio/adc/meson_saradc.c:1218:1-5: WARNING: Use devm_platform_ioremap_resource for base

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: exynos: use devm_platform_ioremap_resource
Jonathan Cameron [Sun, 13 Oct 2019 12:35:24 +0000 (13:35 +0100)]
iio: adc: exynos: use devm_platform_ioremap_resource

Reduce local boilerplate.
Identified by coccinelle
drivers/iio/adc/exynos_adc.c:792:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agoiio: adc: exynos: Drop a stray semicolon
Jonathan Cameron [Sun, 13 Oct 2019 12:35:23 +0000 (13:35 +0100)]
iio: adc: exynos: Drop a stray semicolon

Identified by coccinelle
drivers/iio/adc/exynos_adc.c:654:2-3: Unneeded semicolon

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
4 years agoiio: proximity: pulsedlight v2: Tidy up an endian issue
Jonathan Cameron [Sun, 13 Oct 2019 10:26:00 +0000 (11:26 +0100)]
iio: proximity: pulsedlight v2: Tidy up an endian issue

Sparse identified the following
CHECK   drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c:144:24: warning: cast to restricted __be16
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c:144:24: warning: cast to restricted __be16
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c:144:24: warning: cast to restricted __be16
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c:144:24: warning: cast to restricted __be16

This cleans up by adding a local variable to hold the value whilst
it is __be16 before applying endian converstion into eventual destination.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
4 years agoiio: pressure: bmp280 endian tidy ups
Jonathan Cameron [Sun, 13 Oct 2019 10:17:42 +0000 (11:17 +0100)]
iio: pressure: bmp280 endian tidy ups

There is a somewhat interesting mixture of be16 and le16 going on in
this one function.  Changes here formalize that a little more.

CHECK   drivers/iio/pressure/bmp280-core.c
drivers/iio/pressure/bmp280-core.c:215:35: warning: cast to restricted __le16
drivers/iio/pressure/bmp280-core.c:229:37: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:229:37: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:229:37: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:229:37: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:230:36: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:230:36: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:230:36: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:230:36: warning: cast to restricted __be16
drivers/iio/pressure/bmp280-core.c:237:37: warning: cast to restricted __le16

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
4 years agoiio: gyro: mpu3050: Explicity make a 'poison' value big endian
Jonathan Cameron [Sun, 13 Oct 2019 10:02:55 +0000 (11:02 +0100)]
iio: gyro: mpu3050: Explicity make a 'poison' value big endian

This clearly has no actual affect but it does show sparse and similar
static analysers that we are doing this intentionally.

CHECK   drivers/iio/gyro/mpu3050-core.c
drivers/iio/gyro/mpu3050-core.c:546:48: warning: incorrect type in assignment (different base types)
drivers/iio/gyro/mpu3050-core.c:546:48:    expected restricted __be16 <noident>
drivers/iio/gyro/mpu3050-core.c:546:48:    got int

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
4 years agoiio: chemical: sps30: Explicity truncate constant by masking
Jonathan Cameron [Sun, 13 Oct 2019 09:55:15 +0000 (10:55 +0100)]
iio: chemical: sps30: Explicity truncate constant by masking

When breaking up a constant to write to two 8 bit registers
it isn't obvious to sparse that it was intentional.

CHECK   drivers/iio/chemical/sps30.c
drivers/iio/chemical/sps30.c:120:30: warning: cast truncates bits from constant value (8004 becomes 4)

So in the interests of minimising noisy warnings, let us add
a mask.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Tomasz Duszynski <tduszyns@gmail.com>
4 years agoiio: adc: stmpe-adc: Cleanup endian type of local variable
Jonathan Cameron [Sun, 13 Oct 2019 09:15:41 +0000 (10:15 +0100)]
iio: adc: stmpe-adc: Cleanup endian type of local variable

Nothing stops data being of type __be16, which fixes the warning:

CHECK   drivers/iio/adc/stmpe-adc.c
drivers/iio/adc/stmpe-adc.c:202:29: warning: cast to restricted __be16
drivers/iio/adc/stmpe-adc.c:202:29: warning: cast to restricted __be16
drivers/iio/adc/stmpe-adc.c:202:29: warning: cast to restricted __be16
drivers/iio/adc/stmpe-adc.c:202:29: warning: cast to restricted __be16

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: <philippe.schenker@toradex.com>
4 years agoiio: adc: mcp320x: Tidy up endian types in type cast.
Jonathan Cameron [Sun, 13 Oct 2019 09:05:42 +0000 (10:05 +0100)]
iio: adc: mcp320x: Tidy up endian types in type cast.

Fixes the sparse warning:
drivers/iio/adc/mcp320x.c:167:41: warning: incorrect type in argument 1 (different base types)
drivers/iio/adc/mcp320x.c:167:41:    expected restricted __be32 const [usertype] *p
drivers/iio/adc/mcp320x.c:167:41:    got unsigned int [usertype] *<noident>

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
4 years agoiio: adc: at91-sama5d2: Replace 0 with NULL when clearing some pointers.
Jonathan Cameron [Sun, 13 Oct 2019 08:57:23 +0000 (09:57 +0100)]
iio: adc: at91-sama5d2: Replace 0 with NULL when clearing some pointers.

Cleans up the sparse warning:

CHECK   drivers/iio/adc/at91-sama5d2_adc.c
drivers/iio/adc/at91-sama5d2_adc.c:1486:31: warning: Using plain integer as NULL pointer
drivers/iio/adc/at91-sama5d2_adc.c:1509:31: warning: Using plain integer as NULL pointer

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
4 years agocounter: Fix typo in action_get description
William Breathitt Gray [Sun, 6 Oct 2019 20:03:11 +0000 (16:03 -0400)]
counter: Fix typo in action_get description

The action_get callback returns a Synapse's action mode.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodocs: driver-api: generic-counter: Update Count and Signal data types
William Breathitt Gray [Sun, 6 Oct 2019 20:03:10 +0000 (16:03 -0400)]
docs: driver-api: generic-counter: Update Count and Signal data types

Count data is now always represented as an unsigned integer, while
Signal data is either SIGNAL_LOW or SIGNAL_HIGH. In addition,
clarification changes and additions are made to better explain the
theory of the Generic Counter interface and its use.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agocounter: Simplify the count_read and count_write callbacks
William Breathitt Gray [Sun, 6 Oct 2019 20:03:09 +0000 (16:03 -0400)]
counter: Simplify the count_read and count_write callbacks

The count_read and count_write callbacks are simplified to pass val as
unsigned long rather than as an opaque data structure. The opaque
counter_count_read_value and counter_count_write_value structures,
counter_count_value_type enum, and relevant counter_count_read_value_set
and counter_count_write_value_get functions, are removed as they are no
longer used.

Cc: Patrick Havelange <patrick.havelange@essensium.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: David Lechner <david@lechnology.com>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoMerge branch 'ib-ab8500-5.4-rc1' into HEAD
Jonathan Cameron [Fri, 18 Oct 2019 18:46:10 +0000 (19:46 +0100)]
Merge branch 'ib-ab8500-5.4-rc1' into HEAD

Immutable branch as considerable overlap with mfd, power and hwmon.

4 years agomfd: Switch the AB8500 GPADC to IIO
Linus Walleij [Fri, 11 Oct 2019 07:18:05 +0000 (09:18 +0200)]
mfd: Switch the AB8500 GPADC to IIO

The AB8500 GPADC driver is indeed a "general purpose ADC" driver,
and while the IIO subsystem did not exist when the driver was
first merged, it is never too late to clean things up and move it
to the right place.

Nowadays IIO provides the right abstractions and interfaces to
do generic ADC work in the kernel.

We have to cut a bunch of debugfs luggage to make this transition
swift, but all these files to is read out the raw values of the
ADC and the IIO subsystem already has a standard sysfs ABI for
doing exactly this: no debugfs is needed.

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: New driver for the AB8500 GPADC
Linus Walleij [Fri, 11 Oct 2019 07:18:04 +0000 (09:18 +0200)]
iio: adc: New driver for the AB8500 GPADC

This is a new driver for the ST-Ericsson AB8500 GPADC, which
replaces the old driver in drivers/mfd/ab8500-gpadc.c and
thus gets rid of another necessarily different custom driver
from the times before IIO existed.

The AB8500 GPADC can convert 10 different channels and these
are used for monitoring voltages in the U8500 chipset, some
are used for battery charging, some for temperature
monitoring.

As this is very core functionality that a lot of drivers
depend on and was formerly compiled in with the AB8500 core
driver, we deafault it to 'y' in Kconfig: it can be compiled
out but it is really not advisible: the platform can
for example overheat if we do.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agomfd: ab8500: Augment DT bindings
Linus Walleij [Fri, 11 Oct 2019 07:18:03 +0000 (09:18 +0200)]
mfd: ab8500: Augment DT bindings

As we migrate the AB8500 GPADC driver to use IIO, we need to augment
the bindings to account for defining the ADC channels in the device
tree.

Cc: devicetree@vger.kernel.org
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agohwmon: ab8500: Convert to IIO ADC
Linus Walleij [Fri, 11 Oct 2019 07:18:02 +0000 (09:18 +0200)]
hwmon: ab8500: Convert to IIO ADC

This switches the AB8500 hardware monitor driver to using
the standard IIO ADC channel lookup and conversion routines.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agopower: supply: ab8500_fg: Convert to IIO ADC
Linus Walleij [Fri, 11 Oct 2019 07:18:01 +0000 (09:18 +0200)]
power: supply: ab8500_fg: Convert to IIO ADC

This switches the AB8500 fuel gauge driver to using
the standard IIO ADC channel lookup and conversion routines.

Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agopower: supply: ab8500_charger: Convert to IIO ADC
Linus Walleij [Fri, 11 Oct 2019 07:18:00 +0000 (09:18 +0200)]
power: supply: ab8500_charger: Convert to IIO ADC

This switches the AB8500 battery charger driver to using
the standard IIO ADC channel lookup and conversion routines.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agopower: supply: ab8500_btemp: Convert to IIO ADC
Linus Walleij [Fri, 11 Oct 2019 07:17:59 +0000 (09:17 +0200)]
power: supply: ab8500_btemp: Convert to IIO ADC

This switches the AB8500 battery temperature driver to using
the standard IIO ADC channel lookup and conversion routines.

Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoMerge branch 'ib-ti-eqep-5.4-rc1' into togreg
Jonathan Cameron [Thu, 17 Oct 2019 21:08:43 +0000 (22:08 +0100)]
Merge branch 'ib-ti-eqep-5.4-rc1' into togreg

Immutable branch being merged in.  Created as this also involves
moving some dependencies around, outside of the counter subsystem.
It's possible it will want to be pulled into other trees.

4 years agocounter: new TI eQEP driver
David Lechner [Sun, 1 Sep 2019 22:58:24 +0000 (17:58 -0500)]
counter: new TI eQEP driver

This adds a new counter driver for the Texas Instruments Enhanced
Quadrature Encoder Pulse (eQEP) module.

Only very basic functionality is currently implemented - only enough to
be able to read the position. The actual device has many more features
which can be added to the driver on an as-needed basis.

It is not possible to read the QEPA/B signal values in hardware, so
that feature is omitted.

The TI_PWMSS kernel option is selected in Kconfig to enable the parent
bus, which is needed for power management.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: counter: new bindings for TI eQEP
David Lechner [Sun, 1 Sep 2019 22:58:23 +0000 (17:58 -0500)]
dt-bindings: counter: new bindings for TI eQEP

This documents device tree binding for the Texas Instruments Enhanced
Quadrature Encoder Pulse (eQEP) Module found in various TI SoCs.

Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agobus/ti-pwmss: move TI PWMSS driver from PWM to bus subsystem
David Lechner [Sun, 1 Sep 2019 22:58:22 +0000 (17:58 -0500)]
bus/ti-pwmss: move TI PWMSS driver from PWM to bus subsystem

The TI PWMSS driver is a simple bus driver for providing power
power management for the PWM peripherals on TI AM33xx SoCs, namely
eCAP, eHRPWM and eQEP. The eQEP is a counter rather than a PWM, so
it does not make sense to have the bus driver in the PWM subsystem
since the PWMSS is not exclusive to PWM devices.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: intel_mrfld_adc: Add Basin Cove ADC driver
Vincent Pelletier [Tue, 26 Mar 2019 14:51:38 +0000 (16:51 +0200)]
iio: adc: intel_mrfld_adc: Add Basin Cove ADC driver

Exposes the ADC device present on, at least, Intel Merrifield platform.

Based on work done by:
  Yang Bin <bin.yang@intel.com>
  Huiquan Zhong <huiquan.zhong@intel.com>
  Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
  Pavan Kumar S <pavan.kumar.s@intel.com>

Though it has been heavily rewritten for upstream.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: imu: st_lsm6dsx: add lsm6ds0 device bindings
Lorenzo Bianconi [Mon, 7 Oct 2019 09:43:38 +0000 (11:43 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6ds0 device bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add support to LSM6DS0
Lorenzo Bianconi [Mon, 7 Oct 2019 09:43:37 +0000 (11:43 +0200)]
iio: imu: st_lsm6dsx: add support to LSM6DS0

Add support to STM LSM6DS0 6-axis (acc + gyro) Mems sensor

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: fix gyro gain definitions for LSM9DS1
Lorenzo Bianconi [Mon, 7 Oct 2019 09:12:13 +0000 (11:12 +0200)]
iio: imu: st_lsm6dsx: fix gyro gain definitions for LSM9DS1

Fix typos in gyro gain definitions for LSM9DS1 sensor

Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ad7303: replace mlock with own lock
Alexandru Ardelean [Mon, 7 Oct 2019 08:26:42 +0000 (11:26 +0300)]
iio: dac: ad7303: replace mlock with own lock

This change replaces indio_dev's mlock with the driver's own lock. The lock
is mostly needed to protect state when changing the `dac_cache` info.
The lock has been extended to `ad7303_read_raw()`, to make sure that the
cache is updated if an SPI-write is already in progress.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: maxbotix,mb1232.yaml: transform to yaml
Andreas Klinger [Mon, 7 Oct 2019 17:02:20 +0000 (19:02 +0200)]
dt-bindings: iio: maxbotix,mb1232.yaml: transform to yaml

transform existing documentation of maxbotix,mb1232 ultrasonic ranger
from text documentation format into yaml.

Changes in v3:
- add a i2c node around device node to set up #address-cells and
  #size-cells for omitting error during make dt_binding_check

Changes in v2:
- removed description of reg property
- added a line:
  additionalProperties: false

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add odr calibration feature
Mario Tesi [Mon, 7 Oct 2019 13:56:26 +0000 (15:56 +0200)]
iio: imu: st_lsm6dsx: add odr calibration feature

On LSM6DSO/LSM6DSR/LSM6DSOX/ASM330LHH and ISH330DHCX
devices it is possible to trim the hardware timestamp
resolution through the FREQ_FINE[7:0] bits of the
INTERNAL_FREQ_FINE register, which contains the difference
in percentage of the effective ODR (and timestamp rate)
with respect to the typical value.

The formula for calculating the effective ODR reported
in the application notes has been linearized to the first
order to simplify the calculation (pls. see note on source
code).

This change may be useful in the outcome of CTS
tests regarding the SingleSensorTests and the
SensorTest#testSensorTimeStamps for high ODRs

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: enable drdy-mask if available
Lorenzo Bianconi [Tue, 8 Oct 2019 12:05:02 +0000 (14:05 +0200)]
iio: imu: st_lsm6dsx: enable drdy-mask if available

Enable drdy mask if available in order to mark invalid samples during
sensor bootstrap phase

Tested-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: stm32: add power management support
Fabrice Gasnier [Wed, 9 Oct 2019 13:48:38 +0000 (15:48 +0200)]
iio: dac: stm32: add power management support

Add support for runtime PM & sleep.
Provide pclk to regmap as registers access doesn't need full power
(e.g. regulator). Always restore HFSEL when resuming. It may get lost
depending on low power level that has been achieved.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: enable wake-up event for LSM6DSO
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:07 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: enable wake-up event for LSM6DSO

Add missing wake-up register info for LSM6DSO/LSM6DSOX sensor

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: imu: st_lsm6dsx: document missing wakeup-source property
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:06 +0000 (15:22 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: document missing wakeup-source property

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add missing kernel documenation
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:05 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: add missing kernel documenation

Add missing kernel doc for st_lsm6dsx_hw data structure

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add wakeup_source in st_sensors_platform_data
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:04 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: add wakeup_source in st_sensors_platform_data

Add the possibility to enable/disable wakeup source through
st_sensors_platform_data and not only through device tree

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: fix checkpatch warning
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:03 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: fix checkpatch warning

Fix following checkpatch warnings:

CHECK: Alignment should match open parenthesis
+static int st_lsm6dsx_read_event(struct iio_dev *iio_dev,
+    const struct iio_chan_spec *chan,

CHECK: Alignment should match open parenthesis
+static int st_lsm6dsx_write_event(struct iio_dev *iio_dev,
+     const struct iio_chan_spec *chan,

CHECK: Alignment should match open parenthesis
+static int st_lsm6dsx_read_event_config(struct iio_dev *iio_dev,
+   const struct iio_chan_spec *chan,

CHECK: Alignment should match open parenthesis
+static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev,
+    const struct iio_chan_spec *chan,

WARNING: line over 80 characters
+ if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source"))

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_config
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:02 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_config

Always grub conf mutex in st_lsm6dsx_write_event_config since it can run
concurrently with FIFO configuration

Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: rely on st_lsm6dsx_update_bits_locked configuring events
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:01 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: rely on st_lsm6dsx_update_bits_locked configuring events

Rely on st_lsm6dsx_update_bits_locked in st_lsm6dsx_write_event and
st_lsm6dsx_event_setup routines since they can run concurrently with
sensor hub configuration

Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: always check enable_reg in st_lsm6dsx_event_setup
Lorenzo Bianconi [Sun, 6 Oct 2019 13:22:00 +0000 (15:22 +0200)]
iio: imu: st_lsm6dsx: always check enable_reg in st_lsm6dsx_event_setup

Check if enable_reg of event_settings data structure is defined before
writing on it

Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: move bdu/boot and reset register info in hw_settings
Lorenzo Bianconi [Sun, 6 Oct 2019 13:21:59 +0000 (15:21 +0200)]
iio: imu: st_lsm6dsx: move bdu/boot and reset register info in hw_settings

Move bdu, boot and reset register definitions in hw_settings register
map since not all supported sensors (e.g lsm9ds1) rely on the same
definitions

Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: do not access active-low/open-drain regs if not supported
Lorenzo Bianconi [Sun, 6 Oct 2019 13:21:58 +0000 (15:21 +0200)]
iio: imu: st_lsm6dsx: do not access active-low/open-drain regs if not supported

Move active low and open drain register definitions in hw_settings
register map since not all supported sensors (e.g lsm9ds1) rely on the
same definitions

Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: move irq related definitions in irq_config
Lorenzo Bianconi [Sun, 6 Oct 2019 13:21:57 +0000 (15:21 +0200)]
iio: imu: st_lsm6dsx: move irq related definitions in irq_config

Group irq related definition in irq_config structure in
st_lsm6dsx_settings. This is a preliminary patch to move
OpenDrain/Active low registers in st_lsm6dsx_settings.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: add sanity check for read_fifo pointer
Lorenzo Bianconi [Sun, 6 Oct 2019 13:21:56 +0000 (15:21 +0200)]
iio: imu: st_lsm6dsx: add sanity check for read_fifo pointer

Check read_fifo pointer before using it since we can't assume it
is always set adding new sensors. This patch fixes the following crash:

irq 277: nobody cared (try booting with the "irqpoll" option)
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-rc5-00322-g792b824-dirty #7
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[<c0112750>] (unwind_backtrace) from [<c010d018>] (show_stack+0x10/0x14)
[<c010d018>] (show_stack) from [<c0c2bfc8>] (dump_stack+0xd8/0x10c)
[<c0c2bfc8>] (dump_stack) from [<c01923fc>] (__report_bad_irq+0x24/0xc0)
[<c01923fc>] (__report_bad_irq) from [<c0192820>] (note_interrupt+0x27c/0x2dc)
[<c0192820>] (note_interrupt) from [<c018f174>] (handle_irq_event_percpu+0x54/0x7c)
[<c018f174>] (handle_irq_event_percpu) from [<c018f1d4>] (handle_irq_event+0x38/0x5c)
[<c018f1d4>] (handle_irq_event) from [<c0193664>] (handle_level_irq+0xc8/0x154)
[<c0193664>] (handle_level_irq) from [<c018df58>] (generic_handle_irq+0x20/0x34)
[<c018df58>] (generic_handle_irq) from [<c053c348>] (mxc_gpio_irq_handler+0xc4/0xf8)
[<c053c348>] (mxc_gpio_irq_handler) from [<c053c3e0>] (mx3_gpio_irq_handler+0x64/0xb8)
[<c053c3e0>] (mx3_gpio_irq_handler) from [<c018df58>] (generic_handle_irq+0x20/0x34)
[<c018df58>] (generic_handle_irq) from [<c018e550>] (__handle_domain_irq+0x64/0xe0)
[<c018e550>] (__handle_domain_irq) from [<c0529610>] (gic_handle_irq+0x4c/0xa0)
[<c0529610>] (gic_handle_irq) from [<c0101a70>] (__irq_svc+0x70/0x98)
Exception stack(0xc1301f10 to 0xc1301f58
1f00: 00000001 00000006 00000000 c130c340
1f20: c1300000 c1308928 00000001 c1308960 00000000 c12b9db0 c1308908 00000000
1f40: 00000000 c1301f60 c0182010 c0109508 20000013 ffffffff
[<c0101a70>] (__irq_svc) from [<c0109508>] (arch_cpu_idle+0x20/0x3c)
[<c0109508>] (arch_cpu_idle) from [<c015ed70>] (do_idle+0x1bc/0x2bc)
[<c015ed70>] (do_idle) from [<c015f204>] (cpu_startup_entry+0x18/0x1c)
[<c015f204>] (cpu_startup_entry) from [<c1200e68>] (start_kernel+0x440/0x504)
[<c1200e68>] (start_kernel) from [<00000000>] (0x0)
handlers:
[<62052c0d>] st_lsm6dsx_handler_irq threaded
[<f2004b92>] st_lsm6dsx_handler_thread

Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
Tested-by: Bobby Jones <rjones@gateworks.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: imu: st_lsm6dsx: use st_lsm6dsx_read_locked in st_lsm6dsx_report_motion_event
Lorenzo Bianconi [Sun, 6 Oct 2019 13:21:55 +0000 (15:21 +0200)]
iio: imu: st_lsm6dsx: use st_lsm6dsx_read_locked in st_lsm6dsx_report_motion_event

Rely on st_lsm6dsx_read_locked in st_lsm6dsx_report_motion_event since
it can run concurrently with sensor hub configuration. Move event
related code in st_lsm6dsx_report_motion_event

Fixes: 1aabad1fb5e9 ("iio: imu: st_lsm6dsx: add motion report function and call from interrupt")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: Add max12xx SPI ADC series as trivial devices
Miquel Raynal [Fri, 11 Oct 2019 14:43:47 +0000 (16:43 +0200)]
dt-bindings: Add max12xx SPI ADC series as trivial devices

Update the compatible list with three Maxim ADCs compatibles.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: Add 1027/1029/1031 SPI ADCs as trivial devices
Miquel Raynal [Fri, 11 Oct 2019 14:43:46 +0000 (16:43 +0200)]
dt-bindings: Add 1027/1029/1031 SPI ADCs as trivial devices

In the same time, remove the dedicated bindings file which is now
useless.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: max1027: Mark interrupts as optional
Miquel Raynal [Fri, 11 Oct 2019 14:43:45 +0000 (16:43 +0200)]
dt-bindings: iio: adc: max1027: Mark interrupts as optional

The chips have a 'start conversion' and a 'end of conversion' pair of
pins. They can be used but this is absolutely not mandatory as regular
polling is supported by the chip depending on its internal clocking
setup.

There is no physical reason to force the use of interrupts so turn
them optional.

Also, once the interrupt turned optional, these devices fit perfectly
the "trivial devices" described in the generic (yaml) bindings file, so
instead of converting this text file to json schema, we can just add
the relevant compatibles in:
Documentation/devicetree/bindings/trivial-devices.yaml.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: max1027: Introduce 12-bit devices support
Miquel Raynal [Fri, 11 Oct 2019 14:43:44 +0000 (16:43 +0200)]
iio: adc: max1027: Introduce 12-bit devices support

Maxim's max12xx series is very similar to the max10xx series, with the
difference of the measurements depth which is upgraded from 10 to 12
bits per channel. Everything else looks the same.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: max1027: Prepare the introduction of different resolutions
Miquel Raynal [Fri, 11 Oct 2019 14:43:43 +0000 (16:43 +0200)]
iio: adc: max1027: Prepare the introduction of different resolutions

Maxim's max1027/29/31 series returns the measured voltages with a
resolution of 10 bits. There is a very similar series, max1227/29/31
which works identically but uses a resolution of 12 bits. Prepare the
support for these chips by turning the 'depth' into a macro parameter
instead of hardcoding it everywhere. Also reorganize just a bit the
macros at the top to avoid repeating tens of lines when adding support
for a new chip.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: max1027: Reset the device at probe time
Miquel Raynal [Fri, 11 Oct 2019 14:43:42 +0000 (16:43 +0200)]
iio: adc: max1027: Reset the device at probe time

All the registers are configured by the driver, let's reset the chip
at probe time, avoiding any conflict with a possible earlier
configuration.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: max1027: Make it optional to use interrupts
Miquel Raynal [Fri, 11 Oct 2019 14:43:41 +0000 (16:43 +0200)]
iio: adc: max1027: Make it optional to use interrupts

The chip has a 'start conversion' and a 'end of conversion' pair of
pins. They can be used but this is absolutely not mandatory as regular
polling of the value is totally fine with the current internal
clocking setup. Turn the interrupts optional and do not error out if
they are not inquired in the device tree. This has the effect to
prevent triggered buffers use though.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: max1027: Add debugfs register read support
Miquel Raynal [Fri, 11 Oct 2019 14:43:40 +0000 (16:43 +0200)]
iio: adc: max1027: Add debugfs register read support

Until now, only write operations were supported. Force two bytes read
operation when reading, which should fit most of the development
purposes. Of course, extended operations like buffered reads on
multiple channels or even temperature + voltage reads will not be read
entirely. Usually, just starting a new operation will work but in any
case a software reset (done through the debufs interface too) will
return the device in a usable state.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: light: Add support for ADUX1020 sensor
Manivannan Sadhasivam [Fri, 11 Oct 2019 18:48:52 +0000 (00:18 +0530)]
iio: light: Add support for ADUX1020 sensor

Add initial support for Analog Devices ADUX1020 Photometric sensor.
Only proximity mode has been enabled for now.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: light: Add binding for ADUX1020
Manivannan Sadhasivam [Fri, 11 Oct 2019 18:48:51 +0000 (00:18 +0530)]
dt-bindings: iio: light: Add binding for ADUX1020

Add devicetree binding for Analog Devices ADUX1020 Photometric
sensor.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: wfx: fix potential vulnerability to spectre
Jérôme Pouiller [Fri, 11 Oct 2019 16:47:51 +0000 (16:47 +0000)]
staging: wfx: fix potential vulnerability to spectre

array_index_nospec() should be applied after a bound check.

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191011164746.2518-1-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix error handling in wfx_tx_get_raw_link_id()
Jérôme Pouiller [Fri, 11 Oct 2019 10:16:41 +0000 (10:16 +0000)]
staging: wfx: fix error handling in wfx_tx_get_raw_link_id()

Since wfx_tx_get_raw_link_id() return an unsigned, it makes no sense to
return a negative value. "15" is a better value since it is used by
firmware for stations that have not yet associated link-ids.

Note that this should never happens since driver set max_ap_assoc_sta
to 14.

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191011101639.31025-1-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: use DIV_ROUND_UP helper macro
Wambui Karuga [Sun, 13 Oct 2019 19:10:27 +0000 (22:10 +0300)]
staging: rtl8723bs: use DIV_ROUND_UP helper macro

Use the DIV_ROUND_UP macro to replace open-coded divisor calculation
to improve readability.
Issue found using coccinelle:
@@
expression n,d;
@@
(
- ((n + d - 1) / d)
+ DIV_ROUND_UP(n,d)
|
- ((n + (d - 1)) / d)
+ DIV_ROUND_UP(n,d)
)

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191013191027.6470-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vc04_services: use DIV_ROUND_UP helper macro
Wambui Karuga [Sun, 13 Oct 2019 18:47:50 +0000 (21:47 +0300)]
staging: vc04_services: use DIV_ROUND_UP helper macro

Replace open-coded division calculation with the DIV_ROUND_UP
helper macro for better readability.
Issue found using coccinelle:
@@
expression n,d;
@@
(
- ((n + d - 1) / d)
+ DIV_ROUND_UP(n,d)
|
- ((n + (d - 1)) / d)
+ DIV_ROUND_UP(n,d)
)

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191013184750.32766-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: remove unnecessary conversion to bool
Michael Straube [Sun, 13 Oct 2019 13:12:49 +0000 (15:12 +0200)]
staging: rtl8188eu: remove unnecessary conversion to bool

Comparsions evaluate to bool, explicit conversion with ternary
operator is overly verbose and unnecessary, so remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191013131249.34422-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: remove braces from single statement if block
Michael Straube [Sun, 13 Oct 2019 13:12:48 +0000 (15:12 +0200)]
staging: rtl8188eu: remove braces from single statement if block

Remove braces from single statement if block to comply with kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191013131249.34422-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8712: clean up function headers
Wambui Karuga [Sat, 12 Oct 2019 22:19:16 +0000 (01:19 +0300)]
staging: rtl8712: clean up function headers

Remove unnecessary line-breaks in function headers to
improve readability of function headers.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/c14b9e60b1e9bab635bc9527cbd2a2a07436ba44.1570918228.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8712: remove unnecessary return variables
Wambui Karuga [Sat, 12 Oct 2019 22:19:15 +0000 (01:19 +0300)]
staging: rtl8712: remove unnecessary return variables

Remove variables that are only used to hold and return constants and
have the functions directly return the constants.

Issue found by coccinelle:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/f61a0f036af24228c682c6b12c3a8e6cf6736185.1570918228.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: remove typedef declaration for cvmx_fau_op_size
Wambui Karuga [Sat, 12 Oct 2019 18:04:35 +0000 (21:04 +0300)]
staging: octeon: remove typedef declaration for cvmx_fau_op_size

Remove addition of new typedef for enum cvmx_fau_op_size.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/0130bbbffd4c3c9e0e2ab0fc02cb7fa704ee410c.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: remove typedef declartion for cvmx_pko_command_word0
Wambui Karuga [Sat, 12 Oct 2019 18:04:34 +0000 (21:04 +0300)]
staging: octeon: remove typedef declartion for cvmx_pko_command_word0

Removes addition of new typedef declaration for
cvmx_pko_command_word0.
Also replace previous instances with new union declaration.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/40bb26b250d7ba5b0d5199072e773be2fb0fed90.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: remove typedef declaration for cvmx_fau_reg_32
Wambui Karuga [Sat, 12 Oct 2019 18:04:33 +0000 (21:04 +0300)]
staging: octeon: remove typedef declaration for cvmx_fau_reg_32

Remove typedef declaration for enum cvmx_fau_reg_32.
Also replace its previous uses with new declaration format.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/b7216f423d8e06b2ed7ac2df643a9215cd95be32.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: remove typedef declaration for cvmx_helper_link_info
Wambui Karuga [Sat, 12 Oct 2019 18:04:32 +0000 (21:04 +0300)]
staging: octeon: remove typedef declaration for cvmx_helper_link_info

Remove declaration of union cvmx_helper_link_info as typedef.
Also replace its previous uses with new union declaration.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/fb373aed8fd2b04d01198f5a5769fd2476714e88.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: octeon: remove typedef declaration for cvmx_wqe
Wambui Karuga [Sat, 12 Oct 2019 18:04:31 +0000 (21:04 +0300)]
staging: octeon: remove typedef declaration for cvmx_wqe

Remove typedef declaration from struct cvmx_wqe.
Also replace its previous uses with new struct declaration.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/fa82104ea8d7ff54dc66bfbfedb6cca541701991.1570821661.git.wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoMerge 5.4-rc3 into staging-next
Greg Kroah-Hartman [Mon, 14 Oct 2019 05:07:36 +0000 (07:07 +0200)]
Merge 5.4-rc3 into staging-next

We want the staging driver fixes in here as well to build on and test
with.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoLinux 5.4-rc3 v5.4-rc3
Linus Torvalds [Sun, 13 Oct 2019 23:37:36 +0000 (16:37 -0700)]
Linux 5.4-rc3

4 years agoMerge tag 'trace-v5.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Sun, 13 Oct 2019 21:47:10 +0000 (14:47 -0700)]
Merge tag 'trace-v5.4-rc2' of git://git./linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "A few tracing fixes:

   - Remove lockdown from tracefs itself and moved it to the trace
     directory. Have the open functions there do the lockdown checks.

   - Fix a few races with opening an instance file and the instance
     being deleted (Discovered during the lockdown updates). Kept
     separate from the clean up code such that they can be backported to
     stable easier.

   - Clean up and consolidated the checks done when opening a trace
     file, as there were multiple checks that need to be done, and it
     did not make sense having them done in each open instance.

   - Fix a regression in the record mcount code.

   - Small hw_lat detector tracer fixes.

   - A trace_pipe read fix due to not initializing trace_seq"

* tag 'trace-v5.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Initialize iter->seq after zeroing in tracing_read_pipe()
  tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency
  tracing/hwlat: Report total time spent in all NMIs during the sample
  recordmcount: Fix nop_mcount() function
  tracing: Do not create tracefs files if tracefs lockdown is in effect
  tracing: Add locked_down checks to the open calls of files created for tracefs
  tracing: Add tracing_check_open_get_tr()
  tracing: Have trace events system open call tracing_open_generic_tr()
  tracing: Get trace_array reference for available_tracers files
  ftrace: Get a reference counter for the trace_array on filter files
  tracefs: Revert ccbd54ff54e8 ("tracefs: Restrict tracefs when the kernel is locked down")

4 years agoMerge tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Sun, 13 Oct 2019 15:40:31 +0000 (08:40 -0700)]
Merge tag 'hwmon-for-v5.4-rc3' of git://git./linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - Update/fix inspur-ipsps1 and k10temp Documentation

 - Fix nct7904 driver

 - Fix HWMON_P_MIN_ALARM mask in hwmon core

* tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: docs: Extend inspur-ipsps1 title underline
  hwmon: (nct7904) Add array fan_alarm and vsen_alarm to store the alarms in nct7904_data struct.
  docs: hwmon: Include 'inspur-ipsps1.rst' into docs
  hwmon: Fix HWMON_P_MIN_ALARM mask
  hwmon: (k10temp) Update documentation and add temp2_input info
  hwmon: (nct7904) Fix the incorrect value of vsen_mask in nct7904_data struct

4 years agoMerge tag 'fixes-for-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd...
Linus Torvalds [Sun, 13 Oct 2019 15:26:54 +0000 (08:26 -0700)]
Merge tag 'fixes-for-5.4-rc3' of git://git./linux/kernel/git/mtd/linux

Pull MTD fixes from Richard Weinberger:
 "Two fixes for MTD:

   - spi-nor: Fix for a regression in write_sr()

   - rawnand: Regression fix for the au1550nd driver"

* tag 'fixes-for-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
  mtd: rawnand: au1550nd: Fix au_read_buf16() prototype
  mtd: spi-nor: Fix direction of the write_sr() transfer

4 years agoMerge tag 'for-linus-20191012' of git://git.kernel.dk/linux-block
Linus Torvalds [Sun, 13 Oct 2019 15:15:35 +0000 (08:15 -0700)]
Merge tag 'for-linus-20191012' of git://git.kernel.dk/linux-block

Pull io_uring fix from Jens Axboe:
 "Single small fix for a regression in the sequence logic for linked
  commands"

* tag 'for-linus-20191012' of git://git.kernel.dk/linux-block:
  io_uring: fix sequence logic for timeout requests

4 years agoMerge tag 'iio-for-5.5a-take3' of https://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Sun, 13 Oct 2019 08:59:05 +0000 (10:59 +0200)]
Merge tag 'iio-for-5.5a-take3' of https://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of IIO new device support, cleanups and features for the 5.5 cycle

Third version with the adis rework set dropped as better to just have
a fresh version of that at some future date.

The usual mixed backs of new device support being added to drivers,
long term reworks continuing and little per driver cleanups and
features.

Also a few trivial counter subsystem tidy ups on behalf of William.

Core new feature
* Device label support.  A long requested feature no one got around to
  implementing before.  Allows DT based provision of a 'label' that
  identifies a device uniquely within a system.  This differs from existing
  'name' which is meant to be the part number.
New device support
* ingenic-adc
  - Support for the JZ4770 SoC ADC including bindings.
* inv_mpu6050
  - Add support for magnetometer in MPU925x parts.
    Fiddly to do as this is actually a separate device sitting inside the
    package, but with the master device being able to schedule reads etc.
    Will only run if the auxiliary bus is not in use for any other devices.

Features
* ad7192
  - Userspace calibration controls to do zero and full scale.
* st_lsm6dsx
  - Enable latched interrupts by default for sensors events with related clear.
  - Motion events and related wakeup source.  This needed quite a bit of
    refactoring as well.

Cleanups and minor features
* ad7192
  - sysfs ABI docs
* ad7949
  - Remove code to readback configuration word as driver never actually enabled
    it.
  - Fix incorrect xfer length.  Not actually known to cause problems other
    than wasted bus usage.
* adis16080
  - Replace core mlock usage with local lock with more appropriate scope.
* adis16130
  - Remove pointless mlock usage.
* adis16240
  - Remove include of gpio.h as no gpio usage.
* atlas-ph-sensor
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.
* bh1750
  - Fix up a static compiler warning and make the code more readable.
  - yaml conversion of binding + MAINTAINERS entry.
* bmp280
  - Drop a stray newline.
* cm36651
  - Drop a redundant assignment
* itg3200
  - Alignment cleanup.
* max31856
  - Add missing of_node and parent references, useful to identify the device.
* sc27xx_adc
  - Use devm_hwspin_lock_request_specific rather than local rolled version.
* stm32-lptimer counter
  - kernel-doc warning.
* stm32-timer counter
  - kernel-doc warning.
  - Alignment cleanup.
* sx9500
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.
* tcs3414
  - Improve logical ordering of buffer predisable / postenable functions.
    This is part of a longer term rework Alexandru is driving towards.

* tag 'iio-for-5.5a-take3' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (41 commits)
  iio: pressure: bmp280: remove stray newline
  iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code
  iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
  iio: gyro: clean up indentation issue
  counter: stm32: clean up indentation issue
  iio: proximity: sx9500: fix iio_triggered_buffer_{predisable,postenable} positions
  iio: core: Add optional symbolic label to device attributes
  dt-binding: iio: Add optional label property
  iio: gyro: adis16080: replace mlock with own lock
  counter: stm32-lptimer-cnt: fix a kernel-doc warning
  counter: stm32-timer-cnt: fix a kernel-doc warning
  iio: gyro: adis16130: remove mlock usage
  MAINTAINERS: add entry for ROHM BH1750 driver
  dt-bindings: iio: light: bh1750: convert bindings to yaml
  iio: imu: st_lsm6dsx: add motion report function and call from interrupt
  iio: imu: st_lsm6dsx: always enter interrupt thread
  iio: imu: st_lsm6dsx: add wakeup-source option
  iio: imu: st_lsm6dsx: add motion events
  iio: imu: st_lsm6dsx: move interrupt thread to core
  iio: imu: inv_mpu6050: add fifo support for magnetometer data
  ...

4 years agostaging: rtl8723bs: Remove comparison to NULL
Wambui Karuga [Thu, 10 Oct 2019 13:20:58 +0000 (16:20 +0300)]
staging: rtl8723bs: Remove comparison to NULL

Remove comparison to NULL in drivers/staging/rtl8723bs/core/rtw_ap.c:1449.
Issue found by checkpatch.pl

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191010132058.20887-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: fbtft: fbtft-core: Fix last line displayed on fbcon
Michael Hennerich [Fri, 11 Oct 2019 11:24:41 +0000 (14:24 +0300)]
staging: fbtft: fbtft-core: Fix last line displayed on fbcon

For the special case when fbtft_mkdirty() is called with with -1 for the y
coordinate, the height is truncated by 1.

This isn't required, and causes the last line to not update.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191011112441.31003-1-alexandru.ardelean@analog.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: vc04_services: place the AND operator at the end of the previous line
Jules Irenge [Sat, 12 Oct 2019 15:18:05 +0000 (16:18 +0100)]
staging: vc04_services: place the AND operator at the end of the previous line

Place the AND logical operator at the end of the previous line;
to fix warning of "Logical continuations should be on the previous line".
 Issue detected by checkpatch tool.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191012151805.17988-1-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoiio: pressure: bmp280: remove stray newline
Bartosz Golaszewski [Wed, 2 Oct 2019 08:57:58 +0000 (10:57 +0200)]
iio: pressure: bmp280: remove stray newline

Remove a stray newline from the probe callback.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code
Baolin Wang [Fri, 27 Sep 2019 02:41:19 +0000 (10:41 +0800)]
iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code

Change to use devm_hwspin_lock_request_specific() to help to simplify the
cleanup code for drivers requesting one hwlock.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
Alexandru Ardelean [Fri, 20 Sep 2019 07:31:22 +0000 (10:31 +0300)]
iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.

The iio_triggered_buffer_predisable() should be called last, to detach the
poll func after the devices has been suspended.

The position of iio_triggered_buffer_postenable() is correct.

Note this is not stable material. It's a fix in the logical
model rather fixing an actual bug.  These are being tidied up
throughout the subsystem to allow more substantial rework that
was blocked by variations in how things were done.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>