]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agoiio: proximity: fix typo from currenly to currently
Shi Hao [Mon, 16 Mar 2026 09:00:15 +0000 (14:30 +0530)] 
iio: proximity: fix typo from currenly to currently

Fix incorrect spelling from currenly to currently.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: pressure: fix spelling mistakes in comments
Shi Hao [Mon, 16 Mar 2026 09:00:14 +0000 (14:30 +0530)] 
iio: pressure: fix spelling mistakes in comments

Fix several spelling mistakes in comments.

- opertion -> operations
- transfered -> transferred
- usng -> using
- externaly -> externally

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: magnetometer: fix various spelling mistakes
Shi Hao [Mon, 16 Mar 2026 09:00:13 +0000 (14:30 +0530)] 
iio: magnetometer: fix various spelling mistakes

Fix spelling mistakes in comments.

- follwing -> following
- atleast -> at least
- occured -> occurred
- measurment -> measurement
- rougly -> roughly

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: fix typo from adjustement to adjustment
Shi Hao [Mon, 16 Mar 2026 09:00:12 +0000 (14:30 +0530)] 
iio: imu: fix typo from adjustement to adjustment

Fix incorrect spelling in a comment.

- adjustement -> adjustment

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: add an article and use digitize instead of digitalize
Shi Hao [Mon, 16 Mar 2026 09:00:11 +0000 (14:30 +0530)] 
iio: adc: add an article and use digitize instead of digitalize

Use digitize instead of digitalize, which is the correct technical term,
and add an article for clarity.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: fix several incorrect spellings
Shi Hao [Mon, 16 Mar 2026 09:00:10 +0000 (14:30 +0530)] 
iio: light: fix several incorrect spellings

Fix spelling mistakes reported by codespell.

- sesnor -> sensor
- substraction -> subtraction
- simulataneous -> simultaneous
- proccessed -> processed
- coefficents -> coefficients

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: fix typo celcius to Celsius
Shi Hao [Mon, 16 Mar 2026 09:00:09 +0000 (14:30 +0530)] 
iio: accel: fix typo celcius to Celsius

Fix incorrect spelling in comments
- celcius -> Celsius

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: aspeed: Reserve battery sensing channel for on-demand use
Billy Tsai [Fri, 20 Mar 2026 05:46:38 +0000 (13:46 +0800)] 
iio: adc: aspeed: Reserve battery sensing channel for on-demand use

For controllers with battery sensing capability (AST2600/AST2700), the
last channel uses a different circuit design optimized for battery
voltage measurement. This channel should not be enabled by default
along with other channels to avoid potential interference and power
efficiency issues.
This ensures optimal power efficiency for normal ADC operations while
maintaining full functionality when battery sensing is needed.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: aspeed: Replace mdelay() with fsleep() for ADC stabilization delay
Billy Tsai [Fri, 20 Mar 2026 05:46:37 +0000 (13:46 +0800)] 
iio: adc: aspeed: Replace mdelay() with fsleep() for ADC stabilization delay

The ADC stabilization delays in compensation mode and battery sensing
mode do not require atomic context. Using mdelay() here results in
unnecessary busy waiting.

Replace mdelay(1) with fsleep(1000) to allow the scheduler to run other
tasks while waiting for the ADC to stabilize.

Also fix a minor typo in the comment ("adc" -> "ADC").

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: Enable multiple consecutive channels based on model data
Billy Tsai [Fri, 20 Mar 2026 05:46:36 +0000 (13:46 +0800)] 
iio: adc: Enable multiple consecutive channels based on model data

Add helpers to generate channel masks and enable multiple ADC channels
according to the device model's channel count.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: Add battery channel definition for ADC
Billy Tsai [Fri, 20 Mar 2026 05:46:35 +0000 (13:46 +0800)] 
iio: adc: Add battery channel definition for ADC

Defines a constant for the battery sensing channel, typically the last
channel of the ADC. Clarifies channel usage and improves code
readability.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: dac: ltc2632: add support for LTC2654 DAC family
David Marinovic [Fri, 20 Mar 2026 15:09:48 +0000 (16:09 +0100)] 
iio: dac: ltc2632: add support for LTC2654 DAC family

Add support for the Linear Technology LTC2654 quad DAC family.

The LTC2654 is a 4-channel, 16-/12-bit DAC with SPI interface,
sharing the same 24-bit SPI protocol as the existing LTC2632/
LTC2634/LTC2636 devices supported by this driver.

The 12-bit variants of LTC2654 reuse existing LTC2634 chip_info
structs as they are register-compatible.

Add support for the following variants:
- LTC2654L-16: 16-bit, 2.5V internal reference
- LTC2654L-12: 12-bit, 2.5V internal reference
- LTC2654H-16: 16-bit, 4.096V internal reference
- LTC2654H-12: 12-bit, 4.096V internal reference

Signed-off-by: David Marinovic <david.marinovic@pupin.rs>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings
David Marinovic [Fri, 20 Mar 2026 15:09:47 +0000 (16:09 +0100)] 
dt-bindings: iio: dac: ltc2632: add LTC2654 compatible strings

Add compatible strings for the LTC2654 quad-channel DAC family.

The LTC2654 devices are 4-channel, 16-/12-bit DACs with an internal
reference and SPI interface. They use the same 24-bit SPI command
format as the LTC2632/2634/2636 family.

The 16-bit variants (LTC2654-L16 and LTC2654-H16) require new
compatible strings, as no existing compatibles support 16-bit
resolution.

The 12-bit variants (LTC2654-L12 and LTC2654-H12) are register-
compatible with LTC2634-L12 and LTC2634-H12 respectively, and can
use them as fallback compatibles.

