]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
10 months agoiio: ABI: add missing calibbias attributes
David Lechner [Thu, 15 Aug 2024 17:22:13 +0000 (12:22 -0500)] 
iio: ABI: add missing calibbias attributes

There are a number of calibbias and calibbias_available attributes that
are being used by various drivers that have not been documented yet.

This adds attributes found by searching the code for:

    BIT(IIO_CHAN_INFO_CALIBSCALE)

A couple of not quite alphabetical order attributes were moved while
touching this.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240815-iio-abi-calib-audit-v1-4-536b2fea8620@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: ABI: add missing calibscale attributes
David Lechner [Thu, 15 Aug 2024 17:22:12 +0000 (12:22 -0500)] 
iio: ABI: add missing calibscale attributes

This adds additional calibscale attributes to the ABI documentation for
instances found in drivers by searching the code for:

    BIT(IIO_CHAN_INFO_CALIBSCALE)

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240815-iio-abi-calib-audit-v1-3-536b2fea8620@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: ABI: sort calibscale attributes
David Lechner [Thu, 15 Aug 2024 17:22:11 +0000 (12:22 -0500)] 
iio: ABI: sort calibscale attributes

Sort calibscale attributes so that when we add more, they can also be
added in alphabetical order.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240815-iio-abi-calib-audit-v1-2-536b2fea8620@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: ABI: document calibscale_available attributes
David Lechner [Thu, 15 Aug 2024 17:22:10 +0000 (12:22 -0500)] 
iio: ABI: document calibscale_available attributes

There are a number of light sensor drivers that have various
calibscale_available attributes. Up to now, these were missing from
the documentation.

Kernel version 4.8 is used since the first use appears to be in
commit eb869ade30a6 ("iio: Add tcs3472 color light sensor driver").

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240815-iio-abi-calib-audit-v1-1-536b2fea8620@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: ltr390: Calculate 'counts_per_uvi' dynamically
Abhash Jha [Wed, 14 Aug 2024 11:31:34 +0000 (17:01 +0530)] 
iio: light: ltr390: Calculate 'counts_per_uvi' dynamically

counts_per_uvi depends on the current value of gain and resolution.
Hence, we cannot use the hardcoded value 96.
The `counts_per_uvi` function gives the count based on the current gain
and resolution (integration time).

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240814113135.14575-3-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: ltr390: Add ALS channel and support for gain and resolution
Abhash Jha [Wed, 14 Aug 2024 11:31:33 +0000 (17:01 +0530)] 
iio: light: ltr390: Add ALS channel and support for gain and resolution

Add new ALS channel and allow reading lux and scale values.
Also provide gain and resolution configuration for ALS channel.
Add automatic mode switching between the UVS and ALS channel
based on which channel is being accessed.
The default mode in which the sensor start is ALS mode.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240814113135.14575-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodoc: iio: ad4695: document buffered read
David Lechner [Tue, 13 Aug 2024 17:26:41 +0000 (12:26 -0500)] 
doc: iio: ad4695: document buffered read

Update the ad4695 documentation to say that buffered reads are
supported. Since there are 4 possible modes of reading conversion data,
it is useful to know which one is actually being used, namely the
advanced sequencer mode.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240813-iio-adc-ad4695-buffered-read-v2-2-9bb19fc1924b@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad4695: implement triggered buffer
David Lechner [Tue, 13 Aug 2024 17:26:40 +0000 (12:26 -0500)] 
iio: adc: ad4695: implement triggered buffer

This implements buffered reads for the ad4695 driver using the typical
triggered buffer implementation, including adding a soft timestamp
channel.

The chip has 4 different modes for doing conversions. The driver is
using the advanced sequencer mode since that is the only mode that
allows individual configuration of all aspects each channel (e.g.
bipolar config currently and oversampling to be added in the future).

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240813-iio-adc-ad4695-buffered-read-v2-1-9bb19fc1924b@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: proximity: hx9023s: Fix error code in hx9023s_property_get()
Dan Carpenter [Mon, 12 Aug 2024 06:43:05 +0000 (09:43 +0300)] 
iio: proximity: hx9023s: Fix error code in hx9023s_property_get()

If we're returning because "reg >= HX9023S_CH_NUM" then set the error code
to -ENIVAL instead of success.

Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/49b5a9bc-e5ca-43a7-a665-313eb06fbe27@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: noa1305: Fix up integration time look up
Marek Vasut [Wed, 14 Aug 2024 19:19:09 +0000 (21:19 +0200)] 
iio: light: noa1305: Fix up integration time look up

The current code is always iterating over two fields in the
noa1305_int_time_available array. Fix iteration limit, which
has to be halved to avoid out of bounds access in case the
value that is being looked up is not in the array.

Fixes: 025f23cfebad ("iio: light: noa1305: Make integration time configurable")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240814191946.81386-1-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: humidity: Add support for ENS210
Joshua Felmeden [Mon, 5 Aug 2024 08:12:53 +0000 (09:12 +0100)] 
iio: humidity: Add support for ENS210

Add support for ENS210/ENS210A/ENS211/ENS212/ENS213A/ENS215.

The ENS21x is a family of temperature and relative humidity sensors with
accuracies tailored to the needs of specific applications.

Signed-off-by: Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk>
Link: https://patch.msgid.link/20240805-ens21x-v6-2-5bb576ef26a6@thegoodpenguin.co.uk
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: humidity: add ENS210 sensor family
Joshua Felmeden [Mon, 5 Aug 2024 08:12:52 +0000 (09:12 +0100)] 
dt-bindings: iio: humidity: add ENS210 sensor family

Add device tree documentation for ENS210 family of temperature and
humidity sensors

