]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
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>
3 months agoiio: filter: admv8818: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:40 +0000 (16:01 +0200)] 
iio: filter: admv8818: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: ad7293: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:39 +0000 (16:01 +0200)] 
iio: dac: ad7293: 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>
3 months agoiio: dac: ad7293: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:38 +0000 (16:01 +0200)] 
iio: dac: ad7293: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: frequency: adf4377: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:37 +0000 (16:01 +0200)] 
iio: frequency: adf4377: 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>
3 months agoiio: frequency: adf4377: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:36 +0000 (16:01 +0200)] 
iio: frequency: adf4377: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: frequency: admv1013: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:35 +0000 (16:01 +0200)] 
iio: frequency: admv1013: 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>
3 months agoiio: frequency: admv1013: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:34 +0000 (16:01 +0200)] 
iio: frequency: admv1013: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: frequency: admv1014: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:33 +0000 (16:01 +0200)] 
iio: frequency: admv1014: 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>
3 months agoiio: frequency: admv1014: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:32 +0000 (16:01 +0200)] 
iio: frequency: admv1014: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: frequency: adrf6780: use dev_err_probe()
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:31 +0000 (16:01 +0200)] 
iio: frequency: adrf6780: 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>
3 months agoiio: frequency: adrf6780: add dev variable
Antoniu Miclaus [Fri, 27 Feb 2026 14:01:30 +0000 (16:01 +0200)] 
iio: frequency: adrf6780: add dev variable

Introduce a local struct device pointer in functions that reference
&spi->dev for device-managed resource calls and device property reads,
improving code readability.

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: addac: ad74413r: simplify timeout return
Antoniu Miclaus [Mon, 23 Feb 2026 10:14:40 +0000 (12:14 +0200)] 
iio: addac: ad74413r: simplify timeout return

Return -ETIMEDOUT directly instead of assigning it to an intermediate
variable first.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7173: move opening brace to a separate line
Giorgi Tchankvetadze [Mon, 23 Feb 2026 08:24:00 +0000 (12:24 +0400)] 
iio: adc: ad7173: move opening brace to a separate line

