platform/kernel/linux-rpi.git
3 years agodt-bindings: iio: adc: ti,adc12138 yaml conversion.
Jonathan Cameron [Sun, 30 Aug 2020 16:11:53 +0000 (17:11 +0100)]
dt-bindings: iio: adc: ti,adc12138 yaml conversion.

Simple binding conversion from txt to yaml.
Only addition was #io-channel-cells to allow for potential consumers
of the channels on this device.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/20200830161154.3201-2-jic23@kernel.org
3 years agoiio: frequency: adf4350: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:27:31 +0000 (12:27 +0300)]
iio: frequency: adf4350: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock.
The lock protect the state of the device from potential concurrent writes.
The device is configured via a sequence of SPI writes, and this lock is
meant to prevent the start of another sequence before another one has
finished.

This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092731.77220-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:25:35 +0000 (12:25 +0300)]
iio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock on the device's state from potential concurrent write
accesses from userspace. The write operation requires an SPI write, then
toggling of a GPIO, so the lock aims to protect the sanity of the entire
sequence of operation.

This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092535.76527-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: stm32-dac: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:23:49 +0000 (12:23 +0300)]
iio: stm32-dac: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock. The lock protects against potential races when
reading the CR reg and then updating, so that the state of pm_runtime
is consistent between the two operations.

This is part of a bigger cleanup.
Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/
Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/20200916092349.75647-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: adxrs290: Add debugfs register access support
Nishant Malpani [Thu, 10 Sep 2020 18:04:50 +0000 (23:34 +0530)]
iio: gyro: adxrs290: Add debugfs register access support

Extend support to read/write byte data from/to the device using
debugfs iio interface.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-4-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: gyro: adxrs290: Add interrupts support
Nishant Malpani [Thu, 10 Sep 2020 18:04:49 +0000 (23:34 +0530)]
dt-bindings: iio: gyro: adxrs290: Add interrupts support

Include 'interrupts' property and provide a suitable example for using
a GPIO interrupt line.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-3-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: adxrs290: Add triggered buffer support
Nishant Malpani [Thu, 10 Sep 2020 18:04:48 +0000 (23:34 +0530)]
iio: gyro: adxrs290: Add triggered buffer support

Provide a way for continuous data capture by setting up buffer support. The
data ready signal exposed at the SYNC pin of the ADXRS290 is exploited as
a hardware interrupt which triggers to fill the buffer.

Triggered buffer setup was tested with both hardware trigger (DATA_RDY) and
software triggers (sysfs-trig & hrtimer).

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-2-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: adxrs290: use hook for devm resource unwinding
Nishant Malpani [Thu, 10 Sep 2020 12:27:11 +0000 (17:57 +0530)]
iio: gyro: adxrs290: use hook for devm resource unwinding

Make use of devm_add_action_or_reset() hook to switch device into STANDBY
mode during standard resource unwinding. The patch includes a helper
function, in the form of adxrs290_set_mode(), to realise driving the
device into STANDBY mode.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910122711.16670-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32: Fix missing return in booster error path
Krzysztof Kozlowski [Thu, 10 Sep 2020 08:52:07 +0000 (10:52 +0200)]
iio: adc: stm32: Fix missing return in booster error path

Conversion of error paths to dev_err_probe() dropped one return
statement.  The driver will continue to probe if getting booster
regulator fails.

Fixes: ce30eeb613cb ("iio: adc: stm32: Simplify with dev_err_probe()")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/1599727927-7776-1-git-send-email-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: as73211: Increase measurement timeout
Christian Eggers [Wed, 9 Sep 2020 15:44:39 +0000 (17:44 +0200)]
iio: light: as73211: Increase measurement timeout

