linux-block.git
11 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>
11 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.

11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 months agoiio: backend: spelling: continuous -> continuous
David Lechner [Fri, 26 Jul 2024 20:18:40 +0000 (15:18 -0500)]
iio: backend: spelling: continuous -> continuous

This fixes the spelling in IIO_BACKEND_INTERNAL_CONTINUOUS_WAVE.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240726-iio-backend-spelling-continuous-v1-1-467c6e3f78ff@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: ABI: generalize shunt_resistor attribute
Matteo Martelli [Mon, 22 Jul 2024 10:03:19 +0000 (12:03 +0200)]
iio: ABI: generalize shunt_resistor attribute

Move ABI documentation for custom shunt resistor attributes into the
generic iio documentation file. Exception for pac1934: leave it
untouched since it does not comply with common iio ABI generalization.

Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/20240722-iio-pac1921-v3-2-05dc9916cb33@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: pressure: bmp280-core: Make read-only const array conversion_time_max static
Colin Ian King [Mon, 22 Jul 2024 15:17:38 +0000 (16:17 +0100)]
iio: pressure: bmp280-core: Make read-only const array conversion_time_max static

Don't populate the read-only array conversion_time_max on the stack at
run time, instead make it static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20240722151738.572913-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: ROHM BH1745 colour sensor
Mudit Sharma [Thu, 18 Jul 2024 22:02:06 +0000 (23:02 +0100)]
iio: light: ROHM BH1745 colour sensor

Add support for BH1745, which is an I2C colour sensor with red, green,
blue and clear channels. It has a programmable active low interrupt
pin. Interrupt occurs when the signal from the selected interrupt
source channel crosses set interrupt threshold high or low level.

Interrupt source for the device can be configured by enabling the
corresponding event. Interrupt latch is always enabled when setting
up interrupt.

Add myself as the maintainer for this driver in MAINTAINERS.

Signed-off-by: Mudit Sharma <muditsharma.info@gmail.com>
Reviewed-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240718220208.331942-2-muditsharma.info@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: light: ROHM BH1745
Mudit Sharma [Thu, 18 Jul 2024 22:02:05 +0000 (23:02 +0100)]
dt-bindings: iio: light: ROHM BH1745

Add ROHM BH1745 - 4 channel I2C colour sensor's dt-bindings.

