]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: accel: adxl372: introduce chip_info structure
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Sat, 21 Mar 2026 10:04:56 +0000 (12:04 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 11:19:02 +0000 (11:19 +0000)
commit23d742859a2dd20b1e96ab0828fa26227c47f328
tree3fc664cd2898ec778ed9b4179dad3be35d3b3f85
parent8c7440c686091a109802a720db25224dcc21485a
iio: accel: adxl372: introduce chip_info structure

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

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

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

No functional change intended.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl372.c
drivers/iio/accel/adxl372.h
drivers/iio/accel/adxl372_i2c.c
drivers/iio/accel/adxl372_spi.c