We found some sensors which are much slower (20% at room temperature)
than nominal. According to the data sheet, up to 27% is possible. Now I
add 33% to the nominal time out, hopefully this is enough.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Link: https://lore.kernel.org/r/20200909154439.10308-1-ceggers@arri.de
Fixes: 403e5586b52e ("iio: light: as73211: New driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: temperature: mlx90632: Interface to change object ambient temperature
Crt Mori [Sun, 6 Sep 2020 21:02:31 +0000 (23:02 +0200)]
iio: temperature: mlx90632: Interface to change object ambient temperature

Since object temperature might be different than the sensor temperature
the infrared sensors should provide an interface to inject ambient
temperature. This was in past done via write to ambient temperature
interface (in_temp_ambient_raw), but I think most people did not know
about it. This solution introduces a new iio type of the CALIBAMBIENT
which is hopefully more descriptive and more explicit about the purpose
and capabilities of the sensors.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200906210231.383976-1-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMAINTAINERS: Move Hartmut Knaack to Credits
Krzysztof Kozlowski [Thu, 3 Sep 2020 18:19:26 +0000 (20:19 +0200)]
MAINTAINERS: Move Hartmut Knaack to Credits

Hartmut Knaack was an active reviewer and contributor to the IIO
subsystem and drivers.  However his last message on LKML is from
October 2015.

In thanks for Hartmut's effort, move him name to the Credits.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio <linux-iio@vger.kernel.org>
Link: https://lore.kernel.org/r/20200903181926.5606-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMAINTAINERS: Consolidate Analog Devices IIO entries and remove Beniamin Bia
Krzysztof Kozlowski [Thu, 3 Sep 2020 18:19:25 +0000 (20:19 +0200)]
MAINTAINERS: Consolidate Analog Devices IIO entries and remove Beniamin Bia

Emails to Beniamin Bia bounce with no such address so remove him from
maintainers.  After this removal, many entries for Analog Devices Inc
IIO drivers look exactly the same so consolidate them.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio <linux-iio@vger.kernel.org>
Link: https://lore.kernel.org/r/20200903181926.5606-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Prefer async probe
Douglas Anderson [Tue, 1 Sep 2020 15:19:43 +0000 (08:19 -0700)]
iio: sx9310: Prefer async probe

On one board I found that:
  probe of 5-0028 returned 1 after 259547 usecs

While some of this time is attributable to the pile of i2c transfers
that we do at probe time, the lion's share (over 200 ms) is sitting
waiting in the polling loop in sx9310_init_compensation() waiting for
the hardware to indicate that it's done.

There's no reason to block probe of all other devices on our probe.
Turn on async probe.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Daniel Campello <campello@chromium.org>
Link: https://lore.kernel.org/r/20200901081920.v2.1.Id02b2f451b3eed71ddd580f4b8b44b3e33e84970@changeid
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: rockchip_saradc: Allow compile-testing with !ARM
Alex Dewar [Fri, 4 Sep 2020 17:04:16 +0000 (18:04 +0100)]
iio: adc: rockchip_saradc: Allow compile-testing with !ARM

There seems no reason to allow for compile-testing on ARM only, so
remove this restriction.

Build-tested with allyesconfig on x86.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200904170416.16061-1-alex.dewar90@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodrivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon
kernel test robot [Tue, 1 Sep 2020 18:30:07 +0000 (19:30 +0100)]
drivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon

Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Fixes: 0115a63c9993 ("iio: humidity: Add TI HDC20x0 support")
CC: Eugene Zaikonnikov <ez@norphonic.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Remove unneeded blank lines
Andy Shevchenko [Mon, 31 Aug 2020 09:08:13 +0000 (12:08 +0300)]
iio: accel: bma220: Remove unneeded blank lines

There are few blank lines that split structure definitions
with their users. Remove them to increase readability.

While here, update copyright year.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Use BIT() and GENMASK() macros
Andy Shevchenko [Mon, 31 Aug 2020 09:08:12 +0000 (12:08 +0300)]
iio: accel: bma220: Use BIT() and GENMASK() macros

Code is better to read when numbers of bit are explicitly used.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Group IIO headers together
Andy Shevchenko [Mon, 31 Aug 2020 09:08:11 +0000 (12:08 +0300)]
iio: accel: bma220: Group IIO headers together

Group IIO headers together and follow the common pattern of header inclusion,
i.e. more generic first.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
Andy Shevchenko [Mon, 31 Aug 2020 09:08:10 +0000 (12:08 +0300)]
iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery

The driver is quite likely used only on ACPI based platforms and
rarely build with CONFIG_ACPI=n. Even though, the few dozens of bytes
is better than ugly ifdeffery and inclusion of heavy header.

As a result, replace acpi.h with mod_devicetable.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Mark PM functions as __maybe_unused
Andy Shevchenko [Mon, 31 Aug 2020 09:08:09 +0000 (12:08 +0300)]
iio: accel: bma220: Mark PM functions as __maybe_unused

Instead of using ugly ifdeffery, mark PM functions as __maybe_unused.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Use dev_get_drvdata() directly
Andy Shevchenko [Mon, 31 Aug 2020 09:08:08 +0000 (12:08 +0300)]
iio: accel: bma220: Use dev_get_drvdata() directly

Instead of using to_spi_dev() + spi_get_drvdata(),
use dev_get_drvdata() to make code simpler.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Convert to use ->read_avail()
Andy Shevchenko [Mon, 31 Aug 2020 09:08:07 +0000 (12:08 +0300)]
iio: accel: bma220: Convert to use ->read_avail()

Convert to use ->read_avail() instead of open-coded attribute handling.

While here, fix the typo in array definition and append comma in case of
the future extension.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()
Andy Shevchenko [Mon, 31 Aug 2020 09:08:06 +0000 (12:08 +0300)]
iio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()

Potentially bma220_init() and bma220_deinit() may return positive codes.
Fix the logic to return proper error codes instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200831090813.78841-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: microchip,mcp3201 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:41 +0000 (12:17 +0100)]
dt-bindings: iio: adc: microchip,mcp3201 yaml conversion.