Signed-off-by: Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240805-ens21x-v6-1-5bb576ef26a6@thegoodpenguin.co.uk
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: imu: adis16460: drop ifdef around CONFIG_DEBUG_FS
Nuno Sa [Fri, 9 Aug 2024 09:17:09 +0000 (11:17 +0200)] 
iio: imu: adis16460: drop ifdef around CONFIG_DEBUG_FS

Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present.
Since this is known at compile time, it allows the compiler to drop any
unused code. Therefore no need to wrap the code with #ifdef.

While at it make adis16460_debugfs_init() void as the return code is
ignored.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-4-d3adb6996518@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: imu: adis16400: drop ifdef around CONFIG_DEBUG_FS
Nuno Sa [Fri, 9 Aug 2024 09:17:08 +0000 (11:17 +0200)] 
iio: imu: adis16400: drop ifdef around CONFIG_DEBUG_FS

Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present.
Since this is known at compile time, it allows the compiler to drop any
unused code. Therefore no need to wrap the code with #ifdef.

While at it make adis16400_debugfs_init() void as the return code is
ignored.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-3-d3adb6996518@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: imu: adis16480: drop ifdef around CONFIG_DEBUG_FS
Nuno Sa [Fri, 9 Aug 2024 09:17:07 +0000 (11:17 +0200)] 
iio: imu: adis16480: drop ifdef around CONFIG_DEBUG_FS

Use IS_ENABLED(CONFIG_DEBUG_FS) to return in case debugfs is not present.
Since this is known at compile time, it allows the compiler to drop any
unused code. Therefore no need to wrap the code with #ifdef.

While at it make adis16480_debugfs_init() void as the return code is
ignored.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-2-d3adb6996518@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: imu: adis16475: drop ifdef around CONFIG_DEBUG_FS
Nuno Sa [Fri, 9 Aug 2024 09:17:06 +0000 (11:17 +0200)] 
iio: imu: adis16475: drop ifdef around CONFIG_DEBUG_FS

Use IS_ENABLED(CONFIG_DEBUG_FS) to return early in case debugfs is not
present. Since this is known at compile time, it allows the compiler to
drop any unused code. Therefore no need to wrap the code with #ifdef.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240809-dev-adis-debugfs-improv-v1-1-d3adb6996518@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: pac1921: add missing error return in probe()
Dan Carpenter [Thu, 8 Aug 2024 19:28:17 +0000 (22:28 +0300)] 
iio: adc: pac1921: add missing error return in probe()

This error path was intended to return, and not just print an error.  The
current code will lead to an error pointer dereference.

Fixes: 371f778b83cd ("iio: adc: add support for pac1921")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/1fa4ab12-0939-477d-bc92-306fd32e4fd9@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: Fix spelling mistake "avaialable" -> "available"
Colin Ian King [Wed, 7 Aug 2024 09:47:45 +0000 (10:47 +0100)] 
iio: Fix spelling mistake "avaialable" -> "available"

There is a spelling mistake in a dev_warn message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20240807094745.4174785-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: dac: ltc2664: Fix off by one in ltc2664_channel_config()
Dan Carpenter [Fri, 9 Aug 2024 12:28:30 +0000 (15:28 +0300)] 
iio: dac: ltc2664: Fix off by one in ltc2664_channel_config()

This comparison should be >= ARRAY_SIZE() instead of >.  The "mspan"
variable is later used as an array index into ltc2664_mspan_lut[] so
this is an off by one bug.

Fixes: 4cc2fc445d2e ("iio: dac: ltc2664: Add driver for LTC2664 and LTC2672")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/5727ab54-6280-466e-b107-1b6006e5ab29@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: bmi323: suspend and resume triggering on relevant pm operations
Denis Benato [Wed, 7 Aug 2024 18:56:19 +0000 (20:56 +0200)] 
iio: bmi323: suspend and resume triggering on relevant pm operations

Prevent triggers from stop working after the device has entered sleep:
use iio_device_suspend_triggering and iio_device_resume_triggering helpers.

Signed-off-by: Denis Benato <benato.denis96@gmail.com>
Link: https://patch.msgid.link/20240807185619.7261-3-benato.denis96@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: trigger: allow devices to suspend/resume theirs associated trigger
Denis Benato [Wed, 7 Aug 2024 18:56:18 +0000 (20:56 +0200)] 
iio: trigger: allow devices to suspend/resume theirs associated trigger

When a machine enters a sleep state while a trigger is associated to
an iio device that trigger is not resumed after exiting the sleep state:
provide iio device drivers a way to suspend and resume
the associated trigger to solve the aforementioned bug.

Each iio driver supporting external triggers is expected to call
iio_device_suspend_triggering before suspending,
and iio_device_resume_triggering upon resuming.

Signed-off-by: Denis Benato <benato.denis96@gmail.com>
Link: https://patch.msgid.link/20240807185619.7261-2-benato.denis96@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: adc: Add rockchip,rk3576-saradc string
Detlev Casanova [Fri, 2 Aug 2024 21:45:31 +0000 (17:45 -0400)] 
dt-bindings: iio: adc: Add rockchip,rk3576-saradc string

Add rockchip,rk3576-saradc compatible string.
The saradc on RK3576 is compatible with the one on RK3588, so they are
used together in an arm of the oneOf.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20240802214612.434179-5-detlev.casanova@collabora.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: ad4695: fix common-mode-channel
David Lechner [Thu, 8 Aug 2024 21:12:08 +0000 (16:12 -0500)] 
dt-bindings: iio: ad4695: fix common-mode-channel

The common-mode-channel property is a scalar, not an array, so we should
not be using items: in the schema when specifying allowable values.

