]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
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>
3 months agoiio: amplifiers: ad8366: refactor include headers
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:47 +0000 (17:10 +0000)] 
iio: amplifiers: ad8366: refactor include headers

Apply IWYU principle, removing the following headers:
- linux/device.h: no usage of devm_add_action_or_reset, device_attr...
- linux/kernel.h: no usage of container_of, kasprintf, ...
- linux/slab.h: memory management handled by iio
- linux/sysfs.h: sysfs interaction is managed by iio
- linux/iio/sysfs.h: not using iio device attributes in this driver
Adding the following missing headers:
+ linux/array_size.h: for ARRAY_SIZE
+ linux/bits.h: for BIT
+ linux/dev_printk.h: for dev_err
+ linux/math.h: for abs
+ linux/mutex.h: for mutex_lock, mutex_unlock
+ linux/mod_devicetable.h: for spi_device_id
+ linux/types.h for NULL, __aligned

Additionally, those include directives are alphabetically sorted.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: amplifiers: Add AD8366 support
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:46 +0000 (17:10 +0000)] 
dt-bindings: iio: amplifiers: Add AD8366 support

Add device tree binding documentation for amplifiers and digital
attenuators. This covers different device variants with similar
SPI control. Each device has its own gain range and step, hence
no fallback compatibles are used.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoMAINTAINERS: Add missing maintainer entry for AD8366 driver
Rodrigo Alencar [Mon, 16 Feb 2026 17:10:45 +0000 (17:10 +0000)] 
MAINTAINERS: Add missing maintainer entry for AD8366 driver

Add maintainers entry for drivers/iio/amplifiers/ad8366.c

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ade9000: use dev_err_probe() in probe path
Antoniu Miclaus [Fri, 20 Feb 2026 13:11:43 +0000 (15:11 +0200)] 
iio: adc: ade9000: use dev_err_probe() in probe path

Replace dev_err() + return with dev_err_probe() in ade9000_reset(),
which is called during probe. This simplifies error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: core: Simplify IIO core managed APIs
Andy Shevchenko [Fri, 20 Feb 2026 13:25:19 +0000 (14:25 +0100)] 
iio: core: Simplify IIO core managed APIs

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

While at it, inline devm_iio_kfifo_allocate() into its only user.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7266: simplify error return
Antoniu Miclaus [Fri, 20 Feb 2026 13:18:46 +0000 (15:18 +0200)] 
iio: adc: ad7266: simplify error return

Return PTR_ERR() directly instead of assigning it to an intermediate
variable first.

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: remove redundant else after return
Antoniu Miclaus [Fri, 20 Feb 2026 13:33:34 +0000 (15:33 +0200)] 
iio: filter: admv8818: remove redundant else after return

The else in admv8818_init() is unnecessary since the if block already
returns after calling admv8818_rfin_band_select() when clkin is present.

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: core: Clean up device correctly on viio_trigger_alloc() failure
Salah Triki [Sat, 21 Feb 2026 07:32:42 +0000 (08:32 +0100)] 
iio: core: Clean up device correctly on viio_trigger_alloc() failure

Move device_initialize() after all error paths in viio_trigger_alloc().
Previously, put_device() should have been called on all error paths after
device_initialize(), but that was not done.

Rather than adding put_device(), move device_initialize() to avoid
needing to unwind it on error.

In addition move trig->dev initialization to just before device_initialize()
to related code together.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: nxp-sar-adc: Remove unnecessary type casting
Felix Gu [Sat, 21 Feb 2026 18:09:08 +0000 (02:09 +0800)] 
iio: adc: nxp-sar-adc: Remove unnecessary type casting

The readl_poll_timeout() macro returns a signed integer error code.

In nxp_sar_adc_calibration_wait(), the return value is casted to u32
before being returned as int, which is unnecessary.

Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agostaging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div()
Archit Anant [Wed, 18 Feb 2026 12:53:27 +0000 (18:23 +0530)] 
staging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div()

Replace do_div() with div64_ul() since the remainder is not used.
div64_ul() is the preferred API for 64-bit by 32-bit division when
only the quotient is needed.

Also replace explicit casting and shifting with the BIT_ULL(27) macro
for clarity.

Note: A mathematical simplification to `(freq * BIT_ULL(29)) / mclk` was
suggested during review to improve precision. However, as confirmed by
maintainers, the original driver's truncation via `(mclk / 4)` might
be intentional or relied upon by userspace. Since hardware is not
available for verification, this patch preserves the original logic
to avoid regression risk in the absence of testing.

