]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
2 months agodt-bindings: iio: dac: mcp47feb02: fix example indentation
Ariana Lazar [Wed, 22 Apr 2026 13:40:52 +0000 (16:40 +0300)] 
dt-bindings: iio: dac: mcp47feb02: fix example indentation

Correct inconsistent indentation in the example and use consistent 4-space
indentation.

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agodt-bindings: iio: dac: mcp47feb02: fix reg property value bounds
Ariana Lazar [Wed, 22 Apr 2026 11:53:14 +0000 (14:53 +0300)] 
dt-bindings: iio: dac: mcp47feb02: fix reg property value bounds

Replace minItems/maxItems with minimum/maximum to describe the reg
property as a single channel number with 8 possible values (0-7)

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agodt-bindings: iio: dac: mcp47feb02: Fix I2C address in example
Ariana Lazar [Wed, 22 Apr 2026 11:56:59 +0000 (14:56 +0300)] 
dt-bindings: iio: dac: mcp47feb02: Fix I2C address in example

Change example reg value from 0 to 0x60 in order to use a valid I2C address

Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad7280a: use cleanup helpers guard() and scoped_guard() for mutex locking
Lucas Ivars Cadima Ciziks [Fri, 24 Apr 2026 12:43:40 +0000 (09:43 -0300)] 
iio: adc: ad7280a: use cleanup helpers guard() and scoped_guard() for mutex locking

Replace open-coded mutex_lock/unlock pairs with the cleanup-based
guard() and scoped_guard() helpers in ad7280a_write_thresh(),
ad7280_show_balance_timer(), ad7280_store_balance_sw(),
ad7280_store_balance_timer() and ad7280_read_raw().

This removes the need for the err_unlock label and explicit
mutex_unlock() calls, as the lock is now automatically released
when the function returns or the guarded scope exits, regardless
of the exit path.

Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com>
Co-developed-by: Matheus Giarola <matheusgiarola@usp.br>
Signed-off-by: Matheus Giarola <matheusgiarola@usp.br>
Co-developed-by: Felipe Ribeiro de Souza <felipers@usp.br>
Signed-off-by: Felipe Ribeiro de Souza <felipers@usp.br>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad7280a: Extract chan->address bit fields into named local variables
Lucas Ivars Cadima Ciziks [Fri, 24 Apr 2026 12:43:39 +0000 (09:43 -0300)] 
iio: adc: ad7280a: Extract chan->address bit fields into named local variables

Extract the upper and lower bytes of chan->address into named local
variables devaddr and ch across ad7280_read_raw(),
ad7280_show_balance_timer() and ad7280_store_balance_timer() to improve
readability and avoid inline bit manipulation in function calls.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com>
Co-developed-by: Matheus Giarola <matheusgiarola@usp.br>
Signed-off-by: Matheus Giarola <matheusgiarola@usp.br>
Co-developed-by: Felipe Ribeiro de Souza <felipers@usp.br>
Signed-off-by: Felipe Ribeiro de Souza <felipers@usp.br>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: qcom: Unify user-visible "Qualcomm" name
Krzysztof Kozlowski [Thu, 23 Apr 2026 17:35:46 +0000 (19:35 +0200)] 
iio: adc: qcom: Unify user-visible "Qualcomm" name

Various names for Qualcomm as a company are used in user-visible config
options: QCOM, Qualcomm and Qualcomm Technologies.  Switch to unified
"Qualcomm" so it will be easier for users to identify the options when
for example running menuconfig.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad4130: add new supported parts
Jonathan Santos [Wed, 1 Apr 2026 11:58:50 +0000 (08:58 -0300)] 
iio: adc: ad4130: add new supported parts

Add support for AD4129-4/8, AD4130-4, and AD4131-4/8 variants.

The AD4129 series supports the same FIFO interface as the AD4130 but with
reduced resolution (16-bit). The AD4131 series lacks FIFO support, so
triggered buffer functionality is introduced.

The 4-channel variants feature fewer analog inputs, GPIOs, and sparse pin
mappings for VBIAS, analog inputs, and excitation currents. The driver now
handles these differences with chip-specific configurations, including pin
mappings and GPIO counts.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad4130: introduce chip info for future multidevice support
Jonathan Santos [Wed, 1 Apr 2026 11:58:34 +0000 (08:58 -0300)] 
iio: adc: ad4130: introduce chip info for future multidevice support

Introduce a chip_info structure to abstract device-specific parameters
and prepare the driver for supporting multiple AD4130 family variants.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad4130: Add SPI device ID table
Jonathan Santos [Wed, 1 Apr 2026 11:58:22 +0000 (08:58 -0300)] 
iio: adc: ad4130: Add SPI device ID table

Add SPI device ID table to enable non-device tree based device binding.
The id_table provides a fallback matching mechanism when of_match_table
cannot be used, which is required for proper SPI driver registration.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ti-ads7924: Use guard(mutex) in ADC read helper
Giorgi Tchankvetadze [Mon, 20 Apr 2026 11:34:45 +0000 (15:34 +0400)] 
iio: adc: ti-ads7924: Use guard(mutex) in ADC read helper

Replace mutex_lock()/mutex_unlock() pair with guard(mutex)()
and move the lock into ads7924_get_adc_result(). Keeping the guard
in the helper makes the locking scope match the operation being protected.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: rtq6056: add i2c_device_id support
Kevin Tung [Mon, 20 Apr 2026 12:52:52 +0000 (20:52 +0800)] 
iio: adc: rtq6056: add i2c_device_id support