Reported-by: Rob Herring <robh@kernel.org>
Closes: https://lore.kernel.org/linux-iio/CAL_JsqKaddw8FnPfdnhKhHUb8AcTxFadc_eZmxjX0QxFR80=mw@mail.gmail.com/
Fixes: b40cafc11436 ("dt-bindings: iio: adc: add AD4695 and similar ADCs")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240808-iio-adc-ad4695-fix-dt-bindings-v1-1-5cf37b9547b0@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: apds9960: Add proximity and gesture offset calibration
Abhash Jha [Sun, 4 Aug 2024 13:42:12 +0000 (19:12 +0530)] 
iio: light: apds9960: Add proximity and gesture offset calibration

Proximity and gesture offset registers perform offset correction to
improve cross-talk performance. Added `calibbias` to the proximity
and gesture channels.
Provided facility to set calibbias based on the channel number.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240804134212.51682-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: stm32-dfsdm: add scaling support to dfsdm
Olivier Moysan [Tue, 30 Jul 2024 08:46:39 +0000 (10:46 +0200)] 
iio: adc: stm32-dfsdm: add scaling support to dfsdm

Add scaling support to STM32 DFSDM.

When used in an analog context, a DFSDM filter typically converts the data
from a sigma delta modulator. The IIO device associated to the DFSDM
filter provides these data as raw data.
The IIO device can provide scaling information (voltage and offset) to
allow conversion of raw data into physical values.

With the new binding based on IIO backend framework, the sigma delta
modulators are defined as backends providing scaling information.

The scaling is not supported with legacy binding.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240730084640.1307938-10-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: add iio backend support to sd modulator
Olivier Moysan [Tue, 30 Jul 2024 08:46:38 +0000 (10:46 +0200)] 
iio: add iio backend support to sd modulator

The legacy sd modulator driver registers the sigma delta modulator as
an IIO channel provider. This implementation is not convenient when the
SD modulator has to be cascaded with another IIO device. The scaling
information is distributed across devices, which makes it difficult to
report consistent scaling data on IIO devices.

The solution is to expose these cascaded IIO devices as an aggregate
device, which report global scaling information.
Add IIO backend support to SD modulator to allow scaling information
management.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20240730084640.1307938-9-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: stm32-dfsdm: adopt generic channels bindings
Olivier Moysan [Tue, 30 Jul 2024 08:46:37 +0000 (10:46 +0200)] 
iio: adc: stm32-dfsdm: adopt generic channels bindings

Move to generic channels binding to ease new backend framework adoption
and prepare the convergence with MDF IP support on STM32MP2 SoC family.

Legacy binding:
DFSDM is an IIO channel consumer.
SD modulator is an IIO channels provider.
The channel phandles are provided in DT through io-channels property
and channel indexes through st,adc-channels property.

New binding:
DFSDM is an IIO channel provider.
The channel indexes are given by reg property in channel child node.

This new binding is intended to be used with SD modulator IIO backends.
It does not support SD modulator legacy IIO devices.
The st,adc-channels property presence is used to discriminate
between legacy and backend bindings.

The support of the DFSDM legacy channels and SD modulator IIO devices
is kept for backward compatibility.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20240730084640.1307938-8-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: add vref support to sd modulator
Olivier Moysan [Tue, 30 Jul 2024 08:46:36 +0000 (10:46 +0200)] 
dt-bindings: iio: add vref support to sd modulator

Allow to specify the reference voltage used by the SD modulator.
When the SD modulator is defined as an IIO backend, the reference
voltage can be used to evaluate scaling information of the IIO device.
The reference voltage is not used otherwise.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240730084640.1307938-7-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: add backend support to sd modulator
Olivier Moysan [Tue, 30 Jul 2024 08:46:35 +0000 (10:46 +0200)] 
dt-bindings: iio: add backend support to sd modulator

The legacy sd modulator driver registers the sigma delta modulator as
an IIO channel provider. This implementation is not convenient when the
SD modulator has to be cascaded with another IIO device. The scaling
information is distributed across devices, which makes it difficult to
report consistent scaling data on IIO devices.

The solution is to expose these cascaded IIO devices as an aggregate
device, which report global scaling information.
Add IIO backend support to SD modulator to allow scaling information
management.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240730084640.1307938-6-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: dfsdm: move to backend framework
Olivier Moysan [Tue, 30 Jul 2024 08:46:34 +0000 (10:46 +0200)] 
dt-bindings: iio: dfsdm: move to backend framework

Change the DFSDM binding to use the new IIO backend framework,
along with the adoption of IIO generic channels.
This binding change allows to add scaling support to the DFSDM.

Keep the legacy binding as deprecated for backward compatibility.

The io-backends property is supported only in generic IIO channel
binding.

- Channel description with the generic binding (Audio and Analog):

  Properties superseded by generic properties:
    st,adc-channels: becomes "reg" property in channel node
    st,adc-channel-names: becomes "label" property in channel node
  Properties moved to channel child node:
    st,adc-channel-types: becomes st,adc-channel-type
    st,adc-channel-clk-src, st,adc-alt-channel

- Analog binding:

  DFSDM filter channel is configured as an IIO backend consumer.
  Add io-backends property in channel child nodes.

  DFSDM is no more configured as a channel consumer from SD modulator.
  Use of io-channels in DFSDM node is deprecated.

- Audio binding:

  DFSDM audio DAI is configured as a channel consumer from DFSDM filter.
  No change compare to legacy.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240730084640.1307938-5-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: add child nodes support in iio backend framework
Olivier Moysan [Tue, 30 Jul 2024 08:46:33 +0000 (10:46 +0200)] 
iio: add child nodes support in iio backend framework