Signed-off-by: David Marinovic <david.marinovic@pupin.rs>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: dac: ltc2632: drop enum and use individual chip_info objects
David Marinovic [Fri, 20 Mar 2026 15:09:46 +0000 (16:09 +0100)] 
iio: dac: ltc2632: drop enum and use individual chip_info objects

Remove the ltc2632_chip_info_tbl[] array and related
ltc2632_supported_device_ids enum used for looking up chip-specific
information. Instead, use separate static const struct
ltc2632_chip_info objects for each supported chip variant.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: David Marinovic <david.marinovic@pupin.rs>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agostaging: iio: ad9834: use sysfs_emit() and simplify show functions
Gabriel Rondon [Fri, 20 Mar 2026 22:24:24 +0000 (22:24 +0000)] 
staging: iio: ad9834: use sysfs_emit() and simplify show functions

Replace sprintf() with sysfs_emit() in sysfs attribute show functions.
sysfs_emit() is the preferred API for sysfs callbacks as it is aware
of the PAGE_SIZE buffer limit.

Also simplify the wavetype_available show functions by removing
the intermediate string variable and returning directly from each
branch.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agostaging: iio: ad5933: use sysfs_emit() in show functions
Gabriel Rondon [Fri, 20 Mar 2026 22:24:23 +0000 (22:24 +0000)] 
staging: iio: ad5933: use sysfs_emit() in show functions

Replace sprintf() with sysfs_emit() in all sysfs attribute show
functions. sysfs_emit() is the preferred API for sysfs callbacks as
it is aware of the PAGE_SIZE buffer limit.

Also remove the unnecessary (int) cast in ad5933_show_frequency()
and use the correct format specifier %llu for the unsigned long long
freqreg variable.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: add support for regulators
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:43 +0000 (18:45 +0200)] 
iio: light: vcnl4000: add support for regulators

Add supply, I2C and cathode voltage regulators to the sensor and enable
them. This keeps the sensor powered on even after its only supply shared
by another device shuts down.

Reported-by: Raymond Hackley <raymondhackley@protonmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: remove redundant check for proximity-near-level
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:42 +0000 (18:45 +0200)] 
iio: light: vcnl4000: remove redundant check for proximity-near-level

The data->near_level variable is already assigned 0 during
devm_kzalloc(), therefore checking if the property is present and then
assigning it 0 is redundant. Remove the check for device tree property
and let it fail silently if it is missing or invalid.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: use variables for I2C client and device instances
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:41 +0000 (18:45 +0200)] 
iio: light: vcnl4000: use variables for I2C client and device instances

After moving data->client and client->dev into variables of their own,
replace all instances of data->client and client->dev being used in
vcnl4200_init() and vcnl4000_probe() by the said variables to reduce
clutter.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: remove error messages for trigger and irq
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:40 +0000 (18:45 +0200)] 
iio: light: vcnl4000: remove error messages for trigger and irq

The error code is available in the log after return. In our case,
attaching a triggered buffer can only fail if we are out of memory, as
no other buffer is being attached. Remove duplicate error messages to
reduce noise in dmesg.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: replace mutex_init() with devm_mutex_init()
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:39 +0000 (18:45 +0200)] 
iio: light: vcnl4000: replace mutex_init() with devm_mutex_init()

Replace mutex_init() used across the driver with its device-managed
counterpart, so all assigned mutexes get destroyed.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: move power enablement from init to probe
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:38 +0000 (18:45 +0200)] 
iio: light: vcnl4000: move power enablement from init to probe

Given both vcnl4000_init() and vcnl4200_init() end with
dev->chip_spec->set_power_state(), they can be called once from the
probe to enable the sensors. Move the set_power_state function from init
and call it after init function in probe.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: vcnl4000: sort includes by their name
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:37 +0000 (18:45 +0200)] 
iio: light: vcnl4000: sort includes by their name

Sort include headers by file name for better readability.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: light: vcnl4000: add regulators
Erikas Bitovtas [Fri, 20 Mar 2026 16:45:36 +0000 (18:45 +0200)] 
dt-bindings: iio: light: vcnl4000: add regulators

These sensors can accept 2 supplies - one for the sensor and one for IR
LED [1]. Add supply properties for the sensor - 2 for the sensors and
one external, for their open drain interrupt line, to ensure the sensor
is powered on before proceeding with setup.

[1] https://www.vishay.com/docs/84274/vcnl4040.pdf

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: backend: use __free(fwnode_handle) for automatic cleanup
Antoniu Miclaus [Sat, 21 Mar 2026 10:01:51 +0000 (12:01 +0200)] 
iio: backend: use __free(fwnode_handle) for automatic cleanup

Convert __devm_iio_backend_fwnode_get() to use the __free(fwnode_handle)
cleanup attribute for the fwnode_back variable, removing the need for
manual fwnode_handle_put() calls. Move the declaration closer to its
first use, narrowing its scope.

No functional change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: adxl372: add support for ADXL371
Antoniu Miclaus [Sat, 21 Mar 2026 10:04:59 +0000 (12:04 +0200)] 
iio: accel: adxl372: add support for ADXL371

Add support for the Analog Devices ADXL371, a +-200g 3-axis MEMS
accelerometer sharing the same register map as the ADXL372 but with
different ODR values (320/640/1280/2560/5120 Hz vs 400/800/1600/3200/
6400 Hz), different bandwidth values, and different timer scale
factors for activity/inactivity detection.

