1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 01:20:14 +00:00

1396724 Commits

Author SHA1 Message Date
Antoniu Miclaus
d34ad64672 iio: adc: ad4080: add support for AD4081
Add support for AD4081 20-bit SAR ADC. The AD4081 has the same
resolution as AD4080 (20-bit) but differs in LVDS CNV clock count
maximum (2 vs 7).

Changes:
- Add AD4081_CHIP_ID definition (0x0051)
- Create ad4081_channel with 20-bit resolution and 32-bit storage
- Add ad4081_chip_info with lvds_cnv_clk_cnt_max = 2
- Register AD4081 in device ID and OF match tables

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>
2025-10-19 11:59:22 +01:00
Antoniu Miclaus
83185903b4 dt-bindings: iio: adc: adi,ad4080: add support for AD4081
Add device tree binding support for the AD4081 20-bit SAR ADC.
Add adi,ad4081 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4081 has a different LVDS CNV clock count maximum (2 vs 7), requiring
different driver configuration.

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>
2025-10-19 11:59:22 +01:00
Antoniu Miclaus
6c3e726573 iio: adc: ad4080: add support for AD4084
Add support for AD4084 16-bit SAR ADC. The AD4084 differs from
AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count
maximum (2 vs 7).

Changes:
- Add AD4084_CHIP_ID definition (0x0054)
- Create ad4084_channel with 16-bit resolution and storage
- Add ad4084_chip_info with appropriate configuration
- Register AD4084 in device ID and OF match tables

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>
2025-10-19 11:59:22 +01:00
Antoniu Miclaus
1b86053ba6 dt-bindings: iio: adc: adi,ad4080: add support for AD4084
Add device tree binding support for the AD4084 16-bit SAR ADC.
Add adi,ad4084 to the compatible enum.

A fallback compatible string to adi,ad4080 is not appropriate as the
AD4084 has different resolution (16-bit vs 20-bit) and LVDS CNV clock
count maximum (2 vs 7), requiring different driver configuration.

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>
2025-10-19 11:59:22 +01:00
Antoniu Miclaus
69ca4df349 iio: adc: ad4080: prepare driver for multi-part support
Refactor the ad4080 driver to support multiple ADC variants with
different resolution bits and LVDS CNV clock count maximums.

Changes:
- Add lvds_cnv_clk_cnt_max field to chip_info structure
- Create AD4080_CHANNEL_DEFINE macro for variable resolution/storage bits
- Make LVDS CNV clock count configurable per chip variant
- Use chip_info->product_id for chip identification comparison

This prepares the infrastructure for adding support for additional
ADC parts with different specifications while maintaining backward
compatibility with existing AD4080 functionality.

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>
2025-10-19 11:59:21 +01:00
Antoniu Miclaus
b66cddc8be iio: adc: ad4080: fix chip identification
Fix AD4080 chip identification by using the correct 16-bit product ID
(0x0050) instead of GENMASK(2, 0). Update the chip reading logic to
use regmap_bulk_read to read both PRODUCT_ID_L and PRODUCT_ID_H
registers and combine them into a 16-bit value.

The original implementation was incorrectly reading only 3 bits,
which would not correctly identify the AD4080 chip.

