]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
5 weeks agoiio: common: scmi_sensors: Get rid of const_ilog2()
Andy Shevchenko [Mon, 3 Nov 2025 08:29:11 +0000 (09:29 +0100)] 
iio: common: scmi_sensors: Get rid of const_ilog2()

Fisrt of all, const_ilog2() was a workaround of some sparse issue,
which was never appeared in the C functions. Second, the calls here
are done against constants and work with a bit of luck. Replace
this altogether by a pre-calculated simple integer constant.
Amend a comment to give a hint where it comes from.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: imu: bmi270: fix dev_err_probe error msg
Rodrigo Gobbi [Sun, 2 Nov 2025 22:30:18 +0000 (19:30 -0300)] 
iio: imu: bmi270: fix dev_err_probe error msg

The bmi270 can be connected to I2C or a SPI interface. If it is a SPI,
during probe, if devm_regmap_init() fails, it should print the "spi"
term rather "i2c".

Fixes: 92cc50a00574 ("iio: imu: bmi270: Add spi driver for bmi270 imu")
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: light: apds9960: convert to use maple tree register cache
Chu Guangqing [Fri, 24 Oct 2025 07:38:23 +0000 (15:38 +0800)] 
iio: light: apds9960: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Chu Guangqing <chuguangqing@inspur.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: light: apds9306: convert to use maple tree register cache
Chu Guangqing [Fri, 24 Oct 2025 07:38:22 +0000 (15:38 +0800)] 
iio: light: apds9306: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Chu Guangqing <chuguangqing@inspur.com>
Acked-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: light: veml3235: convert to use maple tree register cache
Chu Guangqing [Fri, 24 Oct 2025 07:38:21 +0000 (15:38 +0800)] 
iio: light: veml3235: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Chu Guangqing <chuguangqing@inspur.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ade9000: convert to use maple tree register cache
Chu Guangqing [Fri, 24 Oct 2025 07:38:20 +0000 (15:38 +0800)] 
iio: adc: ade9000: convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Chu Guangqing <chuguangqing@inspur.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: backend: fix kernel-doc to avoid warnings and ensure consistency
Kriish Sharma [Tue, 28 Oct 2025 09:33:26 +0000 (09:33 +0000)] 
iio: backend: fix kernel-doc to avoid warnings and ensure consistency

Fix multiple kernel-doc warnings and make the documentation style
consistent in drivers/iio/industrialio-backend.c.

Changes include:
 - Add missing @chan parameter description in
   iio_backend_oversampling_ratio_set().
 - Add missing RETURNS section in iio_backend_get_priv().
 - Replace Return: with “RETURNS:” across the file for consistency.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506292344.HLJbrrgR-lkp@intel.com
Suggested-by: Andy Shevchenko <andy@kernel.org>
Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: imu: mpu6050: remove interrupts from required list
Frank Li [Wed, 29 Oct 2025 19:27:18 +0000 (15:27 -0400)] 
dt-bindings: iio: imu: mpu6050: remove interrupts from required list

Irq is optional signal to make sensor work. Not all boards connect this
signals, so remove it from required list.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: Support MediaTek MT8189 evb board auxadc
Jack Hsu [Thu, 30 Oct 2025 13:44:34 +0000 (21:44 +0800)] 
dt-bindings: iio: adc: Support MediaTek MT8189 evb board auxadc

add compatible string for mt8189 evb board dts node of auxadc

Signed-off-by: Jack Hsu <jh.hsu@mediatek.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: rohm-bd79124: Use regmap_reg_range()
Matti Vaittinen [Mon, 27 Oct 2025 12:50:51 +0000 (14:50 +0200)] 
iio: adc: rohm-bd79124: Use regmap_reg_range()

Initializing the regmap_ranges using direct assignment to the range_min
and range_max members is slightly verbose. We can make it a tad cleaner
when using the regmap_reg_range() macro.

Clean up the code using regmap_reg_range() when initializing the
regmap_range structure.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: rohm-bd79112: Use regmap_reg_range()
Matti Vaittinen [Mon, 27 Oct 2025 12:50:30 +0000 (14:50 +0200)] 
iio: adc: rohm-bd79112: Use regmap_reg_range()

Initializing the regmap_ranges using direct assignment to the range_min
and range_max members is slightly verbose. We can make it a tad cleaner
when using the regmap_reg_range() macro.

Clean up the code using regmap_reg_range() when initializing the
regmap_range structure.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: imu: adis: fix all kernel-doc warnings in header file
Randy Dunlap [Sun, 26 Oct 2025 02:47:59 +0000 (19:47 -0700)] 
iio: imu: adis: fix all kernel-doc warnings in header file

Correct and add to adis.h to resolve all kernel-doc warnings:

- add a missing struct member description
- change one non-kernel-doc comment to use /* instead of /**
- correct function parameter @value to @val (7 locations)
- add function return value comments (13 locations)

Warning: include/linux/iio/imu/adis.h:97 struct member 'has_fifo'
 not described in 'adis_data'
Warning: include/linux/iio/imu/adis.h:139 Incorrect use of kernel-doc
 format: * The state_lock is meant to be used during operations that
 require
Warning: include/linux/iio/imu/adis.h:158 struct member '"__adis_"'
 not described in 'adis'
Warning: include/linux/iio/imu/adis.h:264 function parameter 'val'
 not described in 'adis_write_reg'
Warning: include/linux/iio/imu/adis.h:371 No description found for
 return value of 'adis_update_bits_base'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: pressure: adp810: Add driver for adp810 sensor
Akhilesh Patil [Sat, 25 Oct 2025 06:20:55 +0000 (11:50 +0530)] 
iio: pressure: adp810: Add driver for adp810 sensor

Add driver for Aosong adp810 differential pressure and temperature sensor.
This sensor provides an I2C interface for reading data.
Calculate CRC of the data received using standard crc8 library to verify
data integrity.

Tested on TI am62x sk board with sensor connected at i2c-2.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: pressure: Add Aosong adp810
Akhilesh Patil [Sat, 25 Oct 2025 06:18:41 +0000 (11:48 +0530)] 
dt-bindings: iio: pressure: Add Aosong adp810

Add bindings for adp810 differential pressure and temperature
sensor. This sensor communicates over I2C with CRC support and
can measure pressure in the range -500 to 500Pa and temperature
in the range -40 to +85 degree celsius.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ad7124: fix possible OOB array access
David Lechner [Wed, 22 Oct 2025 15:15:05 +0000 (10:15 -0500)] 
iio: adc: ad7124: fix possible OOB array access

Reorder the channel bounds check before using it to index into the
channels array in ad7124_release_config_slot(). This prevents reading
past the end of the array.

The value read from invalid memory was not used, so this was mostly
harmless, but we still should not be reading out of bounds in the first
place.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-iio/aPi6V-hcaKReSNWK@stanley.mountain/
Fixes: 9065197e0d41 ("iio: adc: ad7124: change setup reg allocation strategy")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: imu: inv_icm45600: Add a missing return statement in probe()
Dan Carpenter [Wed, 22 Oct 2025 11:02:20 +0000 (14:02 +0300)] 
iio: imu: inv_icm45600: Add a missing return statement in probe()

The intention here was clearly to return -ENODEV but the return statement
was missing.  It would result in an off by one read in i3c_chip_info[] on
the next line.  Add the return statement.

Fixes: 1bef24e9007e ("iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: Add rockchip,rk3506-saradc variant
Heiko Stuebner [Tue, 21 Oct 2025 22:31:07 +0000 (00:31 +0200)] 
dt-bindings: iio: adc: Add rockchip,rk3506-saradc variant

The SARADC of the RK3506 is similar to the one found in the RK3528
in terms of number of channels and the other implementation details.

So add a variant compatible for it, that reflects this fact.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ad4080: add support for AD4087
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:48 +0000 (10:53 +0000)] 
iio: adc: ad4080: add support for AD4087

Add support for AD4087 14-bit SAR ADC. The AD4087 differs from
AD4080 in resolution (14-bit vs 20-bit) and LVDS CNV clock count
maximum (1 vs 7).

Changes:
- Add AD4087_CHIP_ID definition (0x0057)
- Create ad4087_channel with 14-bit resolution and 16-bit storage
- Add ad4087_chip_info with lvds_cnv_clk_cnt_max = 1
- Register AD4087 in device ID and OF match tables

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: adi,ad4080: add support for AD4087
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:47 +0000 (10:53 +0000)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4087

Add device tree binding support for the AD4087 14-bit SAR ADC.
Add adi,ad4087 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4087 has different resolution (14-bit vs 20-bit) and LVDS CNV clock
count maximum (1 vs 7), requiring different driver configuration.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ad4080: add support for AD4086
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:46 +0000 (10:53 +0000)] 
iio: adc: ad4080: add support for AD4086

Add support for AD4086 14-bit SAR ADC. The AD4086 differs from
AD4080 in resolution (14-bit vs 20-bit) and LVDS CNV clock count
maximum (4 vs 7).

Changes:
- Add AD4086_CHIP_ID definition (0x0056)
- Create ad4086_channel with 14-bit resolution and 16-bit storage
- Add ad4086_chip_info with lvds_cnv_clk_cnt_max = 4
- Register AD4086 in device ID and OF match tables

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: adi,ad4080: add support for AD4086
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:45 +0000 (10:53 +0000)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4086

Add device tree binding support for the AD4086 14-bit SAR ADC.
Add adi,ad4086 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4086 has different resolution (14-bit vs 20-bit) and LVDS CNV clock
count maximum (4 vs 7), requiring different driver configuration.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ad4080: add support for AD4083
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:44 +0000 (10:53 +0000)] 
iio: adc: ad4080: add support for AD4083

Add support for AD4083 16-bit SAR ADC. The AD4083 differs from
AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count
maximum (5 vs 7).

Changes:
- Add AD4083_CHIP_ID definition (0x0053)
- Create ad4083_channel with 16-bit resolution and storage
- Add ad4083_chip_info with lvds_cnv_clk_cnt_max = 5
- Register AD4083 in device ID and OF match tables

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: adi,ad4080: add support for AD4083
Antoniu Miclaus [Tue, 21 Oct 2025 10:53:43 +0000 (10:53 +0000)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4083

Add device tree binding support for the AD4083 16-bit SAR ADC.
Add adi,ad4083 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4083 has different resolution (16-bit vs 20-bit) and LVDS CNV clock
count maximum (5 vs 7), requiring different driver configuration.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: accel: bma220: move set_wdt() out of bma220_core
Petre Rodan [Tue, 21 Oct 2025 10:31:49 +0000 (13:31 +0300)] 
iio: accel: bma220: move set_wdt() out of bma220_core

Move bma220_set_wdt() into bma220_i2c.c instead of using a conditional
based on i2c_verify_client() in bma220_core.c that would make core
always depend on the i2c module.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510102117.Jqxrw1vF-lkp@intel.com/
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: imu: smi330: Add driver
Jianping Shen [Thu, 9 Oct 2025 15:31:49 +0000 (17:31 +0200)] 
iio: imu: smi330: Add driver

Add the iio driver for bosch imu smi330. The smi330 is a combined
three axis angular rate and three axis acceleration sensor.

Signed-off-by: Jianping Shen <Jianping.Shen@de.bosch.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: imu: smi330: Add binding
Jianping Shen [Thu, 9 Oct 2025 15:31:48 +0000 (17:31 +0200)] 
dt-bindings: iio: imu: smi330: Add binding

Add devicetree binding for Bosch imu smi330.
The smi330 is a combined three axis angular rate and
three axis acceleration sensor module.

Signed-off-by: Jianping Shen <Jianping.Shen@de.bosch.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: qcom-vadc-common: fix vadc_scale_fn_type kernel-doc
Randy Dunlap [Fri, 17 Oct 2025 07:07:27 +0000 (00:07 -0700)] 
iio: adc: qcom-vadc-common: fix vadc_scale_fn_type kernel-doc

Fix multiple warnings in enum vadc_scale_fn_type by adding a leading
'@' to the kernel-doc descriptions.

Fixed 14 warnings in this one enum, such as:
Warning: include/linux/iio/adc/qcom-vadc-common.h:123 Enum value
 'SCALE_DEFAULT' not described in enum 'vadc_scale_fn_type'
Warning: ../include/linux/iio/adc/qcom-vadc-common.h:123 Enum value
 'SCALE_THERM_100K_PULLUP' not described in enum 'vadc_scale_fn_type'
Warning: ../include/linux/iio/adc/qcom-vadc-common.h:123 Enum value
 'SCALE_PMIC_THERM' not described in enum 'vadc_scale_fn_type'

Also prevent the warning on SCALE_HW_CALIB_INVALID by marking it
"private:" so that kernel-doc notation is not needed for it.

This leaves only one warning here, which I don't know the
appropriate description of:
qcom-vadc-common.h:125: warning: Enum value
 'SCALE_HW_CALIB_PMIC_THERM_PM7' not described in enum 'vadc_scale_fn_type'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: max14001: New driver
Marilene Andrade Garcia [Wed, 15 Oct 2025 05:12:08 +0000 (02:12 -0300)] 
iio: adc: max14001: New driver

The MAX14001/MAX14002 is configurable, isolated 10-bit ADCs for multi-range
binary inputs. In addition to ADC readings, the MAX14001/MAX14002 offers
more features, like a binary comparator, a filtered reading that can
provide the average of the last 2, 4, or 8 ADC readings, and an inrush
comparator that triggers the inrush current. There is also a fault feature
that can diagnose seven possible fault conditions. And an option to select
an external or internal ADC voltage reference.

MAX14001/MAX14002 features implemented so far:
- Raw ADC reading.
- MV fault disable.
- Selection of external or internal ADC voltage reference, depending on
whether it is declared in the device tree.

Co-developed-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
Tested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: adc: add max14001
Marilene Andrade Garcia [Wed, 15 Oct 2025 05:11:08 +0000 (02:11 -0300)] 
dt-bindings: iio: adc: add max14001

Add device-tree documentation for MAX14001/MAX14002 ADCs.
The MAX14001/MAX14002 are isolated, single-channel analog-to-digital
converters with programmable voltage comparators and inrush current
control optimized for configurable binary input applications.

They share the same features, but in the MAX14001 the inrush trigger
threshold, current magnitude, and current duration are all programmable,
whereas in the MAX14002 these parameters are fixed.

Co-developed-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Signed-off-by: Marilene Andrade Garcia <marilene.agarcia@gmail.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO batch data rate
Francesco Lavra [Fri, 17 Oct 2025 16:42:55 +0000 (18:42 +0200)] 
iio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO batch data rate

The rate at which accelerometer or gyroscope sensor samples are fed
to the hardware FIFO (batch data rate, or BDR) does not have to
coincide with the sensor sampling frequency (output data rate, or
ODR); the only requirement is for the BDR to not be greater than
the ODR. Having a BDR lower than the ODR is useful in cases where
an application requires a high sampling rate for accurate detection
of motion events (e.g. wakeup events), but wants to read sensor
sample values from the hardware FIFO at a lower data rate (e.g. to
minimize the amount of I2C or SPI traffic and the rate of periodic
interrupts).
To support the above use case, add a sampling_frequency sysfs
attribute to the buffer directory of st_lsm6dsx IIO devices, which
controls the BDR for a given sensor independently from the "main"
sampling_frequency attribute (which controls the ODR); introduce a
new `hwfifo_odr_mHz` field in struct st_lsm6dsx_sensor to keep
track of the current BDR value, and use this field instead of the
`odr` field in the code that deals with the FIFO data rate. In the
sensor hub driver, make the hwfifo_odr_mHz value always mirror the
odr value, since there is no separate configuration setting to
control the BDR for data produced by the sensor hub functionality.
For backwards compatibility, set the buffer frequency equal to the
main frequency whenever the latter is updated via sysfs; if
userspace wants a different buffer frequency, it has to write to
the relevant sysfs attribute after any writes to the main frequency
attribute.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: st_lsm6dsx: Fix measurement unit for odr struct member
Francesco Lavra [Fri, 17 Oct 2025 16:42:54 +0000 (18:42 +0200)] 
iio: imu: st_lsm6dsx: Fix measurement unit for odr struct member

The `odr` field in struct st_lsm6dsx_sensor contains a data rate
value expressed in mHz, not in Hz.

Fixes: f8710f0357bc3 ("iio: imu: st_lsm6dsx: express odr in mHZ")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: remove useless include
Petre Rodan [Tue, 14 Oct 2025 16:42:58 +0000 (19:42 +0300)] 
iio: accel: bma220: remove useless include

Remove errno.h include from bma220_i2c.c since error codes are generated
within bma220_core.c instead.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: white space cleanup
Petre Rodan [Tue, 14 Oct 2025 16:42:57 +0000 (19:42 +0300)] 
iio: accel: bma220: white space cleanup

Clean up white space inconsistencies from the last patch series as
requested by Jonathan.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti_am335x_adc: Limit step_avg to valid range for gcc complains
Pei Xiao [Tue, 14 Oct 2025 09:12:50 +0000 (17:12 +0800)] 
iio: adc: ti_am335x_adc: Limit step_avg to valid range for gcc complains

FIELD_PREP() checks that a value fits into the available bitfield, add a
check for step_avg to fix gcc complains.

which gcc complains about:
  drivers/iio/adc/ti_am335x_adc.c: In function 'tiadc_step_config':
  include/linux/compiler_types.h:572:38: error: call to
'__compiletime_assert_491' declared with attribute error: FIELD_PREP: value
too large for the field include/linux/mfd/ti_am335x_tscadc.h:58:29: note:
in expansion of macro 'FIELD_PREP'
    #define STEPCONFIG_AVG(val) FIELD_PREP(GENMASK(4, 2), (val))
                                ^~~~~~~~~~
drivers/iio/adc/ti_am335x_adc.c:127:17: note: in expansion of macro 'STEPCONFIG_AVG'
stepconfig = STEPCONFIG_AVG(ffs(adc_dev->step_avg[i]) - 1)

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510102117.Jqxrw1vF-lkp@intel.com/
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Add detail to comments in GEN INTR configuration
Akshay Jindal [Sun, 12 Oct 2025 18:06:13 +0000 (23:36 +0530)] 
iio: accel: bma400: Add detail to comments in GEN INTR configuration

Append additional information to existing comments in the generic
interrupt configuration code to provide more context.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Rename activity_event_en() to generic_event_en()
Akshay Jindal [Sun, 12 Oct 2025 18:06:12 +0000 (23:36 +0530)] 
iio: accel: bma400: Rename activity_event_en() to generic_event_en()

The function activity_event_en() configures the generic interrupts
GEN1 and GEN2, which are used for activity and inactivity detection
as per the datasheet. The existing name is misleading, since the
device also provides activity change and activity recognition
interrupts. Activity change interrupt is not supported yet whereas
Activity recognition interrupt is configured in a different function.

Rename activity_event_en() to generic_event_en() to better reflect its
actual purpose.

No functional changes intended.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Replace bit shifts with FIELD_PREP() and FIELD_GET()
Akshay Jindal [Sun, 12 Oct 2025 18:06:11 +0000 (23:36 +0530)] 
iio: accel: bma400: Replace bit shifts with FIELD_PREP() and FIELD_GET()

set_* functions involve left shift of param values into respective
register fields before writing to register. Similarly get_* functions
involve right shift to extract values from the respective bit fields.
Replace these explicit shifting statements with standard kernel style
macros FIELD_GET() and FIELD_PREP().

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Use index-based register addressing and lookup
Akshay Jindal [Sun, 12 Oct 2025 18:06:10 +0000 (23:36 +0530)] 
iio: accel: bma400: Use index-based register addressing and lookup

Introduce formula-based macros to compute GEN INTR configuration register
addresses from the interrupt number and register index. This reduces the
need for 22 explicit register macros to three base definitions.

Add a centralized lookup table keyed by IIO event direction and replace
get_gen_config_reg() with a helper integrated with this table.

Apply these changes across the affected callbacks to ensure consistent
access to generic interrupt registers.

No functional changes are intended.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Use macros for generic event configuration values
Akshay Jindal [Sun, 12 Oct 2025 18:06:09 +0000 (23:36 +0530)] 
iio: accel: bma400: Use macros for generic event configuration values

Add macros and enums for configuration values used in generic event
handling for activity and inactivity detection. Replace hard-coded
values in activity_event_en() with the new definitions to make the
configuration explicit.

No functional changes are intended.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma400: Reorganize and rename register and field macros
Akshay Jindal [Sun, 12 Oct 2025 18:06:08 +0000 (23:36 +0530)] 
iio: accel: bma400: Reorganize and rename register and field macros

Reorganize register and field macros to improve consistency with the
datasheet and naming style:

- Move field macros next to their corresponding register macros
- Reorder register macros to follow address order from the datasheet
- Rename field macros to include the register name in the macro name
- Add a _REG suffix to register macros where missing
- Add INT_STAT register fields corresponding to used INT_CONFIG fields

No functional changes are intended.

Signed-off-by: Akshay Jindal <akshayaj.lkd@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: health: max30100: Make LED pulse-width configurable via DT
Shrikant Raskar [Sun, 12 Oct 2025 17:30:35 +0000 (23:00 +0530)] 
iio: health: max30100: Make LED pulse-width configurable via DT

The required LED pulse width depends on board-specific optical and
mechanical design, which affects measurement accuracy and power use.
Making it configurable via Device Tree allows each platform to define
an appropriate value instead of relying on a hardcoded default.

If unspecified, the driver defaults to 1600 us for backward compatibility.

Tested on: Raspberry Pi 3B + MAX30100 breakout board.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: health: max30100: Add LED pulse-width property
Shrikant Raskar [Sun, 12 Oct 2025 17:30:34 +0000 (23:00 +0530)] 
dt-bindings: iio: health: max30100: Add LED pulse-width property

The LED pulse width on the MAX30100 sensor determines how long the
IR/Red LEDs are driven during each sample, directly affecting the
emitted optical energy and hence the received signal amplitude.

This parameter is highly dependent on the mechanical and optical
integration of the sensor, such as:
- The type and thickness of the optical window or lens covering
  the sensor.
- The distance between the LED and photodiode.
- The reflectivity of the target surface.

For example:
- A smartwatch or wearable ring with a thin glass window can operate
  with shorter pulses (200-400 us) to save power.
- A medical-grade pulse oximeter or sensor mounted behind a thicker
  protective layer may require longer pulses (800-1600 us) for
  reliable signal amplitude.

Because this configuration is determined by hardware design rather than
by runtime conditions, it is appropriate to describe it in the DT.

If not specified, the driver defaults to 1600 us to maintain
existing behavior.

Tested on: Raspberry Pi 3B + MAX30100 breakout board.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: accel: adxl345: document second interrupt
Wolfram Sang [Sat, 11 Oct 2025 20:59:09 +0000 (22:59 +0200)] 
dt-bindings: iio: accel: adxl345: document second interrupt

The pinout of all the supported chips in this binding have two interrupt
pins. Document the second one, too, even though the Linux driver
currently does not support the second interrupt. Boards may have it
wired nonetheless. While here, drop the dependency of interrupt-names
which is already described in the core.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads131e08: return correct error code
Dixit Parmar [Sat, 11 Oct 2025 08:11:49 +0000 (13:41 +0530)] 
iio: adc: ti-ads131e08: return correct error code

The error code returned from devm_iio_trigger_register() inturn
iio_trigger_register() can be other than -ENOMEM. Hence return the
same value as it was returned from the function call.
This change makes devm_iio_trigger_register() handling uniform with
other iio drivers.

Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4080: add support for AD4081
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:25 +0000 (11:15 +0000)] 
iio: adc: ad4080: add support for AD4081

Add support for AD4081 20-bit SAR ADC. The AD4081 has the same
resolution as AD4080 (20-bit) but differs in LVDS CNV clock count
maximum (2 vs 7).

Changes:
- Add AD4081_CHIP_ID definition (0x0051)
- Create ad4081_channel with 20-bit resolution and 32-bit storage
- Add ad4081_chip_info with lvds_cnv_clk_cnt_max = 2
- Register AD4081 in device ID and OF match tables

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: adc: adi,ad4080: add support for AD4081
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:24 +0000 (11:15 +0000)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4081

Add device tree binding support for the AD4081 20-bit SAR ADC.
Add adi,ad4081 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4081 has a different LVDS CNV clock count maximum (2 vs 7), requiring
different driver configuration.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4080: add support for AD4084
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:23 +0000 (11:15 +0000)] 
iio: adc: ad4080: add support for AD4084

Add support for AD4084 16-bit SAR ADC. The AD4084 differs from
AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count
maximum (2 vs 7).

Changes:
- Add AD4084_CHIP_ID definition (0x0054)
- Create ad4084_channel with 16-bit resolution and storage
- Add ad4084_chip_info with appropriate configuration
- Register AD4084 in device ID and OF match tables

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: adc: adi,ad4080: add support for AD4084
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:22 +0000 (11:15 +0000)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4084

Add device tree binding support for the AD4084 16-bit SAR ADC.
Add adi,ad4084 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4084 has different resolution (16-bit vs 20-bit) and LVDS CNV clock
count maximum (2 vs 7), requiring different driver configuration.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4080: prepare driver for multi-part support
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:21 +0000 (11:15 +0000)] 
iio: adc: ad4080: prepare driver for multi-part support

Refactor the ad4080 driver to support multiple ADC variants with
different resolution bits and LVDS CNV clock count maximums.

Changes:
- Add lvds_cnv_clk_cnt_max field to chip_info structure
- Create AD4080_CHANNEL_DEFINE macro for variable resolution/storage bits
- Make LVDS CNV clock count configurable per chip variant
- Use chip_info->product_id for chip identification comparison

This prepares the infrastructure for adding support for additional
ADC parts with different specifications while maintaining backward
compatibility with existing AD4080 functionality.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4080: fix chip identification
Antoniu Miclaus [Tue, 7 Oct 2025 11:15:20 +0000 (11:15 +0000)] 
iio: adc: ad4080: fix chip identification

Fix AD4080 chip identification by using the correct 16-bit product ID
(0x0050) instead of GENMASK(2, 0). Update the chip reading logic to
use regmap_bulk_read to read both PRODUCT_ID_L and PRODUCT_ID_H
registers and combine them into a 16-bit value.

The original implementation was incorrectly reading only 3 bits,
which would not correctly identify the AD4080 chip.

Fixes: 6b31ba1811b6 ("iio: adc: ad4080: add driver support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoMAINTAINERS: add entry for inv_icm45600 6-axis imu sensor
Remi Buisson [Tue, 7 Oct 2025 07:20:10 +0000 (07:20 +0000)] 
MAINTAINERS: add entry for inv_icm45600 6-axis imu sensor

Add MAINTAINERS entry for InvenSense ICM-45600 IMU device.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver
Remi Buisson [Tue, 7 Oct 2025 07:20:09 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver

Add I3C driver for InvenSense ICM-45600 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add SPI driver for inv_icm45600 driver
Remi Buisson [Tue, 7 Oct 2025 07:20:08 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add SPI driver for inv_icm45600 driver

Add SPI driver for InvenSense ICM-456000 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver
Remi Buisson [Tue, 7 Oct 2025 07:20:07 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver

Add I2C driver for InvenSense ICM-456000 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add IMU IIO accelerometer device
Remi Buisson [Tue, 7 Oct 2025 07:20:06 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add IMU IIO accelerometer device

Add IIO device for accelerometer sensor
with data polling interface and FIFO parsing.
Attributes: raw, scale, sampling_frequency, calibbias.
Temperature is available as a processed channel.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add IMU IIO gyroscope device
Remi Buisson [Tue, 7 Oct 2025 07:20:05 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add IMU IIO gyroscope device

Add IIO device for gyroscope sensor
with data polling interface and FIFO parsing.
Attributes: raw, scale, sampling_frequency, calibbias.
Temperature is available as a processed channel.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add buffer support in iio devices
Remi Buisson [Tue, 7 Oct 2025 07:20:04 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add buffer support in iio devices

Add FIFO control functions.
Support hwfifo watermark by multiplexing gyro and accel settings.
Support hwfifo flush.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: inv_icm45600: add new inv_icm45600 driver
Remi Buisson [Tue, 7 Oct 2025 07:20:03 +0000 (07:20 +0000)] 
iio: imu: inv_icm45600: add new inv_icm45600 driver

Core component of a new driver for InvenSense ICM-45600 devices.
It includes registers definition, main probe/setup, and device
utility functions.

ICM-456xx devices are latest generation of 6-axis IMU,
gyroscope+accelerometer and temperature sensor. This device
includes a 8K FIFO, supports I2C/I3C/SPI, and provides
intelligent motion features like pedometer, tilt detection,
and tap detection.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: imu: Add inv_icm45600
Remi Buisson [Tue, 7 Oct 2025 07:20:02 +0000 (07:20 +0000)] 
dt-bindings: iio: imu: Add inv_icm45600

Document the ICM-45600 devices devicetree bindings.
Specific variants of the device are defined because of their
differences in terms of FSR or advanced features like eDMP.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: Add Infineon DPS310 sensor documentation
Eddie James [Tue, 7 Oct 2025 19:16:12 +0000 (14:16 -0500)] 
dt-bindings: iio: Add Infineon DPS310 sensor documentation

The DPS310 is a barometric pressure and temperature sensor with
an I2C interface. Remove it from trivial-devices.yaml and add its
own documentation to allow for consumers of this device such as
the iio/hwmon bridge.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add maintainer
Petre Rodan [Sun, 5 Oct 2025 13:12:28 +0000 (16:12 +0300)] 
iio: accel: bma220: add maintainer

Add maintainer for this driver.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add debugfs reg access
Petre Rodan [Sun, 5 Oct 2025 13:12:27 +0000 (16:12 +0300)] 
iio: accel: bma220: add debugfs reg access

Allow read/write access to sensor registers for use in unit-tests.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add LPF cut-off frequency mapping
Petre Rodan [Sun, 5 Oct 2025 13:12:26 +0000 (16:12 +0300)] 
iio: accel: bma220: add LPF cut-off frequency mapping

Add mapping for the low pass filter cut-off frequency.
Make valid values visible for both the cut-off frequency and the scale.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add interrupt trigger
Petre Rodan [Sun, 5 Oct 2025 13:12:25 +0000 (16:12 +0300)] 
iio: accel: bma220: add interrupt trigger

Add interrupt trigger.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add i2c watchdog feature
Petre Rodan [Sun, 5 Oct 2025 13:12:24 +0000 (16:12 +0300)] 
iio: accel: bma220: add i2c watchdog feature

Sometimes the sensor gets stuck and enters a condition in which it pulls
SDA low, thus making the entire i2c bus unusable.
This problem is mitigated by activating a 1ms watchdog implemented in
the sensor.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add i2c module
Petre Rodan [Sun, 5 Oct 2025 13:12:23 +0000 (16:12 +0300)] 
iio: accel: bma220: add i2c module

Add the bma220_i2c module.

Note that this kernel module transparently shifts all register addresses
1 bit to the left, so all functions will operate based on the SPI memory
map.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: use find_match_table fct
Petre Rodan [Sun, 5 Oct 2025 13:12:22 +0000 (16:12 +0300)] 
iio: accel: bma220: use find_match_table fct

Clean up the code a bit by using a find_match_table function.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: populate buffer ts in trigger handler
Petre Rodan [Sun, 5 Oct 2025 13:12:21 +0000 (16:12 +0300)] 
iio: accel: bma220: populate buffer ts in trigger handler

Populate buffer timestamps in trigger handler since not all
triggers can run the top half handler that provides
pf->timestamp.

Fixes failing unit test that triggers based on the INT signal.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: migrate to regmap API
Petre Rodan [Sun, 5 Oct 2025 13:12:20 +0000 (16:12 +0300)] 
iio: accel: bma220: migrate to regmap API

Switch to regmap API.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: reset registers during init stage
Petre Rodan [Sun, 5 Oct 2025 13:12:19 +0000 (16:12 +0300)] 
iio: accel: bma220: reset registers during init stage

Bring all configuration registers to default values during
device probe().
Remove trivial code duplication regarding bma220_power() in
_init()

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: turn power supplies on
Petre Rodan [Sun, 5 Oct 2025 13:12:18 +0000 (16:12 +0300)] 
iio: accel: bma220: turn power supplies on

Add devm_regulator_bulk_get_enable() to device probe().

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: add open firmware table
Petre Rodan [Sun, 5 Oct 2025 13:12:17 +0000 (16:12 +0300)] 
iio: accel: bma220: add open firmware table

Add open firmware entry to the spi driver.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: split original driver
Petre Rodan [Sun, 5 Oct 2025 13:12:16 +0000 (16:12 +0300)] 
iio: accel: bma220: split original driver

In preparation for the i2c module, move the original code into multiple
source files without any other functional change.

Create the additional bma220_core module which currently is not
providing an abstracted bus type (this will change with the regmap
patch).
Fix a few includes in the context of this patch.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: cleanup includes
Petre Rodan [Sun, 5 Oct 2025 13:12:15 +0000 (16:12 +0300)] 
iio: accel: bma220: cleanup includes

Tweak includes based on requirements.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> #added linux/errno.h
2 months agoiio: accel: bma220: move bma220_power function
Petre Rodan [Sun, 5 Oct 2025 13:12:14 +0000 (16:12 +0300)] 
iio: accel: bma220: move bma220_power function

Move bma220_power() before bma220_init() as a precursor to a
patch that removes code duplication.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: shorten spi->dev calls
Petre Rodan [Sun, 5 Oct 2025 13:12:13 +0000 (16:12 +0300)] 
iio: accel: bma220: shorten spi->dev calls

Provide functions easier access to device struct.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: cleanup license string
Petre Rodan [Sun, 5 Oct 2025 13:12:12 +0000 (16:12 +0300)] 
iio: accel: bma220: cleanup license string

Fix checkpatch warning about use of "GPL v2" license:

Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db
("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: relax constraints during probe()
Petre Rodan [Sun, 5 Oct 2025 13:12:11 +0000 (16:12 +0300)] 
iio: accel: bma220: relax constraints during probe()

Do not return error if the chip id being read is not the expected one.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: bma220: remove incorrect kernel-doc marking
Petre Rodan [Sun, 5 Oct 2025 13:12:10 +0000 (16:12 +0300)] 
iio: accel: bma220: remove incorrect kernel-doc marking

Remove incorrect use of kernel-doc marking.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agostaging: iio: ad9834: remove empty ad9834.h file
Taimoor Zaeem [Mon, 6 Oct 2025 09:40:24 +0000 (14:40 +0500)] 
staging: iio: ad9834: remove empty ad9834.h file

Remove drivers/staging/iio/frequency/ad9834.h header file
because it contains nothing except the include guards.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: add RZ/T2H / RZ/N2H ADC driver
Cosmin Tanislav [Sun, 5 Oct 2025 11:13:18 +0000 (14:13 +0300)] 
iio: adc: add RZ/T2H / RZ/N2H ADC driver

Add support for the A/D 12-Bit successive approximation converters found
in the Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.

RZ/T2H has two ADCs with 4 channels and one with 6.
RZ/N2H has two ADCs with 4 channels and one with 15.

Conversions can be performed in single or continuous mode. Result of the
conversion is stored in a 16-bit data register corresponding to each
channel.

The conversions can be started by a software trigger, a synchronous
trigger (from MTU or from ELC) or an asynchronous external trigger (from
ADTRGn# pin).

Only single mode with software trigger is supported for now.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC
Cosmin Tanislav [Sun, 5 Oct 2025 11:13:17 +0000 (14:13 +0300)] 
dt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC

Document the A/D 12-Bit successive approximation converters found in the
Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.

RZ/T2H has two ADCs with 4 channels and one with 6.
RZ/N2H has two ADCs with 4 channels and one with 15.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: dac: ltc2688: use the auto lock API
Nuno Sá [Mon, 29 Sep 2025 13:35:32 +0000 (14:35 +0100)] 
iio: dac: ltc2688: use the auto lock API

Make use of the cleanup API so that we can simplify some code paths.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: resolver: ad2s1210: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:18 +0000 (16:33 +0100)] 
iio: resolver: ad2s1210: replace sprintf() with sysfs_emit()

Update the ad2s1210_read_label() and ad2s1210_read_event_label() functions
to use sysfs_emit() for generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: position: hid-sensor-custom-intel-hinge: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:17 +0000 (16:33 +0100)] 
iio: position: hid-sensor-custom-intel-hinge: replace sprintf() with sysfs_emit()

Update the hinge_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: qcom-spmi-rradc: replace snprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:16 +0000 (16:33 +0100)] 
iio: adc: qcom-spmi-rradc: replace snprintf() with sysfs_emit()

Update the rradc_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: pac1921: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:15 +0000 (16:33 +0100)] 
iio: adc: pac1921: replace sprintf() with sysfs_emit()

Update the pac1921_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: mt6360-adc: replace snprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:14 +0000 (16:33 +0100)] 
iio: adc: mt6360-adc: replace snprintf() with sysfs_emit()

Update the mt6360_adc_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: meson_saradc: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:13 +0000 (16:33 +0100)] 
iio: adc: meson_saradc: replace sprintf() with sysfs_emit()

Update the read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: mcp3564: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:12 +0000 (16:33 +0100)] 
iio: adc: mcp3564: replace sprintf() with sysfs_emit()

Update the mcp3564_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Marius Cristea <marius.cristea@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7768-1: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:11 +0000 (16:33 +0100)] 
iio: adc: ad7768-1: replace sprintf() with sysfs_emit()

Update the ad7768_read_label() function to use sysfs_emit(() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4030: replace sprintf() with sysfs_emit()
Nuno Sá [Tue, 30 Sep 2025 15:33:10 +0000 (16:33 +0100)] 
iio: adc: ad4030: replace sprintf() with sysfs_emit()

Update the ad4030_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sal@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: ltr390: Fix typo in variable name
Sameeksha Sankpal [Fri, 3 Oct 2025 17:44:25 +0000 (23:14 +0530)] 
iio: light: ltr390: Fix typo in variable name

Corrected a spelling mistake in the ltr390 driver:
'recieve_buffer' was renamed to 'receive_buffer'.

This improves code readibility without changing functionality.

Signed-off-by: Sameeksha Sankpal <sameekshasankpal@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: mpl3115: add support for sampling frequency
Antoni Pokusinski [Thu, 2 Oct 2025 20:02:06 +0000 (22:02 +0200)] 
iio: mpl3115: add support for sampling frequency

When the device is in ACTIVE mode the temperature and pressure measurements
are collected with a frequency determined by the ST[3:0] bits of CTRL_REG2
register.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: mpl3115: add support for DRDY interrupt
Antoni Pokusinski [Thu, 2 Oct 2025 20:02:05 +0000 (22:02 +0200)] 
iio: mpl3115: add support for DRDY interrupt

MPL3115 sensor features a "data ready" interrupt which indicates the
presence of new measurements.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: mpl3115: rename CTRL_REG1 field macros
Antoni Pokusinski [Thu, 2 Oct 2025 20:02:04 +0000 (22:02 +0200)] 
iio: mpl3115: rename CTRL_REG1 field macros

Rename the bitfield macros of CTRL_REG1, so that their names clearly
indicate their relation to CTRL_REG1.

This is a preparation for introducing the support for the DRDY interrupt
which requires the usage of other control registers.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: mpl3115: add separate function for triggered buffer data collection
Antoni Pokusinski [Thu, 2 Oct 2025 20:02:03 +0000 (22:02 +0200)] 
iio: mpl3115: add separate function for triggered buffer data collection

Factor out the code responsible for collecting data for the triggered
buffer from the trigger handler into a separate function.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: pressure: add binding for mpl3115
Antoni Pokusinski [Thu, 2 Oct 2025 20:02:02 +0000 (22:02 +0200)] 
dt-bindings: iio: pressure: add binding for mpl3115

MPL3115 is an I2C pressure and temperature sensor. It features 2
interrupt lines which can be configured to indicate events such as data
ready or pressure/temperature threshold reached.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7124: change setup reg allocation strategy
David Lechner [Tue, 23 Sep 2025 21:48:04 +0000 (16:48 -0500)] 
iio: adc: ad7124: change setup reg allocation strategy

Change the allocation strategy of the 8 SETUP registers from a least-
recently-used (LRU) to a first-come-first-served basis.

The AD7124 chips can have up to 16 channels enabled at a time in the
sequencer for buffered reads, but only have 8 SETUP configurations
(namely the OFFSET, GAIN, CONFIG and FILTER registers) that must be
shared among the 16 channels.  This means some of the channels must use
the exact same configuration parameters so that they can share a single
SETUP group of registers.  The previous LRU strategy did not keep track
of how many different configurations were requested at the same time,
so if there were more than 8 different configurations requested, some
channels would end up using the incorrect configuration because the slot
assigned to them would also be assigned to a different configuration
that wrote over it later.

Adding such tracking to solve this would make an already complex
algorithm even more complex.  Instead we can replace it with a simpler
first-come-first-serve strategy.  This makes it easy to track how many
different configurations are being requested at the same time.  This
comes at the expense of slightly longer setup times for buffered reads
since all setup registers must be written each time when a buffered read
is enabled.  But this is generally not considered a hot path where
performance is critical, so should be acceptable.

This new strategy also makes hardware debugging easier since SETUPs are
now assigned in a deterministic manner and in a logical order.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7124: add ext attributes to temperature channel
David Lechner [Tue, 23 Sep 2025 20:33:18 +0000 (15:33 -0500)] 
iio: adc: ad7124: add ext attributes to temperature channel

Use the same .ext_info for the temperature channel as for the voltage
channels. In the ADC, these all go though a mux to select the source
and otherwise operate the same.

These attributes probably won't be used much, but since it is trivial
to add this, we might as well include them.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>