Signed-off-by: Mudit Sharma <muditsharma.info@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240718220208.331942-1-muditsharma.info@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: proximity: sx_common: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:08 +0000 (15:38 +0200)]
iio: proximity: sx_common: 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/20240718-dev-iio-masklength-private2-v1-22-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: proximity: sx9500: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:07 +0000 (15:38 +0200)]
iio: proximity: sx9500: 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/20240718-dev-iio-masklength-private2-v1-21-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: proximity: hx9023s: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:06 +0000 (15:38 +0200)]
iio: proximity: hx9023s: 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/20240718-dev-iio-masklength-private2-v1-20-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: pressure: dlhl60d: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:05 +0000 (15:38 +0200)]
iio: pressure: dlhl60d: 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/20240718-dev-iio-masklength-private2-v1-19-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: magnetometer: rm3100-core: make use of iio_get_masklength()
Nuno Sa [Thu, 18 Jul 2024 13:38:04 +0000 (15:38 +0200)]
iio: magnetometer: rm3100-core: 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/20240718-dev-iio-masklength-private2-v1-18-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: tcs3472: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:03 +0000 (15:38 +0200)]
iio: light: tcs3472: 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/20240718-dev-iio-masklength-private2-v1-17-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: tcs3414: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:02 +0000 (15:38 +0200)]
iio: light: tcs3414: 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/20240718-dev-iio-masklength-private2-v1-16-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: si1145: use new '.masklength' accessors
Nuno Sa [Thu, 18 Jul 2024 13:38:01 +0000 (15:38 +0200)]
iio: light: si1145: 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/20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: isl29125: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:38:00 +0000 (15:38 +0200)]
iio: light: isl29125: 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/20240718-dev-iio-masklength-private2-v1-14-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: gp2ap020a00f: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:59 +0000 (15:37 +0200)]
iio: light: gp2ap020a00f: 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/20240718-dev-iio-masklength-private2-v1-13-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: adjd_s311: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:58 +0000 (15:37 +0200)]
iio: light: adjd_s311: 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/20240718-dev-iio-masklength-private2-v1-12-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: imu: kmx61: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:57 +0000 (15:37 +0200)]
iio: imu: kmx61: 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/20240718-dev-iio-masklength-private2-v1-11-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: imu: bno055: make use of iio_get_masklength()
Nuno Sa [Thu, 18 Jul 2024 13:37:56 +0000 (15:37 +0200)]
iio: imu: bno055: 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/20240718-dev-iio-masklength-private2-v1-10-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: imu: bmi160_core: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:55 +0000 (15:37 +0200)]
iio: imu: bmi160_core: 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/20240718-dev-iio-masklength-private2-v1-9-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: humidity: am2315: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:54 +0000 (15:37 +0200)]
iio: humidity: am2315: 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/20240718-dev-iio-masklength-private2-v1-8-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: health: afe4404: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:53 +0000 (15:37 +0200)]
iio: health: afe4404: 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/20240718-dev-iio-masklength-private2-v1-7-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: health: max30102: make use of iio_get_masklength()
Nuno Sa [Thu, 18 Jul 2024 13:37:52 +0000 (15:37 +0200)]
iio: health: max30102: 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/20240718-dev-iio-masklength-private2-v1-6-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: health: afe4403: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:51 +0000 (15:37 +0200)]
iio: health: afe4403: 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/20240718-dev-iio-masklength-private2-v1-5-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dummy: iio_simple_dummy_buffer: use iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:50 +0000 (15:37 +0200)]
iio: dummy: iio_simple_dummy_buffer: use 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/20240718-dev-iio-masklength-private2-v1-4-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: hx711: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:49 +0000 (15:37 +0200)]
iio: adc: hx711: 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/20240718-dev-iio-masklength-private2-v1-3-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: dln2-adc: use new '.masklength' accessors
Nuno Sa [Thu, 18 Jul 2024 13:37:48 +0000 (15:37 +0200)]
iio: adc: dln2-adc: 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/20240718-dev-iio-masklength-private2-v1-2-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: cc10001_adc: make use of iio_for_each_active_channel()
Nuno Sa [Thu, 18 Jul 2024 13:37:47 +0000 (15:37 +0200)]
iio: adc: cc10001_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>
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-1-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: ad7192: Add clock provider
Alisa-Dariana Roman [Wed, 17 Jul 2024 21:25:35 +0000 (00:25 +0300)]
iio: adc: ad7192: Add clock provider

Internal clock of AD719X devices can be made available on MCLK2 pin. Add
clock provider to support this functionality when clock cells property
is present.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240717212535.8348-5-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: adc: ad7192: Add clock provider
Alisa-Dariana Roman [Wed, 17 Jul 2024 21:25:34 +0000 (00:25 +0300)]
dt-bindings: iio: adc: ad7192: Add clock provider

Internal clock of AD719X devices can be made available on MCLK2 pin. Add
clock provider to support this functionality when clock cells property
is present.

The clock source can be either provided externally or the internal clock
is used. Pair of clocks and clock-names property is mutally exclusive
with #clock-cells property.

Modify second example to showcase the mode where internal clock is used.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240717212535.8348-4-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: ad7192: Update clock config
Alisa-Dariana Roman [Wed, 17 Jul 2024 21:25:33 +0000 (00:25 +0300)]
iio: adc: ad7192: Update clock config

There are actually 4 configuration modes of clock source for AD719X
devices. Either a crystal can be attached externally between MCLK1 and
MCLK2 pins, or an external CMOS-compatible clock can drive the MCLK2
pin. The other 2 modes make use of the 4.92MHz internal clock.

Undocumented properties adi,int-clock-output-enable and adi,clock-xtal
still supported for backward compatibility, but their use is highly
discouraged. Use cleaner alternative of configuring external clock by
using clock names mclk and xtal.

Functionality of AD7192_CLK_INT_CO will be implemented in complementary
patch by adding clock provider.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240717212535.8348-3-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: adc: ad7192: Update clock config
Alisa-Dariana Roman [Wed, 17 Jul 2024 21:25:32 +0000 (00:25 +0300)]
dt-bindings: iio: adc: ad7192: Update clock config

There are actually 4 configuration modes of clock source for AD719X
devices. Either a crystal can be attached externally between MCLK1 and
MCLK2 pins, or an external CMOS-compatible clock can drive the MCLK2
pin. The other 2 modes make use of the 4.92MHz internal clock.

To configure external clock as either a crystal or a CMOS-compatible
clock, changing the register settings is necessary. Therefore, add clock
name xtal alongside mclk. By selecting one or the other, the register is
configured.

