]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 weeks agoiio: proximity: rfd77402: Align polling timeout with datasheet
Shrikant Raskar [Wed, 28 Jan 2026 17:51:49 +0000 (23:21 +0530)] 
iio: proximity: rfd77402: Align polling timeout with datasheet

Update the polling delay to use a 100 ms timeout, as specified
in the RFD77402 datasheet.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: cros_ec: Allow enabling/disabling calibration mode
Gwendal Grignou [Wed, 28 Jan 2026 03:27:02 +0000 (19:27 -0800)] 
iio: cros_ec: Allow enabling/disabling calibration mode

'calibrate' was a one-shot event sent to the sensor to calibrate itself.
It is used on Bosch sensors (BMI160, BMA254).
Light sensors work differently: They are first put in calibration mode,
tests are run to collect information and calculate the calibration
values to apply. Once done, the sensors are put back in normal mode.

Accept boolean true and false (not just true) to enter/exit calibration
state.

Check "echo 0 > calibrate" is supported.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: frequency: ad9523: correct kernel-doc bad line warning
Randy Dunlap [Wed, 28 Jan 2026 06:25:37 +0000 (22:25 -0800)] 
iio: frequency: ad9523: correct kernel-doc bad line warning

Insert a "*" in the kernel-doc line to resolve a warning:

Warning: include/linux/iio/frequency/ad9523.h:47 bad line:
 LSB = 1/2 of a period of the divider input clock.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: buffer: buffer_impl.h: fix kernel-doc warnings
Randy Dunlap [Wed, 28 Jan 2026 20:07:20 +0000 (12:07 -0800)] 
iio: buffer: buffer_impl.h: fix kernel-doc warnings

Resolve all kernel-doc warnings in buffer_impl.h:

Warning: include/linux/iio/buffer_impl.h:172 struct member 'direction' not described in 'iio_buffer'
Warning: include/linux/iio/buffer_impl.h:184 No description found for return value of 'iio_update_buffers'

Also correct one typo (word order switch) and remove one stray space
in a kernel-doc comment.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: gyro: itg3200: Fix unchecked return value in read_raw
Antoniu Miclaus [Thu, 29 Jan 2026 15:01:45 +0000 (17:01 +0200)] 
iio: gyro: itg3200: Fix unchecked return value in read_raw

The return value from itg3200_read_reg_s16() is stored in ret but
never checked. The function unconditionally returns IIO_VAL_INT,
ignoring potential I2C read failures. This causes garbage data to
be returned to userspace when the read fails, with no error reported.

Add proper error checking to propagate the failure to callers.

Fixes: 9dbf091da080 ("iio: gyro: Add itg3200")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoMAINTAINERS: add entry for ADE9000 driver
Antoniu Miclaus [Thu, 29 Jan 2026 14:43:07 +0000 (16:43 +0200)] 
MAINTAINERS: add entry for ADE9000 driver

Add maintainer entry for the ADE9000 polyphase energy metering IC
driver, including devicetree bindings and driver documentation.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: accel: sca3000: remove unused last_timestamp field
Antoniu Miclaus [Thu, 29 Jan 2026 14:11:59 +0000 (16:11 +0200)] 
iio: accel: sca3000: remove unused last_timestamp field

Remove unused last_timestamp field from sca3000_state
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: accel: adxl372: remove unused int2_bitmask field
Antoniu Miclaus [Thu, 29 Jan 2026 14:11:57 +0000 (16:11 +0200)] 
iio: accel: adxl372: remove unused int2_bitmask field

Remove unused int2_bitmask field from adxl372_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: adc: ad7766: Use iio_trigger_generic_data_rdy_poll()
Sebastian Andrzej Siewior [Wed, 28 Jan 2026 09:55:39 +0000 (10:55 +0100)] 
iio: adc: ad7766: Use iio_trigger_generic_data_rdy_poll()

ad7766_irq() is identical to iio_trigger_generic_data_rdy_poll().

Use iio_trigger_generic_data_rdy_poll() instead of ad7766_irq().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: magnetometer: Remove IRQF_ONESHOT
Sebastian Andrzej Siewior [Wed, 28 Jan 2026 09:55:38 +0000 (10:55 +0100)] 
iio: magnetometer: Remove IRQF_ONESHOT

Passing IRQF_ONESHOT ensures that the interrupt source is masked until
the secondary (threaded) handler is done. If only a primary handler is
used then the flag makes no sense because the interrupt can not fire
(again) while its handler is running.
The flag also disallows force-threading of the primary handler and the
irq-core will warn about this.
The force-threading functionality is required on PREEMPT_RT because the
handler is using locks with can sleep on PREEMPT_RT.

Remove IRQF_ONESHOT from irqflags.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: Replace IRQF_ONESHOT with IRQF_NO_THREAD
Sebastian Andrzej Siewior [Wed, 28 Jan 2026 09:55:37 +0000 (10:55 +0100)] 
iio: Replace IRQF_ONESHOT with IRQF_NO_THREAD

Passing IRQF_ONESHOT ensures that the interrupt source is masked until
the secondary (threaded) handler is done. If only a primary handler is
used then the flag makes no sense because the interrupt can not fire
(again) while its handler is running.
The flag also disallows force-threading of the primary handler and the
irq-core will warn about this.

The intention here was probably not allowing forced-threading for
handlers such as iio_trigger_generic_data_rdy_poll() will intends to
invoke hard-interrupt handlers.

Replace IRQF_ONESHOT with IRQF_NO_THREAD.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 weeks agoiio: Use IRQF_NO_THREAD
Sebastian Andrzej Siewior [Wed, 28 Jan 2026 09:55:36 +0000 (10:55 +0100)] 
iio: Use IRQF_NO_THREAD

The interrupt handler iio_trigger_generic_data_rdy_poll() will invoke
other interrupt handler and this supposed to happen from within the
hardirq.