Due to a silicon anomaly (er001) causing FIFO data misalignment on
all current ADXL371 silicon, FIFO and triggered buffer support is
disabled for the ADXL371 - only direct mode reads are supported.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: adxl372: factor out buffer and trigger setup
Antoniu Miclaus [Sat, 21 Mar 2026 10:04:58 +0000 (12:04 +0200)] 
iio: accel: adxl372: factor out buffer and trigger setup

Extract the triggered buffer, trigger allocation, and IRQ request
logic from adxl372_probe() into a dedicated adxl372_buffer_setup()
helper. This reduces the probe function complexity and prepares for
conditionally disabling buffer support on device variants with
known FIFO issues.

No functional change intended.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodt-bindings: iio: accel: adi,adxl372: add ADXL371 compatible
Antoniu Miclaus [Sat, 21 Mar 2026 10:04:57 +0000 (12:04 +0200)] 
dt-bindings: iio: accel: adi,adxl372: add ADXL371 compatible

Add the adi,adxl371 compatible string to the ADXL372 binding. The
ADXL371 is a +-200g 3-axis MEMS accelerometer nearly identical to
the ADXL372 in register layout, differing only in ODR/bandwidth
values, timer scale factors, and a silicon anomaly affecting FIFO
operation.

Update the title and description to reflect both devices.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: adxl372: introduce chip_info structure
Antoniu Miclaus [Sat, 21 Mar 2026 10:04:56 +0000 (12:04 +0200)] 
iio: accel: adxl372: introduce chip_info structure

Introduce a chip_info structure to parameterize device-specific
properties such as ODR/bandwidth frequency tables, activity/inactivity
timer scale factors, and the maximum ODR value. This refactors the
driver to use chip_info lookups instead of hardcoded values, preparing
the driver to support multiple device variants.

The sampling_frequency and filter_low_pass_3db_frequency available
attributes are switched from custom sysfs callbacks to read_avail()
based handling via info_mask_shared_by_type_available. This enforces
consistent formatting through the IIO framework and makes the values
accessible to in-kernel consumers.

The SPI/I2C probe functions are updated to pass a chip_info pointer
instead of a device name string.

No functional change intended.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: mt6359-auxadc: Fix comma spacing
Giorgi Tchankvetadze [Tue, 10 Mar 2026 14:38:10 +0000 (18:38 +0400)] 
iio: adc: mt6359-auxadc: Fix comma spacing

Fix incorrect whitespace around comma on line 325 to comply with
kernel coding style. This silences checkpatch errors "ERROR: space
prohibited before that ','" and "ERROR: space required after that ','".
No functional change.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads7950: remove chip_info[]
David Lechner [Sat, 7 Mar 2026 21:54:37 +0000 (15:54 -0600)] 
iio: adc: ti-ads7950: remove chip_info[]

Remove the chip_info[] array and related enum used for looking up chip-
specific information. Instead, use individual structs directly in the
module device tables.

Also update to use spi_get_device_match_data() in case the devicetree
table is ever used instead of the SPI device ID table.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: palmas_gpadc: Replace leading space indentation with tabs
Giorgi Tchankvetadze [Sat, 7 Mar 2026 13:02:14 +0000 (17:02 +0400)] 
iio: adc: palmas_gpadc: Replace leading space indentation with tabs

Fix lines starting with spaces instead of tabs to comply with the
kernel coding style.

No functional change.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: adxl372: convert to guard(mutex)
Rajveer Chaudhari [Sat, 7 Mar 2026 11:49:12 +0000 (17:19 +0530)] 
iio: accel: adxl372: convert to guard(mutex)

Replace manual mutex_lock/mutex_unlock pair with guard(mutex) in
adxl372_write_threshold_value(). This ensures the mutex is released
on all return paths and allows returning directly without a goto label.

Signed-off-by: Rajveer Chaudhari <rajveer.chaudhari.linux@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: accel: adxl313: convert to guard(mutex)
Rajveer Chaudhari [Sat, 7 Mar 2026 11:49:11 +0000 (17:19 +0530)] 
iio: accel: adxl313: convert to guard(mutex)

Replace manual mutex_lock/mutex_unlock pair with guard(mutex) in
adxl313_read_axis(). This ensures the mutex is released on all
return paths and allows returning directly without a goto label.

Signed-off-by: Rajveer Chaudhari <rajveer.chaudhari.linux@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: buffer: hw-consumer: remove redundant scan_mask flexible array
Nuno Sá [Tue, 3 Mar 2026 11:50:44 +0000 (11:50 +0000)] 
iio: buffer: hw-consumer: remove redundant scan_mask flexible array

The scan_mask flexible array member in hw_consumer_buffer duplicates
the scan_mask pointer already present in struct iio_buffer. Remove it
and allocate the bitmap directly with bitmap_zalloc(), assigning it to
buf->buffer.scan_mask. This simplifies the code and there's no need for
the flex array allocation.

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>
2 months agoiio: adc: meson: no devm for nvmem_cell_get
Rosen Penev [Wed, 4 Mar 2026 04:17:16 +0000 (20:17 -0800)] 
iio: adc: meson: no devm for nvmem_cell_get

There is no reason to extend the lifetime of this post removal of the
driver when it's only needed in one spot.

Moved tsc_regmap assignment to avoid two nvmem_cell_put calls.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get
Rosen Penev [Wed, 4 Mar 2026 04:18:43 +0000 (20:18 -0800)] 
iio: adc: at91-sama5d2_adc: no devm for nvmem_cell_get