Drops the deprecated compatibles without the vendor name.
Whilst the driver continues to support these for old dt blobs,
any dt bindings that are actuallly verified against this document should
be fixed to add the vendor name.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Oskar Andero <oskar.andero@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-2-jic23@kernel.org
3 years agoiio: buffer-dmaengine: adjust `bytes_used` with residue info
Alexandru Ardelean [Wed, 26 Aug 2020 05:20:11 +0000 (07:20 +0200)]
iio: buffer-dmaengine: adjust `bytes_used` with residue info

A transfer may fall shorter than the bytes in the block.
This information is available in the residue from the DMA engine, so we can
compute actual `bytes_used` with that by subtracting the residue.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20200826052011.13348-1-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: ti,tlc4541 binding conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:53 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,tlc4541 binding conversion

Simple binding so easy to convert.
Dropped the stated value of maximum spi bus frequency as it does
not seem to correspond to the datasheet.  The value of 200kHz
is the max sampling frequency of the ADC, not the clock frequency of
the SPI bus.

Added #io-channel-cells to allow use as a provider of channels to
other devices via the consumer binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-By: Phil Reid <preid@electromag.com.au>
Cc: Phil Reid <preid@electromag.com.au>
Link: https://lore.kernel.org/r/20200809111753.156236-14-jic23@kernel.org
3 years agodt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc
Phil Reid [Sun, 9 Aug 2020 11:17:52 +0000 (12:17 +0100)]
dt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc

JC: Seems that I messed up applying the original driver patches, and
this file never actually made it into the tree.

I have picked up original Ack and Sign-off so as to record the
history.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200809111753.156236-13-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,ads8344 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:51 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,ads8344 yaml conversion

Simple binding so easy to convert.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200809111753.156236-12-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc128s052 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:49 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc128s052 yaml conversion.

Simple binding.  Only addition to txt version is
as a provider of channels to other devices using the consumer
binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-10-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc0832 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:46 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc0832 yaml conversion.

Simple binding conversion of this SPI ADC binding, with reference
voltage.

Added the optional property #io-channel-cells to allow for
consumers of channels if that makes sense for a given board.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-7-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc161s626 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:45 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc161s626 yaml conversion.

Simple conversion for this ADC driver.  Note that I haven't put
limits on the spi-max-sampling-frequency because the adc161s626
doesn't state one clearly defined value.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200809111753.156236-6-jic23@kernel.org
3 years agodt-bindings: iio: adc: lltc,ltc2497 yaml conversion.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:44 +0000 (12:17 +0100)]
dt-bindings: iio: adc: lltc,ltc2497 yaml conversion.