Add an API to support IIO generic channels binding:
http://devicetree.org/schemas/iio/adc/adc.yaml#
This new API is needed, as generic channel DT node isn't populated as a
device.
Add devm_iio_backend_fwnode_get() to allow an IIO device backend
consumer to reference backend phandles in its child nodes.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240730084640.1307938-4-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: add enable and disable services to iio backend framework
Olivier Moysan [Tue, 30 Jul 2024 08:46:32 +0000 (10:46 +0200)] 
iio: add enable and disable services to iio backend framework

Add iio_backend_disable() and iio_backend_enable() APIs to allow
IIO backend consumer to request backend disabling and enabling.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240730084640.1307938-3-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: add read scale and offset services to iio backend framework
Olivier Moysan [Tue, 30 Jul 2024 08:46:31 +0000 (10:46 +0200)] 
iio: add read scale and offset services to iio backend framework

Add iio_backend_read_scale() and iio_backend_read_offset() services
to read channel scale and offset from an IIO backbend device.

Also add a read_raw callback which replicates the read_raw callback of
the IIO framework, and is intended to request miscellaneous channel
attributes from the backend device.
Both scale and offset helpers use this callback.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240730084640.1307938-2-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: asahi-kasei,ak8975: drop incorrect AK09116 compatible
Krzysztof Kozlowski [Tue, 6 Aug 2024 05:30:16 +0000 (07:30 +0200)] 
dt-bindings: iio: asahi-kasei,ak8975: drop incorrect AK09116 compatible

All compatibles in this binding without prefixes were deprecated, so
adding a new deprecated one after some time is not allowed, because it
defies the core logic of deprecating things.

Drop the AK09916 vendorless compatible.