Add i2c_device_id table to support legacy I2C instantiation.
Update probe to use i2c_get_match_data() so device data can be
retrieved consistently for both OF and legacy I2C instantiation.

Signed-off-by: Kevin Tung <kevin.tung.openbmc@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: magnetometer: hid-sensor-magn-3d: prefer 'u32' type
Joshua Crofts [Tue, 21 Apr 2026 06:58:37 +0000 (06:58 +0000)] 
iio: magnetometer: hid-sensor-magn-3d: prefer 'u32' type

Use 'u32' instead of bare 'unsigned' to resolve checkpatch.pl warnings
and correct type use as defined in the struct hid_sensor_hub_callbacks.

No functional change.

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad4170: use lookup table for gpio mask selection
Guilherme Ivo Bozi [Sun, 5 Apr 2026 21:37:26 +0000 (18:37 -0300)] 
iio: adc: ad4170: use lookup table for gpio mask selection

Both ad4170_gpio_direction_input() and
ad4170_gpio_direction_output() duplicate the same switch
statement to map a GPIO offset to its corresponding mask.

Replace the switch with a static lookup table, simplifying the code
and avoiding duplication. This also makes future extensions easier.

No functional change intended.

Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@usp.br>
Acked-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agodt-bindings: iio: adc: ad4130: Add new supported parts
Jonathan Santos [Wed, 1 Apr 2026 11:58:12 +0000 (08:58 -0300)] 
dt-bindings: iio: adc: ad4130: Add new supported parts

Extend binding support for AD4129-4/8, AD4130-4, and AD4131-4/8 ADC
variants.

Dropped a reference to driver in the binding whilst here.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agodt-bindings: iio: adc: ad4130: Document interrupts property
Jonathan Santos [Wed, 1 Apr 2026 11:58:02 +0000 (08:58 -0300)] 
dt-bindings: iio: adc: ad4130: Document interrupts property

The Data Ready/FIFO interrupt has a special behavior that inverts the
IRQ polarity when devices with FIFO support enter FIFO mode, while using
normal polarity for data ready.

Document the interrupts property to clarify this special behavior for
users.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: addac: ad74115: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:37 +0000 (20:37 +0100)] 
iio: addac: ad74115: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ltc2664: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:36 +0000 (20:37 +0100)] 
iio: dac: ltc2664: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad5686: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:35 +0000 (20:37 +0100)] 
iio: dac: ad5686: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad5755: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:34 +0000 (20:37 +0100)] 
iio: dac: ad5755: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad5758: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:33 +0000 (20:37 +0100)] 
iio: dac: ad5758: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad7303: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:32 +0000 (20:37 +0100)] 
iio: dac: ad7303: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad3552r: Use devm_mutex_init()
David Carlier [Fri, 10 Apr 2026 19:37:31 +0000 (20:37 +0100)] 
iio: dac: ad3552r: Use devm_mutex_init()

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: nxp-sar-adc: use field_get() for EOC bit check
Piyush Patle [Fri, 10 Apr 2026 21:41:25 +0000 (03:11 +0530)] 
iio: adc: nxp-sar-adc: use field_get() for EOC bit check

Use field_get() here now that runtime-mask support exists, and drop
the obsolete TODO. Since NXP_SAR_ADC_EOC_CH(c) is BIT(c), the
resulting !-test is semantically identical.

No functional change.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Acked-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: ad3552r: use field_get() for power-down bit read
Piyush Patle [Sat, 11 Apr 2026 05:16:47 +0000 (10:46 +0530)] 
iio: dac: ad3552r: use field_get() for power-down bit read

Use field_get() for the per-channel DAC power-down bit instead of an
open-coded mask-and-shift sequence.

No functional change.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ti-ads7950: use spi_optimize_message()
David Lechner [Sat, 11 Apr 2026 22:13:33 +0000 (17:13 -0500)] 
iio: adc: ti-ads7950: use spi_optimize_message()

Use spi_optimize_message() to reduce CPU usage during buffered reads.

On hardware with support for SPI_CS_WORD, this reduced the CPU usage
of the threaded interrupt by about 5%. On hardware without support, this
should reduce CPU usage even more since it won't have to split the SPI
transfers each time the interrupt handler is called.

The .update_scan_mode() callback hand to be moved to the buffer preenable
callback since the SPI transfer mode can't be changed after
spi_optimize_message() has been called. (The buffer postenable callback
can't be used because it happens after the trigger is enabled, so the
SPI message needs to be optimized before that.)

The indent of the pointer to ti_ads7950_read_raw() in the assignment
is changed since there is no longer anything else in the struct to
align with since removal of use of the pointer to
ti_ads7950_update_scan_mode().

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad799x: convert to fully managed resources and drop remove()
Archit Anant [Sun, 12 Apr 2026 09:37:39 +0000 (15:07 +0530)] 
iio: adc: ad799x: convert to fully managed resources and drop remove()

Convert the driver's remaining manual resource management to use the
devm_ infrastructure, allowing for the complete removal of the
ad799x_remove() function and the simplification of the probe error paths.

Specifically:
- Initialize the mutex using devm_mutex_init() and move it to the top
  of probe() (before IRQ registration) to prevent a race condition where
  an interrupt could attempt to take an uninitialized lock.
- Use devm_add_action_or_reset() to ensure that the VCC and VREF
  regulators are disabled safely and in the correct order during driver
  teardown or probe failure.
- Refactor the optional VREF error handling path for better readability.
- Convert iio_triggered_buffer_setup() and iio_device_register() to
  their devm_ variants.