There is absolutely no reason to pospone cleanup of this post driver
removal. Just do it immediately.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: acpi-als: Convert ACPI driver to a platform one
Rafael J. Wysocki [Wed, 4 Mar 2026 18:33:14 +0000 (19:33 +0100)] 
iio: light: acpi-als: Convert ACPI driver to a platform one

In all cases in which a struct acpi_driver is used for binding a driver
to an ACPI device object, a corresponding platform device is created by
the ACPI core and that device is regarded as a proper representation of
underlying hardware.  Accordingly, a struct platform_driver should be
used by driver code to bind to that device.  There are multiple reasons
why drivers should not bind directly to ACPI device objects [1].

Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the ACPI ambient light sensor driver to a
platform one.

After this change, the subordinate IIO device will be registered under
the platform device used for driver binding instead of its ACPI
companion.

While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.

Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: light: acpi-als: Register ACPI notify handler directly
Rafael J. Wysocki [Wed, 4 Mar 2026 18:32:26 +0000 (19:32 +0100)] 
iio: light: acpi-als: Register ACPI notify handler directly

To facilitate subsequent conversion of the driver to a platform one,
make it install an ACPI notify handler directly instead of using
a .notify() callback in struct acpi_driver.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: frequency: admv1013: fix NULL pointer dereference on str
Antoniu Miclaus [Thu, 5 Mar 2026 09:14:48 +0000 (11:14 +0200)] 
iio: frequency: admv1013: fix NULL pointer dereference on str

When device_property_read_string() fails, str is left uninitialized
but the code falls through to strcmp(str, ...), dereferencing a garbage
pointer. Replace manual read/strcmp with
device_property_match_property_string() and consolidate the SE mode
enums into a single sequential enum, mapping to hardware register
values via a switch consistent with other bitfields in the driver.

Several cleanup patches have been applied to this driver recently so
this will need a manual backport.

Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013")
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
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 months agoiio: adc: max1363: Reformat enum and array initializers
Giorgi Tchankvetadze [Sat, 7 Mar 2026 07:15:56 +0000 (11:15 +0400)] 
iio: adc: max1363: Reformat enum and array initializers

Reformat the device enum so each entry is on its own line and add a
trailing comma to the final enumerator. Also reformat the nearby monitor
speeds array for consistency.

No functional change.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: ltr501: return proper error code from ltr501_get_gain_index()
Antoniu Miclaus [Mon, 2 Feb 2026 12:07:12 +0000 (14:07 +0200)] 
iio: light: ltr501: return proper error code from ltr501_get_gain_index()

Return -EINVAL instead of -1 when no matching gain value is found
in the gain table. Update the callers to propagate this error directly
rather than overwriting it with -EINVAL.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Waqar Hameed <waqar.hameed@axis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: cpcap-adc: add support for Mot ADC
Svyatoslav Ryhel [Fri, 6 Feb 2026 17:28:39 +0000 (19:28 +0200)] 
iio: adc: cpcap-adc: add support for Mot ADC

Add support for ADC found in Motorola Mot board, used as a base for
Atrix 4G and Droid X2 smartphones.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: cpcap-adc: document Mot ADC
Svyatoslav Ryhel [Fri, 6 Feb 2026 17:28:38 +0000 (19:28 +0200)] 
dt-bindings: iio: adc: cpcap-adc: document Mot ADC

Add compatible for ADC used in Mot board. Separate compatible is required
since ADC in the Mot board uses a unique set of configurations.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: remove unused debug_reg_addr
Antoniu Miclaus [Mon, 2 Feb 2026 11:26:03 +0000 (13:26 +0200)] 
iio: light: gp2ap020a00f: remove unused debug_reg_addr

Remove unused debug_reg_addr field from gp2ap020a00f_data
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: apds9306: remove unused nlux_per_count
Antoniu Miclaus [Mon, 2 Feb 2026 11:26:02 +0000 (13:26 +0200)] 
iio: light: apds9306: remove unused nlux_per_count

Remove unused nlux_per_count field from apds9306_data
struct. The field is declared but never accessed in the
driver.

Acked-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: imu: bmi323: remove unused drdy_trigger_enabled
Antoniu Miclaus [Mon, 2 Feb 2026 11:26:01 +0000 (13:26 +0200)] 
iio: imu: bmi323: remove unused drdy_trigger_enabled

Remove unused drdy_trigger_enabled field from bmi323_data
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: humidity: hdc2010: remove unused interrupt_config
Antoniu Miclaus [Mon, 2 Feb 2026 11:26:00 +0000 (13:26 +0200)] 
iio: humidity: hdc2010: remove unused interrupt_config

Remove unused interrupt_config field from hdc2010_data
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: dac: ti-dac5571: remove unused id field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:59 +0000 (13:25 +0200)] 
iio: dac: ti-dac5571: remove unused id field

Remove unused id field from dac5571_data struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: dac: adi-axi-dac: remove unused int_tone field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:58 +0000 (13:25 +0200)] 
iio: dac: adi-axi-dac: remove unused int_tone field

Remove unused int_tone field from axi_dac_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ti-ads1015: remove unused enabled field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:57 +0000 (13:25 +0200)] 
iio: adc: ti-ads1015: remove unused enabled field

Remove unused enabled field from ads1015_channel_data
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: nau7802: remove unused min_conversions field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:56 +0000 (13:25 +0200)] 
iio: adc: nau7802: remove unused min_conversions field

Remove unused min_conversions field from nau7802_state
struct. The field is declared but never accessed in the
driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: max1363: remove unused requestedmask field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:55 +0000 (13:25 +0200)] 
iio: adc: max1363: remove unused requestedmask field