Issue identified by coccicheck using do_div.cocci.

Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: Add support for QCOM PMIC5 Gen3 ADC
Jishnu Prakash [Fri, 30 Jan 2026 11:54:20 +0000 (17:24 +0530)] 
iio: adc: Add support for QCOM PMIC5 Gen3 ADC

The ADC architecture on PMIC5 Gen3 is similar to that on PMIC5 Gen2,
with all SW communication to ADC going through PMK8550 which
communicates with other PMICs through PBS.

One major difference is that the register interface used here is that
of an SDAM (Shared Direct Access Memory) peripheral present on PMK8550.
There may be more than one SDAM used for ADC5 Gen3 and each has eight
channels, which may be used for either immediate reads (same functionality
as previous PMIC5 and PMIC5 Gen2 ADC peripherals) or recurring measurements
(same as ADC_TM functionality).

By convention, we reserve the first channel of the first SDAM for all
immediate reads and use the remaining channels across all SDAMs for
ADC_TM monitoring functionality.

Add support for PMIC5 Gen3 ADC driver for immediate read functionality.
ADC_TM is implemented as an auxiliary thermal driver under this ADC
driver.

Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: Add support for QCOM PMIC5 Gen3 ADC
Jishnu Prakash [Fri, 30 Jan 2026 11:54:19 +0000 (17:24 +0530)] 
dt-bindings: iio: adc: Add support for QCOM PMIC5 Gen3 ADC

For the PMIC5-Gen3 type PMICs, ADC peripheral is present in HW for the
following PMICs: PMK8550, PM8550, PM8550B and PM8550VX PMICs.

It is similar to PMIC5-Gen2, with SW communication to ADCs on all PMICs
going through PBS(Programmable Boot Sequence) firmware through a single
register interface. This interface is implemented on SDAM (Shared
Direct Access Memory) peripherals on the master PMIC PMK8550 rather
than a dedicated ADC peripheral.

Add documentation for PMIC5 Gen3 ADC and update SPMI PMIC bindings to
allow ADC5 Gen3 as adc@ subnode.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: Split out QCOM VADC channel properties
Jishnu Prakash [Fri, 30 Jan 2026 11:54:18 +0000 (17:24 +0530)] 
dt-bindings: iio: adc: Split out QCOM VADC channel properties

Split out the common channel properties for QCOM VADC devices into a
separate file so that it can be included as a reference for devices
using them. This will be needed for the upcoming ADC5 Gen3 binding
support patch, as ADC5 Gen3 also uses all of these common properties.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: zopt2201: use lock guards
Gabriel Almeida [Tue, 17 Feb 2026 14:31:57 +0000 (11:31 -0300)] 
iio: light: zopt2201: use lock guards

Use guard() and scoped_guard() to handle the mutex lock instead of
manually locking and unlocking it.

Signed-off-by: Gabriel Almeida <gabrielsousa230@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: zopt2201: Reorder header includes
Gabriel Almeida [Tue, 17 Feb 2026 14:31:56 +0000 (11:31 -0300)] 
iio: light: zopt2201: Reorder header includes

Reorder the header includes to follow the usual kernel ordering
conventions and improve readability.

Signed-off-by: Gabriel Almeida <gabrielsousa230@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: dac: Fix typo in ti,dac7612.yaml
Pranav Kharche [Wed, 18 Feb 2026 03:55:49 +0000 (09:25 +0530)] 
dt-bindings: iio: dac: Fix typo in ti,dac7612.yaml

Fix a typo in the description where "Is is" should be "It is".

Signed-off-by: Pranav Kharche <pranavkharche7@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad4080: add support for AD4082, AD4085 and AD4088
Antoniu Miclaus [Mon, 16 Feb 2026 15:11:11 +0000 (17:11 +0200)] 
iio: adc: ad4080: add support for AD4082, AD4085 and AD4088

Add support for the AD4082, AD4085 and AD4088 SAR ADCs. These devices
share the same resolution as their base variants but differ in LVDS CNV
clock count maximum:
  - AD4082 (20-bit, like AD4080): lvds_cnv_clk_cnt_max 8 vs 7
  - AD4085 (16-bit, like AD4084): lvds_cnv_clk_cnt_max 8 vs 2
  - AD4088 (14-bit, like AD4087): lvds_cnv_clk_cnt_max 8 vs 1

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: adi,ad4080: add support for AD4082, AD4085 and AD4088
Antoniu Miclaus [Mon, 16 Feb 2026 15:11:10 +0000 (17:11 +0200)] 
dt-bindings: iio: adc: adi,ad4080: add support for AD4082, AD4085 and AD4088