Place the opening brace of ad7173_calc_openwire_thrsh_raw() on its own
line to comply with the kernel coding style for function definitions.
Issue found by checkpatch.

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: gp2ap020a00f: Join some lines of code to be a single line
Andy Shevchenko [Mon, 23 Feb 2026 03:40:20 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Join some lines of code to be a single line

In some cases the wrapped lines are harder to follow. Join them despite
being longer than 80 characters in some cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Remove trailing comma in termination entry
Andy Shevchenko [Mon, 23 Feb 2026 03:40:19 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Remove trailing comma in termination entry

Termination entry by definition should be the last one, hence remove
stray comma after it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Explicitly use string literal for driver name
Andy Shevchenko [Mon, 23 Feb 2026 03:40:18 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Explicitly use string literal for driver name

The driver name should be easily greppable and clearly spelled.
Replace a level of indirection and explicitly use string literal.

While at it, remove useless blank lines before module_*() and
MODULE_*() macros.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Use temporary variable for struct device
Andy Shevchenko [Mon, 23 Feb 2026 03:40:17 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Use temporary variable for struct device

Use temporary variable for struct device to make code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Replace custom implementation of min()
Andy Shevchenko [Mon, 23 Feb 2026 03:40:16 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Replace custom implementation of min()

Replace custom implementation of min() to save a few lines of code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Fix possible error swallow
Ethan Tidmore [Mon, 23 Feb 2026 03:40:15 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Fix possible error swallow

Move error check into for loop in gp2ap020a00f_buffer_postenable() and
gp2ap020a00f_buffer_predisable(), this fixes a possible error swallow.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Return directly from the switch cases
Andy Shevchenko [Mon, 23 Feb 2026 03:40:14 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Return directly from the switch cases

Return directly from the switch cases which makes code easier to follow.
In some cases convert pieces to the standard pattern which also unifies
it with the accepted kernel practices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: Use correct types for 16-bit LE data
Andy Shevchenko [Mon, 23 Feb 2026 03:40:13 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: Use correct types for 16-bit LE data

Instead of using byte arrays and then explicit castings, change
the types of byte arrays to be __le16 and update the endianness
conversions accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: correct return type to int
Ethan Tidmore [Mon, 23 Feb 2026 03:40:12 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: correct return type to int

The function gp2ap020a00f_get_thresh_reg() can return -EINVAL in its
error path. Yet, the function has return type of u8. Added error
checking for gp2ap020a00f_get_thresh_reg() return value.

Detected by Smatch:
drivers/iio/light/gp2ap020a00f.c:1013 gp2ap020a00f_get_thresh_reg() warn:
signedness bug returning '(-22)'

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: gp2ap020a00f: simplify locking with guard()
Ethan Tidmore [Mon, 23 Feb 2026 03:40:11 +0000 (21:40 -0600)] 
iio: light: gp2ap020a00f: simplify locking with guard()

Use the guard() cleanup handler to manage the device lock.
This simplifies the code by removing the need for manual unlocking
and goto error handling paths.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoMerge branch 'ib-iio-thermal-qcom-pmic5' into togreg
Jonathan Cameron [Mon, 23 Feb 2026 21:03:25 +0000 (21:03 +0000)] 
Merge branch 'ib-iio-thermal-qcom-pmic5' into togreg
Immutable branch to allow this base work to be merged into thermal.

3 months agoiio: adc: at91_adc: change at91_ts_sample to return void
Antoniu Miclaus [Mon, 2 Feb 2026 11:57:30 +0000 (13:57 +0200)] 
iio: adc: at91_adc: change at91_ts_sample to return void

The return value of at91_ts_sample() is never checked by its caller.
Change the return type to void to make this explicit. The error
conditions are already logged via dev_err() which provides sufficient
visibility into hardware issues.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: update device support
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:55 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: update device support

Add support for the following digital step attenuators:
- HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz
- ADRF5720: 0.5 dB LSB, 6-Bit, Digital Attenuator, 9 kHz to 40 GHz
- ADRF5730: 0.5 dB LSB, 6-Bit, Digital Attenuator, 100 MHz to 40 GHz
- ADRF5731: 2 dB LSB, 4-Bit, Digital Attenuator, 100 MHz to 40 GHz
- HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz
- HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz

Additionally, copyright notice was updated with current year.

Co-developed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: consume enable gpio
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:54 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: consume enable gpio

Some parts may consume enable GPIO to enable serial mode
(HMC1119's and HMC792A P/S pin) or powerup the device
(e.g. ADA4961's PWUP pin).

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: add device tree support
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:53 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: add device tree support

Drop the enum ID, split chip info table into per-device structs and add
of_match_table. Additionally, add 'name' field into the chip info struct,
dropping the usage of spi_get_device_id().

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: prepare for device-tree support
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:52 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: prepare for device-tree support

Drop switch case on the enum ID in favor of extended chip info table,
containing:
- gain_step, indicating with sign the start of the code range;
- num_channels, to indicate the number IIO channels;
- pack_code() function to describe how SPI buffer is populated;

Which allowed for a simplified read_raw() and write_raw() callbacks. The
probe() function was adjusted accordingly. The linux/array_size.h include
is removed as number of channels is provided by chip info table.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: replace reset-gpio with reset controller
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:51 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: replace reset-gpio with reset controller

Remove reset_gpio from the device state struct and use the reset_control
interface instead, using a local variable, as it is not being used
anywhere else. The reset controller init is moved out from the switch case
and optionally initialized for every device variant. Although not all
devices have a reset pin the code does not need to change if it is not
wired.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: refactor device resource management
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:50 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: refactor device resource management

Adhere modern device resource management with the following:
- Voltage regulator managed and enabled internally;
- IIO device registration handled with devm_iio_device_register();
- removal of goto's from the probe function;
- ad8366_remove() removed as it is not needed anymore;

With the drop of goto's dev_err_probe() is used to report probe errors.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: use devm_mutex_init() and drop mutex_init()
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:49 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: use devm_mutex_init() and drop mutex_init()

Adopt proper mutex lifecycle with devm_mutex_init(), replacing
mutex_init(). Mutex init is moved up (before regulator init),
so that goto statement in the error path is avoided (which will
be cleaned up later).

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: amplifiers: ad8366: add local dev pointer to the probe function
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:48 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: add local dev pointer to the probe function

Create local device pointer in the probe function to shorten lines, making
the code easier to read. The local device pointer replaces &spi->dev and
will be reused across other probe function places in later patches.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>