Remove unused requestedmask field from max1363_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad9467: remove unused output_mode field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:54 +0000 (13:25 +0200)] 
iio: adc: ad9467: remove unused output_mode field

Remove unused output_mode field from ad9467_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7793: remove unused int_vref_mv field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:53 +0000 (13:25 +0200)] 
iio: adc: ad7793: remove unused int_vref_mv field

Remove unused int_vref_mv field from ad7793_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7768-1: remove unused mclk_div field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:52 +0000 (13:25 +0200)] 
iio: adc: ad7768-1: remove unused mclk_div field

Remove unused mclk_div field from ad7768_state struct.
The field is declared but never accessed in the driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad4080: remove unused dec_rate field
Antoniu Miclaus [Mon, 2 Feb 2026 11:25:51 +0000 (13:25 +0200)] 
iio: adc: ad4080: remove unused dec_rate field

Remove unused dec_rate field from ad4080_state struct.
The driver reads/writes decimation rate directly from
hardware registers via ad4080_get_dec_rate() and
ad4080_set_dec_rate() functions.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: ABI: fix current_trigger description
Cosmin Tanislav [Wed, 4 Feb 2026 18:02:02 +0000 (20:02 +0200)] 
iio: ABI: fix current_trigger description

Triggers exist under /sys/bus/iio/devices/, not under /sys/class/iio.
/sys/class/iio does not even exist. Use the current path.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: manage device registration with devm helper
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:13 +0000 (05:12 -0800)] 
iio: sca3000: manage device registration with devm helper

Convert the iio registration to use devm_* helpers so the probe no
longer needs a separate cleanup path and remove callback can also drop
the unregister. After this there is no need for having a remove
callback, so remote it.

No functional change intended.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibe.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: stop interrupts via devm_add_action_or_reset()
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:12 +0000 (05:12 -0800)] 
iio: sca3000: stop interrupts via devm_add_action_or_reset()

Used devm_add_action_or_reset() for shutting down the interrupts.
Make sca3000_stop_all_interrupts() return void now that it always hooks
into devm cleanup.

No functional change intended.

Suggested-by: David Lechner <dlechner@baylibre.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: use guard(mutex) to simplify return paths
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:11 +0000 (05:12 -0800)] 
iio: sca3000: use guard(mutex) to simplify return paths

Switch sca3000_stop_all_interrupts() to use guard(mutex) to simplify the
error paths without needing a goto.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: make stop_all_interrupts() return void
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:10 +0000 (05:12 -0800)] 
iio: sca3000: make stop_all_interrupts() return void

sca3000_stop_all_interrupts() is called only from the driver remove
path and its return value is discarded, so convert the helper to return
void.

No functional change.

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:09 +0000 (05:12 -0800)] 
iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()

Move sca3000_stop_all_interrupts() above sca3000_probe() without
altering its logic so the next set of patches are easier to review.

No functional change.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: switch IRQ handling to devm helpers
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:08 +0000 (05:12 -0800)] 
iio: sca3000: switch IRQ handling to devm helpers

Convert the threaded IRQ registration to devm_request_threaded_irq() so
that the probe and remove paths can drop manual freeing of irqs.

No functionality change.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: reuse device pointer for devm helpers
Harshit Mogalapalli [Thu, 5 Feb 2026 13:12:07 +0000 (05:12 -0800)] 
iio: sca3000: reuse device pointer for devm helpers

Cache struct device *dev and feed it to the devm helpers to simplify
the probe function. No functional changes.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: imu: inv_icm42600: Convert to uXX and sXX integer types
Andy Shevchenko [Sun, 9 Nov 2025 19:24:36 +0000 (20:24 +0100)] 
iio: imu: inv_icm42600: Convert to uXX and sXX integer types

The driver has a some use of intXX_t and uintXX_t types which is
not the pattern we use in the IIO subsystem. Switch the driver
to use kernel internal types for that. No functional changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: dac: ad5360: converting to guard(mutex)
Menderes Sabaz [Thu, 29 Jan 2026 16:46:10 +0000 (19:46 +0300)] 
iio: dac: ad5360: converting to guard(mutex)

Converting mutex_lock and mutex_unlock to guard(mutex)

Signed-off-by: Menderes Sabaz <sabazmenderes@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: apds9306: remove redundant explicit pointer cast
SAJJA EASWAR SAI [Thu, 29 Jan 2026 21:04:31 +0000 (02:34 +0530)] 
iio: light: apds9306: remove redundant explicit pointer cast

C allows implicit conversion from void * to struct apds9306_data *, so the
explicit cast on 'ptr' is unnecessary. Removing it improves readability.

Signed-off-by: SAJJA EASWAR SAI <eshwarsajja20@gmail.com>
Acked-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: pressure: hsc030pa: Improve i2c_transfer return value handling
Antoniu Miclaus [Thu, 29 Jan 2026 18:14:52 +0000 (20:14 +0200)] 
iio: pressure: hsc030pa: Improve i2c_transfer return value handling

The i2c_transfer() function returns the number of messages
successfully transferred. The function sends 1 message but checks
for ret == 2, which can never be true.

In practice this has no impact since the caller checks ret < 0,
and the erroneous return value of 1 is not treated as an error.

Improve the return value handling to properly distinguish between
I2C errors and unexpected transfer counts.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Tested-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoMAINTAINERS: add entry for ADL8113 driver
Antoniu Miclaus [Fri, 30 Jan 2026 12:23:08 +0000 (14:23 +0200)] 
MAINTAINERS: add entry for ADL8113 driver