Fixes: 6b31ba1811b6 ("iio: adc: ad4080: add driver support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
b73e812a82 MAINTAINERS: add entry for inv_icm45600 6-axis imu sensor
Add MAINTAINERS entry for InvenSense ICM-45600 IMU device.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
1bef24e900 iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver
Add I3C driver for InvenSense ICM-45600 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
b27492d50d iio: imu: inv_icm45600: add SPI driver for inv_icm45600 driver
Add SPI driver for InvenSense ICM-456000 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
d4684c4363 iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver
Add I2C driver for InvenSense ICM-456000 devices.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
1fad7b491b iio: imu: inv_icm45600: add IMU IIO accelerometer device
Add IIO device for accelerometer sensor
with data polling interface and FIFO parsing.
Attributes: raw, scale, sampling_frequency, calibbias.
Temperature is available as a processed channel.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
27e072bc34 iio: imu: inv_icm45600: add IMU IIO gyroscope device
Add IIO device for gyroscope sensor
with data polling interface and FIFO parsing.
Attributes: raw, scale, sampling_frequency, calibbias.
Temperature is available as a processed channel.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
06674a72cf iio: imu: inv_icm45600: add buffer support in iio devices
Add FIFO control functions.
Support hwfifo watermark by multiplexing gyro and accel settings.
Support hwfifo flush.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
7ff021a3fa iio: imu: inv_icm45600: add new inv_icm45600 driver
Core component of a new driver for InvenSense ICM-45600 devices.
It includes registers definition, main probe/setup, and device
utility functions.

ICM-456xx devices are latest generation of 6-axis IMU,
gyroscope+accelerometer and temperature sensor. This device
includes a 8K FIFO, supports I2C/I3C/SPI, and provides
intelligent motion features like pedometer, tilt detection,
and tap detection.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:21 +01:00
Remi Buisson
7d55d00185 dt-bindings: iio: imu: Add inv_icm45600
Document the ICM-45600 devices devicetree bindings.
Specific variants of the device are defined because of their
differences in terms of FSR or advanced features like eDMP.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Eddie James
95f934b2dd dt-bindings: iio: Add Infineon DPS310 sensor documentation
The DPS310 is a barometric pressure and temperature sensor with
an I2C interface. Remove it from trivial-devices.yaml and add its
own documentation to allow for consumers of this device such as
the iio/hwmon bridge.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
efbce18231 iio: accel: bma220: add maintainer
Add maintainer for this driver.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
c3ee72998b iio: accel: bma220: add debugfs reg access
Allow read/write access to sensor registers for use in unit-tests.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
59a212d3c3 iio: accel: bma220: add LPF cut-off frequency mapping
Add mapping for the low pass filter cut-off frequency.
Make valid values visible for both the cut-off frequency and the scale.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
b7e17ca107 iio: accel: bma220: add interrupt trigger
Add interrupt trigger.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
3499375209 iio: accel: bma220: add i2c watchdog feature
Sometimes the sensor gets stuck and enters a condition in which it pulls
SDA low, thus making the entire i2c bus unusable.
This problem is mitigated by activating a 1ms watchdog implemented in
the sensor.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
7a23e6d922 iio: accel: bma220: add i2c module
Add the bma220_i2c module.

Note that this kernel module transparently shifts all register addresses
1 bit to the left, so all functions will operate based on the SPI memory
map.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
0e3c7fd442 iio: accel: bma220: use find_match_table fct
Clean up the code a bit by using a find_match_table function.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:20 +01:00
Petre Rodan
480f08a689 iio: accel: bma220: populate buffer ts in trigger handler
Populate buffer timestamps in trigger handler since not all
triggers can run the top half handler that provides
pf->timestamp.

Fixes failing unit test that triggers based on the INT signal.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
5c27f13322 iio: accel: bma220: migrate to regmap API
Switch to regmap API.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
2027b1a201 iio: accel: bma220: reset registers during init stage
Bring all configuration registers to default values during
device probe().
Remove trivial code duplication regarding bma220_power() in
_init()

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
dfea5f181c iio: accel: bma220: turn power supplies on
Add devm_regulator_bulk_get_enable() to device probe().

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
4a719f1826 iio: accel: bma220: add open firmware table
Add open firmware entry to the spi driver.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
c785d9803b iio: accel: bma220: split original driver
In preparation for the i2c module, move the original code into multiple
source files without any other functional change.

Create the additional bma220_core module which currently is not
providing an abstracted bus type (this will change with the regmap
patch).
Fix a few includes in the context of this patch.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
7fe8e142f1 iio: accel: bma220: cleanup includes
Tweak includes based on requirements.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> #added linux/errno.h
2025-10-19 11:59:19 +01:00
Petre Rodan
a9865410f4 iio: accel: bma220: move bma220_power function
Move bma220_power() before bma220_init() as a precursor to a
patch that removes code duplication.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
5dbac275dc iio: accel: bma220: shorten spi->dev calls
Provide functions easier access to device struct.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
b4cecec7dc iio: accel: bma220: cleanup license string
Fix checkpatch warning about use of "GPL v2" license:

Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db
("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity")

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:19 +01:00
Petre Rodan
f3f42da588 iio: accel: bma220: relax constraints during probe()
Do not return error if the chip id being read is not the expected one.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Petre Rodan
679bf18ec0 iio: accel: bma220: remove incorrect kernel-doc marking
Remove incorrect use of kernel-doc marking.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Taimoor Zaeem
9cc2d6566f staging: iio: ad9834: remove empty ad9834.h file
Remove drivers/staging/iio/frequency/ad9834.h header file
because it contains nothing except the include guards.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Cosmin Tanislav
fc3b97dd71 iio: adc: add RZ/T2H / RZ/N2H ADC driver
Add support for the A/D 12-Bit successive approximation converters found
in the Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.

RZ/T2H has two ADCs with 4 channels and one with 6.
RZ/N2H has two ADCs with 4 channels and one with 15.

Conversions can be performed in single or continuous mode. Result of the
conversion is stored in a 16-bit data register corresponding to each
channel.

The conversions can be started by a software trigger, a synchronous
trigger (from MTU or from ELC) or an asynchronous external trigger (from
ADTRGn# pin).

Only single mode with software trigger is supported for now.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Cosmin Tanislav
4d8d58987c dt-bindings: iio: adc: document RZ/T2H and RZ/N2H ADC
Document the A/D 12-Bit successive approximation converters found in the
Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs.

RZ/T2H has two ADCs with 4 channels and one with 6.
RZ/N2H has two ADCs with 4 channels and one with 15.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Nuno Sá
70fde04883 iio: dac: ltc2688: use the auto lock API
Make use of the cleanup API so that we can simplify some code paths.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Nuno Sá
7798b50e00 iio: resolver: ad2s1210: replace sprintf() with sysfs_emit()
Update the ad2s1210_read_label() and ad2s1210_read_event_label() functions
to use sysfs_emit() for generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Nuno Sá
dd72a3880f iio: position: hid-sensor-custom-intel-hinge: replace sprintf() with sysfs_emit()
Update the hinge_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Nuno Sá
fdc9719a63 iio: adc: qcom-spmi-rradc: replace snprintf() with sysfs_emit()
Update the rradc_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:18 +01:00
Nuno Sá
4367d24b15 iio: adc: pac1921: replace sprintf() with sysfs_emit()
Update the pac1921_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Nuno Sá
31ab988b9f iio: adc: mt6360-adc: replace snprintf() with sysfs_emit()
Update the mt6360_adc_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Nuno Sá
f24a5ef74c iio: adc: meson_saradc: replace sprintf() with sysfs_emit()
Update the read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Nuno Sá
08be56ebe9 iio: adc: mcp3564: replace sprintf() with sysfs_emit()
Update the mcp3564_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Marius Cristea <marius.cristea@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Nuno Sá
69911a64ba iio: adc: ad7768-1: replace sprintf() with sysfs_emit()
Update the ad7768_read_label() function to use sysfs_emit(() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Nuno Sá
ed1a82401b iio: adc: ad4030: replace sprintf() with sysfs_emit()
Update the ad4030_read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sal@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Sameeksha Sankpal
67f31f0b5f iio: light: ltr390: Fix typo in variable name
Corrected a spelling mistake in the ltr390 driver:
'recieve_buffer' was renamed to 'receive_buffer'.

This improves code readibility without changing functionality.

Signed-off-by: Sameeksha Sankpal <sameekshasankpal@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00
Antoni Pokusinski
1d09cf18cc iio: mpl3115: add support for sampling frequency
When the device is in ACTIVE mode the temperature and pressure measurements
are collected with a frequency determined by the ST[3:0] bits of CTRL_REG2
register.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-19 11:59:17 +01:00