Very simple binding for this i2c device with a reference supply.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20200809111753.156236-5-jic23@kernel.org
3 years agodt-bindings: iio: adc: ti,adc108s102 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:43 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc108s102 yaml conversion

Very simple conversion of spi device with reference supply.

Added the #io-channel-cells property to allow for consumers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Link: https://lore.kernel.org/r/20200809111753.156236-4-jic23@kernel.org
3 years agodt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.
Jonathan Cameron [Sun, 9 Aug 2020 11:17:42 +0000 (12:17 +0100)]
dt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.

These i2c devices have simple bindings, well described by trivial-device.yaml
so rather than convert the binding doc to yaml, let us just add them to
trivial devices and drop the old binding document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Link: https://lore.kernel.org/r/20200809111753.156236-3-jic23@kernel.org
3 years agoiio: accel: adxl372: Add additional trigger ABI docs
Alexandru Tachici [Mon, 10 Aug 2020 09:32:57 +0000 (12:32 +0300)]
iio: accel: adxl372: Add additional trigger ABI docs

Document use of additional trigger supplied by driver.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200810093257.65929-3-alexandru.tachici@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: adxl372: Add support for FIFO peak mode
Stefan Popa [Mon, 10 Aug 2020 09:32:56 +0000 (12:32 +0300)]
iio: accel: adxl372: Add support for FIFO peak mode

By default, if all three channels (x, y, z) are enabled, sample sets of
concurrent 3-axis data is stored in the FIFO. This patch adds the option
to configure the FIFO to store peak acceleration (x, y and z) of every
over-threshold event. When pushing to iio buffer we push only enabled
axis data.

Currently the driver configures adxl372 to work in loop mode.
The inactivity and activity timings  decide how fast the chip
will loop through the awake and waiting states and the
thresholds on x,y,z axis decide when activity or inactivity
will be detected.