Add MAINTAINERS entry for the ADL8113 driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: frequency: admv4420: return proper error code from admv4420_calc_parameters()
Antoniu Miclaus [Fri, 30 Jan 2026 13:50:05 +0000 (15:50 +0200)] 
iio: frequency: admv4420: return proper error code from admv4420_calc_parameters()

Return -EINVAL instead of -1 when no valid PLL parameters solution is
found. Using standard kernel error codes ensures consistency and proper
error propagation through the call chain.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: magnetometer: bmc150_magn: use automated cleanup for mutex
Neel Bullywon [Sat, 28 Feb 2026 17:23:20 +0000 (12:23 -0500)] 
iio: magnetometer: bmc150_magn: use automated cleanup for mutex

Use guard() and scoped_guard() to replace manual mutex lock/unlock
calls. This simplifies error handling and ensures RAII-style cleanup.

guard() is used in read_raw, write_raw, trig_reen, and
trigger_set_state. Case blocks using guard() in read_raw and write_raw
are wrapped in braces at the case label level to ensure clear scope for
the cleanup guards.

A bmc150_magn_set_power_mode_locked() helper is added to deduplicate
the lock-call-unlock pattern used by remove, runtime_suspend, suspend,
and resume.

The trigger_handler function is left unchanged as mixing guard() with
goto error paths can be fragile.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agostaging: iio: ad7816: Replace sprintf() with sysfs_emit()
Bruno Martins [Sun, 1 Mar 2026 21:28:26 +0000 (21:28 +0000)] 
staging: iio: ad7816: Replace sprintf() with sysfs_emit()

As stated in Documentation/filesystems/sysfs.rst:
'New implementations of show() methods should only use sysfs_emit() or
sysfs_emit_at() when formatting the value to be returned to user space.'

Replace sprintf with sysfs_emit in the following sysfs show functions:
- ad7816_show_mode()
- ad7816_show_available_modes()
- ad7816_show_channel()
- ad7816_show_value()
- ad7816_show_oti()

Signed-off-by: Bruno Martins <ehanoc@protonmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ade9000: remove unused ADE9000_ST_ERROR macro
Giorgi Tchankvetadze [Mon, 2 Mar 2026 05:50:36 +0000 (09:50 +0400)] 
iio: adc: ade9000: remove unused ADE9000_ST_ERROR macro

The ADE9000_ST_ERROR macro references ADE9000_ST1_ERROR0
through ADE9000_ST1_ERROR3, but the actual defined symbols
use the BIT suffix. Since this macro is currently unused
in the driver, remove it entirely rather than fixing the names.
It can be reintroduced in a future patch when it is actually needed.

The individual error bit definitions (bits 28-31 of the STATUS1
register at 0x403) are retained as they follow the convention of
defining all register fields.

Reference: ADE9000 datasheet (Rev. B, Page 61), STATUS1 register
(0x403), bits 28-31 define ERROR0 through ERROR3 status flags.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ti-ads1119: Drop redundant error message
Felix Gu [Mon, 2 Mar 2026 17:07:29 +0000 (01:07 +0800)] 
iio: adc: ti-ads1119: Drop redundant error message

devm_request_threaded_irq already prints an error message when failure,
so the error message is redundant, drop it.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: gyroscope: bosch,bmg160: add bmx055 gyroscope binding
Jun Yan [Thu, 5 Feb 2026 15:07:30 +0000 (23:07 +0800)] 
dt-bindings: iio: gyroscope: bosch,bmg160: add bmx055 gyroscope binding

Add the device-tree binding for the bosch BMX055 IMU (gyroscope part),
which is compatible with bmg160.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055 magnetometer binding
Jun Yan [Thu, 5 Feb 2026 15:07:29 +0000 (23:07 +0800)] 
dt-bindings: iio: magnetometer: bosch,bmc150_magn: add bmx055 magnetometer binding

Add the device-tree binding for the bosch BMX055 IMU (magnetometer
part), which is compatible with bmc150_magn.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: accel: bosch,bma255: add bmx055 accel binding
Jun Yan [Thu, 5 Feb 2026 15:07:28 +0000 (23:07 +0800)] 
dt-bindings: iio: accel: bosch,bma255: add bmx055 accel binding

Add the device-tree binding for the Bosch BMX055 IMU (accelerometer part),
which is compatible with bmc150_accel.

Datasheet: https://cdn.sparkfun.com/assets/b/9/1/f/4/bst-bmx055-ds000_datasheet.pdf
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: hid-sensor-gyro-3d: fix typo in array name
Bhargav Joshi [Sat, 28 Feb 2026 19:14:00 +0000 (00:44 +0530)] 
iio: hid-sensor-gyro-3d: fix typo in array name

The array 'gryo_3d_sensitivity_addresses' has a clear spelling mistake
in its prefix. Rename it to 'gyro_3d_sensitivity_addresses' to correctly
match the naming convention.

Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7768-1: add support for SPI offload
Jonathan Santos [Mon, 23 Feb 2026 11:59:53 +0000 (08:59 -0300)] 
iio: adc: ad7768-1: add support for SPI offload

The AD7768-1 family supports sampling rates up to 1 MSPS, which exceeds
the capabilities of conventional triggered buffer operations due to SPI
transaction overhead and interrupt latency.

Add SPI offload support to enable hardware-accelerated data acquisition
that bypasses software SPI transactions using continuous data streaming.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7768-1: disable IRQ autoenable
Jonathan Santos [Mon, 23 Feb 2026 11:59:44 +0000 (08:59 -0300)] 
iio: adc: ad7768-1: disable IRQ autoenable