Add device tree binding support for AD4082, AD4085 and AD4088 SAR ADCs.
Add adi,ad4082, adi,ad4085 and adi,ad4088 to the compatible enum.

A fallback compatible string is not appropriate for these devices as they
differ in LVDS CNV clock count maximum from their base variants:
  - AD4082 (20-bit) vs AD4080: lvds_cnv_clk_cnt_max 8 vs 7
  - AD4085 (16-bit) vs AD4084: lvds_cnv_clk_cnt_max 8 vs 2
  - AD4088 (14-bit) vs AD4087: lvds_cnv_clk_cnt_max 8 vs 1

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad4030: Use BIT macro to improve code readability
Marcelo Schmitt [Mon, 16 Feb 2026 15:00:22 +0000 (12:00 -0300)] 
iio: adc: ad4030: Use BIT macro to improve code readability

Use BIT macro to make the list of average modes more readable.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.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: Reference spi-peripheral-props
Marcelo Schmitt [Mon, 16 Feb 2026 14:59:10 +0000 (11:59 -0300)] 
dt-bindings: iio: adc: adi,ad4030: Reference spi-peripheral-props

AD4030 and similar devices all connect to the system as SPI peripherals.
Reference spi-peripheral-props so common SPI peripheral can be used from
ad4030 dt-binding.

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 agoiio: dac: max5522: simplify probe with devm_regulator_get_enable_read_voltage()
Antoniu Miclaus [Mon, 16 Feb 2026 13:17:05 +0000 (15:17 +0200)] 
iio: dac: max5522: simplify probe with devm_regulator_get_enable_read_voltage()

Simplify probe by using devm_regulator_get_enable_read_voltage() to
get, enable and read the regulator voltage in a single call, caching
the value at probe time.

The reference voltage for this DAC is a fixed hardware configuration
that is not expected to change at runtime, so reading it once during
probe and caching the millivolt value is sufficient.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: magnetometer: si7210: simplify probe with devm_regulator_get_enable_read_voltage()
Antoniu Miclaus [Mon, 16 Feb 2026 13:17:04 +0000 (15:17 +0200)] 
iio: magnetometer: si7210: simplify probe with devm_regulator_get_enable_read_voltage()

Simplify probe by using devm_regulator_get_enable_read_voltage() to
get, enable and read the regulator voltage in a single call, caching
the value at probe time.

This is a functional change as VDD voltage is now read once at probe
rather than dynamically on each temperature measurement. However, in
real deployments it is very rare for VDD to change after initial probe.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7192: Revert "properly check spi_get_device_match_data()"
Andy Shevchenko [Tue, 17 Feb 2026 08:05:14 +0000 (09:05 +0100)] 
iio: adc: ad7192: Revert "properly check spi_get_device_match_data()"

This reverts commit b7f99fa1b64af2f696b13cec581cb4cd7d3982b8.

The added code is currently a dead code. Moreover, the driver is not
designed to have any defaults effectively making driver data a mandatory
information to work with. Taking all together, revert unneeded change.

Discussion at #1 concluded in agreeing a new policy on this for IIO.

Link: https://lore.kernel.org/linux-iio/20260217080514.1288115-1-andriy.shevchenko@linux.intel.com/
Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: sca3000: simplify with spi_get_device_match_data()
Harshit Mogalapalli [Mon, 16 Feb 2026 10:24:48 +0000 (02:24 -0800)] 
iio: sca3000: simplify with spi_get_device_match_data()

Refactor each sca3000 variant with it's own chip_info struct, update the
sca3000_probe() to use spi_get_device_match_data().

Suggested-by: David Lechner <dlechner@baylibre.com>
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: magnetometer: bmc150_magn: minor formatting cleanup
Neel Bullywon [Mon, 16 Feb 2026 01:54:54 +0000 (20:54 -0500)] 
iio: magnetometer: bmc150_magn: minor formatting cleanup

Improve initializer list style for bmc150_magn_samp_freq_table by
moving the opening brace to its own line and using one entry per line
with proper indentation and spaces inside braces.

Add spaces inside braces for initializer lists in the preset table
for consistency.

Fix indentation of bmc150_magn_scan_masks array. No functional changes.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: magnetometer: bmc150_magn: replace msleep with fsleep
Neel Bullywon [Mon, 16 Feb 2026 01:54:53 +0000 (20:54 -0500)] 
iio: magnetometer: bmc150_magn: replace msleep with fsleep