This patch adds standard events sysfs entries for the inactivity
and activity timings: thresh_falling_period/thresh_rising_period
and for the in_accel_x_thresh_falling/rising_value.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200810093257.65929-2-alexandru.tachici@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Some stylefixing leftovers
Crt Mori [Tue, 18 Aug 2020 21:37:37 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Some stylefixing leftovers

There is some inconsistency and whitespace cleanup performed in this
patch. It was done on top of my other patches, but I can rebase to head
of the togreg branch if it would go in sooner.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-6-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Adding extended calibration option
Crt Mori [Tue, 18 Aug 2020 21:37:36 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Adding extended calibration option

For some time the market wants medical grade accuracy in medical range,
while still retaining the declared accuracy outside of the medical range
within the same sensor. That is why we created extended calibration
which is automatically switched to when object temperature is too high.

This patch also introduces the object_ambient_temperature variable which
is needed for more accurate calculation of the object infra-red
footprint as sensor's ambient temperature might be totally different
than what the ambient temperature is at object and that is why we can
have some more errors which can be eliminated. Currently this temperature
is fixed at 25, but the interface to adjust it by user (with external
sensor or just IR measurement of the other object which acts as ambient),
will be introduced in another commit.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-5-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Convert polling while loop to regmap
Crt Mori [Tue, 18 Aug 2020 21:37:35 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Convert polling while loop to regmap

Reduce number of lines and improve readability to convert polling while
loops to regmap_read_poll_timeout.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-4-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Add kerneldoc to the internal struct
Crt Mori [Tue, 18 Aug 2020 21:37:34 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Add kerneldoc to the internal struct

Document internal/private struct for mlx90632 device.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-3-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:temperature:mlx90632: Reduce number of equal calulcations
Crt Mori [Tue, 18 Aug 2020 21:37:33 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Reduce number of equal calulcations

TAdut4 was calculated each iteration although it did not change. In light
of near future additions of the Extended range DSP calculations, this
function refactoring will help reduce unrelated changes in that series as
well as reduce the number of new functions needed.

Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200818213737.140613-2-cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: adxrs290: Insert missing mutex initialization call
Nishant Malpani [Tue, 25 Aug 2020 12:45:52 +0000 (18:15 +0530)]
iio: gyro: adxrs290: Insert missing mutex initialization call

Insert a missing mutex_init() call during the probe that initializes
the driver's local lock to unlocked state.

Fixes: 2c8920fff145 ("iio: gyro: Add driver support for ADXRS290")
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Link: https://lore.kernel.org/r/20200825124552.11155-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodocs: abi: iio: Use What: consistently
Gwendal Grignou [Fri, 28 Aug 2020 23:31:55 +0000 (16:31 -0700)]
docs: abi: iio: Use What: consistently

Change "[w|W]hat[:| ]" to What: for consistency.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20200828233156.2264689-2-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: multiplexer: iio-mux: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:26 +0000 (08:47 +0200)]
iio: multiplexer: iio-mux: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-18-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: mag3110: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:25 +0000 (08:47 +0200)]
iio: magnetometer: mag3110: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-17-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: ak8974: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:24 +0000 (08:47 +0200)]
iio: magnetometer: ak8974: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200829064726.26268-16-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: tsl2772: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:23 +0000 (08:47 +0200)]
iio: light: tsl2772: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-15-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: isl29018: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:22 +0000 (08:47 +0200)]
iio: light: isl29018: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-14-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: inv_mpu6050: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:21 +0000 (08:47 +0200)]
iio: imu: inv_mpu6050: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20200829064726.26268-13-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: dpot-dac: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:20 +0000 (08:47 +0200)]
iio: dac: dpot-dac: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-12-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: chemical: scd30: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:19 +0000 (08:47 +0200)]
iio: chemical: scd30: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Link: https://lore.kernel.org/r/20200829064726.26268-11-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: amplifiers: hmc425a: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:18 +0000 (08:47 +0200)]
iio: amplifiers: hmc425a: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-10-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: afe: iio-rescale: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:17 +0000 (08:47 +0200)]
iio: afe: iio-rescale: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-9-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:16 +0000 (08:47 +0200)]
iio: adc: stm32: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-8-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: rcar-gyroadc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:15 +0000 (08:47 +0200)]
iio: adc: rcar-gyroadc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-7-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: meson_saradc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:14 +0000 (08:47 +0200)]
iio: adc: meson_saradc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-6-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ltc2497: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:13 +0000 (08:47 +0200)]
iio: adc: ltc2497: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-5-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: exynos_adc: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:12 +0000 (08:47 +0200)]
iio: adc: exynos_adc: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-4-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: envelope-detector: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:11 +0000 (08:47 +0200)]
iio: adc: envelope-detector: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200829064726.26268-3-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: mma8452: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:10 +0000 (08:47 +0200)]
iio: accel: mma8452: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bma180: Simplify with dev_err_probe()
Krzysztof Kozlowski [Sat, 29 Aug 2020 06:47:09 +0000 (08:47 +0200)]
iio: accel: bma180: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: chemical: atlas-ezo-sensor: add humidity sensor support
Matt Ranostay [Mon, 17 Aug 2020 00:50:52 +0000 (03:50 +0300)]
iio: chemical: atlas-ezo-sensor: add humidity sensor support

Add support for atlas,hum-ezo / humidity sensor which with scaling
provides respective data in millipercent

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: chemical: add Atlas EZO Humidity module documentation
Matt Ranostay [Mon, 17 Aug 2020 00:50:51 +0000 (03:50 +0300)]
dt-bindings: iio: chemical: add Atlas EZO Humidity module documentation

Cc: devicetree@vger.kernel.org
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()
Tian Tao [Thu, 20 Aug 2020 03:01:26 +0000 (11:01 +0800)]
iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()

Use kobj_to_dev() instead of container_of()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ad5686: Constify static struct iio_chan_spec
Rikard Falkeborn [Tue, 26 May 2020 21:02:21 +0000 (23:02 +0200)]
iio: dac: ad5686: Constify static struct iio_chan_spec

These are never modified and can be made const to allow the compiler to
put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   6642   12608      64   19314    4b72 drivers/iio/dac/ad5686.o