The presence of an external clock source is optional, not required. When
both clocks and clock-names properties are present, an external clock
source is used. If the intention is to use the internal clock, both
properties should be absent. Modify required properties accordingly.

Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240717212535.8348-2-alisa.roman@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: magnetometer: bmc150: Document mount-matrix
Rayyan Ansari [Tue, 16 Jul 2024 13:25:09 +0000 (14:25 +0100)]
dt-bindings: iio: magnetometer: bmc150: Document mount-matrix

Document the mount-matrix property, which is used in device trees such
as msm8916-samsung-fortuna-common.dtsi, and supported by the driver.

Signed-off-by: Rayyan Ansari <rayyan.ansari@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240716132512.80337-1-rayyan.ansari@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: noa1305: Make integration time configurable
Marek Vasut [Mon, 15 Jul 2024 18:28:59 +0000 (20:28 +0200)]
iio: light: noa1305: Make integration time configurable

Add another attribute which is the integration time. Report available
integration time settings, support read of integration time currently
configured in hardware, and support configuration of integration time
into hardware.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240715183120.143417-5-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: noa1305: Report available scale values
Marek Vasut [Mon, 15 Jul 2024 18:28:58 +0000 (20:28 +0200)]
iio: light: noa1305: Report available scale values

Make use of the new static table of scale values and expose available
scale values via sysfs attribute of the IIO device.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240715183120.143417-4-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: noa1305: Use static table lookup of scale values
Marek Vasut [Mon, 15 Jul 2024 18:28:57 +0000 (20:28 +0200)]
iio: light: noa1305: Use static table lookup of scale values

Move scale values into a static table, perform look up of those
scale values in noa1305_scale() simply by using the integration
time register content as an index, because the integration time
register content directly maps to the table values.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240715183120.143417-3-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: noa1305: Assign val in noa1305_measure()
Marek Vasut [Mon, 15 Jul 2024 18:28:56 +0000 (20:28 +0200)]
iio: light: noa1305: Assign val in noa1305_measure()

Make noa1305_measure() behave similar to noa1305_scale(), make it
assign the 'val' output variable on success and return IIO_VAL_INT.
This further simplifies noa1305_read_raw() and allows removal of
ret variable altogether.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240715183120.143417-2-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: light: noa1305: Simplify noa1305_read_raw()
Marek Vasut [Mon, 15 Jul 2024 18:28:55 +0000 (20:28 +0200)]
iio: light: noa1305: Simplify noa1305_read_raw()

The only channel this hardware supports is IIO_LIGHT, if the channel
is anything else, exit right away. The 'ret' variable is now always
only assigned by noa1305_measure(), do not initialize it anymore.
Update function parameter indent. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patch.msgid.link/20240715183120.143417-1-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: accel: kxcjk-1013: Add support for KX022-1020
Rayyan Ansari [Sun, 14 Jul 2024 17:33:04 +0000 (18:33 +0100)]
iio: accel: kxcjk-1013: Add support for KX022-1020

Add compatible for the KX022-1020 accelerometer [1] using the
KX022-1023 [2] register map as both have an identical i2c interface.

[1]: https://kionixfs.azureedge.net/en/datasheet/KX022-1020%20Specifications%20Rev%2012.0.pdf
[2]: https://kionixfs.azureedge.net/en/datasheet/KX023-1025%20Specifications%20Rev%2012.0.pdf

Signed-off-by: Rayyan Ansari <rayyan@ansari.sh>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patch.msgid.link/20240714173431.54332-3-rayyan@ansari.sh
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: kionix,kxcjk1013: Document KX022-1020
Rayyan Ansari [Sun, 14 Jul 2024 17:33:03 +0000 (18:33 +0100)]
dt-bindings: iio: kionix,kxcjk1013: Document KX022-1020

Document the KX022-1020 accelerometer, which has the same register
layout as the KX023-1025 and so can use the same driver.

Signed-off-by: Rayyan Ansari <rayyan@ansari.sh>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240714173431.54332-2-rayyan@ansari.sh
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: mcp3911: use devm_regulator_get_enable_read_voltage()
David Lechner [Fri, 12 Jul 2024 16:03:57 +0000 (11:03 -0500)]
iio: adc: mcp3911: 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 MCP3911 ADC driver.

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