The device continuously converts data while powered up, generating
interrupts in the background. Configure the IRQ to be enabled and
disabled manually as needed to avoid unnecessary CPU load.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7768-1: remove switch to one-shot mode
Jonathan Santos [Mon, 23 Feb 2026 11:59:35 +0000 (08:59 -0300)] 
iio: adc: ad7768-1: remove switch to one-shot mode

wideband low ripple FIR Filter is not available in one-shot mode. In
order to make direct reads work for all filter options, remove the
switch for one-shot mode and guarantee device is always in continuous
conversion mode.

Fixes: fb1d3b24ebf5 ("iio: adc: ad7768-1: add filter type and oversampling ratio attributes")
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7768-1: fix one-shot mode data acquisition
Jonathan Santos [Mon, 23 Feb 2026 11:59:26 +0000 (08:59 -0300)] 
iio: adc: ad7768-1: fix one-shot mode data acquisition

According to the datasheet, one-shot mode requires a SYNC_IN pulse to
trigger a new sample conversion. In the current implementation, No sync
pulse was sent after switching to one-shot mode and reinit_completion()
was called before mode switching, creating a race condition where spurious
interrupts during mode change could trigger completion prematurely.

Fix by sending a sync pulse after configuring one-shot mode and
reinit_completion() to ensure it only waits for the actual conversion
completion.

Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support")
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad4030: Add support for ADAQ4216 and ADAQ4224
Marcelo Schmitt [Mon, 23 Feb 2026 17:10:23 +0000 (14:10 -0300)] 
iio: adc: ad4030: Add support for ADAQ4216 and ADAQ4224

ADAQ4216 and ADAQ4224 are similar to AD4030, but feature a PGA circuitry
that scales the analog input signal prior to it reaching the ADC. The PGA
is controlled through a pair of pins (A0 and A1) whose state define the
gain that is applied to the input signal.

Add support for ADAQ4216 and ADAQ4224. Provide a list of PGA options
through the IIO device channel scale available interface and enable control
of the PGA through the channel scale interface.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: adi,ad4030: Add ADAQ4216 and ADAQ4224
Marcelo Schmitt [Mon, 23 Feb 2026 17:10:01 +0000 (14:10 -0300)] 
dt-bindings: iio: adc: adi,ad4030: Add ADAQ4216 and ADAQ4224

ADAQ4216 and ADAQ4224 are similar to AD4030 except that ADAQ devices have a
PGA (programmable gain amplifier) that scales the input signal prior to it
reaching the ADC inputs. The PGA is controlled through a couple of pins (A0
and A1) that set one of four possible signal gain configurations.

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>
3 months agoiio: adc: ad4030: Add SPI offload support
Marcelo Schmitt [Mon, 23 Feb 2026 17:09:47 +0000 (14:09 -0300)] 
iio: adc: ad4030: Add SPI offload support

AD4030 and similar ADCs can capture data at sample rates up to 2 mega
samples per second (MSPS). Not all SPI controllers are able to achieve such
high throughputs and even when the controller is fast enough to run
transfers at the required speed, it may be costly to the CPU to handle
transfer data at such high sample rates. Add SPI offload support for AD4030
and similar ADCs to enable data capture at maximum sample rates.

Note that a pair of PWM devices are used for the supported setup. One of
the PWM goes to the ADC CNV pin to initiate conversions while the other PWM
is connected to the SPI offload trigger to signal when to fetch data from
the peripheral. Note also that the PWMs must be somewhat synchronized such
to make the controller run transfers only when ADC sample data is
available. See Documentation/iio/ad4030.rst for details.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Co-developed-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: adi,ad4030: Add PWM
Marcelo Schmitt [Mon, 23 Feb 2026 17:09:31 +0000 (14:09 -0300)] 
dt-bindings: iio: adc: adi,ad4030: Add PWM

In setups designed for high speed data rate capture, a PWM is used to
generate the CNV signal that issues data captures from the ADC. Document
the use of a PWM for AD4030 and similar devices.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Acked-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>
3 months agoDocs: iio: ad4030: Add double PWM SPI offload doc
Marcelo Schmitt [Mon, 23 Feb 2026 17:09:11 +0000 (14:09 -0300)] 
Docs: iio: ad4030: Add double PWM SPI offload doc

Document double PWM setup SPI offload wiring schema.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: fix typos found by codespell
Giorgi Tchankvetadze [Wed, 25 Feb 2026 13:08:59 +0000 (17:08 +0400)] 
iio: adc: fix typos found by codespell

Fix various spelling mistakes in comments and error messages
across drivers/iio/adc/, found by running codespell.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodocs: iio: adxl345: update event attributes and scaling math
Taha Ed-Dafili [Thu, 26 Feb 2026 15:11:06 +0000 (15:11 +0000)] 
docs: iio: adxl345: update event attributes and scaling math

Update the documentation to reflect the recent driver additions for
event scaling and the double tap threshold value, alongside correcting
existing technical errors in scale calculations.

Key changes:
- Fix the 62.5 g/LSB typo to 62.5 mg/LSB and add SI unit conversion.
- Correct decimal precision of in_accel_scale and
  in_accel_scale_available to match the actual SI unit (m/s^2)
  values reported by the driver.
- Document the newly generated event scale attributes in the ABI table
  (e.g., in_accel_mag_rising_scale, in_accel_gesture_singletap_scale).
- Document the newly exposed in_accel_gesture_doubletap_value attribute.
- Add a sysfs example showing how to read and interpret the newly
  implemented event scale factor.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: accel: adxl345: Implement event scaling for ABI compliance