Fixes: 76e28aa97fa0 ("iio: magnetometer: ak8975: add AK09116 support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240806053016.6401-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: magnetometer: ak8975: drop incorrect AK09116 compatible
Krzysztof Kozlowski [Tue, 6 Aug 2024 05:30:15 +0000 (07:30 +0200)] 
iio: magnetometer: ak8975: drop incorrect AK09116 compatible

All compatibles in this binding without prefixes were deprecated, so
adding a new deprecated one after some time is not allowed, because it
defies the core logic of deprecating things.

Drop the AK09916 vendorless compatible.

Fixes: 76e28aa97fa0 ("iio: magnetometer: ak8975: add AK09116 support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240806053016.6401-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoABI: debugfs-iio-ad9467: document the debugfs interface
Nuno Sa [Tue, 6 Aug 2024 13:10:40 +0000 (15:10 +0200)] 
ABI: debugfs-iio-ad9467: document the debugfs interface

Document the debugfs interface for the IIO ad9467 high speed ADC.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806-dev-ad-debugfs-doc-v1-2-153b882a3f01@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoMAINTAINERS: add entry for ad9467
Nuno Sa [Tue, 6 Aug 2024 13:10:39 +0000 (15:10 +0200)] 
MAINTAINERS: add entry for ad9467

Document the maintainers for the IIO ad9467 high speed ADC.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806-dev-ad-debugfs-doc-v1-1-153b882a3f01@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: dac: ad9739a: add backend debugfs interface
Nuno Sa [Tue, 6 Aug 2024 13:35:07 +0000 (15:35 +0200)] 
iio: dac: ad9739a: add backend debugfs interface

Call iio_backend_debugfs_add() to add (if available) the backend debug
interface.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806-dev-backend-dac-direct-reg-access-v1-2-b84a6e8ee8a0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: dac: adi-axi-dac: support debugfs direct_reg_access
Nuno Sa [Tue, 6 Aug 2024 13:35:06 +0000 (15:35 +0200)] 
iio: dac: adi-axi-dac: support debugfs direct_reg_access

Make it possible to read/write registers on the backend using the
debugfs interface for it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240806-dev-backend-dac-direct-reg-access-v1-1-b84a6e8ee8a0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: remove unneeded assignment in __iio_format_value
Matteo Martelli [Tue, 30 Jul 2024 09:43:49 +0000 (11:43 +0200)] 
iio: remove unneeded assignment in __iio_format_value

Trivial cleanup in __iio_format_value() for the IIO_VAL_FRACTIONAL case
where tmp1 = vals[1] assignment is unneeded and irrelevant since tmp1 is
immediately overwritten by the subsequent div_s64_rem() call.

Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240730-iio-clean-fmt-value-v1-1-3e1c3deafc33@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7124: set initial ADC mode to idle
Dumitru Ceclan [Wed, 31 Jul 2024 12:37:25 +0000 (15:37 +0300)] 
iio: adc: ad7124: set initial ADC mode to idle

During setup the st->adc_control is 0, which corresponds to a continuous
conversion mode. The reset value for channel 1 is to enable it. The
combined effect of these two is that the ADC will start conversions for
channel 1 without them being read.
This is not neccessarily a problem, but it is an unexpected behavior.

Set the ADC state to idle during setup to avoid this.

Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240731-ad7124-fix-v1-4-46a76aa4b9be@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7124: reduce the number of SPI transfers
Dumitru Ceclan [Wed, 31 Jul 2024 12:37:24 +0000 (15:37 +0300)] 
iio: adc: ad7124: reduce the number of SPI transfers

The ad7124_init_config_vref() function writes the AD7124_ADC_CONTROL
register for each channel that is configured to use the internal
reference.

The ad7124_write_config()function performs 7 SPI transfers for
configuring 2 registers: config_x and filter_x.

Reduce the number of SPI transfers:
-during the probe by only setting the st->adc_control value in
 ad7124_init_config_vref() and writing to the device only at the end of
 ad7124_setup().
-in ad7124_write_config() by grouping writes to the same register.

Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240731-ad7124-fix-v1-3-46a76aa4b9be@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: ltr390: Add configurable gain and resolution
Abhash Jha [Wed, 31 Jul 2024 06:37:03 +0000 (12:07 +0530)] 
iio: light: ltr390: Add configurable gain and resolution

Add support for configuring and reading the gain and resolution
(integration time). Also provide the available values for gain and
resoltion respectively via `read_avail` callback.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240731063706.25412-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad9467: add digital interface test to debugfs
Nuno Sa [Fri, 2 Aug 2024 14:27:06 +0000 (16:27 +0200)] 
iio: adc: ad9467: add digital interface test to debugfs

One useful thing to do (in case of problems) in this high speed devices
with digital interfaces is to try different test patterns to see if the
interface is working properly (and properly calibrated). Hence add this
to debugfs.

On top of this, for some test patterns, the backend may have a matching
validator block which can be helpful in identifying possible issues. For
the other patterns some test equipment must be used so one can look into
the signal and see how it looks like.

Hence, we also add the backend debugfs interface with
iio_backend_debugfs_add().

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-8-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad9467: add backend test mode helpers
Nuno Sa [Fri, 2 Aug 2024 14:27:05 +0000 (16:27 +0200)] 
iio: adc: ad9467: add backend test mode helpers

Group the backend configurations to be done in preparing and stopping
calibration in two new helpers analogous to ad9467_testmode_set(). This
is in preparation for adding support for debugFS test_mode where
we need similar configurations as in the calibration process.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-7-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: adi-axi-adc: implement backend debugfs interface
Nuno Sa [Fri, 2 Aug 2024 14:27:04 +0000 (16:27 +0200)] 
iio: adc: adi-axi-adc: implement backend debugfs interface

Implement debugfs options to read/write registers and print the channel
status into a buffer (so we may know better the cause for errors) .

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-6-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: adi-axi-adc: split axi_adc_chan_status()
Nuno Sa [Fri, 2 Aug 2024 14:27:03 +0000 (16:27 +0200)] 
iio: adc: adi-axi-adc: split axi_adc_chan_status()

Add a new axi_adc_read_chan_status() helper so we get the raw register
value out of it.

This is in preparation of a future change where we really want to look
into dedicated bits of the register.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-5-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: adi-axi-adc: support modified prbs23
Nuno Sa [Fri, 2 Aug 2024 14:27:02 +0000 (16:27 +0200)] 
iio: adc: adi-axi-adc: support modified prbs23

Add support for configuring the prbs23 sequence.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-4-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: backend: add a modified prbs23 support
Nuno Sa [Fri, 2 Aug 2024 14:27:01 +0000 (16:27 +0200)] 
iio: backend: add a modified prbs23 support

Support ADI specific prb23 sequence that can be used both for
calibrating or debugging digital interfaces.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-3-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: backend: add debugFs interface
Nuno Sa [Fri, 2 Aug 2024 14:27:00 +0000 (16:27 +0200)] 
iio: backend: add debugFs interface

This adds a basic debugfs interface for backends. Two new ops are being
added:

 * debugfs_reg_access: Analogous to the core IIO one but for backend
   devices.
 * debugfs_print_chan_status: One useful usecase for this one is for
   testing test tones in a digital interface and "ask" the backend to
   dump more details on why a test tone might have errors.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-2-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: backend: introduce struct iio_backend_info
Nuno Sa [Fri, 2 Aug 2024 14:26:59 +0000 (16:26 +0200)] 
iio: backend: introduce struct iio_backend_info

Instead of only passing the backend ops when calling
devm_iio_backend_register(), pass an info like structure that will
contains the ops and additional information. Fow now, the backend name
is being added as that will be used by the debugFS interface introduced
in a later patch.

It also opens the door for further customizations passed by backends.

All users of devm_iio_backend_register() were updated accordingly.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240802-dev-iio-backend-add-debugfs-v2-1-4cb62852f0d0@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: aspeed: Use of_property_present()
Rob Herring (Arm) [Wed, 31 Jul 2024 19:12:43 +0000 (13:12 -0600)] 
iio: adc: aspeed: Use of_property_present()

Use of_property_present() to test for property presence rather than
of_find_property(). This is part of a larger effort to remove callers
of of_find_property() and similar functions. of_find_property() leaks
the DT struct property and data pointers which is a problem for
dynamically allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://patch.msgid.link/20240731191312.1710417-5-robh@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7768-1: use device_* to iterate over device child nodes
Javier Carrasco [Thu, 1 Aug 2024 06:13:51 +0000 (08:13 +0200)] 
iio: adc: ad7768-1: use device_* to iterate over device child nodes

Drop the manual access to the fwnode of the device to iterate over its
child nodes. `device_for_each_child_node` macro provides direct access
to the child nodes, and given that they are only required within the
loop, the scoped variant of the macro can be used.

Use the `device_for_each_child_node_scoped` macro to iterate over the
direct child nodes of the device.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240801-device_child_node_access-v1-2-ddfa21bef6f2@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodocs: iio: ad7380: add support for single-ended parts
Julien Stephan [Wed, 31 Jul 2024 07:05:48 +0000 (09:05 +0200)] 
docs: iio: ad7380: add support for single-ended parts

The AD7380 family has some compatible single-ended chips: AD7386/7/8(-4).
These single-ended chips have a  2:1 multiplexer in front of each ADC.
They also include additional configuration registers that allow for either
manual selection or automatic switching (sequencer mode), of the
multiplexer inputs. Add a section to describe this.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-7-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7380: enable sequencer for single-ended parts
Julien Stephan [Wed, 31 Jul 2024 07:05:47 +0000 (09:05 +0200)] 
iio: adc: ad7380: enable sequencer for single-ended parts

ad7386/7/8(-4) single-ended parts have a 2:1 mux in front of each ADC.

>From an IIO point of view, all inputs are exported, i.e ad7386/7/8
export 4 channels and ad7386-4/7-4/8-4 export 8 channels. First inputs
of muxes correspond to the first half of IIO channels (i.e 0-1 or 0-3)
and second inputs correspond to second half (i.e 2-3 or 4-7)

Currently, the driver supports only sampling first half OR second half of
the IIO channels. To enable sampling all channels simultaneously, these
parts have an internal sequencer that automatically cycles through the
mux entries.

When enabled, the maximum throughput is divided by two. Moreover, the ADCs
need additional settling time, so we add an extra CS toggle to correctly
propagate setting, and an additional spi transfer to read the second
half.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-6-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7380: add support for single-ended parts
Julien Stephan [Wed, 31 Jul 2024 07:05:46 +0000 (09:05 +0200)] 
iio: adc: ad7380: add support for single-ended parts

Adding ad7386/7/8 (16/14/12 bits) unsigned, dual simultaneous sampling,
single-ended compatible parts, and the corresponding ad7386-4/7-4/8-4
4 channels.

These parts have a 2:1 multiplexer in front of each ADC. They also include
additional configuration registers that allow for either manual selection
or automatic switching (sequencer mode), of the multiplexer inputs.
This commit focus on integrating manual selection. Sequencer mode will
be implemented later.

>From an IIO point of view, all inputs are exported, i.e ad7386/7/8
export 4 channels and ad7386-4/7-4/8-4 export 8 channels.

Inputs AinX0 of multiplexers correspond to the first half of IIO channels
(i.e 0-1 or 0-3) and inputs AinX1 correspond to second half (i.e 2-3 or
4-7). Example for AD7386/7/8 (2 channels parts):

          IIO   | AD7386/7/8
                |         +----------------------------
                |         |     _____        ______
                |         |    |     |      |      |
       voltage0 | AinA0 --|--->|     |      |      |
                |         |    | mux |----->| ADCA |---
       voltage2 | AinA1 --|--->|     |      |      |
                |         |    |_____|      |_____ |
                |         |     _____        ______
                |         |    |     |      |      |
       voltage1 | AinB0 --|--->|     |      |      |
                |         |    | mux |----->| ADCB |---
       voltage3 | AinB1 --|--->|     |      |      |
                |         |    |_____|      |______|
                |         |
                |         +----------------------------

When switching channel, the ADC require an additional settling time.
According to the datasheet, data is valid on the third CS low. We already
have an extra toggle before each read (either direct reads or buffered
reads) to sample correct data, so we just add a single CS toggle at the
end of the register write.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-5-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7380: prepare driver for single-ended parts support
Julien Stephan [Wed, 31 Jul 2024 07:05:45 +0000 (09:05 +0200)] 
iio: adc: ad7380: prepare driver for single-ended parts support

ad738x family contains single-ended parts that have a 2:1 mux in front
of ADC, so the number of IIO channels is different from the number of
simultaneous channels that can be sampled.

To prepare the support for single-ended parts, introduce a new
num_simultaneous_channels variable. For currently supported parts,
num_simultaneous_channels is equal to num_channels minus 1 (the
timestamps channel)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-4-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ad7380: add missing trailing commas
Julien Stephan [Wed, 31 Jul 2024 07:05:44 +0000 (09:05 +0200)] 
iio: adc: ad7380: add missing trailing commas

Add missing trailing commas in iio_scan_type structures

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-3-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: core: add function to retrieve active_scan_mask index
Julien Stephan [Wed, 31 Jul 2024 07:05:43 +0000 (09:05 +0200)] 
iio: core: add function to retrieve active_scan_mask index

Add a function to retrieve the index of the active scan mask inside the
available scan masks array.

As in iio_scan_mask_match and iio_sanity_check_avail_scan_masks,
this function does not handle multi-long masks correctly.
It only checks the first long to be zero, and will use such mask
as a terminator even if there was bits set after the first long.

This should be fine since the available_scan_mask has already been
sanity tested using iio_sanity_check_avail_scan_masks.

See iio_scan_mask_match and iio_sanity_check_avail_scan_masks for
more details

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-2-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: adc: ad7380: add single-ended compatible parts
Julien Stephan [Wed, 31 Jul 2024 07:05:42 +0000 (09:05 +0200)] 
dt-bindings: iio: adc: ad7380: add single-ended compatible parts

Adding ad7386/7/8 single-ended compatible parts, and the corresponding
ad7386-4/7-4/8-4 4 channels.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240731-ad7380-add-single-ended-chips-v2-1-cd63bf05744c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoDocumentation: Add AD4000 documentation
Marcelo Schmitt [Fri, 12 Jul 2024 19:22:25 +0000 (16:22 -0300)] 
Documentation: Add AD4000 documentation

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/aeee5fd9deccf85beadecf58c9b938b97a3aeba5.1720810545.git.marcelo.schmitt@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: Add support for AD4000
Marcelo Schmitt [Fri, 12 Jul 2024 19:22:14 +0000 (16:22 -0300)] 
iio: adc: Add support for AD4000

Add support for AD4000 series of low noise, low power, high speed,
successive approximation register (SAR) ADCs.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Link: https://patch.msgid.link/356109ac61182f16f2379d5d0cadccfe017f505b.1720810545.git.marcelo.schmitt@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoMerge tag 'spi-mosi-config' into togreg
Jonathan Cameron [Sat, 3 Aug 2024 09:52:08 +0000 (10:52 +0100)] 
Merge tag 'spi-mosi-config' into togreg

spi: Support MOSI idle configuration

Add support for configuring the idle state of the MOSI signal in
controllers.

10 months agoiio: frequency: adf4377: add adf4378 support
Antoniu Miclaus [Mon, 29 Jul 2024 09:50:44 +0000 (12:50 +0300)] 
iio: frequency: adf4377: add adf4378 support

Add separate handling for adf4378 within the driver.

The main difference between adf4377 and adf4378 is that adf4378 has only
one output which is handled by only one gpio.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20240729095047.25040-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: adf4377: add adf4378 support
Antoniu Miclaus [Mon, 29 Jul 2024 09:50:43 +0000 (12:50 +0300)] 
dt-bindings: iio: adf4377: add adf4378 support

The adf4378 provides only one output channel. Therefore there is only
one gpio available to enable the output. Reflect that into the bindings
using property conditions.

Add product link for the adf4378.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240729095047.25040-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: light: stk33xx: add compatible for stk3013
Kaustabh Chakraborty [Fri, 26 Jul 2024 18:53:33 +0000 (00:23 +0530)] 
dt-bindings: iio: light: stk33xx: add compatible for stk3013

STK3013 is a proximity sensor by Sensortek, bearing chipid of 0x31. Despite
being marketed as a proximity sensor, it also appears to have ambient
light sensing capabilities.

The part is fully compatible with the existing implementation of the
device driver. Add the compatible string of stk3013 to the existing
list, with a fallback of stk3310.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240727-stk3310-v4-3-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: stk3310: add support for stk3013
Kaustabh Chakraborty [Fri, 26 Jul 2024 18:53:32 +0000 (00:23 +0530)] 
iio: light: stk3310: add support for stk3013

Add support for Sensortek's STK3013 in the driver. The part bears the
product ID 0x31.

As seen in [1], Sensortek lists STK3013 as a proximity sensor. But it
has been experimentally observed that they do have ambient light sensing
capabilities. Furthermore, [2] implements a proximity and ambient light
sensor driver for STK3x1x devices, which is also indicative of the fact
that these parts are also ambient light sensors.

[1] https://www.sensortek.com.tw/index.php/en/products/optical-sensor/
[2] https://android.googlesource.com/kernel/msm.git/+/e6dfa4641d88201e8019be19ff557e5d2cf4572f

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://patch.msgid.link/20240727-stk3310-v4-2-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: light: stk3310: relax chipid check warning
Kaustabh Chakraborty [Fri, 26 Jul 2024 18:53:31 +0000 (00:23 +0530)] 
iio: light: stk3310: relax chipid check warning

In order to allow newer devices which are compatible with existing
sensors, issuing a warning for an unknown chipid indicates that
something has gone wrong with the init process, which isn't ideal.
Swap it with a friendlier info message to get things right.

Suggested-by: Conor Dooley <conor@kernel.org>
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://patch.msgid.link/20240727-stk3310-v4-1-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-tsc2046: use devm_regulator_get_enable_read_voltage()
David Lechner [Thu, 25 Jul 2024 19:22:51 +0000 (14:22 -0500)] 
iio: adc: ti-tsc2046: use devm_regulator_get_enable_read_voltage()

Use devm_regulator_get_enable_read_voltage() to replace
tsc2046_adc_configure_regulator() which does the same thing.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240725-iio-regulator-refactor-round-4-v1-1-55e9dc1de325@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoMAINTAINERS: Add Sensirion SDP500
Petar Stoykov [Thu, 25 Jul 2024 15:37:29 +0000 (17:37 +0200)] 
MAINTAINERS: Add Sensirion SDP500

Add myself as a maintainer for Sensirion SDP500 pressure sensor driver

Signed-off-by: Petar Stoykov <pd.pstoykov@gmail.com>
Link: https://patch.msgid.link/20240725-mainline_sdp500-v4-3-ea2f5b189958@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: pressure: Add driver for Sensirion SDP500
Petar Stoykov [Thu, 25 Jul 2024 15:37:28 +0000 (17:37 +0200)] 
iio: pressure: Add driver for Sensirion SDP500

Sensirion SDP500 is a digital differential pressure sensor. The sensor is
accessed over I2C.

Signed-off-by: Petar Stoykov <pd.pstoykov@gmail.com>
Link: https://patch.msgid.link/20240725-mainline_sdp500-v4-2-ea2f5b189958@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: pressure: Add Sensirion SDP500
Petar Stoykov [Thu, 25 Jul 2024 15:37:27 +0000 (17:37 +0200)] 
dt-bindings: iio: pressure: Add Sensirion SDP500

Sensirion SDP500 is a digital differential pressure sensor. It provides
a digital I2C output. Add devicetree bindings requiring the compatible
string and I2C slave address (reg).

Signed-off-by: Petar Stoykov <pd.pstoykov@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://patch.msgid.link/20240725-mainline_sdp500-v4-1-ea2f5b189958@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: add support for pac1921
Matteo Martelli [Wed, 24 Jul 2024 09:08:33 +0000 (11:08 +0200)] 
iio: adc: add support for pac1921

Add support for Microchip PAC1921 Power/Current monitor.

Implemented features:
* capture of bus voltage, sense voltage, current and power measurements
  in free-run integration mode
* support for both raw and triggered buffer reading
* support for overflow events
* scale attributes to control voltage and current gains
* oversampling ratio attribute to control the number of integration
  samples
* sampling rate attribute that reflects the integration period
* userspace attribute and DT parameter to control shunt resistor
* simple power management support

Limitations:
* operation mode fixed to free-run integration
* READ/INT pin and OUT pin not supported
* no controls for measurement resolutions and filters

Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240724-iio-pac1921-v4-3-723698e903a3@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agodt-bindings: iio: adc: add binding for pac1921
Matteo Martelli [Wed, 24 Jul 2024 09:08:31 +0000 (11:08 +0200)] 
dt-bindings: iio: adc: add binding for pac1921

Add binging for Microchip PAC1921 Power/Current monitor

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240724-iio-pac1921-v4-1-723698e903a3@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agochemical: bme680: Convert to static the const lookup table
Vasileios Amoiridis [Thu, 25 Jul 2024 23:18:18 +0000 (01:18 +0200)] 
chemical: bme680: Convert to static the const lookup table

By converting it to static, we ensure that this will be placed by the
compiler in the read-only area.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240725231818.615530-1-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: buffer-dma: Move exports into IIO_DMA_BUFFER namespace
Nuno Sa [Fri, 26 Jul 2024 11:31:15 +0000 (13:31 +0200)] 
iio: buffer-dma: Move exports into IIO_DMA_BUFFER namespace

Avoid unnecessary pollution of the global symbol namespace and move
global APIs into a specific namespace. Import that into the places that
use them

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-dma-buf-mod-namespace-v1-1-8877cfe7f68e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: mcp3564: use devm_regulator_get_enable_read_voltage()
David Lechner [Tue, 23 Jul 2024 18:59:50 +0000 (13:59 -0500)] 
iio: adc: mcp3564: use devm_regulator_get_enable_read_voltage()

This makes use of the new devm_regulator_get_enable_read_voltage()
helper function to reduce boilerplate code in the MCP3564 ADC driver.

The error message is slightly changed since there are fewer error
return paths.

Setting adc->vref_mv is consolidated into a single place to make the
logic easier to follow.

A use_internal_vref_attr local variable is added to make it more
obvious what the difference between the two iio info structures is.

The return value of the "Unknown Vref" dev_err_probe() is hard-coded to
-ENODEV instead of ret since it was getting a bit far from where ret
was set and logically that is the only value it could have.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Marius Cristea <marius.cristea@microchip.com>
Link: https://patch.msgid.link/20240723-iio-regulator-refactor-round-3-v2-1-ae9291201785@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: core: annotate masklength as __private
Nuno Sa [Fri, 26 Jul 2024 08:23:15 +0000 (10:23 +0200)] 
iio: core: annotate masklength as __private

Now that all users are using the proper accessors, we can mark
masklength as __private so that no one tries to write. We also get help
from checkers in warning us in case someone does it.

To access the private field from IIO core code, we need to use the
ACCESS_PRIVATE() macro.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-23-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agostaging: iio: impedance-analyzer: ad5933: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:14 +0000 (10:23 +0200)] 
staging: iio: impedance-analyzer: ad5933: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-22-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: common: cros_ec_sensors_core: use new '.masklength' accessors
Nuno Sa [Fri, 26 Jul 2024 08:23:13 +0000 (10:23 +0200)] 
iio: common: cros_ec_sensors_core: use new '.masklength' accessors

Make use of iio_get_masklength) and iio_for_each_active_channel() to
access '.masklength' so it can be annotated as __private when there
are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-21-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: xilinx-xadc-core: use new '.masklength' accessors
Nuno Sa [Fri, 26 Jul 2024 08:23:12 +0000 (10:23 +0200)] 
iio: adc: xilinx-xadc-core: use new '.masklength' accessors