After:
   text    data     bss     dec     hex filename
  16946    2304      64   19314    4b72 drivers/iio/dac/ad5686.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio/dac: convert ltc2632.txt to lltc,ltc2632.yaml
Chris Ruehl [Mon, 10 Aug 2020 03:37:52 +0000 (11:37 +0800)]
iio/dac: convert ltc2632.txt to lltc,ltc2632.yaml

Conversion of the ltc2632 to yaml format and name the file to
'lltc,ltc2632.yaml'.

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: documentation: light: Add as73211 sysfs documentation
Christian Eggers [Mon, 10 Aug 2020 05:24:47 +0000 (07:24 +0200)]
iio: documentation: light: Add as73211 sysfs documentation

The driver for the as73211 light sensor provides the following not yet
documented sysfs entries:
- in_intensity_(x|y|z)_raw
- in_intensity_(x|y|z)_scale
- in_intensity_sampling_frequency(_available)
- in_intensity_hardwaregain(_available)
- in_intensity_integration_time

Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:adc:axp20x: Convert from OF to generic fw / device properties
Jonathan Cameron [Sun, 9 Aug 2020 14:13:05 +0000 (15:13 +0100)]
iio:adc:axp20x: Convert from OF to generic fw / device properties

Whilst fairly unlikely anyone will ever use this driver with anything
other than DT, we are trying to move IIO over to the generic interfaces
where easy to do so.

In this case this involved moving to generic check on presence
of fwnode, generic device_get_match_data() and dropping the of_match_ptr
protection.  Also relevant header changes to have property.h and
mod_devicetable.h only.

Also drop the casting away of a const in favour of retaining
the const throughout.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
3 years agoDocumentation: ABI: iio: fix some spelling mistakes
Ahmad Fatoum [Thu, 13 Aug 2020 06:52:20 +0000 (08:52 +0200)]
Documentation: ABI: iio: fix some spelling mistakes

This fixes some typos found while browsing the documentation.

Cc: trivial@kernel.org
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: health: max30102: update author's email
Matt Ranostay [Fri, 14 Aug 2020 13:49:41 +0000 (06:49 -0700)]
iio: health: max30102: update author's email

Update email to author's current employer

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.
Jonathan Cameron [Tue, 21 Jul 2020 17:14:41 +0000 (18:14 +0100)]
iio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.

We have no known users of these in the wild.
it seems very unlikely these are real IDs having the form ADCXXXX
as that ID is owned by Achnor Datacomm not TI.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
3 years agoiio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections
Jonathan Cameron [Tue, 21 Jul 2020 17:14:42 +0000 (18:14 +0100)]
iio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections

I'm trying to clean this (now) anti-pattern out of IIO to avoid
cut and paste into new drivers.

Also add an include of mod_devicetable.h as the driver directly uses
struct of_device_id which is defined in there.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
3 years agoiio:adc:ti-adc128s052: drop of_match_ptr protection
Jonathan Cameron [Tue, 21 Jul 2020 17:14:43 +0000 (18:14 +0100)]
iio:adc:ti-adc128s052: drop of_match_ptr protection

There is no real advantage in having these protections and
for parts that do not have an explicit ACPI ID, it prevents the
use of PRP0001. I'm trying to clear this out of IIO in general
to avoid copying in new drivers.

Include mod_devicetable.h as we are using of_device_id in here so
including that header is best practice.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
3 years agoiio:adc:bcm_iproc: Drop of_match_ptr protection and switch to mod_devicetable.h
Jonathan Cameron [Tue, 21 Jul 2020 17:14:44 +0000 (18:14 +0100)]
iio:adc:bcm_iproc: Drop of_match_ptr protection and switch to mod_devicetable.h

This driver cannot be instantiated from ACPI due to it's use of
syscon_regmap_lookup_by_phandle() but in the interests of clearing
this anti pattern out of IIO, let us switch to an explicit
check in Kconfig and remove the protections on the of_match_table
The switch of header is because we only use of_device_id
in here and that is defined in mod_devicetable.h not of.h.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
3 years agoiio: dac: dac5571: Support powerdown for multi-channel
Vincent Whitchurch [Tue, 4 Aug 2020 09:31:38 +0000 (11:31 +0200)]
iio: dac: dac5571: Support powerdown for multi-channel