Use IRQF_NO_THREAD to forbid forced-threading.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: dac: Add MAX22007 DAC driver support
Janani Sunil [Mon, 19 Jan 2026 11:24:24 +0000 (12:24 +0100)] 
iio: dac: Add MAX22007 DAC driver support

Add support for the MAX22007 4 channel DAC that drives a voltage or
current output on each channel.

Signed-off-by: Janani Sunil <janani.sunil@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agodt-bindings: iio: dac: Add max22007
Janani Sunil [Mon, 19 Jan 2026 11:24:23 +0000 (12:24 +0100)] 
dt-bindings: iio: dac: Add max22007

Devicetree bindings for MAX22007 4-channel 12-bit DAC that drives a
voltage or current output on each channel

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Janani Sunil <janani.sunil@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agodrivers: iio: mpu3050: use dev_err_probe for regulator request
Svyatoslav Ryhel [Thu, 22 Jan 2026 15:34:25 +0000 (17:34 +0200)] 
drivers: iio: mpu3050: use dev_err_probe for regulator request

Regulator requesting may result in deferred probing error which will
abort driver probing. To avoid this just use dev_err_probe which handles
deferred probing.

Fixes: 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: accel: adxl380: Optimize reading of FIFO entries in interrupt handler
Francesco Lavra [Mon, 19 Jan 2026 10:23:17 +0000 (11:23 +0100)] 
iio: accel: adxl380: Optimize reading of FIFO entries in interrupt handler

In order to minimize the time required for transferring FIFO data from the
sensor to the host machine, perform the read from the FIFO in a single call
to regmap_noinc_read().
This allows reading acceleration data for all 3 axes at 16 kHz
sampling frequency using a 1MHz I2C bus frequency.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: accel: adxl380: Avoid reading more entries than present in FIFO
Francesco Lavra [Mon, 19 Jan 2026 10:23:16 +0000 (11:23 +0100)] 
iio: accel: adxl380: Avoid reading more entries than present in FIFO

The interrupt handler reads FIFO entries in batches of N samples, where N
is the number of scan elements that have been enabled. However, the sensor
fills the FIFO one sample at a time, even when more than one channel is
enabled. Therefore,the number of entries reported by the FIFO status
registers may not be a multiple of N; if this number is not a multiple, the
number of entries read from the FIFO may exceed the number of entries
actually present.

To fix the above issue, round down the number of FIFO entries read from the
status registers so that it is always a multiple of N.

Fixes: df36de13677a ("iio: accel: add ADXL380 driver")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: pressure: mprls0025pa: remove error message
Petre Rodan [Sun, 18 Jan 2026 11:19:39 +0000 (13:19 +0200)] 
iio: pressure: mprls0025pa: remove error message

Do not print a duplicate error message if devm_request_irq() fails.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family
Jonathan Santos [Wed, 14 Jan 2026 09:27:29 +0000 (06:27 -0300)] 
iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family

Add support for ADAQ7767/68/69-1 series, which includes PGIA and
Anti-aliasing filter (AAF) gains. Unlike the AD7768-1, they do not
provide a VCM regulator interface.

The PGA gain is configured in run-time through the scale attribute,
if supported by the device. PGA is controlled by GPIOs provided in
the device tree.

The AAF gain is defined by hardware connections and should be specified
in the device tree.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: adc: ad7768-1: refactor ad7768_write_raw()
Jonathan Santos [Wed, 14 Jan 2026 09:27:14 +0000 (06:27 -0300)] 
iio: adc: ad7768-1: refactor ad7768_write_raw()

Squash __ad7768_write_raw() back to ad7768_write_raw() to allow the
addition of new attributes without requiring a direct mode claim.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agounits: add conversion macros for percentage related units
Jonathan Santos [Wed, 14 Jan 2026 09:27:03 +0000 (06:27 -0300)] 
units: add conversion macros for percentage related units

Add macros to convert between ratio and percentage related units,
including percent (1/100), permille (1/1,000), permyriad (1/10,000,
also equivalent to one Basis point) and per cent mille (1/100,000).
Those are  Used for precise fractional calculations in engineering,
finance, and measurement applications.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: adc: ad7768-1: introduce chip info for future multidevice support
Jonathan Santos [Wed, 14 Jan 2026 09:26:52 +0000 (06:26 -0300)] 
iio: adc: ad7768-1: introduce chip info for future multidevice support

Add Chip info struct in SPI device to store channel information for
each supported part.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agodt-bindings: iio: adc: ad7768-1: add new supported parts
Jonathan Santos [Wed, 14 Jan 2026 09:26:39 +0000 (06:26 -0300)] 
dt-bindings: iio: adc: ad7768-1: add new supported parts

Add compatibles for supported parts in the ad7768-1 family:
ADAQ7767-1, ADAQ7768-1 and ADAQ7769-1

Add property and checks for AFF gain, supported by ADAQ7767-1
and ADAQ7769-1, and for PGA gain, supported by ADAQ7768-1
and ADAQ7769-1:
adi,aaf-gain-bp
pga-gpios

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: light: opt4060: Use IIO cleanup helpers
Kurt Borja [Tue, 20 Jan 2026 06:20:47 +0000 (01:20 -0500)] 
iio: light: opt4060: Use IIO cleanup helpers

Use IIO_DEV_GUARD_CURRENT_MODE() cleanup helper to simplify and drop
busy-waiting code in opt4060_set_driver_state().

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: health: max30102: Use IIO cleanup helpers
Kurt Borja [Tue, 20 Jan 2026 06:20:46 +0000 (01:20 -0500)] 
iio: health: max30102: Use IIO cleanup helpers

Use IIO_DEV_GUARD_CURRENT_MODE() cleanup helper to simplify and drop
busy-waiting code in max30102_read_raw().

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: light: vcnl4000: Use IIO cleanup helpers
Kurt Borja [Tue, 20 Jan 2026 06:20:45 +0000 (01:20 -0500)] 
iio: light: vcnl4000: Use IIO cleanup helpers