An extra parameter is added to the config callback to avoid adding
state that is not used outside of the probe() function.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-6-835017bae43d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dac: mcp4922: drop remove() callback
David Lechner [Fri, 12 Jul 2024 16:03:55 +0000 (11:03 -0500)]
iio: dac: mcp4922: drop remove() callback

By using devm_iio_device_register(), we can drop the remove() callback
in the mcp4922 driver. We can also remove spi_set_drvdata() since there
are no more callers of spi_get_drvdata(). Also use dev_err_probe()
while we are at it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-4-835017bae43d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dac: mcp4922: use devm_regulator_get_enable_read_voltage()
David Lechner [Fri, 12 Jul 2024 16:03:54 +0000 (11:03 -0500)]
iio: dac: mcp4922: 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 MCP4922 DAC driver.

The error message is slightly different because there is only one error
return path now.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-3-835017bae43d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dac: mcp4728: use devm_regulator_get_enable_read_voltage()
David Lechner [Fri, 12 Jul 2024 16:03:53 +0000 (11:03 -0500)]
iio: dac: mcp4728: 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 MCP4728 DAC driver.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-2-835017bae43d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dac: mcp4728: rename err to ret in probe function
David Lechner [Fri, 12 Jul 2024 16:03:52 +0000 (11:03 -0500)]
iio: dac: mcp4728: rename err to ret in probe function

To prepare for using a function that returns a non-error value, rename
the variable 'err' to 'ret' in the probe function.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240712-iio-regulator-refactor-round-3-v1-1-835017bae43d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: pressure: bmp280: Sort headers alphabetically
Vasileios Amoiridis [Thu, 11 Jul 2024 21:15:51 +0000 (23:15 +0200)]
iio: pressure: bmp280: Sort headers alphabetically

Sort headers in alphabetical order

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240711211558.106327-4-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: pressure: bmp280: Fix waiting time for BMP3xx configuration
Vasileios Amoiridis [Thu, 11 Jul 2024 21:15:50 +0000 (23:15 +0200)]
iio: pressure: bmp280: Fix waiting time for BMP3xx configuration

According to the datasheet, both pressure and temperature can go up to
oversampling x32. With this option, the maximum measurement time is not
80ms (this is for press x32 and temp x2), but it is 130ms nominal
(calculated from table 3.9.2) and since most of the maximum values
are around +15%, it is configured to 150ms.

Fixes: 8d329309184d ("iio: pressure: bmp280: Add support for BMP380 sensor family")
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240711211558.106327-3-vassilisamir@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: pressure: bmp280: Fix regmap for BMP280 device
Vasileios Amoiridis [Thu, 11 Jul 2024 21:15:49 +0000 (23:15 +0200)]
iio: pressure: bmp280: Fix regmap for BMP280 device

Up to now, the BMP280 device is using the regmap of the BME280 which
has registers that exist only in the BME280 device.

Fixes: 14e8015f8569 ("iio: pressure: bmp280: split driver in logical parts")
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240711211558.106327-2-vassilisamir@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoDocumentation: iio: Document ad4695 driver
David Lechner [Thu, 11 Jul 2024 19:15:43 +0000 (14:15 -0500)]
Documentation: iio: Document ad4695 driver

The Analog Devices Inc. AD4695 (and similar chips) are complex ADCs that
will benefit from a detailed driver documentation.

This documents the current features supported by the driver.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: adc: ad4695: Add driver for AD4695 and similar ADCs
David Lechner [Thu, 11 Jul 2024 19:15:42 +0000 (14:15 -0500)]
iio: adc: ad4695: Add driver for AD4695 and similar ADCs

This is a new driver for Analog Devices Inc. AD4695 and similar ADCs.
The initial driver supports initializing the chip including configuring
all possible LDO and reference voltage sources as well as any possible
voltage input channel wiring configuration.

Only the 4-wire SPI wiring mode where the CNV pin is tied to the CS pin
is supported at this time. And reading sample data from the ADC can only
be done in direct mode for now.

Co-developed-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240711-iio-adc-ad4695-v4-2-c31621113b57@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: adc: add AD4695 and similar ADCs
David Lechner [Thu, 11 Jul 2024 19:15:41 +0000 (14:15 -0500)]
dt-bindings: iio: adc: add AD4695 and similar ADCs

Add device tree bindings for AD4695 and similar ADCs.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240711-iio-adc-ad4695-v4-0-c31621113b57@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: common: scmi_iio: Remove unnecessary u64 type cast
Thorsten Blum [Thu, 11 Jul 2024 13:45:03 +0000 (15:45 +0200)]
iio: common: scmi_iio: Remove unnecessary u64 type cast