Taha Ed-Dafili [Thu, 26 Feb 2026 15:11:05 +0000 (15:11 +0000)] 
iio: accel: adxl345: Implement event scaling for ABI compliance

The ADXL345 uses a fixed threshold resolution of 62.5 mg/LSB for
event-related registers. Previously, the driver reported raw
values without a scale factor.

Implement IIO_EV_INFO_SCALE for all event types to provide the
conversion factor (0.612915 m/s^2) as required by the IIO ABI.

Consequently, remove the obsolete comment in adxl345_read_event_value()
which stated that the scale factor is not applied.

Add explicit write rejection for IIO_EV_INFO_SCALE in
adxl345_write_event_value() returning -EINVAL.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: accel: adxl345: Expose IIO_EV_INFO_VALUE for double tap
Taha Ed-Dafili [Thu, 26 Feb 2026 15:11:04 +0000 (15:11 +0000)] 
iio: accel: adxl345: Expose IIO_EV_INFO_VALUE for double tap

The ADXL345 uses a single hardware register (ADXL345_REG_THRESH_TAP) to
store the threshold for both single tap and double tap events.

Currently, the driver only exposes the IIO_EV_INFO_VALUE attribute for
the single tap event.

However, the IIO ABI dictates that if an event is supported, its
associated configuration attributes should be exposed to userspace. This
applies even if writing to one channel property alters the value of
another due to shared underlying hardware state.

Add IIO_EV_INFO_VALUE to the double tap event specification to ensure
full ABI compliance.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: core: Add IIO_EV_INFO_SCALE to event info
Taha Ed-Dafili [Thu, 26 Feb 2026 15:11:03 +0000 (15:11 +0000)] 
iio: core: Add IIO_EV_INFO_SCALE to event info

Implement support for IIO_EV_INFO_SCALE in the internal enum
iio_event_info to allow proper ABI compliance.

This allows drivers (like the ADXL345) to expose event scale
attributes using the standard IIO ABI rather than manual
device attributes.

Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodocs: iio: adxl345: grammar and formatting cleanups
Taha Ed-Dafili [Thu, 26 Feb 2026 15:11:02 +0000 (15:11 +0000)] 
docs: iio: adxl345: grammar and formatting cleanups

Correct several grammatical errors, typos, and pluralization issues
throughout the ADXL345 documentation.

Key changes include:
- Changing 'generic' to 'general-purpose'
- Correcting 'axis' to 'axes' in multiple tables and descriptions
- Improving phrasing in the device attributes section
- Fixing 'latent' to 'latency' in usage examples
- Sorting the existing event attribute table alphabetically for
  better readability and to establish a clean baseline for future
  additions.

Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: tsl2772: fix all kernel-doc warnings
Randy Dunlap [Thu, 26 Feb 2026 05:12:57 +0000 (21:12 -0800)] 
iio: tsl2772: fix all kernel-doc warnings

Use the correct kernel-doc notation for struct members to eliminate
kernel-doc warnings:

Warning: include/linux/platform_data/tsl2772.h:88 struct member
 'prox_diode' not described in 'tsl2772_settings'
Warning: include/linux/platform_data/tsl2772.h:88 struct member
 'prox_power' not described in 'tsl2772_settings'

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>
3 months agoiio: frequency: ad9523: use octal permissions
Bhargav Joshi [Thu, 26 Feb 2026 23:10:57 +0000 (04:40 +0530)] 
iio: frequency: ad9523: use octal permissions

The driver currently defines device attributes using symbolic permission
flags (S_IRUGO and S_IWUSR). Update these to use octal permissions (0444
and 0200) to resolve checkpatch warnings.

Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: frequency: ad9523: fix multi-line dereferences
Bhargav Joshi [Thu, 26 Feb 2026 23:10:56 +0000 (04:40 +0530)] 
iio: frequency: ad9523: fix multi-line dereferences

Platform data pointer dereferences for pll1_charge_pump_current_nA and
pll2_charge_pump_current_nA were split across multiple lines. Bring the
dereference chains onto a single line.

This resolves the following checkpatch.pl warnings:
WARNING: Avoid multiple line dereference - prefer 'pdata->pll1_charge_pump_current_nA'
WARNING: Avoid multiple line dereference - prefer 'pdata->pll2_charge_pump_current_nA'

Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: frequency: ad9523: fix implicit variable macros
Bhargav Joshi [Thu, 26 Feb 2026 23:10:55 +0000 (04:40 +0530)] 
iio: frequency: ad9523: fix implicit variable macros

The macros AD9523_CLK_DIST_DIV_PHASE_REV(x) and
AD9523_CLK_DIST_DIV_REV(x) implicitly relied on the variable named 'ret'
instead of using passed argument '(x)'. Update the macros to explicitly
use the argument '(x)' for their operations.

This also resolves the following checkpatch.pl warning: Argument '(x)'
is not used in function-like macro.

Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ade9000: remove unused AD9000_CHANNELS_PER_PHASE macro
Giorgi Tchankvetadze [Fri, 27 Feb 2026 08:58:13 +0000 (12:58 +0400)] 
iio: adc: ade9000: remove unused AD9000_CHANNELS_PER_PHASE macro

Remove the AD9000_CHANNELS_PER_PHASE macro which is unused, has a
misspelled prefix (AD9000 instead of ADE9000), and has an incorrect
value (10 instead of 11, there are 33 total channels and 3 phases, so 11
per phase).

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: filter: admv8818: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:41 +0000 (16:01 +0200)] 
iio: filter: admv8818: use dev_err_probe()

Use dev_err_probe() consistently in the probe path to simplify error
handling and ensure deferred probes are logged correctly.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>