Replace msleep(5) with fsleep(5 * USEC_PER_MSEC) to allow the kernel
to select the most appropriate delay mechanism based on duration.
Using USEC_PER_MSEC makes the unit conversion explicit.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: light: vcnl4000: add support for Capella CM36686 and CM36672P
Erikas Bitovtas [Tue, 17 Feb 2026 12:13:16 +0000 (14:13 +0200)] 
iio: light: vcnl4000: add support for Capella CM36686 and CM36672P

Add support for Capella's CM36686 and CM36672P sensors. Capella
CM36686 is an ambient light and proximity sensor that is fully
compatible with VCNL4040 and can be used as is.
CM36672P is partially compatible with VCNL4040 - it uses the same
register fields for proximity sensing, but the ambient light registers
are reserved. For CM36672P, we reuse vcnl4040_channels, but remove the
IIO_LIGHT channel and ambient light integration time.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: light: vcnl4000: add Capella CM36686 and CM36672P
Erikas Bitovtas [Tue, 17 Feb 2026 12:13:15 +0000 (14:13 +0200)] 
dt-bindings: iio: light: vcnl4000: add Capella CM36686 and CM36672P

Capella CM36686 is an ambient light and proximity sensor developed by
Capella Microsystems, now a subsidiary of Vishay Intertechnology Inc. It
has an I2C address of 0x60 and is fully compatible with an existing
driver for VCNL4040. Capella CM36672P is a proximity-only sensor that
is partially compatible with CM36686 - they share the same register
fields for proximity sensing, but ambient light sensor register fields
in CM36672P are reserved. Add compatibles for cm36672p and cm36686,
with a fallback for cm36686 of vcnl4040.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad7380: add support for multiple SPI lanes
David Lechner [Fri, 23 Jan 2026 20:37:32 +0000 (14:37 -0600)] 
iio: adc: ad7380: add support for multiple SPI lanes

Add support for multiple SPI lanes to increase throughput. The AD7380
family of ADCs have multiple SDO lines on the chip that can be used to
read each channel on a separate SPI lane. If wired up to a SPI
controller that supports it, the driver will now take advantage of this
feature. This allows reaching the maximum sample rate advertised in the
datasheet when combined with SPI offloading.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: adc: adi,ad7380: add spi-rx-bus-width property
David Lechner [Fri, 23 Jan 2026 20:37:31 +0000 (14:37 -0600)] 
dt-bindings: iio: adc: adi,ad7380: add spi-rx-bus-width property

Add spi-rx-bus-width property to describe how many SDO lines are wired
up on the ADC. These chips are simultaneous sampling ADCs and have one
SDO line per channel, either 2 or 4 total depending on the part number.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad4062: Add missing IS_ERR() check
Ethan Tidmore [Sat, 14 Feb 2026 00:53:32 +0000 (18:53 -0600)] 
iio: adc: ad4062: Add missing IS_ERR() check

In the function ad4062_sizeof_storagebits() iio_get_current_scan_type()
is called which can return an error pointer and is not checked for it.
Also the function ad4062_sizeof_storagebits() returns type size_t but,
is only used once and the variable assigned from it is type u8.

Add check for error pointer in ad4062_sizeof_storagebits() and change
return type to int so the error code can be properly propagated and then
checked.