The driver currently only allows channel 0 to be powered down but the
multi-channel variants of the hardware allow each channel to be powered
down separately and with separate power down modes.  Add support for
this.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Acked-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: humidity: Add TI HDC20x0 support
Eugene Zaikonnikov [Fri, 7 Aug 2020 14:38:53 +0000 (16:38 +0200)]
dt-bindings: iio: humidity: Add TI HDC20x0 support

Add device tree bindings for HDC2010/HDC2080 family of humidity and
temperature sensors.

Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: humidity: Add TI HDC20x0 support
Eugene Zaikonnikov [Fri, 7 Aug 2020 14:17:55 +0000 (16:17 +0200)]
iio: humidity: Add TI HDC20x0 support

Add driver support for HDC2010/2080 series devices and sysfs
documentation for their heater element.

HDC2010 is an integrated high-accuracy humidity and temperature sensor
with very low power consumption. The device includes a resistive heating
element. The temperature range is -40C to 125C with 0.2C
accuracy. Humidity measurement is 0 to 100% with 2% RH accuracy.

Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use irq trigger flags from firmware
Stephen Boyd [Mon, 3 Aug 2020 23:58:15 +0000 (17:58 -0600)]
iio: sx9310: Use irq trigger flags from firmware

We shouldn't need to set default irq trigger flags here as the firmware
should have properly indicated the trigger type, i.e. level low, in the
DT or ACPI tables.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Enable vdd and svdd regulators at probe
Stephen Boyd [Mon, 3 Aug 2020 23:58:14 +0000 (17:58 -0600)]
iio: sx9310: Enable vdd and svdd regulators at probe

Enable the main power supply (vdd) and digital IO power supply (svdd)
during probe so that the i2c communication and device works properly on
boards that aggressively power gate these supplies.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Drop channel_users[]
Stephen Boyd [Mon, 3 Aug 2020 23:58:13 +0000 (17:58 -0600)]
iio: sx9310: Drop channel_users[]

This struct member isn't used. Drop it.

Fixes: 72ad02b15d63 ("iio: Add SEMTECH SX9310/9311 sensor driver")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Daniel Campello <campello@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Miscellaneous format fixes
Daniel Campello [Mon, 3 Aug 2020 23:58:12 +0000 (17:58 -0600)]
iio: sx9310: Miscellaneous format fixes

Miscellaneous format fixes throughout the whole file.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use variable to hold &client->dev
Daniel Campello [Mon, 3 Aug 2020 23:58:11 +0000 (17:58 -0600)]
iio: sx9310: Use variable to hold &client->dev

Improves readability by storing &client->dev in a local variable.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Simplify error return handling
Daniel Campello [Mon, 3 Aug 2020 23:58:10 +0000 (17:58 -0600)]
iio: sx9310: Simplify error return handling

Checks for non-zero return values to signal error conditions.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Update copyright
Daniel Campello [Mon, 3 Aug 2020 23:58:09 +0000 (17:58 -0600)]
iio: sx9310: Update copyright

Fixes wrong copyright year.

Signed-off-by: Daniel Campello <campello@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use regmap_read_poll_timeout() for compensation
Daniel Campello [Mon, 3 Aug 2020 23:58:08 +0000 (17:58 -0600)]
iio: sx9310: Use regmap_read_poll_timeout() for compensation

Simplify compensation stage by using regmap_read_poll_timeout().

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use long instead of int for channel bitmaps
Daniel Campello [Mon, 3 Aug 2020 23:58:07 +0000 (17:58 -0600)]
iio: sx9310: Use long instead of int for channel bitmaps

Uses for_each_set_bit() macro to loop over channel bitmaps.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Fixes various memory handling
Daniel Campello [Mon, 3 Aug 2020 23:58:06 +0000 (17:58 -0600)]
iio: sx9310: Fixes various memory handling