Use IIO_DEV_ACQUIRE_DIRECT_MODE() helper to automatically release direct
mode.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: core: Add cleanup.h support for iio_device_claim_*()
Kurt Borja [Tue, 20 Jan 2026 06:20:44 +0000 (01:20 -0500)] 
iio: core: Add cleanup.h support for iio_device_claim_*()

Add guard classes for iio_device_claim_*() conditional locks. This will
aid drivers write safer and cleaner code when dealing with some common
patterns.

These classes are not meant to be used directly by drivers (hence the
__priv__ prefix). Instead, documented wrapper macros are provided to
enforce the use of ACQUIRE() or guard() semantics and avoid the
problematic scoped guard.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: core: Match iio_device_claim_*() semantics and implementation
Kurt Borja [Tue, 20 Jan 2026 06:20:43 +0000 (01:20 -0500)] 
iio: core: Match iio_device_claim_*() semantics and implementation

Implement iio_device_claim_buffer_mode() fully inline with the use of
__iio_dev_mode_lock(), which takes care of sparse annotations.

To completely match iio_device_claim_direct() semantics, we need to
also change iio_device_claim_buffer_mode() return semantics to usual
true/false conditional lock semantics.

Additionally, to avoid silently breaking out-of-tree drivers, rename
iio_device_claim_buffer_mode() to iio_device_claim_try_buffer_mode().

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: core: Refactor iio_device_claim_direct() implementation
Kurt Borja [Tue, 20 Jan 2026 06:20:42 +0000 (01:20 -0500)] 
iio: core: Refactor iio_device_claim_direct() implementation

In order to eventually unify the locking API, implement
iio_device_claim_direct() fully inline, with the use of
__iio_dev_mode_lock(), which takes care of sparse annotations.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: core: Add and export __iio_dev_mode_lock()
Kurt Borja [Tue, 20 Jan 2026 06:20:41 +0000 (01:20 -0500)] 
iio: core: Add and export __iio_dev_mode_lock()

Add unconditional wrappers around the internal IIO mode lock.

As mentioned in the documentation, this is not meant to be used by
drivers, instead this will aid in the eventual addition of cleanup
classes around conditional locks.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoMerge remote-tracking branch 'i3c/ib-i3c-iio-v6.20' into togreg
Jonathan Cameron [Thu, 22 Jan 2026 20:52:15 +0000 (20:52 +0000)] 
Merge remote-tracking branch 'i3c/ib-i3c-iio-v6.20' into togreg

Needed for some stubs to prevent build issues if !CONFIG_I3C

3 weeks agoiio: magn: mmc5633: Ensure REGMAP_I2C / I3C not build if I2C / I3C is not.
Jonathan Cameron [Mon, 19 Jan 2026 21:48:16 +0000 (21:48 +0000)] 
iio: magn: mmc5633: Ensure REGMAP_I2C / I3C not build if I2C / I3C is not.

Fixes the following build warning (and equivalent I2C one)
WARNING: unmet direct dependencies detected for REGMAP_I3C
  Depends on [n]: I3C [=n]
  Selected by [m]:
  - MMC5633 [=m] && IIO [=y] && (I2C [=y] || I3C [=n])

Fixes: 6e5f6bf2e3f0 ("iio: magnetometer: Add mmc5633 sensor")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 weeks agoiio: adc: ad4062: Switch from struct i3c_priv_xfer to struct i3c_xfer
Jonathan Cameron [Mon, 19 Jan 2026 21:28:04 +0000 (21:28 +0000)] 
iio: adc: ad4062: Switch from struct i3c_priv_xfer to struct i3c_xfer

Commit 9904232ae30bc ("i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()")
currently in the i3c/for-next tree removes the deprecated
struct i3c_priv_xfer and i3c_device_do_priv_xfers().

Switch to struct i3c_xfer and i3c_device_do_xfers(..., I3C_SDR)
now rather causing a build issue when both trees are merged.

Suggested-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: proximity: rfd77402: Reorder header includes
Shrikant Raskar [Thu, 15 Jan 2026 08:27:37 +0000 (13:57 +0530)] 
iio: proximity: rfd77402: Reorder header includes

Reorder header includes to follow kernel include
ordering conventions.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: imu: smi330: Convert to common field_{get,prep}() helpers
Geert Uytterhoeven [Thu, 15 Jan 2026 14:24:16 +0000 (15:24 +0100)] 
iio: imu: smi330: Convert to common field_{get,prep}() helpers

Drop the driver-specific smi330_field_get() and smi330_field_prep()
macros, in favor of the globally available variants from
<linux/bitfield.h>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: accel: adxl380: Add support for 1 kHz sampling frequency
Francesco Lavra [Thu, 15 Jan 2026 17:53:50 +0000 (18:53 +0100)] 
iio: accel: adxl380: Add support for 1 kHz sampling frequency

In sensor variants (such as ADXL380 and ADXL382) that support low-power
mode, the SAR signal path allows sampling acceleration data at lower rates;
more specifically, when the sensor operates in VLP mode, the sampling
frequency is 1 kHz.

To add support for the 1kHz sampling frequency value, modify the operating
mode selection logic to take into account the sampling frequency, and
configure the decimation filters only when applicable (i.e. when using a
sampling frequency that relies on the DSM signal path); in addition,
constrain the available sampling frequency values based on whether the
sensor is operating in low-power mode.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: accel: adxl380: Introduce helper function for activity detection
Francesco Lavra [Thu, 15 Jan 2026 17:53:49 +0000 (18:53 +0100)] 
iio: accel: adxl380: Introduce helper function for activity detection