Make use of iio_get_masklength) and iio_for_each_active_channel() to
access '.masklength' so it can be annotated as __private when there
are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-20-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: vf610_adc: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:11 +0000 (10:23 +0200)] 
iio: adc: vf610_adc: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-19-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads8688: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:10 +0000 (10:23 +0200)] 
iio: adc: ti-ads8688: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-18-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads131e08: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:09 +0000 (10:23 +0200)] 
iio: adc: ti-ads131e08: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-17-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads124s08: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:08 +0000 (10:23 +0200)] 
iio: adc: ti-ads124s08: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-16-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-adc12138: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:07 +0000 (10:23 +0200)] 
iio: adc: ti-adc12138: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-15-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads1298: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:06 +0000 (10:23 +0200)] 
iio: adc: ti-ads1298: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-14-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads1119: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:05 +0000 (10:23 +0200)] 
iio: adc: ti-ads1119: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-13-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-ads1015: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:04 +0000 (10:23 +0200)] 
iio: adc: ti-ads1015: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-12-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-adc084s021: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:03 +0000 (10:23 +0200)] 
iio: adc: ti-adc084s021: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-11-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: ti-adc0832: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:23:02 +0000 (10:23 +0200)] 
iio: adc: ti-adc0832: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-10-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: stm32-dfsdm-adc: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:01 +0000 (10:23 +0200)] 
iio: adc: stm32-dfsdm-adc: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-9-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: stm32-adc: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:23:00 +0000 (10:23 +0200)] 
iio: adc: stm32-adc: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-8-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: rtq6056: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:59 +0000 (10:22 +0200)] 
iio: adc: rtq6056: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-7-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: rockchip_saradc: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:58 +0000 (10:22 +0200)] 
iio: adc: rockchip_saradc: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-6-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: mt6360-adc: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:57 +0000 (10:22 +0200)] 
iio: adc: mt6360-adc: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-5-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: mcp3911: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:56 +0000 (10:22 +0200)] 
iio: adc: mcp3911: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-4-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: max1118: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:55 +0000 (10:22 +0200)] 
iio: adc: max1118: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-3-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: adc: max1118: make use of iio_for_each_active_channel()
Nuno Sa [Fri, 26 Jul 2024 08:22:54 +0000 (10:22 +0200)] 
iio: adc: max1118: make use of iio_for_each_active_channel()

Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-2-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 months agoiio: accel: adxl380: make use of iio_get_masklength()
Nuno Sa [Fri, 26 Jul 2024 08:22:53 +0000 (10:22 +0200)] 
iio: accel: adxl380: make use of iio_get_masklength()

Use iio_get_masklength() to access '.masklength' so it can be annotated
as __private when there are no more direct users of it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240726-dev-iio-masklength-private3-v1-1-82913fc0fb87@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>