Fixes: 23cc92280302d ("iio: adc: ad4062: Add IIO Trigger support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202512280539.AholFF7m-lkp@intel.com/
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Jorge Marques <jorge.marques@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: frequency: adf4350: Return -ENOMEM on memory allocation failure
Antoniu Miclaus [Wed, 11 Feb 2026 17:10:06 +0000 (19:10 +0200)] 
iio: frequency: adf4350: Return -ENOMEM on memory allocation failure

adf4350_parse_dt() returns NULL only when devm_kzalloc() fails. The
caller should return -ENOMEM in this case, not -EINVAL.

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: pac1934: Return -ENOMEM on memory allocation failure
Antoniu Miclaus [Wed, 11 Feb 2026 17:10:05 +0000 (19:10 +0200)] 
iio: adc: pac1934: Return -ENOMEM on memory allocation failure

devm_kzalloc() returns NULL on allocation failure. The appropriate error
code for this condition is -ENOMEM, not -EINVAL.

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: proximity: hx9023s: support firmware-name property
Yasin Lee [Fri, 13 Feb 2026 15:14:46 +0000 (23:14 +0800)] 
iio: proximity: hx9023s: support firmware-name property

Add an optional firmware-name property to specify the firmware file.
If not provided, the driver falls back to the default firmware name.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agodt-bindings: iio: proximity: hx9023s: support firmware-name property
Yasin Lee [Fri, 13 Feb 2026 15:14:45 +0000 (23:14 +0800)] 
dt-bindings: iio: proximity: hx9023s: support firmware-name property

The hx9023s requires a firmware blob containing board-specific
configuration data used to initialize its internal sensing engine.

Although the silicon is identical across platforms, different products
may use different electrode layouts, PCB routing, cover materials and
mechanical stack-ups. These physical differences require distinct
calibration parameters and register configuration tables in order for
the sensor to operate correctly.

The driver has always required firmware and historically assumed a
single default firmware file name suitable for the reference design.
However, this assumption does not hold for boards with different
physical sensor layouts.

The default firmware file name remains unchanged and continues to be
used for existing platforms. Allowing the firmware file name to be
specified via device tree enables selecting the appropriate
hardware-specific configuration when the board design differs.

This property does not change the existing ABI and is optional.

Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad9467: check for backend capabilities
Tomas Melin [Tue, 10 Feb 2026 10:53:39 +0000 (10:53 +0000)] 
iio: adc: ad9467: check for backend capabilities

Add capability checks for operation with backends that do not necessarily
support full set of features, but are otherwise compatible with the device.
This ensures a fully functional device, but with limited capabilities.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: ad9467: simplify device pointer in probe
Tomas Melin [Tue, 10 Feb 2026 10:53:38 +0000 (10:53 +0000)] 
iio: adc: ad9467: simplify device pointer in probe

Create alias for the device pointer to simplify referencing
and keeping syntax and column width shorter.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: sd_adc_modulator: define supported iio-backend capabilities
Tomas Melin [Tue, 10 Feb 2026 10:53:37 +0000 (10:53 +0000)] 
iio: adc: sd_adc_modulator: define supported iio-backend capabilities

This backend supports the added CAP_ENABLE capability.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: dac: adi-axi-dac: define supported iio-backend capabilities
Tomas Melin [Tue, 10 Feb 2026 10:53:36 +0000 (10:53 +0000)] 
iio: dac: adi-axi-dac: define supported iio-backend capabilities

Backends support the buffer/enable capabilities so advertise it
while registering in case a frontend makes checks for it.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: adc: adi-axi-adc: define supported iio-backend capabilities
Tomas Melin [Tue, 10 Feb 2026 10:53:35 +0000 (10:53 +0000)] 
iio: adc: adi-axi-adc: define supported iio-backend capabilities

axi-adc and axi-ad485x backend variants provide calibration support,
whereas the axi-ad408x does not. Set accordingly.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoiio: industrialio-backend: support backend capabilities
Tomas Melin [Tue, 10 Feb 2026 10:53:34 +0000 (10:53 +0000)] 
iio: industrialio-backend: support backend capabilities

Not all backends support the full set of capabilities provided by the
industrialio-backend framework. Capability bits can be used in frontends
and backends for checking for a certain feature set, or if using
related functions can be expected to fail.

Capability bits should be set by a compatible backend and provided when
registering the backend.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 months agoLinux 7.0-rc1 v7.0-rc1
Linus Torvalds [Sun, 22 Feb 2026 21:18:59 +0000 (13:18 -0800)] 
Linux 7.0-rc1

3 months agoMerge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux
Linus Torvalds [Sun, 22 Feb 2026 21:12:04 +0000 (13:12 -0800)] 
Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux

Pull fsverity fixes from Eric Biggers:

 - Fix a build error on parisc

 - Remove the non-large-folio-aware function fsverity_verify_page()

* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux:
  fsverity: fix build error by adding fsverity_readahead() stub
  fsverity: remove fsverity_verify_page()
  f2fs: make f2fs_verify_cluster() partially large-folio-aware
  f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster()

3 months agoMerge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 22 Feb 2026 21:09:33 +0000 (13:09 -0800)] 
Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux

Pull crypto library fix from Eric Biggers:
 "Fix a big endian specific issue in the PPC64-optimized AES code"

* tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux:
  lib/crypto: powerpc/aes: Fix rndkey_from_vsx() on big endian CPUs

3 months agoCREDITS: Add -next to Stephen Rothwell's entry
Mark Brown [Tue, 17 Feb 2026 13:10:46 +0000 (13:10 +0000)] 
CREDITS: Add -next to Stephen Rothwell's entry