Motion detection functionalities (such as activity and inactivity
detection) are only available when the chip is in a low-power mode; this
affects the available sampling frequency values.
In preparation for adding support for a new frequency value, introduce a
helper function that checks whether activity/inactivity detection is
currently enabled; this function will be reused in a future commit to
determine what frequency values are available at any given time.
No functional changes.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: accel: adxl380: Store sampling frequency index in odr struct member
Francesco Lavra [Thu, 15 Jan 2026 17:53:48 +0000 (18:53 +0100)] 
iio: accel: adxl380: Store sampling frequency index in odr struct member

The ADXL380 driver assumes that acceleration samples are always retrieved
via the high-performance DSM signal path; as a result, the sampling
frequency value depends exclusively on the decimation filter settings in
the TRIG_CFG register.
In preparation for adding support for sampling frequency values that rely
on the low-power SAR signal path (on which the decimation filters are not
supported), use the (currently unused) 'odr' member of struct adxl380_state
to store the sampling frequency value, and when userspace requests the
current frequency value, retrieve it from the struct instead of calculating
it from the decimation filter settings.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: adc: ad9467: include two's complement in default mode
Tomas Melin [Wed, 14 Jan 2026 10:45:50 +0000 (10:45 +0000)] 
iio: adc: ad9467: include two's complement in default mode