Because all resources are now managed by the devm core, the unwinding
order is guaranteed to follow the reverse order of allocation. All manual
error handling goto labels in ad799x_probe() have been removed.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Suggested-by: David Lechner <dlechner@baylibre.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad799x: cache regulator voltages during probe
Archit Anant [Sun, 12 Apr 2026 09:37:38 +0000 (15:07 +0530)] 
iio: adc: ad799x: cache regulator voltages during probe

Since the reference voltage for this ADC is not expected to
change at runtime, determine the active reference voltage (either VREF
or VCC) during probe() and cache it in a single variable in the state
structure.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad799x: use a static buffer for scan data
Archit Anant [Sun, 12 Apr 2026 09:37:37 +0000 (15:07 +0530)] 
iio: adc: ad799x: use a static buffer for scan data

Currently, rx_buf is dynamically allocated using kmalloc() every time
ad799x_update_scan_mode() is called. This can lead to memory leaks if
the scan mask is updated multiple times.

Drop the dynamic allocation and replace it with a static buffer at the
end of the state structure using IIO_DECLARE_BUFFER_WITH_TS().
This eliminates the allocation overhead, prevents leaks, and removes
the need for manual kfree() on driver removal.

Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad799x: use local device pointer in probe
Archit Anant [Sun, 12 Apr 2026 09:37:36 +0000 (15:07 +0530)] 
iio: adc: ad799x: use local device pointer in probe

Introduce a local device pointer 'dev' in ad799x_probe() and use it
throughout the function instead of accessing &client->dev repeatedly.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ad799x: sort headers alphabetically
Archit Anant [Sun, 12 Apr 2026 09:37:35 +0000 (15:07 +0530)] 
iio: adc: ad799x: sort headers alphabetically

Reorder header includes to maintain proper alphabetical ordering.

No functional changes.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: register an IIO device with a device-managed function
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:22 +0000 (15:37 +0300)] 
iio: light: vcnl4000: register an IIO device with a device-managed function

Use a device-managed counterpart of iio_device_register() and remove the
redundant iio_device_unregister() call in driver remove function,
allowing us to remove vcnl4000_remove() function altogether.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: make pm_runtime_enable() device-managed
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:21 +0000 (15:37 +0300)] 
iio: light: vcnl4000: make pm_runtime_enable() device-managed

Replace pm_runtime_set_active() and pm_runtime_enable() with their
device-managed counterpart to remove them from vcnl4000_remove().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: move power state function into device-managed action
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:20 +0000 (15:37 +0300)] 
iio: light: vcnl4000: move power state function into device-managed action

Move power state setting into a device-managed action to get rid of
fail_poweroff goto label and remove it from vcnl4000_remove() function.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: move device tree entries into one line
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:19 +0000 (15:37 +0300)] 
iio: light: vcnl4000: move device tree entries into one line

Make device tree entries one line each to save space and LOC.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: drop enum id table in favor of chip structs
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:18 +0000 (15:37 +0300)] 
iio: light: vcnl4000: drop enum id table in favor of chip structs

Instead of creating an enum table with chip IDs, store pointers to
structs directly. This drops the association between chip structs and
enum IDs and allows for easier addition or removal of new devices.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: light: vcnl4000: validate device by prod ID instead of table ID
Erikas Bitovtas [Tue, 14 Apr 2026 12:37:17 +0000 (15:37 +0300)] 
iio: light: vcnl4000: validate device by prod ID instead of table ID

Add a new field for vcnl4000_chip_spec and check if we have the right
device by that instead of the index from enum table. This leaves the
enum table being used only for picking the right vcnl4000_chip_spec,
allowing us to drop it later on.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: mcp4821: add configurable gain support
Nikhil Gautam [Tue, 14 Apr 2026 17:03:08 +0000 (22:33 +0530)] 
iio: dac: mcp4821: add configurable gain support

Add support for configuring the DAC gain using the GA bit

The MCP4821 supports two gain settings:
- 1x gain → 2.048V full-scale
- 2x gain → 4.096V full-scale

Scale write support is added in the IIO interface. Only scale
values advertised via the scale_available attribute are accepted,
ensuring consistency between the configured gain and exposed
scale values.

Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: mcp4821: move state initialization outside switch
Nikhil Gautam [Tue, 14 Apr 2026 17:03:07 +0000 (22:33 +0530)] 
iio: dac: mcp4821: move state initialization outside switch

Move the iio_priv() call outside the switch statement in
mcp4821_read_raw() to avoid repeating it in multiple cases.

No functional change.

Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: dac: mcp4821: fix spelling mistake in enum name
Nikhil Gautam [Tue, 14 Apr 2026 17:03:06 +0000 (22:33 +0530)] 
iio: dac: mcp4821: fix spelling mistake in enum name

Fix a typo in the enum name mcp4821_supported_drvice_ids
by renaming it to mcp4821_supported_device_ids.

This improves code readability and consistency.

Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: ssp_sensors: cleanup codestyle check
Sanjay Chitroda [Wed, 15 Apr 2026 05:07:44 +0000 (10:37 +0530)] 
iio: ssp_sensors: cleanup codestyle check

Reported by checkpatch:
FILE: drivers/iio/common/ssp_sensors/ssp_spi.c

CHECK: Macro argument '...' may be better as '(...)'
to avoid precedence issues

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: ssp_sensors: cleanup codestyle warning
Sanjay Chitroda [Wed, 15 Apr 2026 05:07:43 +0000 (10:37 +0530)] 
iio: ssp_sensors: cleanup codestyle warning