Stephen retired and stepped back from -next maintainership, update his
entry in CREDITS to recognise his 18 years of hard work making it what
it is today and all the impact it's had on our development process.

Also update to his current GnuPG key while we're here.

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agox509: select CONFIG_CRYPTO_LIB_SHA256
Arnd Bergmann [Tue, 17 Feb 2026 08:26:49 +0000 (08:26 +0000)] 
x509: select CONFIG_CRYPTO_LIB_SHA256

The x509 public key code gained a dependency on the sha256 hash
implementation, causing a rare link time failure in randconfig
builds:

  arm-linux-gnueabi-ld: crypto/asymmetric_keys/x509_public_key.o: in function `x509_get_sig_params':
  x509_public_key.c:(.text.x509_get_sig_params+0x12): undefined reference to `sha256'
  arm-linux-gnueabi-ld: (sha256): Unknown destination type (ARM/Thumb) in crypto/asymmetric_keys/x509_public_key.o
  x509_public_key.c:(.text.x509_get_sig_params+0x12): dangerous relocation: unsupported relocation

Select the necessary library code from Kconfig.

Fixes: 2c62068ac86b ("x509: Separately calculate sha256 for blacklist")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoxz: fix arm fdt compile error for kmalloc replacement
Haiyue Wang [Sun, 22 Feb 2026 12:11:00 +0000 (20:11 +0800)] 
xz: fix arm fdt compile error for kmalloc replacement