All supported drivers currently implicitly use two's complement mode.
Make this clear by declaring two's complement in the default
output mode. Calibration mode uses offset binary, so change the output
mode only when running the calibration or other test mode.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: add copyright line
Petre Rodan [Wed, 14 Jan 2026 16:55:42 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: add copyright line

Add copyright line to the core driver.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: change measurement sequence
Petre Rodan [Wed, 14 Jan 2026 16:55:41 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: change measurement sequence

Implement a measurement sequence that does not involve a one byte read of
the status byte before reading the conversion.

The sensor's conversions should be read either once the EoC interrupt
has triggered or 5ms after the 0xaa command. See Options 1 and 2
respectively in Tables 16 (page 15) and 18 (page 18) of the datasheet.
Note that Honeywell's example code also covered in the datasheet follows
Option 2 for both i2c and SPI.

The datasheet does not specify any of the retry parameters that are
currently implemented in the driver. A simple 5+ms sleep as specified in
Option 2 is enough for a valid measurement sequence.

The change also gets rid of the code duplication tied to the verification
of the status byte.

This change only affects users that do not define the EoC interrupt in
the device tree.

Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/micropressure-mpr-series/documents/sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf?download=false
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: stricter checks for the status byte
Petre Rodan [Wed, 14 Jan 2026 16:55:40 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: stricter checks for the status byte

Make sure a valid conversion comes with a status byte that only has
the MPR_ST_POWER bit set.
Return -EBUSY if also MPR_ST_BUSY is set or -EIO otherwise.

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: move memset to core
Petre Rodan [Wed, 14 Jan 2026 16:55:39 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: move memset to core

Move memset() from the bus specific code into core.

Zeroing out the buffer is performed because the sensor has noticeable
latch-up sensitivity and in some cases it clamps the MISO signal to GND
in sync with SCLK [1]. A raw conversion of zero is out of bounds since
valid values have to be between output_min and output_max (and the
smallest output_min is 2.5% of 2^24 = 419430).

The user is expected to discard out of bounds pressure values.

Given the fact that we can't follow the behaviour of all SPI controllers
when faced to this clamping of an output signal, a raw conversion of zero
is used as an early warning in case the low level SPI API reacts
unexpectedly.

Link: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1588325/am3358-spi-tx-data-corruption
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: introduce tx buffer
Petre Rodan [Wed, 14 Jan 2026 16:55:38 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: introduce tx buffer

Use a tx_buf that is part of the priv struct for transferring data to
the sensor instead of relying on a devm_kzalloc()-ed array.
Remove the .init operation in the process.

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: rename buffer variable
Petre Rodan [Wed, 14 Jan 2026 16:55:37 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: rename buffer variable

For the reason of better naming consistency rename priv->buffer into
priv->rx_buf since tx_buf will get introduced in the next patch.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: remove redundant declarations
Petre Rodan [Wed, 14 Jan 2026 16:55:36 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: remove redundant declarations

Remove the iio_chan_spec and iio_dev structs which are already defined in
the included iio.h header.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: cleanup includes
Petre Rodan [Wed, 14 Jan 2026 16:55:35 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: cleanup includes

Remove unused headers and add required headers as needed.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: fix pressure calculation
Petre Rodan [Wed, 14 Jan 2026 16:55:34 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: fix pressure calculation

A sign change is needed for proper calculation of the pressure.

This is a minor fix since it only affects users that might have custom
silicon from Honeywell that has honeywell,pmin-pascal != 0.

Also due to the fact that raw pressure values can not be lower
than output_min (400k-3.3M) there is no need to calculate a decimal for
the offset.

Fixes: 713337d9143e ("iio: pressure: Honeywell mprls0025pa pressure sensor")
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: fix scan_type struct
Petre Rodan [Wed, 14 Jan 2026 16:55:33 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: fix scan_type struct

Fix the scan_type sign and realbits assignment.

The pressure is a 24bit unsigned int between output_min and output_max.

 transfer function A: 10%   to 90%   of 2^24
 transfer function B:  2.5% to 22.5% of 2^24
 transfer function C: 20%   to 80%   of 2^24
[MPR_FUNCTION_A] = { .output_min = 1677722, .output_max = 15099494 }
[MPR_FUNCTION_B] = { .output_min =  419430, .output_max =  3774874 }
[MPR_FUNCTION_C] = { .output_min = 3355443, .output_max = 13421773 }

Fixes: 713337d9143e ("iio: pressure: Honeywell mprls0025pa pressure sensor")
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: fix interrupt flag
Petre Rodan [Wed, 14 Jan 2026 16:55:32 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: fix interrupt flag

Interrupt falling/rising flags should only be defined in the device tree.

Fixes: 713337d9143e ("iio: pressure: Honeywell mprls0025pa pressure sensor")
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: fix SPI CS delay violation
Petre Rodan [Wed, 14 Jan 2026 16:55:31 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: fix SPI CS delay violation

Based on the sensor datasheet in chapter 7.6 SPI timing, Table 20,
during the SPI transfer there is a minimum time interval requirement
between the CS being asserted and the first clock edge (tHDSS).
This minimum interval of 2.5us is being violated if two consecutive SPI
transfers are queued up.

Fixes: a0858f0cd28e ("iio: pressure: mprls0025pa add SPI driver")
Datasheet: https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/pressure-sensors/board-mount-pressure-sensors/micropressure-mpr-series/documents/sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf?download=false
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: mprls0025pa: fix spi_transfer struct initialisation
Petre Rodan [Wed, 14 Jan 2026 16:55:30 +0000 (18:55 +0200)] 
iio: pressure: mprls0025pa: fix spi_transfer struct initialisation

Make sure that the spi_transfer struct is zeroed out before use.

Fixes: a0858f0cd28e ("iio: pressure: mprls0025pa add SPI driver")
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoi3c: Add stub functions when I3C support is disabled
Frank Li [Tue, 30 Dec 2025 14:57:18 +0000 (09:57 -0500)] 
i3c: Add stub functions when I3C support is disabled

When I3C is disabled, unused functions are removed by the linker because
the driver relies on regmap and no I3C devices are registered, so normal
I3C paths are never called.

However, some drivers may still call low-level I3C transfer helpers.
Provide stub implementations to avoid adding conditional ifdefs everywhere.

Add stubs for i3c_device_do_xfers() and
i3c_device_get_supported_xfer_mode() only. Other stubs will be introduced
when they are actually needed.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512230418.nu3V6Yua-lkp@intel.com/
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251230145718.4088694-1-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
4 weeks agoi3c: master: Simplify with scoped for each OF child loop
Krzysztof Kozlowski [Wed, 24 Dec 2025 12:45:52 +0000 (13:45 +0100)] 
i3c: master: Simplify with scoped for each OF child loop

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251224124551.208778-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
4 weeks agoi3c: master: svc: Initialize 'dev' to NULL in svc_i3c_master_ibi_isr()
Frank Li [Mon, 15 Dec 2025 20:08:51 +0000 (15:08 -0500)] 
i3c: master: svc: Initialize 'dev' to NULL in svc_i3c_master_ibi_isr()

Initialize the 'dev' pointer to NULL in svc_i3c_master_ibi_isr() and add
a NULL check in the error path.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202512131016.YCKIsDXM-lkp@intel.com/
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251215200852.3079073-1-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
4 weeks agoi3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()
Frank Li [Mon, 15 Dec 2025 17:24:04 +0000 (12:24 -0500)] 
i3c: drop i3c_priv_xfer and i3c_device_do_priv_xfers()

Drop i3c_priv_xfer and i3c_device_do_priv_xfers() after all driver switch
to use new API.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251215172405.2982801-1-Frank.Li@nxp.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
4 weeks agoiio: pressure: abp2030pa: remove error message
Petre Rodan [Wed, 14 Jan 2026 07:51:38 +0000 (09:51 +0200)] 
iio: pressure: abp2030pa: remove error message

Do not print a duplicate error message if devm_request_irq() fails.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 weeks agoiio: pressure: abp2030pa: fix typo in Kconfig description
Petre Rodan [Wed, 14 Jan 2026 07:51:37 +0000 (09:51 +0200)] 
iio: pressure: abp2030pa: fix typo in Kconfig description

Replace "I2C" with "SPI" in the SPI module description.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoi3c: dw: Preserve DAT entry bits when restoring addresses
Adrian Ng Ho Yin [Fri, 12 Dec 2025 09:02:58 +0000 (17:02 +0800)] 
i3c: dw: Preserve DAT entry bits when restoring addresses

Update dw_i3c_master_restore_addrs() to preserve existing bits in each
Device Address Table (DAT) entry when restoring addresses. This prevents
overwriting configuration bits during PM runtime resumes.

Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/46112c0da44110f46709cb0e7a4595e312b95c10.1765529948.git.adrianhoyin.ng@altera.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 weeks agoi3c: dw: use FIELD_PREP for device address table macros
Adrian Ng Ho Yin [Fri, 12 Dec 2025 09:02:57 +0000 (17:02 +0800)] 
i3c: dw: use FIELD_PREP for device address table macros

Add DEV_ADDR_TABLE_DYNAMIC_MASK / DEV_ADDR_TABLE_DYNAMIC_ADDR(x) for
dynamic device addresses and DEV_ADDR_TABLE_STATIC_MASK /
DEV_ADDR_TABLE_STATIC_ADDR(x) for static device addresses in the I3C
address table. Replace manual shift-and-mask with FIELD_PREP() for both
dynamic and static addresses for clarity and maintainability.

Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/d72896e510db1870d26a794f131f600c7e42cf00.1765529948.git.adrianhoyin.ng@altera.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 weeks agoi3c: dw: Add support for Device NACK Retry configuration
Adrian Ng Ho Yin [Fri, 12 Dec 2025 09:02:56 +0000 (17:02 +0800)] 
i3c: dw: Add support for Device NACK Retry configuration

The DesignWare I3C controller supports automatically retrying transactions
when a device NACKs. This is useful for slave devices that may be
temporarily busy and not ready to respond immediately.

Add new ops to configure all active DAT entry with dev_nack_retry during
runtime. Returns error when value exceeds hw specified limit.

Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/f09ee67e61d31f0a12a0bf48f01e9057ca9e2fb7.1765529948.git.adrianhoyin.ng@altera.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 weeks agoi3c: add sysfs entry and attribute for Device NACK Retry count
Adrian Ng Ho Yin [Fri, 12 Dec 2025 09:02:55 +0000 (17:02 +0800)] 
i3c: add sysfs entry and attribute for Device NACK Retry count

Document sysfs attribute dev_nack_retry_cnt that controls the number of
automatic retries performed by the I3C controller when a target device
returns a NACK

Add a `dev_nack_retry_count` sysfs attribute to allow reading and updating
the device NACK retry count. A new `dev_nack_retry_count` field and an
optional `set_dev_nack_retry()` callback are added to
i3c_master_controller. The attribute is created only when the callback is
implemented.

Updates are applied under the I3C bus maintenance lock to ensure safe
hardware reconfiguration.

Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/3c4b5082bde64024fc383c44bebeef89ad3c7ed3.1765529948.git.adrianhoyin.ng@altera.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
5 weeks agoiio: dac: ds4424: drop unused include IIO consumer header
Romain Gantois [Tue, 9 Dec 2025 08:25:55 +0000 (09:25 +0100)] 
iio: dac: ds4424: drop unused include IIO consumer header

To prepare for the introduction of namespaced exports for the IIO consumer
API, remove this include directive which isn't actually used by the driver.

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: Initial support for AD4134
Marcelo Schmitt [Wed, 7 Jan 2026 14:47:59 +0000 (11:47 -0300)] 
iio: adc: Initial support for AD4134

AD4134 is a 24-bit, 4-channel, simultaneous sampling, precision
analog-to-digital converter (ADC). The device can be managed through SPI or
direct control of pin logical levels (pin control mode). The AD4134 design
also features a dedicated bus for ADC sample data output. Though, this
initial driver for AD4134 only supports usual SPI connections.

Add basic support for AD4134 that enables single-shot ADC sample read.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: adc: Add AD4134
Marcelo Schmitt [Wed, 7 Jan 2026 14:47:37 +0000 (11:47 -0300)] 
dt-bindings: iio: adc: Add AD4134

Add device tree documentation for AD4134 24-Bit, 4-channel simultaneous
sampling, precision ADC.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ad7476: Remove duplicate include
Chen Ni [Wed, 7 Jan 2026 08:29:20 +0000 (16:29 +0800)] 
iio: adc: ad7476: Remove duplicate include

Remove duplicate inclusion of linux/bitops.h.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: ti-ads1018: Drop stale kernel-doc function context
Kurt Borja [Tue, 6 Jan 2026 08:17:32 +0000 (03:17 -0500)] 
iio: adc: ti-ads1018: Drop stale kernel-doc function context

The driver no longer uses iio_device_claim_buffer_mode(). Drop it from
ads1018_spi_read_exclusive() context remark.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: bmi270_i2c: Add MODULE_DEVICE_TABLE for BMI260/270
Derek J. Clark [Tue, 6 Jan 2026 05:45:19 +0000 (05:45 +0000)] 
iio: bmi270_i2c: Add MODULE_DEVICE_TABLE for BMI260/270

Currently BMI260 & BMI270 devices do not automatically load this
driver. To fix this, add missing MODULE_DEVICE_TABLE for the i2c,
acpi, and of device tables so the driver will load when the hardware
is detected.

Tested on my OneXPlayer F1 Pro.

Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agostaging: iio: adt7316: modernize power management
Michael Harris [Tue, 6 Jan 2026 14:50:55 +0000 (06:50 -0800)] 
staging: iio: adt7316: modernize power management

Replaced use of deprecated function SIMPLE_DEV_PM_OPS() with
EXPORT_GPL_SIMPLE_DEV_PM_OPS().

Removed PM preprocessor conditions with usage of pm_sleep_ptr().

Signed-off-by: Michael Harris <michaelharriscode@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: proximity: rfd77402: Add OF device ID for enumeration via DT
Shrikant Raskar [Thu, 1 Jan 2026 16:17:39 +0000 (21:47 +0530)] 
iio: proximity: rfd77402: Add OF device ID for enumeration via DT

Add an OF device ID table so the driver can bind automatically when
the RFD77402 sensor is described in Device Tree. This enables proper
enumeration via its compatible string and allows instantiation on
DT-based platforms.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agodt-bindings: iio: proximity: Add RF Digital RFD77402 ToF sensor
Shrikant Raskar [Thu, 1 Jan 2026 16:17:38 +0000 (21:47 +0530)] 
dt-bindings: iio: proximity: Add RF Digital RFD77402 ToF sensor

The RF Digital RFD77402 is a Time-of-Flight (ToF) proximity and distance
sensor that provides absolute and highly accurate distance measurements
from 100 mm up to 2000 mm over an I2C interface. It includes an optional
interrupt pin that signals when new measurement data is ready.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 weeks agoiio: adc: men_z188_adc: drop unneeded MODULE_ALIAS
Jose Javier Rodriguez Barbarin [Thu, 8 Jan 2026 13:53:01 +0000 (14:53 +0100)] 
iio: adc: men_z188_adc: drop unneeded MODULE_ALIAS

Since commit 1f4ea4838b13 ("mcb: Add missing modpost build support")
the MODULE_ALIAS() is redundant as the module alias is now
automatically generated from the MODULE_DEVICE_TABLE().

Remove the explicit alias.

No functional change intended.

Reviewed-by: Jorge Sanjuan Garcia <dev-jorge.sanjuangarcia@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: core: Constify struct configfs_item_operations and configfs_group_operations
Christophe JAILLET [Mon, 29 Dec 2025 11:27:43 +0000 (12:27 +0100)] 
iio: core: Constify struct configfs_item_operations and configfs_group_operations

'struct configfs_item_operations' and 'configfs_group_operations' are not
modified in this driver.

Constifying these structures moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
   5037    1528      64    6629    19e5 drivers/iio/industrialio-sw-device.o
   5509    1528      64    7101    1bbd drivers/iio/industrialio-sw-trigger.o

After:
=====
   text    data     bss     dec     hex filename
   5133    1432      64    6629    19e5 drivers/iio/industrialio-sw-device.o
   5605    1432      64    7101    1bbd drivers/iio/industrialio-sw-trigger.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: test: drop dangling symbol in gain-time-scale helpers
Randy Dunlap [Sun, 28 Dec 2025 07:10:29 +0000 (23:10 -0800)] 
iio: test: drop dangling symbol in gain-time-scale helpers

The code for this never went upstream. It was replaced by other code,
so this should be dropped.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216748
Fixes: cf996f039679 ("iio: test: test gain-time-scale helpers")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: dac: adi-axi-dac: Make use of dev_err_probe()
Nuno Sá [Mon, 22 Dec 2025 13:48:02 +0000 (13:48 +0000)] 
iio: dac: adi-axi-dac: Make use of dev_err_probe()

Be consistent and use dev_err_probe() as in all other places in the
.probe() path.

While at it, remove the line break in the version condition. Yes, it
goes over the 80 column limit but I do think the line break hurts
readability in this case.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: dac: adi-axi-dac: Make use of a local struct device variable
Nuno Sá [Mon, 22 Dec 2025 13:48:01 +0000 (13:48 +0000)] 
iio: dac: adi-axi-dac: Make use of a local struct device variable

Use a local struct device variable to improve readability in some code
paths during probe. While at it, fix some line breaks not properly
aligned to the open parenthesis.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: rockchip: Simplify probe() with local 'dev'
Krzysztof Kozlowski [Sun, 21 Dec 2025 14:26:05 +0000 (15:26 +0100)] 
iio: adc: rockchip: Simplify probe() with local 'dev'

Simplify the probe function by using a local 'dev' variable instead of
full pointer dereference.  This makes several lines shorter, which
allows to avoid wrapping making code more readable.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: exynos: Simplify probe() with local 'dev' and 'np'
Krzysztof Kozlowski [Sun, 21 Dec 2025 14:26:04 +0000 (15:26 +0100)] 
iio: adc: exynos: Simplify probe() with local 'dev' and 'np'

Simplify the probe function by using local 'dev' and 'np' variables
instead of full pointer dereferences.  This makes several lines shorter,
which allows to avoid wrapping making code more readable.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: aspeed: Simplify probe() with local 'dev' and 'np'
Krzysztof Kozlowski [Sun, 21 Dec 2025 14:26:03 +0000 (15:26 +0100)] 
iio: adc: aspeed: Simplify probe() with local 'dev' and 'np'

Simplify the probe function by using local 'dev' and 'np' variables
instead of full pointer dereferences.  This makes several lines shorter,
which allows to avoid wrapping making code more readable.  While
touching the return line, simplify by avoiding unnecessary 'ret'
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: ad4062: Add GPIO Controller support
Jorge Marques [Wed, 17 Dec 2025 12:13:32 +0000 (13:13 +0100)] 
iio: adc: ad4062: Add GPIO Controller support

When gp0 or gp1 is not taken as an interrupt, expose them as GPO if
gpio-contoller is set in the devicetree. gpio-regmap is not used
because the GPO static low is 'b101 and static high is 0b110; low state
requires setting bit 0, not fitting the abstraction of low=0 and
high=mask.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agodocs: iio: ad4062: Add GPIO Controller support
Jorge Marques [Wed, 17 Dec 2025 12:13:31 +0000 (13:13 +0100)] 
docs: iio: ad4062: Add GPIO Controller support

Explains the GPIO controller support with emphasis on the mask
depending on which GPs are exposed.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: ad4062: Add IIO Events support
Jorge Marques [Wed, 17 Dec 2025 12:13:30 +0000 (13:13 +0100)] 
iio: adc: ad4062: Add IIO Events support

Adds support for IIO Events. Optionally, gp0 is assigned as Threshold
Either signal, if not present, fallback to an I3C IBI with the same
role.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agodocs: iio: ad4062: Add IIO Events support
Jorge Marques [Wed, 17 Dec 2025 12:13:29 +0000 (13:13 +0100)] 
docs: iio: ad4062: Add IIO Events support

Explains the IIO Events support.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: ad4062: Add IIO Trigger support
Jorge Marques [Wed, 17 Dec 2025 12:13:28 +0000 (13:13 +0100)] 
iio: adc: ad4062: Add IIO Trigger support

Adds support for IIO Trigger. Optionally, gp1 is assigned as Data Ready
signal, if not present, fallback to an I3C IBI with the same role.
The software trigger is allocated by the device, but must be attached by
the user before enabling the buffer. The purpose is to not impede
removing the driver due to the increased reference count when
iio_trigger_set_immutable() or iio_trigger_get() is used.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agodocs: iio: ad4062: Add IIO Trigger support
Jorge Marques [Wed, 17 Dec 2025 12:13:27 +0000 (13:13 +0100)] 
docs: iio: ad4062: Add IIO Trigger support

Explains the IIO Trigger support and timings involved.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: adc: Add support for ad4062
Jorge Marques [Wed, 17 Dec 2025 12:13:26 +0000 (13:13 +0100)] 
iio: adc: Add support for ad4062

The AD4060/AD4062 are versatile, 16-bit/12-bit, successive approximation
register (SAR) analog-to-digital converter (ADC) with low-power and
threshold monitoring modes.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agodocs: iio: New docs for ad4062 driver
Jorge Marques [Wed, 17 Dec 2025 12:13:25 +0000 (13:13 +0100)] 
docs: iio: New docs for ad4062 driver

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

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agodt-bindings: iio: adc: Add adi,ad4062
Jorge Marques [Wed, 17 Dec 2025 12:13:24 +0000 (13:13 +0100)] 
dt-bindings: iio: adc: Add adi,ad4062

Add dt-bindings for AD4062 family, devices AD4060/AD4062, low-power with
monitor capabilities SAR ADCs. Each variant of the family differs in
resolution. The device contains two outputs (gp0, gp1). The outputs can
be configured for range of options, such as threshold and data ready.
The device uses a 2-wire I3C interface.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 weeks agoiio: dac: adding support for Microchip MCP47FEB02
Ariana Lazar [Tue, 16 Dec 2025 12:05:51 +0000 (14:05 +0200)] 
iio: dac: adding support for Microchip MCP47FEB02

This is the iio driver for Microchip MCP47F(E/V)B(0/1/2)1,
MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and MCP47F(E/V)B(0/1/2)8 series
of buffered voltage output Digital-to-Analog Converters with nonvolatile or
volatile memory and an I2C Interface.

The families support up to 8 output channels.

The devices can be 8-bit, 10-bit and 12-bit.

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 weeks agodt-bindings: iio: dac: adding support for Microchip MCP47FEB02
Ariana Lazar [Tue, 16 Dec 2025 12:05:50 +0000 (14:05 +0200)] 
dt-bindings: iio: dac: adding support for Microchip MCP47FEB02

This is the device tree schema for iio driver for Microchip
MCP47F(E/V)B(0/1/2)1, MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and
MCP47F(E/V)B(0/1/2)8 series of buffered voltage output Digital-to-Analog
Converters with nonvolatile or volatile memory and an I2C Interface.

The families support up to 8 output channels.

The devices can be 8-bit, 10-bit and 12-bit.

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: adc: ad7606_spi: use bitmap_full() in ad7606_spi_update_scan_mode()
Yury Norov (NVIDIA) [Tue, 16 Dec 2025 00:18:06 +0000 (19:18 -0500)] 
iio: adc: ad7606_spi: use bitmap_full() in ad7606_spi_update_scan_mode()

bitmap_full() is less verbose and more efficient, as it stops traversing
scan_mask as soon as the 1st unset bit found.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agostaging: iio: ad9832: clean up whitespace
Tomas Borquez [Mon, 15 Dec 2025 19:08:02 +0000 (16:08 -0300)] 
staging: iio: ad9832: clean up whitespace

Remove unnecessary blank lines between comment sections to improve
readability.

Signed-off-by: Tomas Borquez <tomasborquez13@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: magnetometer: Add mmc5633 sensor
Frank Li [Mon, 15 Dec 2025 16:51:11 +0000 (11:51 -0500)] 
iio: magnetometer: Add mmc5633 sensor

Add mmc5633 sensor basic support.
- Support read 20 bits X/Y/Z magnetic.
- Support I3C HDR mode to send start measurememt command.
- Support I3C HDR mode to read all sensors data by one command.

Co-developed-by: Carlos Song <carlos.song@nxp.com>
Signed-off-by: Carlos Song <carlos.song@nxp.com>
Co-developed-by: Adrian Fluturel <fluturel.adrian@gmail.com>
Signed-off-by: Adrian Fluturel <fluturel.adrian@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agodt-bindings: trivial-devices: add MEMSIC 3-axis magnetometer
Frank Li [Mon, 15 Dec 2025 16:51:10 +0000 (11:51 -0500)] 
dt-bindings: trivial-devices: add MEMSIC 3-axis magnetometer

Add compatible string 'memsic,mmc5603' and 'memsic,mmc5633' for
MEMSIC 3-axis magnetometer.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: adc: Add ti-ads1018 driver
Kurt Borja [Fri, 12 Dec 2025 04:25:44 +0000 (23:25 -0500)] 
iio: adc: Add ti-ads1018 driver

Add ti-ads1018 driver for Texas Instruments ADS1018 and ADS1118 SPI
analog-to-digital converters.

This chips' MOSI pin is shared with a data-ready interrupt. Defining
this interrupt in devicetree is optional, therefore we only create an
IIO trigger if one is found.

Handling this interrupt requires some considerations. When enabling the
trigger the CS line is tied low (active), thus we need to hold
spi_bus_lock() too, to avoid state corruption. This is done inside the
set_trigger_state() callback, to let users use other triggers without
wasting a bus lock.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agodt-bindings: iio: adc: Add TI ADS1018/ADS1118
Kurt Borja [Fri, 12 Dec 2025 04:25:43 +0000 (23:25 -0500)] 
dt-bindings: iio: adc: Add TI ADS1018/ADS1118

Add documentation for Texas Instruments ADS1018 and ADS1118
analog-to-digital converters.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: imu: inv_icm42600: enable temp polling when buffer is on
Jean-Baptiste Maneyrol [Thu, 18 Dec 2025 09:21:17 +0000 (10:21 +0100)] 
iio: imu: inv_icm42600: enable temp polling when buffer is on

Delete iio_device_claim_direct_mode() when reading temperature.
It enables polling of temperature data while buffer is on and it
doesn't have any impact on the other sensors.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: pressure: mprls0025pa: Kconfig allow bus selection
Petre Rodan [Thu, 18 Dec 2025 11:05:43 +0000 (13:05 +0200)] 
iio: pressure: mprls0025pa: Kconfig allow bus selection

Allow the user to select either the SPI or the i2c bus specific
module and autoselect core if needed.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: chemical: scd4x: expose timestamp channel
Fiona Klute [Thu, 18 Dec 2025 15:12:05 +0000 (16:12 +0100)] 
iio: chemical: scd4x: expose timestamp channel

Timestamps were already written to the buffer in
scd4x_trigger_handler(), this patch makes them available as a channel.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
8 weeks agoiio: adc: sc27xx: Simplify with dev_err_probe
Krzysztof Kozlowski [Fri, 19 Dec 2025 14:31:54 +0000 (15:31 +0100)] 
iio: adc: sc27xx: Simplify with dev_err_probe

Use dev_err_probe() to make error code handling simpler and handle
deferred probe nicely (avoid spamming logs).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>