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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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.
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>
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.
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.
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: adc: qcom-spmi-rradc: Simplify with dev_err_probe
Use dev_err_probe() to make error code handling simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Nuno Sá [Fri, 19 Dec 2025 15:28:12 +0000 (15:28 +0000)]
iio: buffer-dma: Use lockdep for locking annotations
Don't use mutex_is_locked() + WARN_ON() for checking if a specif lock is
taken. Instead use the existing annotations which means
lockdep_assert_held().
Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
There's no point in having a ret variable and checking for errors (as we
do nothing with it). Instead, save some lines of code and directly
return the devm_add_action_or_reset() call.
Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Nuno Sá [Fri, 19 Dec 2025 15:40:38 +0000 (15:40 +0000)]
iio: adc: adi-axi-adc: 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. And use a struct device *dev helper for
neater code.
Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Petre Rodan [Sun, 7 Dec 2025 06:00:48 +0000 (08:00 +0200)]
iio: pressure: add Honeywell ABP2 driver
Adds driver for digital Honeywell ABP2 series of board mount
pressure and temperature sensors.
This driver covers 113 different pressure ranges and units on
both i2c and SPI buses.
The communication protocol involves sending two simple commands
to the sensor and there is no register access or a memory map.
For this reason the regmap API was not used.
The i2c address is hardcoded and depends on the part number.
Optional end of conversion interrupt control is present on the
i2c variants of the chips.
The EOC can also be defined for the SPI variants if a non-ABP2
but compatible chip is to be driven.
Tested on two sensors (ABP2MRRT001PDSA3 and ABP2DANT001BA2A3).
Adds binding for digital Honeywell ABP2 series pressure and temperature
sensors.
The i2c address is hardcoded and depends on the part number.
There is an optional interrupt that signals the end of conversion.
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tomas Melin [Tue, 9 Dec 2025 15:38:12 +0000 (15:38 +0000)]
iio: adc: ad9467: add support for ad9211
The AD9211 is a 10-bit monolithic sampling analog-to-digital converter
optimized for high performance, low power, and ease of use. The product
operates at up to a 300 MSPS conversion rate and is optimized for
outstanding dynamic performance in wideband carrier and broadband systems.
The scale table implemented here is not an exact match with the
datasheet as the table presented there is missing some information.
The reference presents these values as being linear,
but that does not add up. There is information missing in the table.
Implemented scale table matches values at the middle and at the ends,
smoothing the curve towards middle and end.
Impact on end result from deviation in scale factor affects only software
using it for scaling. All the possible hw-settings are also available with
this implementation.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9211.pdf Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tomas Melin [Tue, 9 Dec 2025 15:38:11 +0000 (15:38 +0000)]
iio: adc: ad9467: sort header includes
Include headers in ascending order.
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tomas Melin [Tue, 9 Dec 2025 15:38:10 +0000 (15:38 +0000)]
dt-bindings: adc: ad9467: add support for ad9211
This device has e.g. different scaling values than currently
listed devices.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Andrew Jeffery [Thu, 11 Dec 2025 08:45:56 +0000 (17:45 +0900)]
dt-bindings: iio: adc: Allow interrupts property for AST2600
The device has interrupts allocated according to the datasheet, and
the devicetree already defines the interrupt property. Address existing
warnings by allowing the property.
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> Acked-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Antoniu Miclaus [Fri, 12 Dec 2025 15:38:25 +0000 (17:38 +0200)]
dt-bindings: iio: amplifiers: add adl8113
Add devicetree bindings for the ADL8113 Low Noise Amplifier.
The bindings include support for specifying gain values of external
amplifiers connected to the two external bypass paths (A and B). These
optional properties allow the gain values to be selectable via the
hardwaregain attribute, enabling complete devicetree description of
the signal chain including external components.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Lezcano [Mon, 8 Dec 2025 02:08:19 +0000 (03:08 +0100)]
iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
The NXP S32G2 and S32G3 platforms integrate a successive approximation
register (SAR) ADC. Two instances are available, each providing 8
multiplexed input channels with 12-bit resolution. The conversion rate
is up to 1 Msps depending on the configuration and sampling window.
The SAR ADC supports raw, buffer, and trigger modes. It can operate
in both single-shot and continuous conversion modes, with optional
hardware triggering through the cross-trigger unit (CTU) or external
events. An internal prescaler allows adjusting the sampling clock,
while per-channel programmable sampling times provide fine-grained
trade-offs between accuracy and latency. Automatic calibration is
performed at probe time to minimize offset and gain errors.
All modes have been validated on the S32G274-RDB2 platform using an
externally generated square wave captured by the ADC. Tests covered
buffered streaming via IIO, trigger synchronization, and accuracy
verification against a precision laboratory signal source.
One potential scenario, not detected during testing, is that in some
corner cases the DMA may already have been armed for the next
transfer, which can lead dmaengine_tx_status() to return an incorrect
residue. The callback_result() operation—intended to supply the
residue directly and eliminate the need to call
dmaengine_tx_status()—also does not work. Attempting to use
dmaengine_pause() and dmaengine_resume() to prevent the residue from
being updated does not work either.
This potential scenario should apply to any driver using cyclic DMA.
However, no current driver actually handles this case, and they all rely
on the same acquisition routine (e.g., the STM32 implementation).
The NXP SAR acquisition routine has been used in production for several
years, which is a good indication of its robustness.
As the IIO is implementing the cyclic DMA support API, it is not worth
to do more spins to the current routine as it will go away when the
new API will be available.
The driver is derived from the BSP implementation and has been partly
rewritten to comply with upstream requirements. For this reason, all
contributors to the original code are listed as co-developers.
Originally-by: Stefan-Gabriel Mirea <stefan-gabriel.mirea@nxp.com> Co-developed-by: Alexandru-Catalin Ionita <alexandru-catalin.ionita@nxp.com> Signed-off-by: Alexandru-Catalin Ionita <alexandru-catalin.ionita@nxp.com> Co-developed-by: Ciprian Costea <ciprianmarian.costea@nxp.com> Signed-off-by: Ciprian Costea <ciprianmarian.costea@nxp.com> Co-developed-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Lezcano [Mon, 8 Dec 2025 02:08:18 +0000 (03:08 +0100)]
dt-bindings: iio: adc: Add the NXP SAR ADC for s32g2/3 platforms
The s32g2 and s32g3 NXP platforms have two instances of a Successive
Approximation Register ADC. It supports the raw, trigger and scan
modes which involves the DMA. Add their descriptions.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Jorge Marques [Wed, 12 Nov 2025 22:06:38 +0000 (23:06 +0100)]
iio: accel: Change adxl345 depend to negate adxl35x
Change 'depends on INPUT_ADXL34X=n' to '!(INPUT_ADXL34X)' to allow both
drivers to be compiled as modules. The user then can use the blacklist
to block loading one.
Signed-off-by: Jorge Marques <jorge.marques@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
David Jander [Tue, 18 Nov 2025 14:18:21 +0000 (15:18 +0100)]
iio: adc: Add TI ADS131M0x ADC driver
Add a new IIO ADC driver for Texas Instruments ADS131M0x devices
(ADS131M02/03/04/06/08). These are 24-bit, up to 64 kSPS, simultaneous-
sampling delta-sigma ADCs accessed via SPI.
Highlights:
- Supports 2/3/4/6/8-channel variants with per-channel RAW and SCALE.
- Implements device-required full-duplex fixed-frame transfers.
- Handles both input and output CRC
Note: Despite the almost identical name, this hardware is not
compatible with the ADS131E0x series handled by
drivers/iio/adc/ti-ads131e08.c.
Signed-off-by: David Jander <david@protonic.nl> Co-developed-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Oleksij Rempel [Tue, 18 Nov 2025 14:18:20 +0000 (15:18 +0100)]
bindings: iio: adc: Add bindings for TI ADS131M0x ADCs
Add device tree bindings documentation for the Texas Instruments
ADS131M0x analog-to-digital converters. This family includes the ADS131M02,
ADS131M03, ADS131M04, ADS131M06, and ADS131M08 variants.
These variants differ primarily in the number of supported channels
(2, 3, 4, 6, and 8, respectively), which requires separate compatible
strings to validate the channel nodes.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: imu: smi330: remove redundant assignment in smi330_read_avail
In the IIO_CHAN_INFO_OVERSAMPLING_RATIO case, the type parameter
is assigned from smi330_average_attr.type and then immediately
overwritten with IIO_VAL_INT on the next line.
Since smi330_average_attr.type is already initialized to IIO_VAL_INT,
the second assignment is redundant. Remove the hardcoded assignment
to maintain consistency in the code.
Tomas Borquez [Wed, 26 Nov 2025 20:32:40 +0000 (17:32 -0300)]
iio: light: isl29018: replace sprintf() with safer alternatives
This patch replaces sprintf() with sysfs_emit() and sysfs_emit_at() safer
alternative with no functional changes.
Signed-off-by: Tomas Borquez <tomasborquez13@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>