The variable uHz already has the type u64 and casting it to u64 is
unnecessary. Remove the redundant type cast.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Link: https://patch.msgid.link/20240711134502.168484-1-thorsten.blum@toblux.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: dac: ltc2664: Add driver for LTC2664 and LTC2672
Kim Seer Paller [Thu, 18 Jul 2024 05:18:34 +0000 (13:18 +0800)]
iio: dac: ltc2664: Add driver for LTC2664 and LTC2672

LTC2664 4 channel, 12-/16-Bit Voltage Output SoftSpan DAC
LTC2672 5 channel, 12-/16-Bit Current Output Softspan DAC

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20240718051834.32270-7-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: dac: Add adi,ltc2672.yaml
Kim Seer Paller [Thu, 18 Jul 2024 05:18:33 +0000 (13:18 +0800)]
dt-bindings: iio: dac: Add adi,ltc2672.yaml

Add documentation for ltc2672.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://patch.msgid.link/20240718051834.32270-6-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: dac: Add adi,ltc2664.yaml
Kim Seer Paller [Thu, 18 Jul 2024 05:18:32 +0000 (13:18 +0800)]
dt-bindings: iio: dac: Add adi,ltc2664.yaml

Add documentation for ltc2664.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://patch.msgid.link/20240718051834.32270-5-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodt-bindings: iio: dac: Generalize DAC common properties
Kim Seer Paller [Thu, 18 Jul 2024 05:18:31 +0000 (13:18 +0800)]
dt-bindings: iio: dac: Generalize DAC common properties

Introduce a generalized DAC binding that can be used by DACs that have
similar properties adding output-range-microamp and output-range-microvolt.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://patch.msgid.link/20240718051834.32270-4-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: ABI: add DAC 42kohm_to_gnd powerdown mode
Kim Seer Paller [Thu, 18 Jul 2024 05:18:30 +0000 (13:18 +0800)]
iio: ABI: add DAC 42kohm_to_gnd powerdown mode

Add a new powerdown mode for DACs with 42kohm resistor to GND.

Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://patch.msgid.link/20240718051834.32270-3-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: ABI: Generalize ABI documentation for DAC
Kim Seer Paller [Thu, 18 Jul 2024 05:18:29 +0000 (13:18 +0800)]
iio: ABI: Generalize ABI documentation for DAC

Introduces a more generalized ABI documentation for DAC. Instead of
having separate ABI files for each DAC, we now have a single ABI file
that covers the common sysfs interface for all DAC.

Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
https://patch.msgid.link/20240718051834.32270-2-kimseer.paller@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: backend: print message in case op is not implemented
Nuno Sa [Tue, 9 Jul 2024 11:14:29 +0000 (13:14 +0200)]
iio: backend: print message in case op is not implemented

For APIs that have a return value, -EOPNOTSUPP is returned in case the
backend does not support the functionality. However, for APIs that do
not have a return value we are left in silence. Hence, at least print a
debug message in case the callback is not implemented by the backend.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240709-dev-iio-backend-add-debugfs-v1-2-fb4b8f2373c7@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agoiio: backend: remove unused parameter
Nuno Sa [Tue, 9 Jul 2024 11:14:28 +0000 (13:14 +0200)]
iio: backend: remove unused parameter

Indio_dev was not being used in iio_backend_extend_chan_spec() so remove
it.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240709-dev-iio-backend-add-debugfs-v1-1-fb4b8f2373c7@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodocs: iio: new docs for ad7380 driver
Julien Stephan [Tue, 9 Jul 2024 15:16:46 +0000 (17:16 +0200)]
docs: iio: new docs for ad7380 driver

This adds a new page to document how to use the ad7380 ADC driver.

Credit: this docs is based on ad7944 docs.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20240709-ad7380-add-docs-v1-1-458ced3dfcc5@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11 months agodocs: iio: add documentation for adxl380 driver
Antoniu Miclaus [Mon, 8 Jul 2024 10:40:13 +0000 (13:40 +0300)]
docs: iio: add documentation for adxl380 driver

Add documentation for adxl380 driver which describes the driver
device files and shows how the user may use the ABI for various
scenarios (configuration, measurement, etc.).

Signed-off-by: Ramona Gradinariu <ramona.gradinariu@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://patch.msgid.link/20240708104114.29894-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>