Makes use __aligned(8) to ensure that the timestamp is correctly aligned
when we call io_push_to_buffers_with_timestamp().
Also makes use of sizeof() for regmap_bulk_read instead of static value.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Change from .probe to .probe_new
Daniel Campello [Mon, 3 Aug 2020 23:58:05 +0000 (17:58 -0600)]
iio: sx9310: Change from .probe to .probe_new

Uses .probe_new in place of .probe. Also uses device_get_match_data()
for whoami matching.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Remove acpi and of table macros
Daniel Campello [Mon, 3 Aug 2020 23:58:04 +0000 (17:58 -0600)]
iio: sx9310: Remove acpi and of table macros

Avoids unused warnings due to acpi/of table macros.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Fix irq handling
Daniel Campello [Mon, 3 Aug 2020 23:58:03 +0000 (17:58 -0600)]
iio: sx9310: Fix irq handling

Fixes enable/disable irq handling at various points. The driver needs to
only enable/disable irqs if there is an actual irq handler installed.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Update macros declarations
Daniel Campello [Mon, 3 Aug 2020 23:58:02 +0000 (17:58 -0600)]
iio: sx9310: Update macros declarations

Follows spec sheet for macro declarations.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: Add bindings for sx9310 sensor
Daniel Campello [Mon, 3 Aug 2020 23:58:01 +0000 (17:58 -0600)]
dt-bindings: iio: Add bindings for sx9310 sensor

Adds device tree bindings for sx9310 sensor.

Signed-off-by: Daniel Campello <campello@chromium.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Rob Herring <robh+dt@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
[swboyd@chromium.org: Add both regulators and make them optional]
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: maxim,max1118 yaml conversion
Jonathan Cameron [Sat, 1 Aug 2020 17:58:50 +0000 (18:58 +0100)]
dt-bindings: iio: adc: maxim,max1118 yaml conversion

Simple device with a simple conversion.  Special handling needed
for the max1118 which is the only supported part that has an external
reference voltage.

Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agoiio: light: as73211: New driver
Christian Eggers [Wed, 5 Aug 2020 05:57:44 +0000 (07:57 +0200)]
iio: light: as73211: New driver

Support for AMS AS73211 JENCOLOR(R) Digital XYZ Sensor.

This driver has no built-in trigger. In order for making triggered
measurements, an external (software) trigger driver like
iio-trig-hrtimer or iio-trig-sysfs is required.

The sensor supports single and continuous measurement modes. The latter
is not used by design as this would require tight timing synchronization
between hardware and driver without much benefit.

Datasheet: https://ams.com/documents/20143/36005/AS73211_DS000556_3-01.pdf
Signed-off-by: Christian Eggers <ceggers@arri.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: light: add AMS AS73211 support
Christian Eggers [Wed, 5 Aug 2020 05:57:43 +0000 (07:57 +0200)]
dt-bindings: iio: light: add AMS AS73211 support

Add DT bindings for AMS AS73211 XYZ True Color Sensor.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: iio: ad9834: Remove excess blank line
Calvin Glisson [Wed, 5 Aug 2020 22:23:00 +0000 (15:23 -0700)]
staging: iio: ad9834: Remove excess blank line

Remove excess blank line after variable declarations.
Improves code consistency and readability.
Change suggested by checkpatch.pl:

CHECK: Please don't use multiple blank lines

Signed-off-by: Calvin Glisson <taragaram@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoplatform_data: ad7793.h: drop a duplicated word
Randy Dunlap [Sun, 19 Jul 2020 00:30:40 +0000 (17:30 -0700)]
platform_data: ad7793.h: drop a duplicated word

Drop the repeated word "and" in a comment.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: maxim,max9611 yaml conversions
Jonathan Cameron [Wed, 22 Jul 2020 17:12:24 +0000 (18:12 +0100)]
dt-bindings: iio: adc: maxim,max9611 yaml conversions

Straight forward conversion of this binding for this
current sense amplifier and ADC.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: iio: adc: maxim,max11100 yaml conversion
Jonathan Cameron [Wed, 22 Jul 2020 17:12:22 +0000 (18:12 +0100)]
dt-bindings: iio: adc: maxim,max11100 yaml conversion

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>