Align to the commit bf4afc53b77a ("Convert 'alloc_obj' family to use the
new default GFP_KERNEL argument") update the 'kmalloc_obj' declaration
for userspace to fix below compile error:

  In file included from arch/arm/boot/compressed/../../../../lib/decompress_unxz.c:241,
                   from arch/arm/boot/compressed/decompress.c:56:
  arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'xz_dec_init':
  arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c:787:28: error: implicit declaration of function 'kmalloc_obj'; did you mean 'kmalloc'? [-Wimplicit-function-declaration]
     787 |         struct xz_dec *s = kmalloc_obj(*s);
         |                            ^~~~~~~~~~~
         |                            kmalloc

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
Fixes: 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types")
Fixes: bf4afc53b77a ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument")
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoMerge tag 'rtc-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Linus Torvalds [Sun, 22 Feb 2026 17:43:11 +0000 (09:43 -0800)] 
Merge tag 'rtc-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:

 - loongson: Loongson-2K0300 support

 - s35390a: nvmem support

 - zynqmp: rework calibration

* tag 'rtc-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
  rtc: ds1390: fix number of bytes read from RTC
  rtc: class: Remove duplicate check for alarm
  rtc: optee: simplify OP-TEE context match
  rtc: interface: Alarm race handling should not discard preceding error
  rtc: s35390a: implement nvmem support
  rtc: loongson: Add Loongson-2K0300 support
  dt-bindings: rtc: loongson: Document Loongson-2K0300 compatible
  dt-bindings: rtc: loongson: Correct Loongson-1C interrupts property
  dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2N support
  dt-bindings: rtc: cpcap: convert to schema
  rtc: zynqmp: use dynamic max and min offset ranges
  rtc: zynqmp: rework set_offset
  rtc: zynqmp: rework read_offset
  rtc: zynqmp: check calibration max value
  rtc: zynqmp: correct frequency value
  rtc: amlogic-a4: Remove IRQF_ONESHOT
  rtc: pcf8563: use correct of_node for output clock
  rtc: max31335: use correct CONFIG symbol in IS_REACHABLE()
  rtc: nvvrs: Add ARCH_TEGRA to the NV VRS RTC driver

3 months agoMerge tag 'rust-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda...
Linus Torvalds [Sun, 22 Feb 2026 16:43:31 +0000 (08:43 -0800)] 
Merge tag 'rust-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux

Pull rust fixes from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Pass '-Zunstable-options' flag required by the future Rust 1.95.0

   - Fix 'objtool' warning for Rust 1.84.0

  'kernel' crate:

   - 'irq' module: add missing bound detected by the future Rust 1.95.0

   - 'list' module: add missing 'unsafe' blocks and placeholder safety
     comments to macros (an issue for future callers within the crate)

  'pin-init' crate:

   - Clean Clippy warning that changed behavior in the future Rust
     1.95.0"

* tag 'rust-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
  rust: list: Add unsafe blocks for container_of and safety comments
  rust: pin-init: replace clippy `expect` with `allow`
  rust: irq: add `'static` bounds to irq callbacks
  objtool/rust: add one more `noreturn` Rust function
  rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0

3 months agoMerge tag 'trace-rv-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sun, 22 Feb 2026 16:40:13 +0000 (08:40 -0800)] 
Merge tag 'trace-rv-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull runtime verifier fix from Steven Rostedt:

 - Fix multiple definition of __pcpu_unique_da_mon_this

   After refactoring monitors, we used static per-cpu variables with the
   same names across different per-cpu monitors. This is explicitly
   disallowed for modules on some architectures (alpha) or if
   CONFIG_DEBUG_FORCE_WEAK_PER_CPU is enabled (e.g. Fedora's debug
   kernel). Make sure all those variables have different names to avoid
   compilation issues.

* tag 'trace-rv-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  rv: Fix multiple definition of __pcpu_unique_da_mon_this

3 months agoConvert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Kees Cook [Sun, 22 Feb 2026 07:46:04 +0000 (23:46 -0800)] 
Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses

Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
      kzalloc_obj,kzalloc_objs,kzalloc_flex,
    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

   ALLOC(...
  - , GFP_KERNEL
   )

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoConvert more 'alloc_obj' cases to default GFP_KERNEL arguments
Linus Torvalds [Sun, 22 Feb 2026 04:03:00 +0000 (20:03 -0800)] 
Convert more 'alloc_obj' cases to default GFP_KERNEL arguments

This converts some of the visually simpler cases that have been split
over multiple lines.  I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.

Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script.  I probably had made it a bit _too_ trivial.

So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.

The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoConvert 'alloc_flex' family to use the new default GFP_KERNEL argument
Linus Torvalds [Sun, 22 Feb 2026 01:06:51 +0000 (17:06 -0800)] 
Convert 'alloc_flex' family to use the new default GFP_KERNEL argument

This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoConvert 'alloc_obj' family to use the new default GFP_KERNEL argument
Linus Torvalds [Sun, 22 Feb 2026 00:37:42 +0000 (16:37 -0800)] 
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument

This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoadd default_gfp() helper macro and use it in the new *alloc_obj() helpers
Linus Torvalds [Sun, 22 Feb 2026 00:14:11 +0000 (16:14 -0800)] 
add default_gfp() helper macro and use it in the new *alloc_obj() helpers

Most simple allocations use GFP_KERNEL, and with the new allocation
helpers being introduced, let's just take advantage of that to simplify
that default case.

It's a numbers game:

    git grep 'alloc_obj(' |
sed 's/.*\(GFP_[_A-Z]*\).*/\1/' |
sort | uniq -c | sort -n | tail

shows that about 90% of all those new allocator instances just use that
standard GFP_KERNEL.

Those helpers are already macros, and we can easily just make it be the
default case when the gfp argument is missing.

And yes, we could do that for all the legacy interfaces too, but let's
keep it to just the new ones at least for now, since those all got
converted recently anyway, so this is not any "extra" noise outside of
that limited conversion.

And, in fact, I want to do this before doing the -rc1 release, exactly
so that we don't get extra merge conflicts.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoslab.h: disable completely broken overflow handling in flex allocations
Linus Torvalds [Sat, 21 Feb 2026 23:12:09 +0000 (15:12 -0800)] 
slab.h: disable completely broken overflow handling in flex allocations

Commit 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for
non-scalar types") started using the new allocation helpers, and in the
process showed that they were completely non-working.

The overflow logic in overflows_flex_counter_type() is completely the
wrong way around, and that broke __alloc_flex() completely.  By chance,
the resulting code was then such a mess that clang generated
sufficiently garbage code that objtool warned about it all.  Which made
it somewhat quicker to narrow things down.

While fixing overflows_flex_counter_type() would presumably fix this
all, I'm excising the whole broken overflow logic from __alloc_flex(),
because we don't want that kind of code in basic allocation functions
anyway.

That (no longer) broken overflows_flex_counter_type() thing needs to be
inserted into the actual __set_flex_counter() logic in the unlikely case
that we ever want this at all.  And made conditional.

Fixes: 81cee9166a90 ("compiler_types: Introduce __flex_counter() and family")
Fixes: 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types")
Cc: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/all/CAHk-=whEd020BYzGTzYrENjD9Z5_82xx6h8HsQvH5xDSnv0=Hw@mail.gmail.com/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 months agoMerge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kerne...
Linus Torvalds [Sat, 21 Feb 2026 19:02:58 +0000 (11:02 -0800)] 
Merge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull kmalloc_obj conversion from Kees Cook:
 "This does the tree-wide conversion to kmalloc_obj() and friends using
  coccinelle, with a subsequent small manual cleanup of whitespace
  alignment that coccinelle does not handle.

  This uncovered a clang bug in __builtin_counted_by_ref(), so the
  conversion is preceded by disabling that for current versions of
  clang.  The imminent clang 22.1 release has the fix.

  I've done allmodconfig build tests for x86_64, arm64, i386, and arm. I
  did defconfig builds for alpha, m68k, mips, parisc, powerpc, riscv,
  s390, sparc, sh, arc, csky, xtensa, hexagon, and openrisc"

* tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  kmalloc_obj: Clean up after treewide replacements
  treewide: Replace kmalloc with kmalloc_obj for non-scalar types
  compiler_types: Disable __builtin_counted_by_ref for Clang

3 months agoMerge tag 'perf-tools-for-v7.0-1-2026-02-21' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sat, 21 Feb 2026 18:51:08 +0000 (10:51 -0800)] 
Merge tag 'perf-tools-for-v7.0-1-2026-02-21' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools

Pull perf tools updates from Arnaldo Carvalho de Melo:

 - Introduce 'perf sched stats' tool with record/report/diff workflows
   using schedstat counters

 - Add a faster libdw based addr2line implementation and allow selecting
   it or its alternatives via 'perf config addr2line.style='

 - Data-type profiling fixes and improvements including the ability to
   select fields using 'perf report''s -F/-fields, e.g.:

     'perf report --fields overhead,type'

 - Add 'perf test' regression tests for Data-type profiling with C and
   Rust workloads

 - Fix srcline printing with inlines in callchains, make sure this has
   coverage in 'perf test'

 - Fix printing of leaf IP in LBR callchains

 - Fix display of metrics without sufficient permission in 'perf stat'

 - Print all machines in 'perf kvm report -vvv', not just the host

 - Switch from SHA-1 to BLAKE2s for build ID generation, remove SHA-1
   code

 - Fix 'perf report's histogram entry collapsing with '-F' option

 - Use system's cacheline size instead of a hardcoded value in 'perf
   report'

 - Allow filtering conversion by time range in 'perf data'

 - Cover conversion to CTF using 'perf data' in 'perf test'

 - Address newer glibc const-correctness (-Werror=discarded-qualifiers)
   issues

 - Fixes and improvements for ARM's CoreSight support, simplify ARM SPE
   event config in 'perf mem', update docs for 'perf c2c' including the
   ARM events it can be used with

 - Build support for generating metrics from arch specific python
   script, add extra AMD, Intel, ARM64 metrics using it

 - Add AMD Zen 6 events and metrics

 - Add JSON file with OpenHW Risc-V CVA6 hardware counters

 - Add 'perf kvm' stats live testing

 - Add more 'perf stat' tests to 'perf test'

 - Fix segfault in `perf lock contention -b/--use-bpf`

 - Fix various 'perf test' cases for s390

 - Build system cleanups, bump minimum shellcheck version to 0.7.2

 - Support building the capstone based annotation routines as a plugin

 - Allow passing extra Clang flags via EXTRA_BPF_FLAGS

* tag 'perf-tools-for-v7.0-1-2026-02-21' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (255 commits)
  perf test script: Add python script testing support
  perf test script: Add perl script testing support
  perf script: Allow the generated script to be a path
  perf test: perf data --to-ctf testing
  perf test: Test pipe mode with data conversion --to-json
  perf json: Pipe mode --to-ctf support
  perf json: Pipe mode --to-json support
  perf check: Add libbabeltrace to the listed features
  perf build: Allow passing extra Clang flags via EXTRA_BPF_FLAGS
  perf test data_type_profiling.sh: Skip just the Rust tests if code_with_type workload is missing
  tools build: Fix feature test for rust compiler
  perf libunwind: Fix calls to thread__e_machine()
  perf stat: Add no-affinity flag
  perf evlist: Reduce affinity use and move into iterator, fix no affinity
  perf evlist: Missing TPEBS close in evlist__close()
  perf evlist: Special map propagation for tool events that read on 1 CPU
  perf stat-shadow: In prepare_metric fix guard on reading NULL perf_stat_evsel
  Revert "perf tool_pmu: More accurately set the cpus for tool events"
  tools build: Emit dependencies file for test-rust.bin
  tools build: Make test-rust.bin be removed by the 'clean' target
  ...