Reported by checkpatch:
FILE: drivers/iio/common/ssp_sensors/ssp_spi.c

WARNING: Prefer __packed over __attribute__((__packed__))
+} __attribute__((__packed__));

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: frequency: ad9834: clean up includes
Joshua Crofts [Thu, 16 Apr 2026 09:32:40 +0000 (09:32 +0000)] 
iio: frequency: ad9834: clean up includes

Cleanup include headers by removing proxy kernel.h header and
unnecessary list.h, interrupt.h, workqueue.h and slab.h headers. Added
additional headers that were previously included from kernel.h.

Verified using the include-what-you-use tool.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: frequency: ad9832: remove kernel.h proxy header
Joshua Crofts [Fri, 17 Apr 2026 10:16:22 +0000 (10:16 +0000)] 
iio: frequency: ad9832: remove kernel.h proxy header

Remove kernel.h proxy header and add replacement headers (array_size.h,
dev_printk.h, kstrtox.h, mod_devicetable.h, mutex, types.h, asm/byteorder.h) to
maintain atomicity. Moved asm/div64.h header below generic <linux/*>
headers. Additionally, add bitops.h for BIT_ULL() macro.

Audited using the include-what-you-use tool.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl372: Use dev_err_probe()
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:24 +0000 (18:19 +0530)] 
iio: accel: adxl372: Use dev_err_probe()

dev_err_probe() makes error code handling simpler and handles
deferred probe nicely (avoid spamming logs).

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl372: Use devm-managed mutex initialization
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:23 +0000 (18:19 +0530)] 
iio: accel: adxl372: Use devm-managed mutex initialization

Use devm_mutex_init() to tie the mutex lifetime to the device and
improve debugging when CONFIG_DEBUG_MUTEXES is enabled.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl367: Use devm-managed mutex initialization
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:22 +0000 (18:19 +0530)] 
iio: accel: adxl367: Use devm-managed mutex initialization

Use devm_mutex_init() to tie the mutex lifetime to the device and
improve debugging when CONFIG_DEBUG_MUTEXES is enabled.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl355: Use dev_err_probe()
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:21 +0000 (18:19 +0530)] 
iio: accel: adxl355: Use dev_err_probe()

dev_err_probe() makes error code handling simpler and handles
deferred probe nicely (avoid spamming logs).

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl355_core: Use devm-managed mutex initialization
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:20 +0000 (18:19 +0530)] 
iio: accel: adxl355_core: Use devm-managed mutex initialization

Use devm_mutex_init() to tie the mutex lifetime to the device and
improve debugging when CONFIG_DEBUG_MUTEXES is enabled.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl380: Use devm-managed mutex initialization
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:19 +0000 (18:19 +0530)] 
iio: accel: adxl380: Use devm-managed mutex initialization

Use devm_mutex_init() to tie the mutex lifetime to the device and
improve debugging when CONFIG_DEBUG_MUTEXES is enabled.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl313: Use dev_err_probe()
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:18 +0000 (18:19 +0530)] 
iio: accel: adxl313: Use dev_err_probe()

dev_err_probe() makes error code handling simpler and handles
deferred probe nicely (avoid spamming logs).

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: accel: adxl313_core: Use devm-managed mutex initialization
Sanjay Chitroda [Fri, 17 Apr 2026 12:49:17 +0000 (18:19 +0530)] 
iio: accel: adxl313_core: Use devm-managed mutex initialization

Use devm_mutex_init() to tie the mutex lifetime to the device and
improve debugging when CONFIG_DEBUG_MUTEXES is enabled.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: magnetometer: ak8975: remove unnecessary braces
Joshua Crofts [Fri, 17 Apr 2026 13:02:24 +0000 (13:02 +0000)] 
iio: magnetometer: ak8975: remove unnecessary braces

Remove unnecessary braces at single if statement block.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 months agoiio: adc: ti-ads8688: use read_avail for available attributes
Gabriel Rondon [Mon, 30 Mar 2026 18:15:27 +0000 (19:15 +0100)] 
iio: adc: ti-ads8688: use read_avail for available attributes

Convert the in_voltage_scale_available and in_voltage_offset_available
attributes from legacy IIO_DEVICE_ATTR with custom show functions to the
IIO framework's read_avail callback. This uses the framework's built-in
support for _available attributes, removing the need for manual sysfs
formatting.

Precompute the available scale values at probe time since they depend on
the reference voltage which does not change after initialization.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad4062: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:56 +0000 (14:18 +0300)] 
iio: adc: ad4062: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad9467: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:55 +0000 (14:18 +0300)] 
iio: adc: ad9467: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7768-1: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:54 +0000 (14:18 +0300)] 
iio: adc: ad7768-1: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7280a: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:53 +0000 (14:18 +0300)] 
iio: adc: ad7280a: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7791: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:52 +0000 (14:18 +0300)] 
iio: adc: ad7791: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7791: add dev variable
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:51 +0000 (14:18 +0300)] 
iio: adc: ad7791: add dev variable

Add a local struct device pointer to simplify repeated &spi->dev
dereferences throughout the probe function.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7292: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:50 +0000 (14:18 +0300)] 
iio: adc: ad7292: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7292: add dev variable
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:49 +0000 (14:18 +0300)] 
iio: adc: ad7292: add dev variable

Add a local struct device pointer to simplify repeated &spi->dev
dereferences throughout the probe function.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7793: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:48 +0000 (14:18 +0300)] 
iio: adc: ad7793: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7793: add dev variable
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:47 +0000 (14:18 +0300)] 
iio: adc: ad7793: add dev variable

Add a local struct device pointer to simplify repeated &spi->dev
dereferences throughout the probe function.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7780: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:46 +0000 (14:18 +0300)] 
iio: adc: ad7780: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7780: add dev variable
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:45 +0000 (14:18 +0300)] 
iio: adc: ad7780: add dev variable

Add a local struct device pointer to simplify repeated &spi->dev
dereferences throughout the probe function.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7949: use dev_err_probe()
Antoniu Miclaus [Mon, 30 Mar 2026 11:18:44 +0000 (14:18 +0300)] 
iio: adc: ad7949: use dev_err_probe()

Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads7950: complete conversion to using managed resources
Dmitry Torokhov [Mon, 6 Apr 2026 04:39:26 +0000 (21:39 -0700)] 
iio: adc: ti-ads7950: complete conversion to using managed resources

All resources that the driver needs have managed API now. Switch to
using them to make code clearer and drop ti_ads7950_remove().

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()
Dmitry Torokhov [Mon, 6 Apr 2026 04:39:25 +0000 (21:39 -0700)] 
iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()

The regulator is enabled for the entire time the driver is bound to the
device, and we only need to access it to fetch voltage, which can be
done at probe time.

Switch to using devm_regulator_get_enable_read_voltage() which
simplifies probing and unbinding code.

Suggested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads7950: simplify check for spi_setup() failures
Dmitry Torokhov [Mon, 6 Apr 2026 04:39:24 +0000 (21:39 -0700)] 
iio: adc: ti-ads7950: simplify check for spi_setup() failures

spi_setup() specifies that it returns 0 on success or negative error on
failure. Therefore we can simply check for the return code being 0 or
not.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ti-ads7950: switch to using guard() notation
Dmitry Torokhov [Mon, 6 Apr 2026 04:39:23 +0000 (21:39 -0700)] 
iio: adc: ti-ads7950: switch to using guard() notation

guard() notation allows early returns when encountering errors, making
control flow more obvious. Use it.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ltc2309: Optimize chip_info structure layout
Carlos Jones Jr [Tue, 31 Mar 2026 01:24:57 +0000 (09:24 +0800)] 
iio: adc: ltc2309: Optimize chip_info structure layout

Improve the ltc2309_chip_info structure with better type safety and
memory efficiency:

- Add __counted_by_ptr() annotation to the channels pointer, linking
  it to num_channels for improved bounds checking and kernel hardening
- Reorder structure fields to minimize padding:
  * Place read_delay_us before num_channels
  * This reduces struct size and eliminates internal gaps
- Reorder field initialization to match the structure definition order

The __counted_by_ptr() attribute enables compile-time and runtime
verification that array accesses to channels[] stay within the bounds
specified by num_channels, improving memory safety.

Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ltc2309: add read delay for ltc2305
Carlos Jones Jr [Tue, 31 Mar 2026 01:24:56 +0000 (09:24 +0800)] 
iio: adc: ltc2309: add read delay for ltc2305

The LTC2305 requires a minimum 1.6μs delay between the I2C write
operation (channel selection) and the subsequent read operation to
allow the chip to process the command and prepare the result. While
not explicitly documented in the datasheet, this timing requirement
was identified by the hardware designer as necessary for reliable
operation.

Add a read_delay_us field to both the ltc2309_chip_info and ltc2309
device structures to support chip-specific timing requirements. Use
fsleep() to implement the delay when non-zero, with LTC2305 set to
2μs (1.6μs requirement rounded up). LTC2309 does not require
additional delay beyond inherent I2C bus timing.

This extends the existing LTC2305 support added in
(commit 8625d418d24b ("iio: adc: ltc2309: add support for ltc2305"))
with the missing inter-transaction delay.

Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: st_lsm6dsx: Add support for rotation sensor
Francesco Lavra [Tue, 24 Mar 2026 08:48:07 +0000 (09:48 +0100)] 
iio: imu: st_lsm6dsx: Add support for rotation sensor

Some IMU chips in the LSM6DSX family have sensor fusion features that
combine data from the accelerometer and gyroscope. One of these features
generates rotation vector data and makes it available in the hardware
FIFO as a quaternion (more specifically, the X, Y and Z components of the
quaternion vector, expressed as 16-bit half-precision floating-point
numbers).

Add support for a new sensor instance that allows receiving sensor fusion
data, by defining a new struct st_lsm6dsx_fusion_settings (which contains
chip-specific details for the sensor fusion functionality), and adding this
struct as a new field in struct st_lsm6dsx_settings. In st_lsm6dsx_core.c,
populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the
logic to initialize an additional IIO device if this struct is populated
for the hardware type being probed.
Note: a new IIO device is being defined (as opposed to adding channels to
an existing device) because the rate at which sensor fusion data is
generated may not match the data rate from any of the existing devices.

Tested on LSM6DSV16X.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: ABI: Add quaternion axis modifier
Francesco Lavra [Tue, 24 Mar 2026 08:47:59 +0000 (09:47 +0100)] 
iio: ABI: Add quaternion axis modifier

This modifier applies to the IIO_ROT channel type, and indicates a data
representation that specifies the {x, y, z} components of the normalized
quaternion vector.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: ABI: Add support for floating-point numbers in buffer scan elements
Francesco Lavra [Tue, 24 Mar 2026 08:47:53 +0000 (09:47 +0100)] 
iio: ABI: Add support for floating-point numbers in buffer scan elements

In the data storage description of a scan element, the first character
after the colon can have the values 's' and 'u' to specify signed and
unsigned integers, respectively.
Add 'f' as an allowed value to specify floating-point numbers formatted
according to the IEEE 754 standard.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: tools: Add support for floating-point types in buffer scan elements
Francesco Lavra [Tue, 24 Mar 2026 08:47:46 +0000 (09:47 +0100)] 
iio: tools: Add support for floating-point types in buffer scan elements

A subsequent commit will add floating-point support to the ABI; enhance
the iio_generic_buffer tool to be able to parse this new data format.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: Replace 'sign' field with union in struct iio_scan_type
Francesco Lavra [Tue, 24 Mar 2026 08:47:40 +0000 (09:47 +0100)] 
iio: Replace 'sign' field with union in struct iio_scan_type

This field is used to differentiate between signed and unsigned integers.
A following commit will extend its use in order to add support for non-
integer scan elements; therefore, replace it with a union that contains a
more generic 'format' field. This union will be dropped when all drivers
are changed to use the format field.
Opportunistically replace character literals with symbolic constants that
represent the set of allowed values for the format field.

Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Francesco Lavra [Tue, 24 Mar 2026 08:47:33 +0000 (09:47 +0100)] 
iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO

The DRDY_MASK feature implemented in sensor chips marks gyroscope and
accelerometer invalid samples (i.e. samples that have been acquired during
the settling time of sensor filters) with the special values 0x7FFFh,
0x7FFE, and 0x7FFD.
The driver checks FIFO samples against these special values in order to
discard invalid samples; however, it does the check regardless of the type
of samples being processed, whereas this feature is specific to gyroscope
and accelerometer data. This could cause valid samples to be discarded.

Fix the above check so that it takes into account the type of samples being
processed. To avoid casting to __le16 * when checking sample values, clean
up the type representation for data read from the FIFO.

Fixes: 960506ed2c69 ("iio: imu: st_lsm6dsx: enable drdy-mask if available")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: adc: ad7191: Don't check for specific errors when parsing properties
Andy Shevchenko [Thu, 19 Feb 2026 14:39:36 +0000 (15:39 +0100)] 
iio: adc: ad7191: Don't check for specific errors when parsing properties

Instead of checking for the specific error codes (that can be considered
a layering violation to some extent) check for the property existence first
and then either parse it, or apply a default value.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: orientation: hid-sensor-rotation: use ext_scan_type
David Lechner [Sun, 1 Mar 2026 23:46:48 +0000 (17:46 -0600)] 
iio: orientation: hid-sensor-rotation: use ext_scan_type

Make use of ext_scan_type to handle the dynamic realbits size of the
quaternion data. This lets us implement it using static data rather than
having to duplicate the channel info for each driver instance.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: imu: bno055: add explicit scan buf layout
David Lechner [Sat, 14 Mar 2026 21:38:25 +0000 (16:38 -0500)] 
iio: imu: bno055: add explicit scan buf layout

Move the scan buf.chans array into a union along with a struct that
gives the layout of the buffer with all channels enabled.

Although not technically required in this case, if there had been a
different number of items before the quaternion, there could have been
a subtle bug with the special alignment needed for the quaternion
channel data and the array would have been too small.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: buffer: fix timestamp alignment when quaternion in scan
David Lechner [Sun, 8 Mar 2026 01:44:13 +0000 (19:44 -0600)] 
iio: buffer: fix timestamp alignment when quaternion in scan

Fix timestamp alignment when a scan buffer contains an element larger
than sizeof(int64_t). Currently s32 quaternions are the only such
element, and the one driver that has this (hid-sensor-rotation) has a
workaround in place already so this change does not affect it.

Previously, we assumed that the timestamp would always be 8-byte aligned
relative to the end of the scan buffer, but in the case of a scan buffer
a 16-byte quaternion vector, scan_bytes == 32, but the timestamp needs
to be placed at offset 16, not 24.

ts_offset is now a value in bytes so we have to change how the array
access is done.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: buffer: ensure repeat alignment is a power of two
David Lechner [Sun, 8 Mar 2026 01:44:12 +0000 (19:44 -0600)] 
iio: buffer: ensure repeat alignment is a power of two

Use roundup_pow_of_two() in the calculation of iio_storage_bytes_for_si()
when scan_type->repeat > 1 to ensure that the size is a power of two.
storagebits is always going to be a power of two bytes, so we only need
to apply this to the repeat factor. The storage size is also used for
alignment, and we want to ensure that all alignments are a power of two.

The only repeat in use in the kernel currently is for quaternions, which
have a repeat of 4, so this does not change the result for existing
users.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: buffer: cache timestamp offset in scan buffer
David Lechner [Sun, 8 Mar 2026 01:44:11 +0000 (19:44 -0600)] 
iio: buffer: cache timestamp offset in scan buffer

Cache the offset (in bytes) for the timestamp element in a scan buffer.
This will be used later to ensure proper alignment of the timestamp
element in the scan buffer.

The new field could not be placed in struct iio_dev_opaque because we
will need to access it in a static inline function later, so we make it
__private instead. It is only intended to be used by core IIO code.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agoiio: buffer: check return value of iio_compute_scan_bytes()
David Lechner [Sun, 8 Mar 2026 01:44:10 +0000 (19:44 -0600)] 
iio: buffer: check return value of iio_compute_scan_bytes()

Check return value of iio_compute_scan_bytes() as it can return an
error.

The result is moved to an output parameter while we are touching this
as we will need to add a second output parameter in a later change.

The return type of iio_buffer_update_bytes_per_datum() also had to be
changed to propagate the error.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 months agodrm/i915/dp: Change drm_err to drm_dbg_kms
Suraj Kandpal [Thu, 23 Apr 2026 08:03:55 +0000 (13:33 +0530)] 
drm/i915/dp: Change drm_err to drm_dbg_kms

Change the drm_err to drm_dbg_kms when we fail to read the FEC
capability. This is mainly because this is called from intel_dp_detect.
Which ends up in race more frequently in case of MST scenarios,
when we are disabling streams but the downstream Dock still sends
signals which causes intel_dp_detect to be invoked which has DPCD
reads. These pass until the Transcoder and DPLL go down causing
AUX to go down too. At this point AUX Timeouts are expected and not
an issue. But this drm_err gets flagged in CI causing noise even
for passing scenarios.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Link: https://patch.msgid.link/20260423080355.2744117-1-suraj.kandpal@intel.com
2 months agoMerge drm/drm-next into drm-misc-next
Thomas Zimmermann [Mon, 27 Apr 2026 08:49:13 +0000 (10:49 +0200)] 
Merge drm/drm-next into drm-misc-next

Getting fixes and updates from v7.1-rc1.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2 months agoxfs: check da node block pad field during scrub
Yuto Ohnuki [Fri, 10 Apr 2026 17:06:15 +0000 (18:06 +0100)] 
xfs: check da node block pad field during scrub

The da node block header (xfs_da3_node_hdr) contains a __pad32 field
that should always be zero. Add a check for this during directory and
attribute btree scrubbing.

Since old kernels may have written non-zero padding without issues, flag
this as an optimization opportunity (preen) rather than corruption.

Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: fix memory leak for data allocated by xfs_zone_gc_data_alloc()
Wilfred Mallawa [Fri, 17 Apr 2026 02:16:30 +0000 (12:16 +1000)] 
xfs: fix memory leak for data allocated by xfs_zone_gc_data_alloc()

In xfs_zone_gc_mount(), on error, a struct xfs_zone_gc_data allocated
with xfs_zone_gc_data_alloc() is freed with kfree(), however, this
doesn't free the underlying folios or the rmap_irecs.

Use xfs_zone_gc_data_free() to correctly free this memory.

Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Cc: stable@vger.kernel.org # v6.15
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: fix memory leak on error in xfs_alloc_zone_info()
Wilfred Mallawa [Tue, 14 Apr 2026 23:45:14 +0000 (09:45 +1000)] 
xfs: fix memory leak on error in xfs_alloc_zone_info()

Currently, the 0th index of the zi_used_bucket_bitmap array is not freed
on error due to the pre-decrement then evaluate semantic of the while
loop used in xfs_alloc_zone_info(). Fix it by allowing for the i == 0
case to be covered.

Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Cc: stable@vger.kernel.org # v6.15
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: check directory data block header padding in scrub
Yuto Ohnuki [Sat, 11 Apr 2026 14:24:15 +0000 (15:24 +0100)] 
xfs: check directory data block header padding in scrub

Add the missing scrub check for the pad field in directory data block
headers. Old kernels may have written non-zero padding without issue,
and the write path now self-heals stale padding on modification. Flag
non-zero padding as an optimization opportunity (preen) rather than
corruption.

Add xchk_fblock_set_preen helper for reporting file fork block issues
that could be optimized. The trace event xchk_fblock_preen already
exists.

Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: zero directory data block padding on write verification
Yuto Ohnuki [Sat, 11 Apr 2026 14:24:14 +0000 (15:24 +0100)] 
xfs: zero directory data block padding on write verification

Old kernels did not zero the pad field in xfs_dir3_data_hdr when
initializing directory data blocks, so existing filesystems may have
non-zero padding on disk.

Zero the pad field in xfs_dir3_data_write_verify alongside the existing
LSN and checksum updates. The pad field is pure alignment padding with
no runtime meaning, so zeroing it during write verification is safe and
has no additional I/O cost. This lets filesystems gradually self-heal
stale non-zero padding as directories are modified, without requiring an
explicit repair pass.

Suggested-by: Dave Chinner <dgc@kernel.org>
Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: zero entire directory data block header region at init
Yuto Ohnuki [Sat, 11 Apr 2026 14:24:13 +0000 (15:24 +0100)] 
xfs: zero entire directory data block header region at init

xfs_dir3_data_init currently zeroes only the xfs_dir3_blk_hdr portion of
the directory data block header, then manually initializes the bestfree
entries in a loop. This leaves the pad field in xfs_dir3_data_hdr
uninitialized and requires explicit zeroing of each bestfree slot.

Zero the entire header region (geo->data_entry_offset bytes)
unconditionally before setting individual fields. This covers all
current and future header fields, all padding (implicit and explicit),
and the bestfree array, so the manual zeroing loop for bestfree can be
removed.

Suggested-by: Dave Chinner <dgc@kernel.org>
Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agoxfs: remove the meaningless XFS_ALLOC_FLAG_FREEING
Jinliang Zheng [Fri, 10 Apr 2026 10:11:06 +0000 (18:11 +0800)] 
xfs: remove the meaningless XFS_ALLOC_FLAG_FREEING

In xfs_refcount_finish_one(), there's no need to pass
XFS_ALLOC_FLAG_FREEING to xfs_alloc_read_agf().

So remove it.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
2 months agopinctrl: qcom: ipq4019: mark gpio as a GPIO pin function
Til Kaiser [Mon, 13 Apr 2026 13:52:34 +0000 (15:52 +0200)] 
pinctrl: qcom: ipq4019: mark gpio as a GPIO pin function

The qcom pinctrl core supports marking functions that represent GPIO mode
via PINCTRL_GPIO_PINFUNCTION(), so that strict pinmuxing does not reject
GPIO requests for pins that are muxed to the GPIO function.

ipq4019 still describes its gpio function with QCA_PIN_FUNCTION(gpio),
so it is not treated as a GPIO pin function. As a result, GPIO consumers
can still conflict with pinctrl states that select the "gpio" function.

Add a QCA_GPIO_PIN_FUNCTION() helper and use it for the ipq4019 gpio
function, matching how the msm-based qcom drivers handle this.

This allows ipq4019 to keep the GPIO-related pin configuration in DTS
without tripping over strict pinmux ownership checks.

Fixes: cc85cb96e2e4 ("pinctrl: qcom: make the pinmuxing strict")
Signed-off-by: Til Kaiser <mail@tk154.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2 months agopinctrl: mediatek: moore: implement gpio_chip::get_direction()
Bartosz Golaszewski [Fri, 10 Apr 2026 07:09:35 +0000 (09:09 +0200)] 
pinctrl: mediatek: moore: implement gpio_chip::get_direction()

If the gpio_chip::get_direction() callback is not implemented by the GPIO
controller driver, GPIOLIB emits a warning.

Implement get_direction() for the GPIO part of pinctrl-moore.

Fixes: 471e998c0e31 ("gpiolib: remove redundant callback check")
Fixes: e623c4303ed1 ("gpiolib: sanitize the return value of gpio_chip::get_direction()")
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Closes: https://lore.kernel.org/all/20260409132724.126258-1-linux@fw-web.de/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tested-By: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2 months agoMerge drm/drm-fixes into drm-misc-fixes
Thomas Zimmermann [Mon, 27 Apr 2026 08:26:49 +0000 (10:26 +0200)] 
Merge drm/drm-fixes into drm-misc-fixes

Getting fixes and updates from v7.1-rc1.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2 months agoMerge tag 'kvm-x86-selftests_kernel_types-7.1' of https://github.com/kvm-x86/linux...
Paolo Bonzini [Mon, 27 Apr 2026 08:24:41 +0000 (04:24 -0400)] 
Merge tag 'kvm-x86-selftests_kernel_types-7.1' of https://github.com/kvm-x86/linux into HEAD

KVM selftests type renames for 7.1

Renames types across all KVM selftests to more closely align with types used
in the kernel:

  vm_vaddr_t -> gva_t
  vm_paddr_t -> gpa_t

  uint64_t -> u64
  uint32_t -> u32
  uint16_t -> u16
  uint8_t  -> u8

  int64_t -> s64
  int32_t -> s32
  int16_t -> s16
  int8_t  -> s8

Using the kernel's preferred types eliminates a source of friction for many
contributors, as the majority of KVM selftests contributions come from kernel
developers.  The kernel names are also shorter, which allows for more concise
code, and in any many cases eliminates newlines thanks to shorter types and
parameter names.

Rename variables and parameters as well as types, e.g. gpa instead of paddr,
to again align with the kernel, and in a few cases to remove ambiguity, e.g.
where paddr is used to refer to a _host_ physical address.

2 months agoMerge tag 'kvmarm-fixes-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmar...
Paolo Bonzini [Mon, 27 Apr 2026 08:24:34 +0000 (04:24 -0400)] 
Merge tag 'kvmarm-fixes-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 7.1, take #1

- Allow tracing for non-pKVM, which was accidentally disabled when
  the series was merged

- Rationalise the way the pKVM hypercall ranges are defined by using
  the same mechanism as already used for the vcpu_sysreg enum

- Enforce that SMCCC function numbers relayed by the pKVM proxy are
  actually compliant with the specification

- Fix a couple of feature to idreg mappings which resulted in the
  wrong sanitisation being applied

- Fix the GICD_IIDR revision number field that could never been
  written correctly by userspace

- Make kvm_vcpu_initialized() correctly use its parameter instead
  of relying on the surrounding context

- Enforce correct ordering in __pkvm_init_vcpu(), plugging a
  potential pin leak at the same time

- Move __pkvm_init_finalise() to a less dangerous spot, avoiding
  future problems

- Restore functional userspace irqchip support after a four year
  breakage (last functional kernel was 5.18...). This is obviously
  ripe for garbage collection.

- ... and the usual lot of spelling fixes

2 months agoKVM: selftests: Add check_steal_time_uapi() implementation for LoongArch
Sean Christopherson [Mon, 20 Apr 2026 19:26:44 +0000 (12:26 -0700)] 
KVM: selftests: Add check_steal_time_uapi() implementation for LoongArch

Define check_steal_time_uapi() for LoongArch so that the steal_time test
builds.  Note, while LoongArch's steal_time_init() has some funky asserts,
none of the code is uniquely verifying KVM's uAPI.

Cc: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Cc: Jiakai Xu <jiakaiPeanut@gmail.com>
Cc: Andrew Jones <andrew.jones@oss.qualcomm.com>
Cc: Anup Patel <anup@brainfault.org>
Cc: Tianrui Zhao <zhaotianrui@loongson.cn>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>
Fixes: 40351ed924dd ("KVM: selftests: Refactor UAPI tests into dedicated function")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20260420192644.3892050-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>