imu: st_lsm6dsx: Add support for rotation sensor
Subsystems (95)
v6 cover imu: st_lsm6dsx: Add support for rotation sensor
This series adds support for the rotation sensor functionality present in some chips from the ST LSM6DSX IMU family.
The IIO ABI has been amended to allow the use of floating-point data and custom (driver-specific) channels in IIO buffers.
Tested on LSM6DSV16X.
Changes from v5 [5]:
- cleaned up FIFO data representation in st_lsm6dsx_read_tagged_fifo() to avoid casting (Andy, Jonathan)
- renamed 'sign' field to format in struct iio_scan_type
- added support for IEEE 754 floating-point format in buffer scan elements
- added custom data type in the ABI (IIO_CUSTOM in enum iio_chan_type) (Jonathan)
- added driver document in Documentation/iio/ (Jonathan)
Changes from v4 [4]:
- changed data parameter in st_lsm6dsx_push_tagged_data() to __le16 * (Andy)
Changes from v3 [3]:
- added patch 3 (Andy)
- removed unneeded checks for negative return values in st_lsm6dsx_fusion.c (Andy)
- replaced st_lsm6dsx_sf_set_page function with st_lsm6dsx_sf_page_enable/disable (Andy)
- used reversed xmas tree ordering for local variables (Andy)
- added parentheses to MILLI / MICRO in st_lsm6dsx_sf_write_raw (Andy)
- added check for string truncation in st_lsm6dsx_sf_probe (Andy)
Changes from v2 [2]:
- amended description of patch 2 to point out that there are no supported gyro events (Jonathan)
- removed superfluous parentheses in st_lsm6dsx_fifo_setup (Lorenzo)
- added Lorenzo's acked-by tag to patch 3
- added missing checks of st_lsm6dsx_sf_set_page() return value (Jonathan)
- added comment in st_lsm6dsx_sf_write_raw (Jonathan)
Changes from v1 [1]:
- swapped patches 1 and 2 (Jonathan)
- miscellaneous stylistic changes (Andy)
- fixed usage of MICRO and MILLI constants in st_lsm6dsx_sf_read_raw and st_lsm6dsx_sf_write_raw (Andy)
- replaced scnprintf() with sysfs_emit_at() in st_lsm6dsx_sf_sampling_freq_avail (Andy)
- replaced scnprintf() with snprintf() in st_lsm6dsx_sf_probe (Andy)
- clarified in a comment in st_lsm6dsx_set_fifo_odr() that only internal sensors have a FIFO ODR configuration register (Jonathan)
- modified patch 3 description to explain justification for the extra IIO device (Jonathan)
- moved page lock from st_lsm6dsx_sf_set_page() to the callers (Jonathan)
- s/magnetometer/gyroscope/ in patch 2 description
[1] https://lore.kernel.org/linux-iio/[email protected]/T/
[2] https://lore.kernel.org/linux-iio/[email protected]/T/
[3] https://lore.kernel.org/linux-iio/[email protected]/T/
[4] https://lore.kernel.org/linux-iio/[email protected]/T/
[5] https://lore.kernel.org/linux-iio/[email protected]/T/
Francesco Lavra (7):
iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope
only
iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer
only
iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
iio: Rename 'sign' field to format in struct iio_scan_type
iio: ABI: Add support for floating-point numbers in buffer scan
elements
iio: ABI: Add custom data type
iio: imu: st_lsm6dsx: Add support for rotation sensor
Documentation/ABI/testing/sysfs-bus-iio | 52 ++-- Documentation/driver-api/iio/buffers.rst | 9 +- Documentation/iio/iio_devbuf.rst | 3 +- drivers/iio/accel/adxl313_core.c | 2 +- drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl355_core.c | 4 +- drivers/iio/accel/adxl367.c | 4 +- drivers/iio/accel/adxl372.c | 2 +- drivers/iio/accel/adxl380.c | 4 +- drivers/iio/accel/bma180.c | 10 +- drivers/iio/accel/bma220_core.c | 2 +- drivers/iio/accel/bma400_core.c | 4 +- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/cros_ec_accel_legacy.c | 2 +- drivers/iio/accel/fxls8962af-core.c | 4 +- drivers/iio/accel/hid-sensor-accel-3d.c | 2 +- drivers/iio/accel/kionix-kx022a.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 2 +- drivers/iio/accel/kxsd9.c | 4 +- drivers/iio/accel/mma7455_core.c | 2 +- drivers/iio/accel/mma8452.c | 4 +- drivers/iio/accel/msa311.c | 2 +- drivers/iio/accel/mxc4005.c | 2 +- drivers/iio/accel/sca3000.c | 4 +- drivers/iio/accel/sca3300.c | 6 +- drivers/iio/accel/stk8312.c | 2 +- drivers/iio/accel/stk8ba50.c | 2 +- drivers/iio/adc/ad4000.c | 8 +- drivers/iio/adc/ad4030.c | 10 +- drivers/iio/adc/ad4062.c | 8 +- drivers/iio/adc/ad4080.c | 2 +- drivers/iio/adc/ad4130.c | 2 +- drivers/iio/adc/ad4170-4.c | 12 +- drivers/iio/adc/ad4695.c | 24 +- drivers/iio/adc/ad4851.c | 12 +- drivers/iio/adc/ad7124.c | 4 +- drivers/iio/adc/ad7173.c | 6 +- drivers/iio/adc/ad7191.c | 6 +- drivers/iio/adc/ad7192.c | 2 +- drivers/iio/adc/ad7266.c | 6 +- drivers/iio/adc/ad7280a.c | 4 +- drivers/iio/adc/ad7298.c | 4 +- drivers/iio/adc/ad7380.c | 44 ++-- drivers/iio/adc/ad7405.c | 2 +- drivers/iio/adc/ad7476.c | 2 +- drivers/iio/adc/ad7606.c | 14 +- drivers/iio/adc/ad7625.c | 2 +- drivers/iio/adc/ad7766.c | 2 +- drivers/iio/adc/ad7768-1.c | 8 +- drivers/iio/adc/ad7779.c | 2 +- drivers/iio/adc/ad7780.c | 2 +- drivers/iio/adc/ad7791.c | 2 +- drivers/iio/adc/ad7793.c | 2 +- drivers/iio/adc/ad7887.c | 2 +- drivers/iio/adc/ad7923.c | 2 +- drivers/iio/adc/ad7944.c | 8 +- drivers/iio/adc/ad799x.c | 2 +- drivers/iio/adc/ad9467.c | 4 +- drivers/iio/adc/ade9000.c | 4 +- drivers/iio/adc/at91-sama5d2_adc.c | 10 +- drivers/iio/adc/at91_adc.c | 4 +- drivers/iio/adc/cc10001_adc.c | 4 +- drivers/iio/adc/cpcap-adc.c | 2 +- drivers/iio/adc/dln2-adc.c | 4 +- drivers/iio/adc/hx711.c | 4 +- drivers/iio/adc/ina2xx-adc.c | 8 +- drivers/iio/adc/ingenic-adc.c | 12 +- drivers/iio/adc/max1027.c | 4 +- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max11205.c | 2 +- drivers/iio/adc/max11410.c | 2 +- drivers/iio/adc/max1363.c | 4 +- drivers/iio/adc/mcp3911.c | 2 +- drivers/iio/adc/mt6359-auxadc.c | 2 +- drivers/iio/adc/mt6360-adc.c | 2 +- drivers/iio/adc/mxs-lradc-adc.c | 6 +- drivers/iio/adc/nxp-sar-adc.c | 2 +- drivers/iio/adc/pac1921.c | 8 +- drivers/iio/adc/pac1934.c | 32 +-- drivers/iio/adc/rockchip_saradc.c | 2 +- drivers/iio/adc/rtq6056.c | 16 +- drivers/iio/adc/sd_adc_modulator.c | 2 +- drivers/iio/adc/stm32-adc.c | 4 +- drivers/iio/adc/stm32-dfsdm-adc.c | 2 +- drivers/iio/adc/ti-adc081c.c | 2 +- drivers/iio/adc/ti-adc0832.c | 4 +- drivers/iio/adc/ti-adc084s021.c | 2 +- drivers/iio/adc/ti-adc108s102.c | 2 +- drivers/iio/adc/ti-adc12138.c | 4 +- drivers/iio/adc/ti-adc161s626.c | 4 +- drivers/iio/adc/ti-ads1015.c | 4 +- drivers/iio/adc/ti-ads1018.c | 6 +- drivers/iio/adc/ti-ads1100.c | 2 +- drivers/iio/adc/ti-ads1119.c | 2 +- drivers/iio/adc/ti-ads124s08.c | 2 +- drivers/iio/adc/ti-ads1298.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-ads7950.c | 2 +- drivers/iio/adc/ti-ads8688.c | 2 +- drivers/iio/adc/ti-lmp92064.c | 4 +- drivers/iio/adc/ti-tlc4541.c | 2 +- drivers/iio/adc/ti-tsc2046.c | 2 +- drivers/iio/adc/ti_am335x_adc.c | 2 +- drivers/iio/adc/vf610_adc.c | 4 +- drivers/iio/adc/xilinx-ams.c | 2 +- drivers/iio/adc/xilinx-xadc-core.c | 10 +- drivers/iio/addac/ad74115.c | 2 +- drivers/iio/addac/ad74413r.c | 2 +- drivers/iio/chemical/atlas-ezo-sensor.c | 4 +- drivers/iio/chemical/atlas-sensor.c | 12 +- drivers/iio/chemical/bme680_core.c | 8 +- drivers/iio/chemical/ccs811.c | 4 +- drivers/iio/chemical/ens160_core.c | 4 +- drivers/iio/chemical/pms7003.c | 2 +- drivers/iio/chemical/scd30_core.c | 2 +- drivers/iio/chemical/scd4x.c | 6 +- drivers/iio/chemical/sps30.c | 2 +- .../common/cros_ec_sensors/cros_ec_activity.c | 2 +- .../cros_ec_sensors/cros_ec_lid_angle.c | 2 +- .../common/cros_ec_sensors/cros_ec_sensors.c | 4 +- drivers/iio/common/scmi_sensors/scmi_iio.c | 4 +- .../iio/common/ssp_sensors/ssp_iio_sensor.h | 4 +- drivers/iio/dac/ad3552r-hs.c | 2 +- drivers/iio/dac/ad3552r.c | 2 +- drivers/iio/dac/ad5064.c | 2 +- drivers/iio/dac/ad5360.c | 2 +- drivers/iio/dac/ad5380.c | 2 +- drivers/iio/dac/ad5421.c | 2 +- drivers/iio/dac/ad5446.h | 2 +- drivers/iio/dac/ad5449.c | 2 +- drivers/iio/dac/ad5504.c | 2 +- drivers/iio/dac/ad5592r-base.c | 2 +- drivers/iio/dac/ad5624r_spi.c | 2 +- drivers/iio/dac/ad5686.c | 2 +- drivers/iio/dac/ad5755.c | 2 +- drivers/iio/dac/ad5761.c | 2 +- drivers/iio/dac/ad5764.c | 2 +- drivers/iio/dac/ad5766.c | 2 +- drivers/iio/dac/ad5791.c | 4 +- drivers/iio/dac/ad7303.c | 2 +- drivers/iio/dac/ad8460.c | 2 +- drivers/iio/dac/ad9739a.c | 2 +- drivers/iio/dac/ltc1660.c | 2 +- drivers/iio/dac/max5522.c | 2 +- drivers/iio/dac/mcp4922.c | 2 +- drivers/iio/dac/stm32-dac.c | 2 +- drivers/iio/dummy/iio_simple_dummy.c | 8 +- drivers/iio/gyro/adis16136.c | 4 +- drivers/iio/gyro/adxrs290.c | 4 +- drivers/iio/gyro/bmg160_core.c | 2 +- drivers/iio/gyro/fxas21002c_core.c | 2 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 2 +- drivers/iio/gyro/itg3200_core.c | 2 +- drivers/iio/gyro/mpu3050-core.c | 4 +- drivers/iio/health/afe440x.h | 2 +- drivers/iio/health/max30100.c | 4 +- drivers/iio/health/max30102.c | 2 +- drivers/iio/humidity/am2315.c | 4 +- drivers/iio/humidity/hdc100x.c | 4 +- drivers/iio/humidity/hid-sensor-humidity.c | 2 +- drivers/iio/humidity/hts221_core.c | 4 +- drivers/iio/imu/adis.c | 2 +- drivers/iio/imu/adis16400.c | 16 +- drivers/iio/imu/adis16460.c | 4 +- drivers/iio/imu/adis16475.c | 6 +- drivers/iio/imu/adis16480.c | 6 +- drivers/iio/imu/adis16550.c | 6 +- drivers/iio/imu/bmi160/bmi160_core.c | 2 +- drivers/iio/imu/bmi270/bmi270_core.c | 4 +- drivers/iio/imu/bmi323/bmi323_core.c | 4 +- drivers/iio/imu/bno055/bno055.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_temp.h | 2 +- drivers/iio/imu/inv_icm45600/inv_icm45600.h | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_accel.c | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_gyro.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 +- drivers/iio/imu/kmx61.c | 4 +- drivers/iio/imu/smi240.c | 4 +- drivers/iio/imu/smi330/smi330_core.c | 6 +- drivers/iio/imu/st_lsm6dsx/Makefile | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 30 ++- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 45 +++- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 58 +++++ .../iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 235 ++++++++++++++++++ drivers/iio/industrialio-buffer.c | 4 +- drivers/iio/industrialio-core.c | 1 + drivers/iio/light/acpi-als.c | 2 +- drivers/iio/light/adjd_s311.c | 2 +- drivers/iio/light/apds9960.c | 2 +- drivers/iio/light/as73211.c | 6 +- drivers/iio/light/bh1745.c | 2 +- drivers/iio/light/cros_ec_light_prox.c | 4 +- drivers/iio/light/gp2ap020a00f.c | 6 +- drivers/iio/light/hid-sensor-als.c | 2 +- drivers/iio/light/hid-sensor-prox.c | 2 +- drivers/iio/light/isl29125.c | 2 +- drivers/iio/light/ltr501.c | 4 +- drivers/iio/light/max44000.c | 4 +- drivers/iio/light/opt4060.c | 4 +- drivers/iio/light/rohm-bu27034.c | 4 +- drivers/iio/light/rpr0521.c | 6 +- drivers/iio/light/si1145.c | 2 +- drivers/iio/light/st_uvis25_core.c | 2 +- drivers/iio/light/tcs3414.c | 2 +- drivers/iio/light/tcs3472.c | 2 +- drivers/iio/light/vcnl4000.c | 2 +- drivers/iio/light/vcnl4035.c | 4 +- drivers/iio/light/veml6030.c | 8 +- drivers/iio/light/veml6046x00.c | 8 +- drivers/iio/light/vl6180.c | 6 +- drivers/iio/magnetometer/af8133j.c | 2 +- drivers/iio/magnetometer/ak8974.c | 2 +- drivers/iio/magnetometer/ak8975.c | 2 +- drivers/iio/magnetometer/als31300.c | 4 +- drivers/iio/magnetometer/bmc150_magn.c | 2 +- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 2 +- drivers/iio/magnetometer/hmc5843_core.c | 4 +- drivers/iio/magnetometer/mag3110.c | 4 +- drivers/iio/magnetometer/rm3100-core.c | 2 +- drivers/iio/magnetometer/tlv493d.c | 4 +- drivers/iio/magnetometer/tmag5273.c | 8 +- drivers/iio/magnetometer/yamaha-yas530.c | 4 +- drivers/iio/orientation/hid-sensor-incl-3d.c | 2 +- drivers/iio/orientation/hid-sensor-rotation.c | 2 +- .../position/hid-sensor-custom-intel-hinge.c | 6 +- drivers/iio/potentiostat/lmp91000.c | 2 +- drivers/iio/pressure/abp2030pa.c | 4 +- drivers/iio/pressure/bmp280-core.c | 18 +- drivers/iio/pressure/cros_ec_baro.c | 4 +- drivers/iio/pressure/dlhl60d.c | 4 +- drivers/iio/pressure/hid-sensor-press.c | 2 +- drivers/iio/pressure/hsc030pa.c | 4 +- drivers/iio/pressure/mpl3115.c | 4 +- drivers/iio/pressure/mprls0025pa.c | 2 +- drivers/iio/pressure/ms5611_core.c | 4 +- drivers/iio/pressure/rohm-bm1390.c | 4 +- drivers/iio/pressure/st_pressure_core.c | 12 +- drivers/iio/pressure/zpa2326.c | 4 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/hx9023s.c | 2 +- drivers/iio/proximity/irsd200.c | 2 +- drivers/iio/proximity/isl29501.c | 2 +- drivers/iio/proximity/mb1232.c | 2 +- .../iio/proximity/pulsedlight-lidar-lite-v2.c | 2 +- drivers/iio/proximity/srf08.c | 2 +- drivers/iio/proximity/sx9310.c | 2 +- drivers/iio/proximity/sx9324.c | 2 +- drivers/iio/proximity/sx9360.c | 4 +- drivers/iio/proximity/sx9500.c | 2 +- drivers/iio/proximity/vl53l0x-i2c.c | 2 +- drivers/iio/resolver/ad2s1210.c | 4 +- .../iio/temperature/hid-sensor-temperature.c | 2 +- drivers/iio/temperature/maxim_thermocouple.c | 6 +- drivers/iio/temperature/tmp006.c | 4 +- include/linux/iio/common/st_sensors.h | 2 +- include/linux/iio/iio.h | 6 +- include/linux/iio/imu/adis.h | 6 +- include/uapi/linux/iio/types.h | 1 + 260 files changed, 905 insertions(+), 545 deletions(-) create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
Signature · 1 line
2.39.5
PATCH v6 1/7 iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only
The st_lsm6dsx_set_fifo_odr() function, which is called when enabling and disabling the hardware FIFO, checks the contents of the hw->settings->batch array at index sensor->id, and then sets the current ODR value in sensor registers that depend on whether the register address is set in the above array element. This logic is valid for internal sensors only, i.e. the accelerometer and gyroscope; however, since commit c91c1c844ebd ("iio: imu:st_lsm6dsx: add i2c embedded controller support"), this function is called also when configuring the hardware FIFO for external sensors (i.e. sensors accessed through the sensor hub functionality), which can result in unrelated device registers being written.
Add a check to the beginning of st_lsm6dsx_set_fifo_odr() so that it does not touch any registers unless it is called for internal sensors.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +4 -0
@@ -225,6 +225,10 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor,const struct st_lsm6dsx_reg *batch_reg;u8 data; +/* Only internal sensors have a FIFO ODR configuration register. */ +if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) +return 0 ; + batch_reg = &hw->settings->batch[sensor->id];if (batch_reg->addr) {int val;
Signature · 1 line
2.39.5
PATCH v6 2/7 iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
The st_lsm6dsx_hwfifo_odr_store() function, which is called when userspace writes the buffer sampling frequency sysfs attribute, calls st_lsm6dsx_check_odr(), which accesses the odr_table array at index sensor->id; since this array is only 2 entries long, an access for any sensor type other than accelerometer or gyroscope is an out-of-bounds access.
The motivation for being able to set a buffer frequency different from the sensor sampling frequency is to support use cases that need accurate event detection (which requires a high sampling frequency) while retrieving sensor data at low frequency. Since all the supported event types are generated from acceleration data only, do not create the buffer sampling frequency attribute for sensor types other than the accelerometer.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +10 -1
@@ -862,12 +862,21 @@ int st_lsm6dsx_fifo_setup(struct st_lsm6dsx_hw *hw)int i, ret;for (i =0 ; i <ST_LSM6DSX_ID_MAX ; i++) { +const struct iio_dev_attr **attrs; +if (!hw->iio_devs[i])continue ; +/* +* For the accelerometer, allow setting FIFO sampling frequency +* values different from the sensor sampling frequency, which +* may be needed to keep FIFO data rate low while sampling +* acceleration data at high rates for accurate event detection. +*/ + attrs = i ==ST_LSM6DSX_ID_ACC ? st_lsm6dsx_buffer_attrs :NULL ; ret =devm_iio_kfifo_buffer_setup_ext (hw->dev, hw->iio_devs[i], &st_lsm6dsx_buffer_ops, - st_lsm6dsx_buffer_attrs); + attrs);if (ret)return ret; }
Signature · 1 line
2.39.5
PATCH v6 3/7 iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
In reply to Francesco LavraThe DRDY_MASK feature implemented in sensor chips marks gyroscope and accelerometer invalid samples (i.e. samples that have been acquired during the settling time of sensor filters) with the special values 0x7FFFh, 0x7FFE, and 0x7FFD.
The driver checks FIFO samples against these special values in order to discard invalid samples; however, it does the check regardless of the type of samples being processed, whereas this feature is specific to gyroscope and accelerometer data. This could cause valid samples to be discarded.
Fix the above check so that it takes into account the type of samples being processed. To avoid casting to __le16 * when checking sample values, clean up the type representation for data read from the FIFO.
--- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +14 -9
@@ -365,8 +365,6 @@ static inline int st_lsm6dsx_read_block(struct st_lsm6dsx_hw *hw, u8 addr,return 0 ; } -#define ST_LSM6DSX_IIO_BUFF_SIZE (ALIGN(ST_LSM6DSX_SAMPLE_SIZE, \ - sizeof(s64)) + sizeof(s64))/** * st_lsm6dsx_read_fifo() - hw FIFO read routine * @hw: Pointer to instance of struct st_lsm6dsx_hw.
@@ -539,14 +537,14 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw)#define ST_LSM6DSX_INVALID_SAMPLE 0x7ffdstatic int st_lsm6dsx_push_tagged_data (struct st_lsm6dsx_hw *hw,u8 tag, -u8 *data,s64 ts) +__le16 *data,s64 ts) { -s16 val =le16_to_cpu (*(__le16 *)data);struct st_lsm6dsx_sensor *sensor;struct iio_dev *iio_dev;/* invalid sample during bootstrap phase */ -if (val >=ST_LSM6DSX_INVALID_SAMPLE ) +if ((tag ==ST_LSM6DSX_GYRO_TAG || tag ==ST_LSM6DSX_ACC_TAG ) && + (s16 )le16_to_cpup (data) >=ST_LSM6DSX_INVALID_SAMPLE )return -EINVAL ;/*
@@ -609,7 +607,13 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)* must be passed a buffer that is aligned to 8 bytes so * as to allow insertion of a naturally aligned timestamp. */ -u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };u8 tag;bool reset_ts = false;int i, err, read_len;
@@ -648,7 +652,7 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)for (i =0 ; i < pattern_len; i +=ST_LSM6DSX_TAGGED_SAMPLE_SIZE ) { -memcpy (iio_buff, &hw->buff[i +ST_LSM6DSX_TAG_SIZE ], +memcpy (&iio_buff, &hw->buff[i +ST_LSM6DSX_TAG_SIZE ],ST_LSM6DSX_SAMPLE_SIZE ); tag = hw->buff[i] >>3 ;
@@ -659,7 +663,7 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)* B0 = ts[7:0], B1 = ts[15:8], B2 = ts[23:16], * B3 = ts[31:24] */ - ts =le32_to_cpu (*((__le32 *)iio_buff)); + ts =le32_to_cpu (iio_buff.fifo_ts);/* * check if hw timestamp engine is going to * reset (the sensor generates an interrupt
@@ -670,7 +674,8 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) reset_ts = true; ts *= hw->ts_gain; }else { -st_lsm6dsx_push_tagged_data (hw, tag, iio_buff, +st_lsm6dsx_push_tagged_data (hw, tag, + iio_buff.data, ts); } }
Signature · 1 line
2.39.5
PATCH v6 4/7 iio: Rename 'sign' field to `format` in struct iio_scan_type
In reply to Francesco LavraThis field is used to differentiate between signed and unsigned integers. A following commit will extend its use to in order to add support for non- integer scan elements; therefore, change its name from 'sign' to a more generic 'format'.
--- Documentation/driver-api/iio/buffers.rst | 4 +- drivers/iio/accel/adxl313_core.c | 2 +- drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl355_core.c | 4 +- drivers/iio/accel/adxl367.c | 4 +- drivers/iio/accel/adxl372.c | 2 +- drivers/iio/accel/adxl380.c | 4 +- drivers/iio/accel/bma180.c | 10 ++--- drivers/iio/accel/bma220_core.c | 2 +- drivers/iio/accel/bma400_core.c | 4 +- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/cros_ec_accel_legacy.c | 2 +- drivers/iio/accel/fxls8962af-core.c | 4 +- drivers/iio/accel/hid-sensor-accel-3d.c | 2 +- drivers/iio/accel/kionix-kx022a.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 2 +- drivers/iio/accel/kxsd9.c | 4 +- drivers/iio/accel/mma7455_core.c | 2 +- drivers/iio/accel/mma8452.c | 4 +- drivers/iio/accel/msa311.c | 2 +- drivers/iio/accel/mxc4005.c | 2 +- drivers/iio/accel/sca3000.c | 4 +- drivers/iio/accel/sca3300.c | 6 +-- drivers/iio/accel/stk8312.c | 2 +- drivers/iio/accel/stk8ba50.c | 2 +- drivers/iio/adc/ad4000.c | 8 ++-- drivers/iio/adc/ad4030.c | 10 ++--- drivers/iio/adc/ad4062.c | 8 ++-- drivers/iio/adc/ad4080.c | 2 +- drivers/iio/adc/ad4130.c | 2 +- drivers/iio/adc/ad4170-4.c | 12 ++--- drivers/iio/adc/ad4695.c | 24 +++++----- drivers/iio/adc/ad4851.c | 12 ++--- drivers/iio/adc/ad7124.c | 4 +- drivers/iio/adc/ad7173.c | 6 +-- drivers/iio/adc/ad7191.c | 6 +-- drivers/iio/adc/ad7192.c | 2 +- drivers/iio/adc/ad7266.c | 6 +-- drivers/iio/adc/ad7280a.c | 4 +- drivers/iio/adc/ad7298.c | 4 +- drivers/iio/adc/ad7380.c | 44 +++++++++---------- drivers/iio/adc/ad7405.c | 2 +- drivers/iio/adc/ad7476.c | 2 +- drivers/iio/adc/ad7606.c | 14 +++--- drivers/iio/adc/ad7625.c | 2 +- drivers/iio/adc/ad7766.c | 2 +- drivers/iio/adc/ad7768-1.c | 8 ++-- drivers/iio/adc/ad7779.c | 2 +- drivers/iio/adc/ad7780.c | 2 +- drivers/iio/adc/ad7791.c | 2 +- drivers/iio/adc/ad7793.c | 2 +- drivers/iio/adc/ad7887.c | 2 +- drivers/iio/adc/ad7923.c | 2 +- drivers/iio/adc/ad7944.c | 8 ++-- drivers/iio/adc/ad799x.c | 2 +- drivers/iio/adc/ad9467.c | 4 +- drivers/iio/adc/ade9000.c | 4 +- drivers/iio/adc/at91-sama5d2_adc.c | 10 ++--- drivers/iio/adc/at91_adc.c | 4 +- drivers/iio/adc/cc10001_adc.c | 4 +- drivers/iio/adc/cpcap-adc.c | 2 +- drivers/iio/adc/dln2-adc.c | 4 +- drivers/iio/adc/hx711.c | 4 +- drivers/iio/adc/ina2xx-adc.c | 8 ++-- drivers/iio/adc/ingenic-adc.c | 12 ++--- drivers/iio/adc/max1027.c | 4 +- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max11205.c | 2 +- drivers/iio/adc/max11410.c | 2 +- drivers/iio/adc/max1363.c | 4 +- drivers/iio/adc/mcp3911.c | 2 +- drivers/iio/adc/mt6359-auxadc.c | 2 +- drivers/iio/adc/mt6360-adc.c | 2 +- drivers/iio/adc/mxs-lradc-adc.c | 6 +-- drivers/iio/adc/nxp-sar-adc.c | 2 +- drivers/iio/adc/pac1921.c | 8 ++-- drivers/iio/adc/pac1934.c | 32 +++++++------- drivers/iio/adc/rockchip_saradc.c | 2 +- drivers/iio/adc/rtq6056.c | 16 +++---- drivers/iio/adc/sd_adc_modulator.c | 2 +- drivers/iio/adc/stm32-adc.c | 4 +- drivers/iio/adc/stm32-dfsdm-adc.c | 2 +- drivers/iio/adc/ti-adc081c.c | 2 +- drivers/iio/adc/ti-adc0832.c | 4 +- drivers/iio/adc/ti-adc084s021.c | 2 +- drivers/iio/adc/ti-adc108s102.c | 2 +- drivers/iio/adc/ti-adc12138.c | 4 +- drivers/iio/adc/ti-adc161s626.c | 4 +- drivers/iio/adc/ti-ads1015.c | 4 +- drivers/iio/adc/ti-ads1018.c | 6 +-- drivers/iio/adc/ti-ads1100.c | 2 +- drivers/iio/adc/ti-ads1119.c | 2 +- drivers/iio/adc/ti-ads124s08.c | 2 +- drivers/iio/adc/ti-ads1298.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-ads7950.c | 2 +- drivers/iio/adc/ti-ads8688.c | 2 +- drivers/iio/adc/ti-lmp92064.c | 4 +- drivers/iio/adc/ti-tlc4541.c | 2 +- drivers/iio/adc/ti-tsc2046.c | 2 +- drivers/iio/adc/ti_am335x_adc.c | 2 +- drivers/iio/adc/vf610_adc.c | 4 +- drivers/iio/adc/xilinx-ams.c | 2 +- drivers/iio/adc/xilinx-xadc-core.c | 10 ++--- drivers/iio/addac/ad74115.c | 2 +- drivers/iio/addac/ad74413r.c | 2 +- drivers/iio/chemical/atlas-ezo-sensor.c | 4 +- drivers/iio/chemical/atlas-sensor.c | 12 ++--- drivers/iio/chemical/bme680_core.c | 8 ++-- drivers/iio/chemical/ccs811.c | 4 +- drivers/iio/chemical/ens160_core.c | 4 +- drivers/iio/chemical/pms7003.c | 2 +- drivers/iio/chemical/scd30_core.c | 2 +- drivers/iio/chemical/scd4x.c | 6 +-- drivers/iio/chemical/sps30.c | 2 +- .../common/cros_ec_sensors/cros_ec_activity.c | 2 +- .../cros_ec_sensors/cros_ec_lid_angle.c | 2 +- .../common/cros_ec_sensors/cros_ec_sensors.c | 4 +- drivers/iio/common/scmi_sensors/scmi_iio.c | 4 +- .../iio/common/ssp_sensors/ssp_iio_sensor.h | 4 +- drivers/iio/dac/ad3552r-hs.c | 2 +- drivers/iio/dac/ad3552r.c | 2 +- drivers/iio/dac/ad5064.c | 2 +- drivers/iio/dac/ad5360.c | 2 +- drivers/iio/dac/ad5380.c | 2 +- drivers/iio/dac/ad5421.c | 2 +- drivers/iio/dac/ad5446.h | 2 +- drivers/iio/dac/ad5449.c | 2 +- drivers/iio/dac/ad5504.c | 2 +- drivers/iio/dac/ad5592r-base.c | 2 +- drivers/iio/dac/ad5624r_spi.c | 2 +- drivers/iio/dac/ad5686.c | 2 +- drivers/iio/dac/ad5755.c | 2 +- drivers/iio/dac/ad5761.c | 2 +- drivers/iio/dac/ad5764.c | 2 +- drivers/iio/dac/ad5766.c | 2 +- drivers/iio/dac/ad5791.c | 4 +- drivers/iio/dac/ad7303.c | 2 +- drivers/iio/dac/ad8460.c | 2 +- drivers/iio/dac/ad9739a.c | 2 +- drivers/iio/dac/ltc1660.c | 2 +- drivers/iio/dac/max5522.c | 2 +- drivers/iio/dac/mcp4922.c | 2 +- drivers/iio/dac/stm32-dac.c | 2 +- drivers/iio/dummy/iio_simple_dummy.c | 8 ++-- drivers/iio/gyro/adis16136.c | 4 +- drivers/iio/gyro/adxrs290.c | 4 +- drivers/iio/gyro/bmg160_core.c | 2 +- drivers/iio/gyro/fxas21002c_core.c | 2 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 2 +- drivers/iio/gyro/itg3200_core.c | 2 +- drivers/iio/gyro/mpu3050-core.c | 4 +- drivers/iio/health/afe440x.h | 2 +- drivers/iio/health/max30100.c | 4 +- drivers/iio/health/max30102.c | 2 +- drivers/iio/humidity/am2315.c | 4 +- drivers/iio/humidity/hdc100x.c | 4 +- drivers/iio/humidity/hid-sensor-humidity.c | 2 +- drivers/iio/humidity/hts221_core.c | 4 +- drivers/iio/imu/adis.c | 2 +- drivers/iio/imu/adis16400.c | 16 +++---- drivers/iio/imu/adis16460.c | 4 +- drivers/iio/imu/adis16475.c | 6 +-- drivers/iio/imu/adis16480.c | 6 +-- drivers/iio/imu/adis16550.c | 6 +-- drivers/iio/imu/bmi160/bmi160_core.c | 2 +- drivers/iio/imu/bmi270/bmi270_core.c | 4 +- drivers/iio/imu/bmi323/bmi323_core.c | 4 +- drivers/iio/imu/bno055/bno055.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_temp.h | 2 +- drivers/iio/imu/inv_icm45600/inv_icm45600.h | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_accel.c | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_gyro.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 +-- drivers/iio/imu/kmx61.c | 4 +- drivers/iio/imu/smi240.c | 4 +- drivers/iio/imu/smi330/smi330_core.c | 6 +-- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 +- drivers/iio/industrialio-buffer.c | 4 +- drivers/iio/light/acpi-als.c | 2 +- drivers/iio/light/adjd_s311.c | 2 +- drivers/iio/light/apds9960.c | 2 +- drivers/iio/light/as73211.c | 6 +-- drivers/iio/light/bh1745.c | 2 +- drivers/iio/light/cros_ec_light_prox.c | 4 +- drivers/iio/light/gp2ap020a00f.c | 6 +-- drivers/iio/light/hid-sensor-als.c | 2 +- drivers/iio/light/hid-sensor-prox.c | 2 +- drivers/iio/light/isl29125.c | 2 +- drivers/iio/light/ltr501.c | 4 +- drivers/iio/light/max44000.c | 4 +- drivers/iio/light/opt4060.c | 4 +- drivers/iio/light/rohm-bu27034.c | 4 +- drivers/iio/light/rpr0521.c | 6 +-- drivers/iio/light/si1145.c | 2 +- drivers/iio/light/st_uvis25_core.c | 2 +- drivers/iio/light/tcs3414.c | 2 +- drivers/iio/light/tcs3472.c | 2 +- drivers/iio/light/vcnl4000.c | 2 +- drivers/iio/light/vcnl4035.c | 4 +- drivers/iio/light/veml6030.c | 8 ++-- drivers/iio/light/veml6046x00.c | 8 ++-- drivers/iio/light/vl6180.c | 6 +-- drivers/iio/magnetometer/af8133j.c | 2 +- drivers/iio/magnetometer/ak8974.c | 2 +- drivers/iio/magnetometer/ak8975.c | 2 +- drivers/iio/magnetometer/als31300.c | 4 +- drivers/iio/magnetometer/bmc150_magn.c | 2 +- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 2 +- drivers/iio/magnetometer/hmc5843_core.c | 4 +- drivers/iio/magnetometer/mag3110.c | 4 +- drivers/iio/magnetometer/rm3100-core.c | 2 +- drivers/iio/magnetometer/tlv493d.c | 4 +- drivers/iio/magnetometer/tmag5273.c | 8 ++-- drivers/iio/magnetometer/yamaha-yas530.c | 4 +- drivers/iio/orientation/hid-sensor-incl-3d.c | 2 +- drivers/iio/orientation/hid-sensor-rotation.c | 2 +- .../position/hid-sensor-custom-intel-hinge.c | 6 +-- drivers/iio/potentiostat/lmp91000.c | 2 +- drivers/iio/pressure/abp2030pa.c | 4 +- drivers/iio/pressure/bmp280-core.c | 18 ++++---- drivers/iio/pressure/cros_ec_baro.c | 4 +- drivers/iio/pressure/dlhl60d.c | 4 +- drivers/iio/pressure/hid-sensor-press.c | 2 +- drivers/iio/pressure/hsc030pa.c | 4 +- drivers/iio/pressure/mpl3115.c | 4 +- drivers/iio/pressure/mprls0025pa.c | 2 +- drivers/iio/pressure/ms5611_core.c | 4 +- drivers/iio/pressure/rohm-bm1390.c | 4 +- drivers/iio/pressure/st_pressure_core.c | 12 ++--- drivers/iio/pressure/zpa2326.c | 4 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/hx9023s.c | 2 +- drivers/iio/proximity/irsd200.c | 2 +- drivers/iio/proximity/isl29501.c | 2 +- drivers/iio/proximity/mb1232.c | 2 +- .../iio/proximity/pulsedlight-lidar-lite-v2.c | 2 +- drivers/iio/proximity/srf08.c | 2 +- drivers/iio/proximity/sx9310.c | 2 +- drivers/iio/proximity/sx9324.c | 2 +- drivers/iio/proximity/sx9360.c | 4 +- drivers/iio/proximity/sx9500.c | 2 +- drivers/iio/proximity/vl53l0x-i2c.c | 2 +- drivers/iio/resolver/ad2s1210.c | 4 +- .../iio/temperature/hid-sensor-temperature.c | 2 +- drivers/iio/temperature/maxim_thermocouple.c | 6 +-- drivers/iio/temperature/tmp006.c | 4 +- include/linux/iio/common/st_sensors.h | 2 +- include/linux/iio/iio.h | 6 +-- include/linux/iio/imu/adis.h | 6 +-- 252 files changed, 511 insertions(+), 511 deletions(-)
Documentation/driver-api/iio/buffers.rst +2 -2
@@ -78,7 +78,7 @@ fields in iio_chan_spec definition:: /* other members */ int scan_index struct { - char sign; + char format; u8 realbits; u8 storagebits; u8 shift;
@@ -98,7 +98,7 @@ following channel definition:: /* other stuff here */ .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 12, .storagebits = 16, .shift = 4,
drivers/iio/accel/adxl313_core.c +1 -1
@@ -259,7 +259,7 @@ static const int adxl313_odr_freqs[][2] = { .info_mask_shared_by_type_available = \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 13, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/accel/adxl345_core.c +1 -1
@@ -254,7 +254,7 @@ static const struct iio_event_spec adxl345_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = (index), \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/accel/adxl355_core.c +2 -2
@@ -725,7 +725,7 @@ static irqreturn_t adxl355_trigger_handler(int irq, void *p)BIT (IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =20 , \ .storagebits =32 , \ .shift =4 , \
@@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 3, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_BE ,
drivers/iio/accel/adxl367.c +2 -2
@@ -1344,7 +1344,7 @@ static const struct iio_event_spec adxl367_events[] = { .num_event_specs = ARRAY_SIZE(adxl367_events), \ .scan_index = (index), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -1360,7 +1360,7 @@ static const struct iio_event_spec adxl367_events[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (index), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/accel/adxl372.c +1 -1
@@ -262,7 +262,7 @@ static const struct iio_event_spec adxl372_events[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .shift =4 , \
drivers/iio/accel/adxl380.c +2 -2
@@ -1789,7 +1789,7 @@ static const struct iio_event_spec adxl380_events[] = {BIT (IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
@@ -1810,7 +1810,7 @@ static const struct iio_chan_spec adxl380_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 3, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .shift =4 ,
drivers/iio/accel/bma180.c +5 -5
@@ -541,7 +541,7 @@ static int bma180_read_raw(struct iio_dev *indio_dev,iio_device_release_direct (indio_dev);if (ret <0 )return ret; -if (chan->scan_type.sign =='s' ) { +if (chan->scan_type.format =='s' ) { *val =sign_extend32 (ret >> chan->scan_type.shift, chan->scan_type.realbits -1 ); }else {
@@ -663,7 +663,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = _bits, \ .storagebits =16 , \ .shift =16 - _bits, \
@@ -677,7 +677,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = TEMP, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 16, \ }, \
@@ -692,7 +692,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = _bits, \ .storagebits =16 , \ .shift =16 - _bits, \
@@ -706,7 +706,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 8, \ .storagebits = 16, \ }, \
drivers/iio/accel/bma220_core.c +1 -1
@@ -107,7 +107,7 @@BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =6 , \ .storagebits =8 , \ .shift =2 , \
drivers/iio/accel/bma400_core.c +2 -2
@@ -399,7 +399,7 @@ static const struct attribute_group bma400_event_attribute_group = { .ext_info = bma400_ext_info, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -428,7 +428,7 @@ static const struct iio_chan_spec bma400_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 8, .storagebits = 8, .endianness = IIO_LE,
drivers/iio/accel/bmc150-accel-core.c +1 -1
@@ -1059,7 +1059,7 @@ static const struct iio_event_spec bmc150_accel_event = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
drivers/iio/accel/cros_ec_accel_legacy.c +1 -1
@@ -189,7 +189,7 @@ static const struct iio_info cros_ec_accel_legacy_info = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .ext_info = cros_ec_sensors_ext_info, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =CROS_EC_SENSOR_BITS , \ .storagebits =CROS_EC_SENSOR_BITS , \ }, \
drivers/iio/accel/fxls8962af-core.c +2 -2
@@ -731,7 +731,7 @@ static const struct iio_event_spec fxls8962af_event[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .endianness =IIO_LE , \
@@ -748,7 +748,7 @@ static const struct iio_event_spec fxls8962af_event[] = {BIT (IIO_CHAN_INFO_OFFSET ),\ .scan_index = -1, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =8 , \ .storagebits =8 , \ }, \
drivers/iio/accel/hid-sensor-accel-3d.c +1 -1
@@ -123,7 +123,7 @@ static const struct iio_chan_spec gravity_channels[] = {static void accel_3d_adjust_channel_bit_mask (struct iio_chan_spec *channels,int channel,int size) { - channels[channel].scan_type.sign ='s' ; + channels[channel].scan_type.format ='s' ;/* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size *8 ;/* Maximum size of a sample to capture is u32 */
drivers/iio/accel/kionix-kx022a.c +1 -1
@@ -348,7 +348,7 @@ static const struct iio_chan_spec_ext_info kx022a_ext_info[] = { .address = reg, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/accel/kxcjk-1013.c +1 -1
@@ -1147,7 +1147,7 @@ static const struct iio_chan_spec_ext_info kxcjk1013_ext_info[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .shift =4 , \
drivers/iio/accel/kxsd9.c +2 -2
@@ -284,7 +284,7 @@ static const struct iio_chan_spec_ext_info kxsd9_ext_info[] = { .address = KXSD9_REG_##axis, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
@@ -303,7 +303,7 @@ static const struct iio_chan_spec kxsd9_channels[] = { .address = KXSD9_REG_AUX, .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, .shift = 4,
drivers/iio/accel/mma7455_core.c +1 -1
@@ -219,7 +219,7 @@ static const struct iio_info mma7455_info = {BIT (IIO_CHAN_INFO_SCALE ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =10 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/accel/mma8452.c +2 -2
@@ -1233,7 +1233,7 @@ static const struct iio_chan_spec_ext_info mma8452_ext_info[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
@@ -1255,7 +1255,7 @@ static const struct iio_chan_spec_ext_info mma8452_ext_info[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
drivers/iio/accel/msa311.c +1 -1
@@ -382,7 +382,7 @@ enum msa311_si { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = MSA311_SI_##axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/accel/mxc4005.c +1 -1
@@ -306,7 +306,7 @@ static const unsigned long mxc4005_scan_masks[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/accel/sca3000.c +2 -2
@@ -485,7 +485,7 @@ static const struct iio_event_spec sca3000_event = { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 13, \ .storagebits = 16, \ .shift = 3, \
@@ -528,7 +528,7 @@ static const struct iio_chan_spec sca3000_channels_with_temp[] = {/* No buffer support */ .scan_index = -1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 9, .storagebits = 16, .shift = 5,
drivers/iio/accel/sca3300.c +3 -3
@@ -70,7 +70,7 @@ enum sca3300_scan_indexes {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
@@ -87,7 +87,7 @@ enum sca3300_scan_indexes { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -100,7 +100,7 @@ enum sca3300_scan_indexes { .scan_index = index, \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/accel/stk8312.c +1 -1
@@ -80,7 +80,7 @@ static const struct {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =8 , \ .storagebits =8 , \ .endianness =IIO_CPU , \
drivers/iio/accel/stk8ba50.c +1 -1
@@ -108,7 +108,7 @@ struct stk8ba50_data {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =10 , \ .storagebits =16 , \ .shift =STK8BA50_DATA_SHIFT , \
drivers/iio/adc/ad4000.c +4 -4
@@ -51,7 +51,7 @@ .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\ .scan_index = 0, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _real_bits, \ .storagebits = _storage_bits, \ .shift = (_offl ? 0 : _storage_bits - _real_bits), \
@@ -89,7 +89,7 @@ .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\ .scan_index = 0, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _real_bits, \ .storagebits = _storage_bits, \ .shift = (_offl ? 0 : _storage_bits - _real_bits), \
@@ -540,7 +540,7 @@ static void ad4000_fill_scale_tbl(struct ad4000_state *st,* ADCs that output two's complement code have one less bit to express * voltage magnitude. */ -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) scale_bits = chan->scan_type.realbits -1 ;else scale_bits = chan->scan_type.realbits;
@@ -657,7 +657,7 @@ static int ad4000_single_conversion(struct iio_dev *indio_dev, sample >>= chan->scan_type.shift; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (sample, chan->scan_type.realbits -1 );else *val = sample;
drivers/iio/adc/ad4030.c +5 -5
@@ -196,7 +196,7 @@ struct ad4030_state { .channel = ((_idx) - (_ch)) * 2 + (_ch), \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .storagebits = 8, \ .realbits = 8, \ .endianness = IIO_BE, \
@@ -1083,14 +1083,14 @@ static const unsigned long ad4630_channel_masks[] = {static const struct iio_scan_type ad4030_24_scan_types[] = { [AD4030_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =24 , .shift =8 , .endianness =IIO_BE , }, [AD4030_SCAN_TYPE_AVG ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =30 , .shift =2 ,
@@ -1100,14 +1100,14 @@ static const struct iio_scan_type ad4030_24_scan_types[] = {static const struct iio_scan_type ad4030_16_scan_types[] = { [AD4030_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =16 , .shift =16 , .endianness =IIO_BE , }, [AD4030_SCAN_TYPE_AVG ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =30 , .shift =2 ,
drivers/iio/adc/ad4062.c +4 -4
@@ -122,13 +122,13 @@ enum {static const struct iio_scan_type ad4062_scan_type_12_s[] = { [AD4062_SCAN_TYPE_SAMPLE ] = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_BE , }, [AD4062_SCAN_TYPE_BURST_AVG ] = { - .sign ='s' , + .format ='s' , .realbits =14 , .storagebits =16 , .endianness =IIO_BE ,
@@ -137,13 +137,13 @@ static const struct iio_scan_type ad4062_scan_type_12_s[] = {static const struct iio_scan_type ad4062_scan_type_16_s[] = { [AD4062_SCAN_TYPE_SAMPLE ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE , }, [AD4062_SCAN_TYPE_BURST_AVG ] = { - .sign ='s' , + .format ='s' , .realbits =20 , .storagebits =32 , .endianness =IIO_BE ,
drivers/iio/adc/ad4080.c +1 -1
@@ -432,7 +432,7 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[] = { .ext_info = ad4080_ext_info, \ .scan_index = 0, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = (storage), \ }, \
drivers/iio/adc/ad4130.c +1 -1
@@ -1002,7 +1002,7 @@ static const struct iio_chan_spec ad4130_channel_template = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), .ext_info = ad4130_ext_info, .scan_type = { - .sign ='u' , + .format ='u' , .endianness =IIO_BE , }, };
drivers/iio/adc/ad4170-4.c +6 -6
@@ -955,7 +955,7 @@ static const struct iio_chan_spec ad4170_temp_channel_template = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), .info_mask_separate_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , .shift =8 ,
@@ -1101,7 +1101,7 @@ static int ad4170_get_input_range(struct ad4170_state *st,struct iio_chan_spec const *chan, unsigned int ch_reg, unsigned int ref_sel) { - bool bipolar = chan->scan_type.sign == 's'; + bool bipolar = chan->scan_type.format == 's';struct device *dev = &st->spi->dev;int refp, refn, ain_voltage, ret;
@@ -1228,7 +1228,7 @@ static int __ad4170_read_sample(struct iio_dev *indio_dev,if (ret)return ret; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );return 0 ;
@@ -1353,7 +1353,7 @@ static int ad4170_fill_scale_tbl(struct iio_dev *indio_dev,struct ad4170_state *st =iio_priv (indio_dev);struct ad4170_chan_info *chan_info = &st->chan_infos[chan->address];struct device *dev = &st->spi->dev; -int bipolar = chan->scan_type.sign =='s' ?1 :0 ; +int bipolar = chan->scan_type.format =='s' ?1 :0 ;int precision_bits = chan->scan_type.realbits;int pga, ainm_voltage, ret;unsigned long long offset;
@@ -2335,9 +2335,9 @@ static int ad4170_parse_channel_node(struct iio_dev *indio_dev, bipolar =fwnode_property_read_bool (child,"bipolar" ); setup->afe |=FIELD_PREP (AD4170_AFE_BIPOLAR_MSK , bipolar);if (bipolar) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;else - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; ret =ad4170_validate_channel (st, chan);if (ret)
drivers/iio/adc/ad4695.c +12 -12
@@ -314,25 +314,25 @@ enum {static const struct iio_scan_type ad4695_scan_type_offload_u[] = { [AD4695_SCAN_TYPE_OSR_1 ] = { - .sign ='u' , + .format ='u' , .realbits =16 , .shift =3 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_4 ] = { - .sign ='u' , + .format ='u' , .realbits =17 , .shift =2 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_16 ] = { - .sign ='u' , + .format ='u' , .realbits =18 , .shift =1 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_64 ] = { - .sign ='u' , + .format ='u' , .realbits =19 , .storagebits =32 , },
@@ -340,25 +340,25 @@ static const struct iio_scan_type ad4695_scan_type_offload_u[] = {static const struct iio_scan_type ad4695_scan_type_offload_s[] = { [AD4695_SCAN_TYPE_OSR_1 ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .shift =3 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_4 ] = { - .sign ='s' , + .format ='s' , .realbits =17 , .shift =2 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_16 ] = { - .sign ='s' , + .format ='s' , .realbits =18 , .shift =1 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_64 ] = { - .sign ='s' , + .format ='s' , .realbits =19 , .storagebits =32 , },
@@ -375,7 +375,7 @@ static const struct iio_chan_spec ad4695_channel_template = { .info_mask_separate_available = BIT(IIO_CHAN_INFO_CALIBSCALE) | BIT(IIO_CHAN_INFO_CALIBBIAS), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
@@ -388,7 +388,7 @@ static const struct iio_chan_spec ad4695_temp_channel_template = {BIT (IIO_CHAN_INFO_SCALE ) | BIT(IIO_CHAN_INFO_OFFSET), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, },
@@ -1037,7 +1037,7 @@ static int __ad4695_read_info_raw(struct ad4695_state *st,if (ret)return ret; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (st->raw_data, realbits -1 );else *val = st->raw_data;
@@ -1603,7 +1603,7 @@ static int ad4695_parse_channel_cfg(struct ad4695_state *st) fwnode_get_name(child));if (chan_cfg->bipolar) - iio_chan->scan_type.sign ='s' ; + iio_chan->scan_type.format ='s' ; ret =ad4695_write_chn_cfg (st, chan_cfg);if (ret)
drivers/iio/adc/ad4851.c +6 -6
@@ -891,12 +891,12 @@ static int ad4851_read_avail(struct iio_dev *indio_dev,static const struct iio_scan_type ad4851_scan_type_20_u[] = { [AD4851_SCAN_TYPE_NORMAL ] = { - .sign ='u' , + .format ='u' , .realbits =20 , .storagebits =32 , }, [AD4851_SCAN_TYPE_RESOLUTION_BOOST ] = { - .sign ='u' , + .format ='u' , .realbits =24 , .storagebits =32 , },
@@ -904,12 +904,12 @@ static const struct iio_scan_type ad4851_scan_type_20_u[] = {static const struct iio_scan_type ad4851_scan_type_20_b[] = { [AD4851_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .realbits =20 , .storagebits =32 , }, [AD4851_SCAN_TYPE_RESOLUTION_BOOST ] = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , },
@@ -949,7 +949,7 @@ static int ad4851_get_current_scan_type(const struct iio_dev *indio_dev, { \ AD4851_IIO_CHANNEL, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ }, \
@@ -997,7 +997,7 @@ static int ad4851_parse_channels_common(struct iio_dev *indio_dev, st->bipolar_ch[reg] =fwnode_property_read_bool (child,"bipolar" );if (st->bipolar_ch[reg]) { - channels->scan_type.sign ='s' ; + channels->scan_type.format ='s' ; }else { ret =regmap_write (st->regmap,AD4851_REG_CHX_SOFTSPAN (reg),AD4851_SOFTSPAN_0V_40V );
drivers/iio/adc/ad7124.c +2 -2
@@ -1182,7 +1182,7 @@ static const struct iio_chan_spec ad7124_channel_template = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_type = { - .sign ='u' , + .format ='u' , .realbits =24 , .storagebits =32 , .endianness =IIO_BE ,
@@ -1308,7 +1308,7 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,* measurement yields an unsigned value, but * this matches the device's manual. */ - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7173.c +3 -3
@@ -1549,7 +1549,7 @@ static const struct iio_info ad7173_info = { };static const struct iio_scan_type ad4113_scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -1561,7 +1561,7 @@ static const struct iio_chan_spec ad7173_channel_template = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -1577,7 +1577,7 @@ static const struct iio_chan_spec ad7173_temp_iio_channel_template = {BIT (IIO_CHAN_INFO_SCALE ) |BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7191.c +3 -3
@@ -437,7 +437,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -458,7 +458,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -479,7 +479,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7192.c +1 -1
@@ -1151,7 +1151,7 @@ static const struct iio_info ad7195_info = { .ext_info = (_ext_info), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/ad7266.c +3 -3
@@ -160,7 +160,7 @@ static int ad7266_read_raw(struct iio_dev *indio_dev,if (ret <0 )return ret; *val = (*val >>2 ) &0xfff ; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );
@@ -196,7 +196,7 @@ static int ad7266_read_raw(struct iio_dev *indio_dev, | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = (_chan), \ .scan_type = { \ - .sign = (_sign), \ + .format = (_sign), \ .realbits =12 , \ .storagebits =16 , \ .shift =2 , \
@@ -244,7 +244,7 @@ static AD7266_DECLARE_SINGLE_ENDED_CHANNELS_FIXED(s, 's'); | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = (_chan), \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits =12 , \ .storagebits =16 , \ .shift =2 , \
drivers/iio/adc/ad7280a.c +2 -2
@@ -621,7 +621,7 @@ static void ad7280_common_fields_init(struct iio_chan_spec *chan, int addr, chan->info_mask_shared_by_all =BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); chan->address = addr; chan->scan_index = cnt; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =32 ; }
@@ -638,7 +638,7 @@ static void ad7280_total_voltage_channel_init(struct iio_chan_spec *chan, chan->info_mask_separate =BIT (IIO_CHAN_INFO_RAW ); chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); chan->scan_index = cnt; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =32 ; chan->scan_type.storagebits =32 ; }
drivers/iio/adc/ad7298.c +2 -2
@@ -63,7 +63,7 @@ struct ad7298_state { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -81,7 +81,7 @@ static const struct iio_chan_spec ad7298_channels[] = { .address = AD7298_CH_TEMP, .scan_index = -1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, },
drivers/iio/adc/ad7380.c +22 -22
166 lines not on this page · raw message
drivers/iio/adc/ad7405.c +1 -1
@@ -133,7 +133,7 @@ static const struct iio_chan_spec ad7405_channel = { .differential = 1, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
drivers/iio/adc/ad7476.c +1 -1
@@ -160,7 +160,7 @@ static int ad7476_read_raw(struct iio_dev *indio_dev, .info_mask_separate = _info_mask_sep, \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (_shift), \
drivers/iio/adc/ad7606.c +7 -7
@@ -413,7 +413,7 @@ static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev,/* Bipolar single-ended ranges start at 0 (b0000) */ ci->reg_offset =0 ; ci->range =3 ; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -424,7 +424,7 @@ static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev,/* Unipolar single-ended ranges start at 5 (b0101) */ ci->reg_offset =5 ; ci->range =1 ; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ;return 0 ; }
@@ -458,7 +458,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev, ci->range =1 ; chan->differential =1 ; chan->channel2 = chan->channel; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -472,7 +472,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev,/* Bipolar single-ended ranges start at 0 (b0000) */ ci->reg_offset =0 ; ci->range =3 ; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -483,7 +483,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev,/* Unipolar single-ended ranges start at 5 (b0101) */ ci->reg_offset =5 ; ci->range =1 ; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ;return 0 ; }
@@ -703,7 +703,7 @@ static int ad7606_scan_direct(struct iio_dev *indio_dev, unsigned int ch, *val &=GENMASK (realbits -1 ,0 ); -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, realbits -1 ); error_ret:
@@ -1412,7 +1412,7 @@ static int ad7606_probe_channels(struct iio_dev *indio_dev) chan->indexed =1 ; chan->channel = i; chan->scan_index = i; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ; chan->scan_type.realbits = st->chip_info->bits;/* * If in SPI offload mode, storagebits are set based
drivers/iio/adc/ad7625.c +1 -1
@@ -54,7 +54,7 @@ struct ad7625_chip_info { .info_mask_separate = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = 0, \ - .scan_type.sign = 's', \ + .scan_type.format = 's', \ .scan_type.storagebits = (_bits) > 16 ? 32 : 16, \ .scan_type.realbits = (_bits), \ }
drivers/iio/adc/ad7766.c +1 -1
@@ -154,7 +154,7 @@ static const struct iio_chan_spec ad7766_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7768-1.c +4 -4
@@ -254,14 +254,14 @@ static const char * const ad7768_filter_enum[] = {static const struct iio_scan_type ad7768_scan_type[] = { [AD7768_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , .shift =8 , .endianness =IIO_BE , }, [AD7768_SCAN_TYPE_HIGH_SPEED ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -541,7 +541,7 @@ static void ad7768_fill_scale_tbl(struct iio_dev *dev)u64 tmp2; scan_type =iio_get_current_scan_type (dev, &dev->channels[0 ]); -if (scan_type->sign =='s' ) +if (scan_type->format =='s' ) val2 = scan_type->realbits -1 ;else val2 = scan_type->realbits;
@@ -1102,7 +1102,7 @@ static int ad7768_write_raw(struct iio_dev *indio_dev,if (!st->chip->has_pga)return -EOPNOTSUPP ; -if (scan_type->sign =='s' ) +if (scan_type->format =='s' ) gain_mode =ad7768_calc_pga_gain (st, val, val2, scan_type->realbits -1 );else
drivers/iio/adc/ad7779.c +1 -1
@@ -690,7 +690,7 @@ static const struct iio_chan_spec_ext_info ad7779_ext_filter[] = { .scan_index = (index), \ .ext_info = (_ext_info), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/ad7780.c +1 -1
@@ -217,7 +217,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = { .info_mask_shared_by_all = _mask_all, \ .scan_index = 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 32, \ .shift = (_wordsize) - (_bits), \
drivers/iio/adc/ad7791.c +1 -1
@@ -80,7 +80,7 @@ .info_mask_shared_by_all = _mask_all, \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = (_storagebits), \ .shift = (_shift), \
drivers/iio/adc/ad7793.c +1 -1
@@ -568,7 +568,7 @@ static const struct iio_info ad7797_info = { .info_mask_shared_by_all = _mask_all, \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = (_storagebits), \ .shift = (_shift), \
drivers/iio/adc/ad7887.c +1 -1
@@ -188,7 +188,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev, .address = (x), \ .scan_index = (x), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .shift = 0, \
drivers/iio/adc/ad7923.c +1 -1
@@ -91,7 +91,7 @@ enum ad7923_id { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/adc/ad7944.c +4 -4
@@ -135,7 +135,7 @@ static const struct ad7944_chip_info _name##_chip_info = { \ .channel = 0, \ .channel2 = _diff ? 1 : 0, \ .scan_index = 0, \ - .scan_type.sign = _diff ? 's' : 'u', \ + .scan_type.format = _diff ? 's' : 'u', \ .scan_type.realbits = _bits, \ .scan_type.storagebits = _bits > 16 ? 32 : 16, \ .scan_type.endianness = IIO_CPU, \
@@ -152,7 +152,7 @@ static const struct ad7944_chip_info _name##_chip_info = { \ .channel = 0, \ .channel2 = _diff ? 1 : 0, \ .scan_index = 0, \ - .scan_type.sign = _diff ? 's' : 'u', \ + .scan_type.format = _diff ? 's' : 'u', \ .scan_type.realbits = _bits, \ .scan_type.storagebits = 32, \ .scan_type.endianness = IIO_CPU, \
@@ -364,7 +364,7 @@ static int ad7944_single_conversion(struct ad7944_adc *adc, *val = adc->sample.raw.u16; } -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );else *val &=GENMASK (chan->scan_type.realbits -1 ,0 );
@@ -410,7 +410,7 @@ static int ad7944_read_raw(struct iio_dev *indio_dev,case IIO_VOLTAGE : *val = adc->ref_mv; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val2 = chan->scan_type.realbits -1 ;else *val2 = chan->scan_type.realbits;
drivers/iio/adc/ad799x.c +1 -1
@@ -586,7 +586,7 @@ static const struct iio_event_spec ad799x_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_realbits), \ .storagebits = 16, \ .shift = 12 - (_realbits), \
drivers/iio/adc/ad9467.c +2 -2
@@ -319,7 +319,7 @@ static void __ad9467_get_scale(struct ad9467_state *st, int index, .info_mask_shared_by_type_available = avai_mask, \ .scan_index = _si, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _bits, \ .storagebits = 16, \ }, \
@@ -343,7 +343,7 @@ static const struct iio_chan_spec ad9434_channels[] = {BIT (IIO_CHAN_INFO_CALIBBIAS ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , },
drivers/iio/adc/ade9000.c +2 -2
@@ -451,7 +451,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = { .scan_index = num, \ .indexed = 1, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -471,7 +471,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = { .scan_index = num + 1, /* interleave with current channels */ \ .indexed = 1, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/at91-sama5d2_adc.c +5 -5
@@ -337,7 +337,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .address = addr, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = rbits, \ .storagebits = 16, \ }, \
@@ -366,7 +366,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .address = addr, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = rbits, \ .storagebits = 16, \ }, \
@@ -394,7 +394,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .channel2 = mod, \ .scan_index = num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -411,7 +411,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .channel = num, \ .scan_index = num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -1787,7 +1787,7 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev,if (ret >0 ) { *val = st->conversion_value; ret =at91_adc_adjust_val_osr (st, val); -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 ); st->conversion_done = false;
drivers/iio/adc/at91_adc.c +2 -2
@@ -514,7 +514,7 @@ static int at91_adc_channel_init(struct iio_dev *idev) chan->indexed =1 ; chan->channel = bit; chan->scan_index = idx; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits = st->res; chan->scan_type.storagebits =16 ; chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE );
@@ -526,7 +526,7 @@ static int at91_adc_channel_init(struct iio_dev *idev) timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = idx; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/cc10001_adc.c +2 -2
@@ -281,7 +281,7 @@ static int cc10001_adc_channel_init(struct iio_dev *indio_dev, chan->indexed =1 ; chan->channel = bit; chan->scan_index = idx; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =10 ; chan->scan_type.storagebits =16 ; chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE );
@@ -293,7 +293,7 @@ static int cc10001_adc_channel_init(struct iio_dev *indio_dev, timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = idx; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/cpcap-adc.c +1 -1
@@ -340,7 +340,7 @@ static const int temp_map[CPCAP_MAX_TEMP_LVL][2] = {BIT (IIO_CHAN_INFO_PROCESSED ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =10 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
drivers/iio/adc/dln2-adc.c +2 -2
@@ -438,7 +438,7 @@ static int dln2_update_scan_mode(struct iio_dev *indio_dev, lval.info_mask_shared_by_all =BIT (IIO_CHAN_INFO_SCALE ) | \BIT (IIO_CHAN_INFO_SAMP_FREQ ); \ lval.scan_index = idx; \ - lval.scan_type.sign ='u' ; \ + lval.scan_type.format ='u' ; \ lval.scan_type.realbits =DLN2_ADC_DATA_BITS ; \ lval.scan_type.storagebits =16 ; \ lval.scan_type.endianness =IIO_LE ; \
@@ -449,7 +449,7 @@ static int dln2_update_scan_mode(struct iio_dev *indio_dev, lval.type =IIO_TIMESTAMP ; \ lval.channel =-1 ; \ lval.scan_index = _si; \ - lval.scan_type.sign ='s' ; \ + lval.scan_type.format ='s' ; \ lval.scan_type.realbits =64 ; \ lval.scan_type.storagebits =64 ; \ }
drivers/iio/adc/hx711.c +2 -2
@@ -432,7 +432,7 @@ static const struct iio_chan_spec hx711_chan_spec[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_CPU,
@@ -446,7 +446,7 @@ static const struct iio_chan_spec hx711_chan_spec[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/adc/ina2xx-adc.c +4 -4
@@ -623,7 +623,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev, .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -641,7 +641,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev,BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
@@ -666,7 +666,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev, .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .shift = _shift, \ .realbits = 16 - _shift, \ .storagebits = 16, \
@@ -686,7 +686,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev,BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/adc/ingenic-adc.c +6 -6
@@ -456,7 +456,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XP, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -467,7 +467,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YP, .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -478,7 +478,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XN, .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -489,7 +489,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YN, .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -500,7 +500,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XD, .scan_index = 4, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -511,7 +511,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YD, .scan_index = 5, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
drivers/iio/adc/max1027.c +2 -2
@@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = index + 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = depth, \ .storagebits = 16, \ .shift = (depth == 10) ? 2 : 0, \
@@ -119,7 +119,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/adc/max1118.c +1 -1
@@ -54,7 +54,7 @@ struct max1118 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = ch, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
drivers/iio/adc/max11205.c +1 -1
@@ -75,7 +75,7 @@ static const struct iio_chan_spec max11205_channels[] = { .type = IIO_VOLTAGE, .indexed = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/adc/max11410.c +1 -1
@@ -156,7 +156,7 @@ static const struct iio_chan_spec chanspec_template = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_LE,
drivers/iio/adc/max1363.c +2 -2
@@ -473,7 +473,7 @@ static const struct iio_event_spec max1363_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .datasheet_name = "AIN"#num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = (bits > 8) ? 16 : 8, \ .endianness = IIO_BE, \
@@ -496,7 +496,7 @@ static const struct iio_event_spec max1363_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .datasheet_name = "AIN"#num"-AIN"#num2, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = bits, \ .storagebits = (bits > 8) ? 16 : 8, \ .endianness = IIO_BE, \
drivers/iio/adc/mcp3911.c +1 -1
@@ -446,7 +446,7 @@ static int mcp3911_calc_scale_table(u32 vref_mv) .info_mask_separate_available = \ BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/mt6359-auxadc.c +1 -1
@@ -196,7 +196,7 @@ struct mtk_pmic_auxadc_info { .scan_index = PMIC_AUXADC_CHAN_##_ch_idx, \ .datasheet_name = __stringify(_name), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = _nbits, \ .storagebits =16 , \ .endianness = IIO_CPU \
drivers/iio/adc/mt6360-adc.c +1 -1
@@ -230,7 +230,7 @@ static const struct iio_info mt6360_adc_iio_info = { .scan_index = MT6360_CHAN_##_idx, \ .datasheet_name = #_idx, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/mxs-lradc-adc.c +3 -3
@@ -582,7 +582,7 @@ static const struct iio_buffer_setup_ops mxs_lradc_adc_buffer_ops = { .channel = (idx), \ .address = (idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = LRADC_RESOLUTION, \ .storagebits = 32, \ }, \
@@ -607,7 +607,7 @@ static const struct iio_chan_spec mx23_lradc_chan_spec[] = {BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SCALE), .channel = 8, - .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,}, + .scan_type = {.format = 'u', .realbits = 18, .storagebits = 32,}, .datasheet_name = "TEMP_DIE", },/* Hidden channel to keep indexes */
@@ -643,7 +643,7 @@ static const struct iio_chan_spec mx28_lradc_chan_spec[] = {BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SCALE), .channel = 8, - .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,}, + .scan_type = {.format = 'u', .realbits = 18, .storagebits = 32,}, .datasheet_name = "TEMP_DIE", },/* Hidden channel to keep indexes */
drivers/iio/adc/nxp-sar-adc.c +1 -1
@@ -167,7 +167,7 @@ struct nxp_sar_adc_data {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = (_idx), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =12 , \ .storagebits =16 , \ }, \
drivers/iio/adc/pac1921.c +4 -4
@@ -937,7 +937,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VBUS, .scan_index = PAC1921_CHAN_VBUS, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -960,7 +960,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VSENSE, .scan_index = PAC1921_CHAN_VSENSE, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -983,7 +983,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VSENSE, .scan_index = PAC1921_CHAN_CURRENT, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -1005,7 +1005,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VPOWER, .scan_index = PAC1921_CHAN_POWER, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
drivers/iio/adc/pac1934.c +16 -16
@@ -330,7 +330,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 48, \ .storagebits = 64, \ .endianness = IIO_CPU, \
@@ -348,7 +348,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -366,7 +366,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -384,7 +384,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -402,7 +402,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -420,7 +420,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 28, \ .storagebits = 32, \ .shift = 4, \
@@ -839,7 +839,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VBUS_AVG_3_ADDR :case PAC1934_VBUS_AVG_4_ADDR : *val =PAC1934_VOLTAGE_MILLIVOLTS_MAX ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 =PAC1934_VOLTAGE_U_RES ;else *val2 =PAC1934_VOLTAGE_S_RES ;
@@ -858,7 +858,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VSENSE_AVG_3_ADDR :case PAC1934_VSENSE_AVG_4_ADDR : *val =PAC1934_MAX_VSENSE_RSHIFTED_BY_16B ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -873,7 +873,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VPOWER_3_ADDR :case PAC1934_VPOWER_4_ADDR : *val =PAC1934_MAX_VPOWER_RSHIFTED_BY_28B ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -888,7 +888,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,*/ *val =PAC1934_SCALE_CONSTANT ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -1393,17 +1393,17 @@ static int pac1934_prep_iio_channels(struct pac1934_chip_info *info, struct iio_* whole chip rail(channel) is bi-directional */ if (info->bi_dir[cnt]) { - ch_sp[PAC1934_CH_ENERGY ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_ENERGY ].scan_type.format ='s' ; ch_sp[PAC1934_CH_ENERGY ].scan_type.realbits =47 ; - ch_sp[PAC1934_CH_POWER ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_POWER ].scan_type.format ='s' ; ch_sp[PAC1934_CH_POWER ].scan_type.realbits =27 ; - ch_sp[PAC1934_CH_VOLTAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_VOLTAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_VOLTAGE ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_CURRENT ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_CURRENT ].scan_type.format ='s' ; ch_sp[PAC1934_CH_CURRENT ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.realbits =15 ; } tmp_data +=sizeof (pac1934_single_channel);
drivers/iio/adc/rockchip_saradc.c +1 -1
@@ -221,7 +221,7 @@ static const struct iio_info rockchip_saradc_iio_info = { .datasheet_name = _id, \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = _res, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/rtq6056.c +8 -8
@@ -127,7 +127,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -146,7 +146,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -164,7 +164,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -181,7 +181,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -210,7 +210,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -228,7 +228,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -246,7 +246,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -263,7 +263,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/sd_adc_modulator.c +1 -1
@@ -21,7 +21,7 @@ static const struct iio_chan_spec iio_sd_mod_ch = { .type = IIO_VOLTAGE, .indexed = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 1, .shift = 0, },
drivers/iio/adc/stm32-adc.c +2 -2
@@ -2109,7 +2109,7 @@ static void stm32_adc_chan_init_one(struct iio_dev *indio_dev, chan->info_mask_shared_by_all |=BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); chan->info_mask_shared_by_all_available =BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); } - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits = adc->cfg->adc_info->resolutions[adc->res]; chan->scan_type.storagebits =16 ; chan->ext_info = stm32_adc_ext_info;
@@ -2448,7 +2448,7 @@ static int stm32_adc_chan_fw_init(struct iio_dev *indio_dev, bool timestamping) timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = scan_index; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/stm32-dfsdm-adc.c +1 -1
@@ -1559,7 +1559,7 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev, struct iio_c }else { ch->scan_type.shift =8 ; } - ch->scan_type.sign ='s' ; + ch->scan_type.format ='s' ; ch->scan_type.realbits =24 ; ch->scan_type.storagebits =32 ;
drivers/iio/adc/ti-adc081c.c +1 -1
@@ -81,7 +81,7 @@ static int adc081c_read_raw(struct iio_dev *iio, .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 12 - (_bits), \
drivers/iio/adc/ti-adc0832.c +2 -2
@@ -49,7 +49,7 @@ struct adc0832 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = chan, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
@@ -66,7 +66,7 @@ struct adc0832 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = si, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
drivers/iio/adc/ti-adc084s021.c +1 -1
@@ -46,7 +46,7 @@ struct adc084s021 { .indexed = 1, \ .scan_index = (num), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/adc/ti-adc108s102.c +1 -1
@@ -90,7 +90,7 @@ struct adc108s102_state { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = ADC108S102_BITS, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/adc/ti-adc12138.c +2 -2
@@ -67,7 +67,7 @@ struct adc12138 { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = chan, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .shift =3 , \
@@ -87,7 +87,7 @@ struct adc12138 { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = si, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .shift =3 , \
drivers/iio/adc/ti-adc161s626.c +2 -2
@@ -38,7 +38,7 @@ static const struct iio_chan_spec ti_adc141s626_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =14 , .storagebits =16 , },
@@ -55,7 +55,7 @@ static const struct iio_chan_spec ti_adc161s626_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , },
drivers/iio/adc/ti-ads1015.c +2 -2
@@ -193,7 +193,7 @@ static const struct iio_event_spec ads1015_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = _addr, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (_realbits), \ .storagebits =FIT_CHECK ((_realbits) + (_shift),16 ), \ .shift = (_shift), \
@@ -219,7 +219,7 @@ static const struct iio_event_spec ads1015_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = _addr, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (_realbits), \ .storagebits =FIT_CHECK ((_realbits) + (_shift),16 ), \ .shift = (_shift), \
drivers/iio/adc/ti-ads1018.c +3 -3
@@ -105,7 +105,7 @@ struct ads1018 { .channel2 = _chan2, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
@@ -125,7 +125,7 @@ struct ads1018 { .channel = _chan, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
@@ -143,7 +143,7 @@ struct ads1018 { .type = IIO_TEMP, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
drivers/iio/adc/ti-ads1100.c +1 -1
@@ -60,7 +60,7 @@ static const struct iio_chan_spec ads1100_channel = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/ti-ads1119.c +1 -1
@@ -586,7 +586,7 @@ static int ads1119_alloc_and_config_channels(struct iio_dev *indio_dev)BIT (IIO_CHAN_INFO_SCALE ) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/ti-ads124s08.c +1 -1
@@ -117,7 +117,7 @@ struct ads124s_private { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ }, \
drivers/iio/adc/ti-ads1298.c +1 -1
@@ -149,7 +149,7 @@ struct ads1298_private {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =ADS1298_BITS_PER_SAMPLE , \ .storagebits =32 , \ .endianness =IIO_CPU , \
drivers/iio/adc/ti-ads131e08.c +1 -1
@@ -768,7 +768,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)BIT (IIO_CHAN_INFO_SCALE ); channels[i].info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SAMP_FREQ ); channels[i].scan_index = channel; - channels[i].scan_type.sign ='s' ; + channels[i].scan_type.format ='s' ; channels[i].scan_type.realbits =24 ; channels[i].scan_type.storagebits =32 ; channels[i].scan_type.shift =8 ;
drivers/iio/adc/ti-ads7950.c +1 -1
@@ -144,7 +144,7 @@ enum ti_ads7950_id { .datasheet_name = "CH##index", \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/adc/ti-ads8688.c +1 -1
@@ -157,7 +157,7 @@ static const struct attribute_group ads8688_attribute_group = { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = index, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
drivers/iio/adc/ti-lmp92064.c +2 -2
@@ -96,7 +96,7 @@ static const struct iio_chan_spec lmp92064_adc_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = TI_LMP92064_CHAN_INC, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -109,7 +109,7 @@ static const struct iio_chan_spec lmp92064_adc_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = TI_LMP92064_CHAN_INV, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
drivers/iio/adc/ti-tlc4541.c +1 -1
@@ -60,7 +60,7 @@ enum tlc4541_id { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (bitshift), \
drivers/iio/adc/ti-tsc2046.c +1 -1
@@ -192,7 +192,7 @@ struct tsc2046_adc_priv { .datasheet_name = "#name", \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/ti_am335x_adc.c +1 -1
@@ -417,7 +417,7 @@ static int tiadc_channel_init(struct device *dev, struct iio_dev *indio_dev, chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); chan->datasheet_name = chan_name_ain[chan->channel]; chan->scan_index = i; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =16 ; }
drivers/iio/adc/vf610_adc.c +2 -2
@@ -515,7 +515,7 @@ static const struct iio_chan_spec_ext_info vf610_ext_info[] = { .ext_info = vf610_ext_info, \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -527,7 +527,7 @@ static const struct iio_chan_spec_ext_info vf610_ext_info[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
drivers/iio/adc/xilinx-ams.c +1 -1
@@ -1208,7 +1208,7 @@ static int ams_get_ext_chan(struct fwnode_handle *chan_node,memcpy (chan, &ams_pl_channels[ext_chan],sizeof (*channels));if (fwnode_property_read_bool (child,"xlnx,bipolar" )) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ; num_channels++; }
drivers/iio/adc/xilinx-xadc-core.c +5 -5
@@ -928,7 +928,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev,return ret; val16 >>= chan->scan_type.shift; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val = val16;else *val =sign_extend32 (val16, bits -1 );
@@ -1066,7 +1066,7 @@ static const struct iio_event_spec xadc_voltage_events[] = { .num_event_specs = ARRAY_SIZE(xadc_temp_events), \ .scan_index = (_scan_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
@@ -1086,7 +1086,7 @@ static const struct iio_event_spec xadc_voltage_events[] = { .num_event_specs = (_alarm) ? ARRAY_SIZE(xadc_voltage_events) : 0, \ .scan_index = (_scan_index), \ .scan_type = { \ - .sign = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \ + .format = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
@@ -1265,7 +1265,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)continue ;if (fwnode_property_read_bool (child,"xlnx,bipolar" )) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;if (reg ==0 ) { chan->scan_index =11 ;
@@ -1420,7 +1420,7 @@ static int xadc_probe(struct platform_device *pdev) bipolar_mask =0 ;for (i =0 ; i < indio_dev->num_channels; i++) { -if (indio_dev->channels[i].scan_type.sign =='s' ) +if (indio_dev->channels[i].scan_type.format =='s' ) bipolar_mask |=BIT (indio_dev->channels[i].scan_index); }
drivers/iio/addac/ad74115.c +1 -1
@@ -1280,7 +1280,7 @@ static const struct iio_info ad74115_info = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =32 , \ .shift =8 , \
drivers/iio/addac/ad74413r.c +1 -1
@@ -1120,7 +1120,7 @@ static const struct iio_info ad74413r_info = { .info_mask_separate_available = \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 32, \ .shift = 8, \
drivers/iio/chemical/atlas-ezo-sensor.c +2 -2
@@ -52,7 +52,7 @@ struct atlas_ezo_data { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_CPU, \
@@ -74,7 +74,7 @@ static const struct iio_chan_spec atlas_hum_ezo_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/chemical/atlas-sensor.c +6 -6
@@ -118,7 +118,7 @@ static const struct iio_chan_spec atlas_ph_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -145,7 +145,7 @@ static const struct iio_chan_spec atlas_ph_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _idx + 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -160,7 +160,7 @@ static const struct iio_chan_spec atlas_ec_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -187,7 +187,7 @@ static const struct iio_chan_spec atlas_orp_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -204,7 +204,7 @@ static const struct iio_chan_spec atlas_do_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -228,7 +228,7 @@ static const struct iio_chan_spec atlas_rtd_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/chemical/bme680_core.c +4 -4
@@ -172,7 +172,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_CPU ,
@@ -187,7 +187,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 1, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =32 , .storagebits =32 , .endianness =IIO_CPU ,
@@ -202,7 +202,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 2, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =32 , .storagebits =32 , .endianness =IIO_CPU ,
@@ -213,7 +213,7 @@ static const struct iio_chan_spec bme680_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/chemical/ccs811.c +2 -2
@@ -105,7 +105,7 @@ static const struct iio_chan_spec ccs811_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = 0, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -118,7 +118,7 @@ static const struct iio_chan_spec ccs811_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = 1, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
drivers/iio/chemical/ens160_core.c +2 -2
@@ -76,7 +76,7 @@ static const struct iio_chan_spec ens160_channels[] = { .address = ENS160_REG_DATA_TVOC, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -91,7 +91,7 @@ static const struct iio_chan_spec ens160_channels[] = { .address = ENS160_REG_DATA_ECO2, .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
drivers/iio/chemical/pms7003.c +1 -1
@@ -178,7 +178,7 @@ static const struct iio_info pms7003_info = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 10, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/chemical/scd30_core.c +1 -1
@@ -455,7 +455,7 @@ static const struct iio_info scd30_info = { };#define SCD30_CHAN_SCAN_TYPE (_sign, _realbits) .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _realbits, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/chemical/scd4x.c +3 -3
@@ -583,7 +583,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_CO2, .scan_index = SCD4X_CO2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -598,7 +598,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_TEMP, .scan_index = SCD4X_TEMP, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -611,7 +611,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_HR, .scan_index = SCD4X_HR, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/chemical/sps30.c +1 -1
@@ -299,7 +299,7 @@ static const struct iio_info sps30_info = { .address = _mod, \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 19, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/common/cros_ec_sensors/cros_ec_activity.c +1 -1
@@ -283,7 +283,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->scan_index = index; channel->type =IIO_TIMESTAMP ; channel->channel =-1 ; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ; channel->scan_type.realbits =64 ; channel->scan_type.storagebits =64 ;
drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c +1 -1
@@ -36,7 +36,7 @@ static const struct iio_chan_spec cros_ec_lid_angle_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), .scan_type.realbits = CROS_EC_SENSOR_BITS, .scan_type.storagebits = CROS_EC_SENSOR_BITS, - .scan_type.sign = 'u', + .scan_type.format = 'u', .type =IIO_ANGL },IIO_CHAN_SOFT_TIMESTAMP (1 )
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +2 -2
@@ -260,7 +260,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->ext_info = cros_ec_sensors_ext_info; channel->modified =1 ; channel->channel2 =IIO_MOD_X + i; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ;/* Sensor specific */ switch (state->core.type) {
@@ -283,7 +283,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->type =IIO_TIMESTAMP ; channel->channel =-1 ; channel->scan_index =CROS_EC_SENSOR_MAX_AXIS ; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ; channel->scan_type.realbits =64 ; channel->scan_type.storagebits =64 ;
drivers/iio/common/scmi_sensors/scmi_iio.c +2 -2
@@ -425,7 +425,7 @@ static void scmi_iio_set_timestamp_channel(struct iio_chan_spec *iio_chan, iio_chan->type =IIO_TIMESTAMP ; iio_chan->channel =-1 ; iio_chan->scan_index = scan_index; - iio_chan->scan_type.sign ='u' ; + iio_chan->scan_type.format ='u' ; iio_chan->scan_type.realbits =64 ; iio_chan->scan_type.storagebits =64 ; }
@@ -443,7 +443,7 @@ static void scmi_iio_set_data_channel(struct iio_chan_spec *iio_chan, iio_chan->info_mask_shared_by_type_available =BIT (IIO_CHAN_INFO_SAMP_FREQ ); iio_chan->scan_index = scan_index; - iio_chan->scan_type.sign ='s' ; + iio_chan->scan_type.format ='s' ; iio_chan->scan_type.realbits =64 ; iio_chan->scan_type.storagebits =64 ; iio_chan->scan_type.endianness =IIO_LE ;
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h +2 -2
@@ -10,7 +10,7 @@ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ),\ .scan_index = _index,\ .scan_type = {\ - .sign = 's',\ + .format = 's',\ .realbits = 16,\ .storagebits = 16,\ .shift = 0,\
@@ -24,7 +24,7 @@ .channel = -1, \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 64, \ .storagebits = 64, \ }, \
drivers/iio/dac/ad3552r-hs.c +1 -1
@@ -766,7 +766,7 @@ static const struct iio_buffer_setup_ops ad3552r_hs_buffer_setup_ops = { .channel = (ch), \ .scan_index = (ch), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/dac/ad3552r.c +1 -1
@@ -128,7 +128,7 @@ static int ad3552r_update_reg_field(struct ad3552r_desc *dac, u8 addr, u16 mask, .channel = _idx, \ .scan_index = _idx, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/dac/ad5064.c +1 -1
@@ -402,7 +402,7 @@ static const struct iio_chan_spec_ext_info ltc2617_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \ .address = addr, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =16 , \ .shift = (_shift), \
drivers/iio/dac/ad5360.c +1 -1
@@ -109,7 +109,7 @@ enum ad5360_type {BIT (IIO_CHAN_INFO_CALIBSCALE ) | \ BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 16 - (bits), \
drivers/iio/dac/ad5380.c +1 -1
@@ -258,7 +258,7 @@ static const struct iio_chan_spec_ext_info ad5380_ext_info[] = {BIT (IIO_CHAN_INFO_CALIBBIAS ), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =14 - (_bits), \
drivers/iio/dac/ad5421.c +1 -1
@@ -116,7 +116,7 @@ static const struct iio_chan_spec ad5421_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
drivers/iio/dac/ad5446.h +1 -1
@@ -20,7 +20,7 @@ extern const struct iio_chan_spec_ext_info ad5446_ext_info_powerdown[]; .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = (storage), \ .shift = (_shift), \
drivers/iio/dac/ad5449.c +1 -1
@@ -203,7 +203,7 @@ static const struct iio_info ad5449_info = {BIT (IIO_CHAN_INFO_SCALE ), \ .address = (chan), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =12 - (bits), \
drivers/iio/dac/ad5504.c +1 -1
@@ -254,7 +254,7 @@ static const struct iio_chan_spec_ext_info ad5504_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = AD5504_ADDR_DAC(_chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
drivers/iio/dac/ad5592r-base.c +1 -1
@@ -480,7 +480,7 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev, chan->channel = id; chan->info_mask_separate =BIT (IIO_CHAN_INFO_RAW ); chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =16 ; chan->ext_info = ad5592r_ext_info;
drivers/iio/dac/ad5624r_spi.c +1 -1
@@ -172,7 +172,7 @@ static const struct iio_chan_spec_ext_info ad5624r_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = (_chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5686.c +1 -1
@@ -197,7 +197,7 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\ .address = addr, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (_shift), \
drivers/iio/dac/ad5755.c +1 -1
@@ -534,7 +534,7 @@ static const struct iio_chan_spec_ext_info ad5755_ext_info[] = {BIT (IIO_CHAN_INFO_CALIBSCALE ) | \ BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5761.c +1 -1
@@ -257,7 +257,7 @@ static const struct iio_info ad5761_info = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5764.c +1 -1
@@ -84,7 +84,7 @@ enum ad5764_type {BIT (IIO_CHAN_INFO_CALIBBIAS ), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =16 - (_bits), \
drivers/iio/dac/ad5766.c +1 -1
@@ -449,7 +449,7 @@ static const struct iio_chan_spec_ext_info ad5766_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \ .scan_index = (_chan), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =16 - (_bits), \
drivers/iio/dac/ad5791.c +2 -2
@@ -323,7 +323,7 @@ static const struct ad5791_chip_info _name##_chip_info = { \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 32, \ .shift = (_shift), \
@@ -341,7 +341,7 @@ static const struct ad5791_chip_info _name##_chip_info = { \BIT (IIO_CHAN_INFO_OFFSET ), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),\ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =32 , \ .shift = (_shift), \
drivers/iio/dac/ad7303.c +1 -1
@@ -185,7 +185,7 @@ static const struct iio_chan_spec_ext_info ad7303_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = (chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ .shift = 0, \
drivers/iio/dac/ad8460.c +1 -1
@@ -742,7 +742,7 @@ static const struct iio_event_spec ad8460_events[] = { .channel = 0, \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/dac/ad9739a.c +1 -1
@@ -335,7 +335,7 @@ static struct iio_chan_spec ad9739a_channels[] = { .output = 1, .ext_info = ad9739a_ext_info, .scan_type = { - .sign = 's', + .format = 's', .storagebits = 16, .realbits = 16, },
drivers/iio/dac/ltc1660.c +1 -1
@@ -109,7 +109,7 @@ static int ltc1660_write_raw(struct iio_dev *indio_dev, .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/dac/max5522.c +1 -1
@@ -45,7 +45,7 @@ struct max5522_state { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 10, \ .storagebits = 16, \ .shift = 2, \
drivers/iio/dac/mcp4922.c +1 -1
@@ -41,7 +41,7 @@ struct mcp4922_state { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/dac/stm32-dac.c +1 -1
@@ -255,7 +255,7 @@ static const struct iio_chan_spec_ext_info stm32_dac_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \/* scan_index is always 0 as num_channels is 1 */ \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =12 , \ .storagebits =16 , \ }, \
drivers/iio/dummy/iio_simple_dummy.c +4 -4
@@ -128,7 +128,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {/* The ordering of elements in the buffer via an enum */ .scan_index = DUMMY_INDEX_VOLTAGE_0, .scan_type = { /* Description of storage in buffer */ - .sign = 'u', /* unsigned */ + .format = 'u', /* unsigned */ .realbits = 13, /* 13 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
@@ -167,7 +167,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {*/ .scan_index = DUMMY_INDEX_DIFFVOLTAGE_1M2, .scan_type = { /* Description of storage in buffer */ - .sign = 's', /* signed */ + .format = 's', /* signed */ .realbits = 12, /* 12 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
@@ -185,7 +185,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = { .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = DUMMY_INDEX_DIFFVOLTAGE_3M4, .scan_type = { - .sign = 's', + .format = 's', .realbits = 11, .storagebits = 16, .shift = 0,
@@ -212,7 +212,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = { .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = DUMMY_INDEX_ACCELX, .scan_type = { /* Description of storage in buffer */ - .sign = 's', /* signed */ + .format = 's', /* signed */ .realbits = 16, /* 16 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
drivers/iio/gyro/adis16136.c +2 -2
@@ -361,7 +361,7 @@ static const struct iio_chan_spec adis16136_channels[] = { .address = ADIS16136_REG_GYRO_OUT2, .scan_index = ADIS16136_SCAN_GYRO, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -375,7 +375,7 @@ static const struct iio_chan_spec adis16136_channels[] = { .address = ADIS16136_REG_TEMP_OUT, .scan_index = ADIS16136_SCAN_TEMP, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/gyro/adxrs290.c +2 -2
@@ -538,7 +538,7 @@ static irqreturn_t adxrs290_trigger_handler(int irq, void *p) BIT(IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY), \ .scan_index = ADXRS290_IDX_##axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -555,7 +555,7 @@ static const struct iio_chan_spec adxrs290_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = ADXRS290_IDX_TEMP, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_LE ,
drivers/iio/gyro/bmg160_core.c +1 -1
@@ -833,7 +833,7 @@ static const struct iio_event_spec bmg160_event = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/gyro/fxas21002c_core.c +1 -1
@@ -696,7 +696,7 @@ static const struct attribute_group fxas21002c_attrs_group = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = CHANNEL_SCAN_INDEX_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
drivers/iio/gyro/hid-sensor-gyro-3d.c +1 -1
@@ -86,7 +86,7 @@ static const struct iio_chan_spec gyro_3d_channels[] = {static void gyro_3d_adjust_channel_bit_mask (struct iio_chan_spec *channels,int channel,int size) { - channels[channel].scan_type.sign ='s' ; + channels[channel].scan_type.format ='s' ;/* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size *8 ;/* Maximum size of a sample to capture is u32 */
drivers/iio/gyro/itg3200_core.c +1 -1
@@ -257,7 +257,7 @@ static const struct iio_chan_spec_ext_info itg3200_ext_info[] = { };#define ITG3200_ST \ - { .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE } + { .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE }#define ITG3200_GYRO_CHAN (_mod) { \ .type = IIO_ANGL_VEL, \
drivers/iio/gyro/mpu3050-core.c +2 -2
@@ -697,7 +697,7 @@ static const struct iio_chan_spec_ext_info mpu3050_ext_info[] = { .ext_info = mpu3050_ext_info, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -713,7 +713,7 @@ static const struct iio_chan_spec mpu3050_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/health/afe440x.h +1 -1
@@ -87,7 +87,7 @@ .address = _index, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/health/max30100.c +2 -2
@@ -124,7 +124,7 @@ static const struct iio_chan_spec max30100_channels[] = { .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
@@ -137,7 +137,7 @@ static const struct iio_chan_spec max30100_channels[] = { .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/health/max30102.c +1 -1
@@ -135,7 +135,7 @@ static const unsigned long max30105_scan_masks[] = { .modified = 1, \ .scan_index = _si, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .shift = 8, \ .realbits = 18, \ .storagebits = 32, \
drivers/iio/humidity/am2315.c +2 -2
@@ -51,7 +51,7 @@ static const struct iio_chan_spec am2315_channels[] = { BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -63,7 +63,7 @@ static const struct iio_chan_spec am2315_channels[] = { BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/humidity/hdc100x.c +2 -2
@@ -100,7 +100,7 @@ static const struct iio_chan_spec hdc100x_channels[] = { BIT(IIO_CHAN_INFO_OFFSET), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
@@ -114,7 +114,7 @@ static const struct iio_chan_spec hdc100x_channels[] = { BIT(IIO_CHAN_INFO_INT_TIME), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/humidity/hid-sensor-humidity.c +1 -1
@@ -47,7 +47,7 @@ static const struct iio_chan_spec humidity_channels[] = { static void humidity_adjust_channel_bit_mask(struct iio_chan_spec *channels, int channel, int size) { - channels[channel].scan_type.sign = 's'; + channels[channel].scan_type.format = 's'; /* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size * 8; /* Maximum size of a sample to capture is s32 */
drivers/iio/humidity/hts221_core.c +2 -2
@@ -100,7 +100,7 @@ static const struct iio_chan_spec hts221_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -116,7 +116,7 @@ static const struct iio_chan_spec hts221_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
drivers/iio/imu/adis.c +1 -1
@@ -482,7 +482,7 @@ int adis_single_conversion(struct iio_dev *indio_dev, return ret; } - if (chan->scan_type.sign == 's') + if (chan->scan_type.format == 's') *val = sign_extend32(uval, chan->scan_type.realbits - 1); else *val = uval & ((1 << chan->scan_type.realbits) - 1);
drivers/iio/imu/adis16400.c +8 -8
@@ -653,7 +653,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = (si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -679,7 +679,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = addr, \ .scan_index = ADIS16400_SCAN_GYRO_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -699,7 +699,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16400_SCAN_ACC_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -718,7 +718,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16400_SCAN_MAGN_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -744,7 +744,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16350_SCAN_TEMP_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -763,7 +763,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16350_SCAN_TEMP_X, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -781,7 +781,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16300_SCAN_INCLI_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -834,7 +834,7 @@ static const struct iio_chan_spec adis16448_channels[] = { .address = ADIS16448_BARO_OUT, .scan_index = ADIS16400_SCAN_BARO, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/imu/adis16460.c +2 -2
@@ -242,7 +242,7 @@ enum { .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_bits), \ .storagebits = (_bits), \ .endianness = IIO_BE, \
@@ -270,7 +270,7 @@ enum { .address = ADIS16460_REG_TEMP_OUT, \ .scan_index = ADIS16460_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/adis16475.c +3 -3
@@ -671,7 +671,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_r_bits), \ .storagebits = (_s_bits), \ .endianness = IIO_BE, \
@@ -699,7 +699,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = ADIS16475_REG_TEMP_OUT, \ .scan_index = ADIS16475_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -717,7 +717,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_r_bits), \ .storagebits = (_s_bits), \ .endianness = IIO_BE, \
drivers/iio/imu/adis16480.c +3 -3
@@ -741,7 +741,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_bits), \ .storagebits = (_bits), \ .endianness = IIO_BE, \
@@ -798,7 +798,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = ADIS16480_REG_BAROM_OUT, \ .scan_index = ADIS16480_SCAN_BARO, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -816,7 +816,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = ADIS16480_REG_TEMP_OUT, \ .scan_index = ADIS16480_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/adis16550.c +3 -3
@@ -706,7 +706,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -731,7 +731,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = ADIS16550_REG_TEMP, \ .scan_index = ADIS16550_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -748,7 +748,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/imu/bmi160/bmi160_core.c +1 -1
@@ -105,7 +105,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bmi270/bmi270_core.c +2 -2
@@ -1275,7 +1275,7 @@ static const struct iio_info bmi270_info = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = BMI270_SCAN_ACCEL_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -1296,7 +1296,7 @@ static const struct iio_info bmi270_info = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = BMI270_SCAN_GYRO_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bmi323/bmi323_core.c +2 -2
@@ -248,7 +248,7 @@ static const struct iio_event_spec bmi323_accel_event[] = { BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -272,7 +272,7 @@ static const struct iio_event_spec bmi323_accel_event[] = { BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bno055/bno055.c +1 -1
@@ -444,7 +444,7 @@ static void bno055_uninit(void *arg) .info_mask_shared_by_type_available = _avail, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +1 -1
@@ -42,7 +42,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +1 -1
@@ -39,7 +39,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_temp.h +1 -1
@@ -17,7 +17,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ }, \
drivers/iio/imu/inv_icm45600/inv_icm45600.h +1 -1
@@ -346,7 +346,7 @@ inv_icm45600_get_mount_matrix(const struct iio_dev *indio_dev, BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm45600/inv_icm45600_accel.c +1 -1
@@ -52,7 +52,7 @@ static const struct iio_chan_spec_ext_info inv_icm45600_accel_ext_infos[] = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm45600/inv_icm45600_gyro.c +1 -1
@@ -52,7 +52,7 @@ static const struct iio_chan_spec_ext_info inv_icm45600_gyro_ext_infos[] = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +3 -3
@@ -1469,7 +1469,7 @@ static const struct iio_event_spec inv_wom_events[] = { BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .shift = 0, \
@@ -1486,7 +1486,7 @@ static const struct iio_event_spec inv_wom_events[] = { | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .shift = 0, \
@@ -1578,7 +1578,7 @@ static const unsigned long inv_mpu_scan_masks[] = { BIT(IIO_CHAN_INFO_RAW), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _bits, \ .storagebits = 16, \ .shift = 0, \
drivers/iio/imu/kmx61.c +2 -2
@@ -234,7 +234,7 @@ static const struct iio_event_spec kmx61_event = { .address = KMX61_ACC, \ .scan_index = KMX61_AXIS_ ## _axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
@@ -254,7 +254,7 @@ static const struct iio_event_spec kmx61_event = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = KMX61_AXIS_ ## _axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .shift = 2, \
drivers/iio/imu/smi240.c +2 -2
@@ -80,7 +80,7 @@ BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -96,7 +96,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/imu/smi330/smi330_core.c +3 -3
@@ -85,7 +85,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = SMI330_SCAN_ACCEL_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -110,7 +110,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = SMI330_SCAN_GYRO_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -124,7 +124,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +2 -2
@@ -92,7 +92,7 @@ enum st_lsm6dsx_hw_id { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -113,7 +113,7 @@ enum st_lsm6dsx_hw_id { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/industrialio-buffer.c +2 -2
@@ -421,7 +421,7 @@ static ssize_t iio_show_fixed_type(struct device *dev, if (scan_type->repeat > 1) return sysfs_emit(buf, "%s:%c%d/%dX%d>>%u\n", iio_endian_prefix[type], - scan_type->sign, + scan_type->format, scan_type->realbits, scan_type->storagebits, scan_type->repeat,
@@ -429,7 +429,7 @@ static ssize_t iio_show_fixed_type(struct device *dev, else return sysfs_emit(buf, "%s:%c%d/%d>>%u\n", iio_endian_prefix[type], - scan_type->sign, + scan_type->format, scan_type->realbits, scan_type->storagebits, scan_type->shift);
drivers/iio/light/acpi-als.c +1 -1
@@ -38,7 +38,7 @@ static const struct iio_chan_spec acpi_als_channels[] = { { .type = IIO_LIGHT, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, },
drivers/iio/light/adjd_s311.c +1 -1
@@ -152,7 +152,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p) .channel2 = (IIO_MOD_LIGHT_##_color), \ .scan_index = (_scan_idx), \ .scan_type = { \ - .sign = 'u', \
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/hid-sensor-magn-3d.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/hmc5843_core.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/yamaha-yas530.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/iio/orientation/hid-sensor-incl-3d.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/orientation/hid-sensor-rotation.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/position/hid-sensor-custom-intel-hinge.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/iio/pressure/hid-sensor-press.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/pressure/st_pressure_core.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/temperature/hid-sensor-temperature.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/temperature/maxim_thermocouple.c +3 -3
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.5
Part of the diff is not shown here. View the raw message.
PATCH v6 5/7 iio: ABI: Add support for floating-point numbers in buffer scan elements
In reply to Francesco LavraIn the data storage description of a scan element, the first character after the colon can have the values 's' and 'u' to specify signed and unsigned integers, respectively.
Add 'f' as an allowed value to specify floating-point numbers formatted according to the IEEE 754 standard.
--- Documentation/ABI/testing/sysfs-bus-iio | 33 +++++++++++++----------- Documentation/driver-api/iio/buffers.rst | 5 ++-- Documentation/iio/iio_devbuf.rst | 3 ++- 3 files changed, 23 insertions(+), 18 deletions(-)
Documentation/ABI/testing/sysfs-bus-iio +18 -15
@@ -1510,21 +1510,24 @@ Contact: [email protected] Description: Description of the scan element data storage within the buffer and hence the form in which it is read from user-space. - Form is [be|le]:[s|u]bits/storagebits[>>shift]. - be or le specifies big or little endian. s or u specifies if - signed (2's complement) or unsigned. bits is the number of bits - of data and storagebits is the space (after padding) that it - occupies in the buffer. shift if specified, is the shift that - needs to be applied prior to masking out unused bits. Some - devices put their data in the middle of the transferred elements - with additional information on both sides. Note that some - devices will have additional information in the unused bits - so to get a clean value, the bits value must be used to mask - the buffer output value appropriately. The storagebits value - also specifies the data alignment. So s48/64>>2 will be a - signed 48 bit integer stored in a 64 bit location aligned to - a 64 bit boundary. To obtain the clean value, shift right 2 - and apply a mask to zero the top 16 bits of the result. + Form is [be|le]:[s|u|f]bits/storagebits[>>shift]. + be or le specifies big or little endian. s means signed (two's + complement), u means unsigned, f means floating-point (IEEE 754 + binary format). bits is the number of bits of data and storagebits + is the space (after padding) that it occupies in the buffer; when + using a floating-point format, bits must be one of the width values + defined in the IEEE 754 standard for binary interchange formats + (e.g. 16 indicates the binary16 format for half-precision numbers). + shift, if specified, is the shift that needs to be applied prior to + masking out unused bits. Some devices put their data in the middle + of the transferred elements with additional information on both + sides. Note that some devices will have additional information in + the unused bits, so to get a clean value the bits value must be + used to mask the buffer output value appropriately. The storagebits + value also specifies the data alignment. So s48/64>>2 will be a + signed 48 bit integer stored in a 64 bit location aligned to a 64 + bit boundary. To obtain the clean value, shift right 2 and apply a + mask to zero the top 16 bits of the result. For other storage combinations this attribute will be extended appropriately.
Documentation/driver-api/iio/buffers.rst +3 -2
@@ -37,10 +37,11 @@ directory contains attributes of the following form: * :file:`index`, the scan_index of the channel. * :file:`type`, description of the scan element data storage within the buffer and hence the form in which it is read from user space. - Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . + Format is [be|le]:[s|u|f]bits/storagebits[Xrepeat][>>shift] . * *be* or *le*, specifies big or little endian. - * *s* or *u*, specifies if signed (2's complement) or unsigned. + * *s* or *u* or *f*, specifies if signed (2's complement) or unsigned or + floating-point. * *bits*, is the number of valid data bits. * *storagebits*, is the number of bits (after padding) that it occupies in the buffer.
Documentation/iio/iio_devbuf.rst +2 -1
@@ -86,7 +86,8 @@ within the buffer and hence the form in which it is read from userspace. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift], where: - **be** or **le** specifies big or little-endian. -- **s** or **u** specifies if signed (2's complement) or unsigned. +- **s** or **u** or **f** specifies if signed (2's complement) or unsigned or + floating-point. - **bits** is the number of valid data bits. - **storagebits** is the number of bits (after padding) that it occupies in the buffer.
Signature · 1 line
2.39.5
PATCH v6 6/7 iio: ABI: Add custom data type
In reply to Francesco LavraThis type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace.
--- Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++ drivers/iio/industrialio-core.c | 1 + include/uapi/linux/iio/types.h | 1 + 3 files changed, 21 insertions(+)
Documentation/ABI/testing/sysfs-bus-iio +19 -0
@@ -450,6 +450,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_offset What: /sys/bus/iio/devices/iio:deviceX/in_rot_offset What: /sys/bus/iio/devices/iio:deviceX/in_angl_offset What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_custom_offset +What: /sys/bus/iio/devices/iio:deviceX/in_customY_offset KernelVersion: 2.6.35 Contact: [email protected] Description:
@@ -507,6 +509,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale What: /sys/bus/iio/devices/iio:deviceX/in_concentration_co2_scale +What: /sys/bus/iio/devices/iio:deviceX/in_custom_scale +What: /sys/bus/iio/devices/iio:deviceX/in_customY_scale KernelVersion: 2.6.35 Contact: [email protected] Description:
@@ -1486,6 +1490,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_en What: /sys/.../iio:deviceX/bufferY/in_pressure_en What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_en What: /sys/.../iio:deviceX/bufferY/in_proximity_en +What: /sys/.../iio:deviceX/bufferY/in_custom_en +What: /sys/.../iio:deviceX/bufferY/in_customZ_en KernelVersion: 5.11 Contact: [email protected] Description:
@@ -1505,6 +1511,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_type What: /sys/.../iio:deviceX/bufferY/in_pressure_type What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_type What: /sys/.../iio:deviceX/bufferY/in_proximity_type +What: /sys/.../iio:deviceX/bufferY/in_custom_type +What: /sys/.../iio:deviceX/bufferY/in_customZ_type KernelVersion: 5.11 Contact: [email protected] Description:
@@ -1566,6 +1574,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_index What: /sys/.../iio:deviceX/bufferY/in_pressure_index What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_index What: /sys/.../iio:deviceX/bufferY/in_proximity_index +What: /sys/.../iio:deviceX/bufferY/in_custom_index +What: /sys/.../iio:deviceX/bufferY/in_customZ_index KernelVersion: 5.11 Contact: [email protected] Description:
@@ -2393,6 +2403,15 @@ Description: The x and y light color coordinate on the CIE 1931 chromaticity diagram. +What: /sys/bus/iio/devices/iio:deviceX/in_custom_raw +What: /sys/bus/iio/devices/iio:deviceX/in_customY_raw +KernelVersion: 7.1 +Contact: [email protected] +Description: + Custom input value, whose type is driver-specific and is described + in a separate document. It can have a modifier Y, in which case it + is a measuremement from channel Y. + What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_either_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_rising_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_thresh_falling_label
drivers/iio/industrialio-core.c +1 -0
@@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CHROMATICITY] = "chromaticity", [IIO_ATTENTION] = "attention", [IIO_ALTCURRENT] = "altcurrent", + [IIO_CUSTOM ] ="custom" };static const char *const iio_modifier_names[] = {
include/uapi/linux/iio/types.h +1 -0
@@ -53,6 +53,7 @@ enum iio_chan_type {IIO_CHROMATICITY ,IIO_ATTENTION ,IIO_ALTCURRENT , +IIO_CUSTOM }; enum iio_modifier {
Signature · 1 line
2.39.5
PATCH v6 7/7 iio: imu: st_lsm6dsx: Add support for rotation sensor
In reply to Francesco LavraSome IMU chips in the LSM6DSX family have sensor fusion features that combine data from the accelerometer and gyroscope. One of these features generates rotation vector data and makes it available in the hardware FIFO as a quaternion (more specifically, the X, Y and Z components of the quaternion vector, expressed as 16-bit half-precision floating-point numbers).
Add support for a new sensor instance that allows receiving sensor fusion data, by defining a new struct st_lsm6dsx_sf_settings (which contains chip-specific details for the sensor fusion functionality), and adding this struct as a new field in struct st_lsm6dsx_settings. In st_lsm6dsx_core.c, populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the logic to initialize an additional IIO device if this struct is populated for the hardware type being probed.
Note: a new IIO device is being defined (as opposed to adding channels to an existing device) because the rate at which sensor fusion data is generated may not match the data rate from any of the existing devices.
Tested on LSMDSV16X.
--- Documentation/iio/index.rst | 1 + Documentation/iio/st_lsm6dsx.rst | 44 ++++ drivers/iio/imu/st_lsm6dsx/Makefile | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 26 +- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 58 +++++ .../iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 235 ++++++++++++++++++ 7 files changed, 368 insertions(+), 7 deletions(-) create mode 100644 Documentation/iio/st_lsm6dsx.rst create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
Documentation/iio/index.rst +1 -0
@@ -39,3 +39,4 @@ Industrial I/O Kernel Drivers bno055 ep93xx_adc opt4060 + st_lsm6dsx
Documentation/iio/st_lsm6dsx.rst new file +44 -0
44 lines not on this page · raw message
drivers/iio/imu/st_lsm6dsx/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only st_lsm6dsx-y := st_lsm6dsx_core.o st_lsm6dsx_buffer.o \ - st_lsm6dsx_shub.o + st_lsm6dsx_shub.o st_lsm6dsx_fusion.o obj-$(CONFIG_IIO_ST_LSM6DSX) += st_lsm6dsx.o obj-$(CONFIG_IIO_ST_LSM6DSX_I2C) += st_lsm6dsx_i2c.o
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +21 -5
@@ -294,6 +294,7 @@ enum st_lsm6dsx_sensor_id {ST_LSM6DSX_ID_EXT0 ,ST_LSM6DSX_ID_EXT1 ,ST_LSM6DSX_ID_EXT2 , +ST_LSM6DSX_ID_SF , ST_LSM6DSX_ID_MAX };
@@ -301,6 +302,15 @@ enum st_lsm6dsx_ext_sensor_id { ST_LSM6DSX_ID_MAGN, }; +struct st_lsm6dsx_sf_settings { +const struct iio_chan_spec *chan; +int chan_len; +struct st_lsm6dsx_odr_table_entry odr_table; +struct st_lsm6dsx_reg fifo_enable; +struct st_lsm6dsx_reg page_mux; +struct st_lsm6dsx_reg enable; +}; +/** * struct st_lsm6dsx_ext_dev_settings - i2c controller slave settings * @i2c_addr: I2c slave address list.
@@ -388,6 +398,7 @@ struct st_lsm6dsx_settings {struct st_lsm6dsx_hw_ts_settings ts_settings;struct st_lsm6dsx_shub_settings shub_settings;struct st_lsm6dsx_event_settings event_settings; +struct st_lsm6dsx_sf_settings sf_settings; };enum st_lsm6dsx_fifo_mode {
@@ -510,6 +521,9 @@ int st_lsm6dsx_check_odr(struct st_lsm6dsx_sensor *sensor, u32 odr, u8 *val);int st_lsm6dsx_shub_probe (struct st_lsm6dsx_hw *hw,const char *name);int st_lsm6dsx_shub_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable);int st_lsm6dsx_shub_read_output (struct st_lsm6dsx_hw *hw,u8 *data,int len); +int st_lsm6dsx_sf_probe (struct st_lsm6dsx_hw *hw,const char *name); +int st_lsm6dsx_sf_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable); +int st_lsm6dsx_sf_set_odr (struct st_lsm6dsx_sensor *sensor,bool enable);int st_lsm6dsx_set_page (struct st_lsm6dsx_hw *hw,bool enable); static inline int
@@ -564,12 +578,14 @@ st_lsm6dsx_get_mount_matrix(const struct iio_dev *iio_dev,static inline int st_lsm6dsx_device_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable) { -if (sensor->id ==ST_LSM6DSX_ID_EXT0 || - sensor->id ==ST_LSM6DSX_ID_EXT1 || - sensor->id ==ST_LSM6DSX_ID_EXT2 ) +switch (sensor->id) { + case ST_LSM6DSX_ID_EXT0 ... ST_LSM6DSX_ID_EXT2:return st_lsm6dsx_shub_set_enable (sensor, enable); - -return st_lsm6dsx_sensor_set_enable (sensor, enable); +case ST_LSM6DSX_ID_SF : +return st_lsm6dsx_sf_set_enable (sensor, enable); +default : +return st_lsm6dsx_sensor_set_enable (sensor, enable); + } } static const
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +8 -1
@@ -88,6 +88,7 @@ enum st_lsm6dsx_fifo_tag {ST_LSM6DSX_EXT0_TAG =0x0f ,ST_LSM6DSX_EXT1_TAG =0x10 ,ST_LSM6DSX_EXT2_TAG =0x11 , + ST_LSM6DSX_ROT_TAG = 0x13, }; static const
@@ -226,8 +227,11 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor,u8 data;/* Only internal sensors have a FIFO ODR configuration register. */ -if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) +if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) { +if (sensor->id ==ST_LSM6DSX_ID_SF ) +return st_lsm6dsx_sf_set_odr (sensor, enable);return 0 ; + } batch_reg = &hw->settings->batch[sensor->id];if (batch_reg->addr) {
@@ -578,6 +582,9 @@ st_lsm6dsx_push_tagged_data(struct st_lsm6dsx_hw *hw, u8 tag,case ST_LSM6DSX_EXT2_TAG : iio_dev = hw->iio_devs[ST_LSM6DSX_ID_EXT2 ];break ; +case ST_LSM6DSX_ROT_TAG : + iio_dev = hw->iio_devs[ST_LSM6DSX_ID_SF ]; +break ;default :return -EINVAL ; }
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +58 -0
82 lines not on this page · raw message
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +235 -0
235 lines not on this page · raw message
Signature · 1 line
2.39.5
PATCH v6 1/7 iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only
In reply to Francesco LavraThe st_lsm6dsx_set_fifo_odr() function, which is called when enabling and disabling the hardware FIFO, checks the contents of the hw->settings->batch array at index sensor->id, and then sets the current ODR value in sensor registers that depend on whether the register address is set in the above array element. This logic is valid for internal sensors only, i.e. the accelerometer and gyroscope; however, since commit c91c1c844ebd ("iio: imu:st_lsm6dsx: add i2c embedded controller support"), this function is called also when configuring the hardware FIFO for external sensors (i.e. sensors accessed through the sensor hub functionality), which can result in unrelated device registers being written.
Add a check to the beginning of st_lsm6dsx_set_fifo_odr() so that it does not touch any registers unless it is called for internal sensors.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +4 -0
@@ -225,6 +225,10 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor,const struct st_lsm6dsx_reg *batch_reg;u8 data; +/* Only internal sensors have a FIFO ODR configuration register. */ +if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) +return 0 ; + batch_reg = &hw->settings->batch[sensor->id];if (batch_reg->addr) {int val;
Signature · 1 line
2.39.5
PATCH v6 2/7 iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
In reply to Francesco LavraThe st_lsm6dsx_hwfifo_odr_store() function, which is called when userspace writes the buffer sampling frequency sysfs attribute, calls st_lsm6dsx_check_odr(), which accesses the odr_table array at index sensor->id; since this array is only 2 entries long, an access for any sensor type other than accelerometer or gyroscope is an out-of-bounds access.
The motivation for being able to set a buffer frequency different from the sensor sampling frequency is to support use cases that need accurate event detection (which requires a high sampling frequency) while retrieving sensor data at low frequency. Since all the supported event types are generated from acceleration data only, do not create the buffer sampling frequency attribute for sensor types other than the accelerometer.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +10 -1
@@ -862,12 +862,21 @@ int st_lsm6dsx_fifo_setup(struct st_lsm6dsx_hw *hw)int i, ret;for (i =0 ; i <ST_LSM6DSX_ID_MAX ; i++) { +const struct iio_dev_attr **attrs; +if (!hw->iio_devs[i])continue ; +/* +* For the accelerometer, allow setting FIFO sampling frequency +* values different from the sensor sampling frequency, which +* may be needed to keep FIFO data rate low while sampling +* acceleration data at high rates for accurate event detection. +*/ + attrs = i ==ST_LSM6DSX_ID_ACC ? st_lsm6dsx_buffer_attrs :NULL ; ret =devm_iio_kfifo_buffer_setup_ext (hw->dev, hw->iio_devs[i], &st_lsm6dsx_buffer_ops, - st_lsm6dsx_buffer_attrs); + attrs);if (ret)return ret; }
Signature · 1 line
2.39.5
Jonathan Cameron
maintainerRe: [PATCH v6 2/7] iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only
Quoted 14 lines · On Wed, 25 Feb 2026 11:16:32 +0100 Francesco Lavra <[email protected]> wrote:
The
st_lsm6dsx_hwfifo_odr_store()function, which is called when userspace writes the buffer sampling frequency sysfs attribute, callsst_lsm6dsx_check_odr(), which accesses theodr_tablearray at indexsensor->id; since this array is only 2 entries long, an access for any sensor type other than accelerometer or gyroscope is an out-of-bounds access.The motivation for being able to set a buffer frequency different from the sensor sampling frequency is to support use cases that need accurate event detection (which requires a high sampling frequency) while retrieving sensor data at low frequency. Since all the supported event types are generated from acceleration data only, do not create the buffer sampling frequency attribute for sensor types other than the accelerometer.
Quoted 2 lines
Fixes 6b648a36c200 ("iio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO batch data rate")Signed-off-by Francesco Lavra <[email protected]>
It feels like we may need a little longer to converge on the rest of the series, and I don't want to risk delaying the fixes further.
A such I've picked up patches 1 and 2 on the fixes-togreg branch of iio.git Please just assume they are available for v7 and drop them from what you post.
This may mean we have to wait for these to be available in a suitable upstream tree before I can pick up the rest. We have plenty of cycle left and the fixes are really piling up in my tree, so that shouldn't be a problem.
Jonathan
Quoted 31 lines
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +10
-1@@ -862,12 +862,21 @@ int st_lsm6dsx_fifo_setup(struct st_lsm6dsx_hw *hw)int i, ret;for (i =0 ; i <ST_LSM6DSX_ID_MAX ; i++) { +const struct iio_dev_attr **attrs; +if (!hw->iio_devs[i])continue ; +/* +* For the accelerometer, allow setting FIFO sampling frequency +* values different from the sensor sampling frequency, which +* may be needed to keep FIFO data rate low while sampling +* acceleration data at high rates for accurate event detection. +*/ + attrs = i ==ST_LSM6DSX_ID_ACC ? st_lsm6dsx_buffer_attrs :NULL ; ret =devm_iio_kfifo_buffer_setup_ext (hw->dev, hw->iio_devs[i], &st_lsm6dsx_buffer_ops, - st_lsm6dsx_buffer_attrs); + attrs);if (ret)return ret; }
PATCH v6 3/7 iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
In reply to Francesco LavraThe DRDY_MASK feature implemented in sensor chips marks gyroscope and accelerometer invalid samples (i.e. samples that have been acquired during the settling time of sensor filters) with the special values 0x7FFFh, 0x7FFE, and 0x7FFD.
The driver checks FIFO samples against these special values in order to discard invalid samples; however, it does the check regardless of the type of samples being processed, whereas this feature is specific to gyroscope and accelerometer data. This could cause valid samples to be discarded.
Fix the above check so that it takes into account the type of samples being processed. To avoid casting to __le16 * when checking sample values, clean up the type representation for data read from the FIFO.
--- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +14 -9
@@ -365,8 +365,6 @@ static inline int st_lsm6dsx_read_block(struct st_lsm6dsx_hw *hw, u8 addr,return 0 ; } -#define ST_LSM6DSX_IIO_BUFF_SIZE (ALIGN(ST_LSM6DSX_SAMPLE_SIZE, \ - sizeof(s64)) + sizeof(s64))/** * st_lsm6dsx_read_fifo() - hw FIFO read routine * @hw: Pointer to instance of struct st_lsm6dsx_hw.
@@ -539,14 +537,14 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw)#define ST_LSM6DSX_INVALID_SAMPLE 0x7ffdstatic int st_lsm6dsx_push_tagged_data (struct st_lsm6dsx_hw *hw,u8 tag, -u8 *data,s64 ts) +__le16 *data,s64 ts) { -s16 val =le16_to_cpu (*(__le16 *)data);struct st_lsm6dsx_sensor *sensor;struct iio_dev *iio_dev;/* invalid sample during bootstrap phase */ -if (val >=ST_LSM6DSX_INVALID_SAMPLE ) +if ((tag ==ST_LSM6DSX_GYRO_TAG || tag ==ST_LSM6DSX_ACC_TAG ) && + (s16 )le16_to_cpup (data) >=ST_LSM6DSX_INVALID_SAMPLE )return -EINVAL ;/*
@@ -609,7 +607,13 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)* must be passed a buffer that is aligned to 8 bytes so * as to allow insertion of a naturally aligned timestamp. */ -u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };u8 tag;bool reset_ts = false;int i, err, read_len;
@@ -648,7 +652,7 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)for (i =0 ; i < pattern_len; i +=ST_LSM6DSX_TAGGED_SAMPLE_SIZE ) { -memcpy (iio_buff, &hw->buff[i +ST_LSM6DSX_TAG_SIZE ], +memcpy (&iio_buff, &hw->buff[i +ST_LSM6DSX_TAG_SIZE ],ST_LSM6DSX_SAMPLE_SIZE ); tag = hw->buff[i] >>3 ;
@@ -659,7 +663,7 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)* B0 = ts[7:0], B1 = ts[15:8], B2 = ts[23:16], * B3 = ts[31:24] */ - ts =le32_to_cpu (*((__le32 *)iio_buff)); + ts =le32_to_cpu (iio_buff.fifo_ts);/* * check if hw timestamp engine is going to * reset (the sensor generates an interrupt
@@ -670,7 +674,8 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) reset_ts = true; ts *= hw->ts_gain; }else { -st_lsm6dsx_push_tagged_data (hw, tag, iio_buff, +st_lsm6dsx_push_tagged_data (hw, tag, + iio_buff.data, ts); } }
Signature · 1 line
2.39.5
Re: [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Quoted 12 lines · Francesco Lavra
The
DRDY_MASKfeature implemented in sensor chips marks gyroscope and accelerometer invalid samples (i.e. samples that have been acquired during the settling time of sensor filters) with the special values 0x7FFFh,0x7FFE, and0x7FFD.
The driver checks FIFO samples against these special values in order to discard invalid samples; however, it does the check regardless of the type of samples being processed, whereas this feature is specific to gyroscope and accelerometer data. This could cause valid samples to be discarded.Fix the above check so that it takes into account the type of samples being processed. To avoid casting to
__le16* when checking sample values, clean up the type representation for data read from the FIFO.
...
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) · line 616
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +7
-1-u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };
Hmm... Have you considered m68k case? IIRC there the alignment is 2 (even for 64-bit members), so theoretically the beginning of the structure can be aligned to address 2. and hence the __le16 data[3] will have no gap to the following timestamp. In current code it's 64-bit and not 48-bit item.
I believe it's easy to check, though.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Hi Andy,
Quoted 25 lines · Andy Shevchenko
Quoted 12 lines · Francesco Lavra
The
DRDY_MASKfeature implemented in sensor chips marks gyroscope and accelerometer invalid samples (i.e. samples that have been acquired during the settling time of sensor filters) with the special values 0x7FFFh,0x7FFE, and0x7FFD.
The driver checks FIFO samples against these special values in order to discard invalid samples; however, it does the check regardless of the type of samples being processed, whereas this feature is specific to gyroscope and accelerometer data. This could cause valid samples to be discarded.Fix the above check so that it takes into account the type of samples being processed. To avoid casting to
__le16* when checking sample values, clean up the type representation for data read from the FIFO....
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) · line 616
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +7
-1-u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };
Quoted 4 lines
Hmm... Have you considered m68k case? IIRC there the alignment is 2 (even for 64-bit members), so theoretically the beginning of the structure can be aligned to address 2. and hence the
__le16data[3] will have no gap to the following timestamp. In current code it's 64-bit and not 48-bit item.
Fortunately, the layout of a structure does not change because the first member could be stored at a less-aligned address, as that would make it incompatible with a different instance that is stored at a differently-aligned address ;-)
The alignment of a structure is the maximum of the alignments of its members. So that will be 8 bytes, as the aligned_s64 definition has an internal "__attribute__((aligned(8)))".
It would be wise to add explicit padding ("u16 pad") just before timestamp though, for documentation purpose.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Quoted 3 lines · Geert Uytterhoeven
Quoted 1 line · Andy Shevchenko
On Wed, Feb 25, 2026 at 11:17:11AM +0100, Francesco Lavra wrote:
...
Quoted 14 lines
Quoted 9 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) · line 616
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +7
-1-u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };Quoted 4 lines
Hmm... Have you considered m68k case? IIRC there the alignment is 2 (even for 64-bit members), so theoretically the beginning of the structure can be aligned to address 2. and hence the
__le16data[3] will have no gap to the following timestamp. In current code it's 64-bit and not 48-bit item.
Quoted 8 lines
Fortunately, the layout of a structure does not change because the first member could be stored at a less-aligned address, as that would make it incompatible with a different instance that is stored at a differently-aligned address ;-)
The alignment of a structure is the maximum of the alignments of its members. So that will be 8 bytes, as the
aligned_s64definition has an internal "__attribute__((aligned(8)))".
Thanks for the elaboration on this case, my knowledge about m68k is too shallow!
Quoted 2 lines
It would be wise to add explicit padding ("u16 pad") just before timestamp though, for documentation purpose.
__le16 :-) Something like this:
struct {
union {
__le16 data[3];
__le32 fifo_ts;
};
__le16 reserved; // ...compatibility with the previous impl...
aligned_s64 timestamp;
} iio_buff = { };?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerRe: [PATCH v6 3/7] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Quoted 35 lines · On Thu, 26 Feb 2026 11:56:01 +0200 Andy Shevchenko…
Quoted 3 lines · Geert Uytterhoeven
Quoted 1 line · Andy Shevchenko
On Wed, Feb 25, 2026 at 11:17:11AM +0100, Francesco Lavra wrote:
...
Quoted 14 lines
Quoted 9 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw) · line 616
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +7
-1-u8 iio_buff[ST_LSM6DSX_IIO_BUFF_SIZE ]__aligned(8) ; +struct { +union { +__le16 data[3 ]; +__le32 fifo_ts; + }; +aligned_s64 timestamp; + } iio_buff = { };Quoted 4 lines
Hmm... Have you considered m68k case? IIRC there the alignment is 2 (even for 64-bit members), so theoretically the beginning of the structure can be aligned to address 2. and hence the
__le16data[3] will have no gap to the following timestamp. In current code it's 64-bit and not 48-bit item.Quoted 8 lines
Fortunately, the layout of a structure does not change because the first member could be stored at a less-aligned address, as that would make it incompatible with a different instance that is stored at a differently-aligned address ;-)
The alignment of a structure is the maximum of the alignments of its members. So that will be 8 bytes, as the
aligned_s64definition has an internal "__attribute__((aligned(8)))".Thanks for the elaboration on this case, my knowledge about m68k is too shallow!
Quoted 2 lines
It would be wise to add explicit padding ("u16 pad") just before timestamp though, for documentation purpose.
Quoted 8 lines
__le16:-) Something like this:struct { union { __le16 data[3]; __le32 fifo_ts; }; __le16 reserved; // ...compatibility with the previous impl...
We typically haven't done this. I'm not sure why this driver justifies it as IIO timestamp placement always relies on the set of rules Geert has laid out.
Also if we did do it, applying an endianness to reserve data is a an odd thing to do.
So as far a I'm concerned the approach in this patch seems fine.
Thanks,
Jonathan
Quoted 5 lines
aligned_s64 timestamp; } iio_buff = { };?
PATCH v6 4/7 iio: Rename 'sign' field to `format` in struct iio_scan_type
In reply to Francesco LavraThis field is used to differentiate between signed and unsigned integers. A following commit will extend its use to in order to add support for non- integer scan elements; therefore, change its name from 'sign' to a more generic 'format'.
--- Documentation/driver-api/iio/buffers.rst | 4 +- drivers/iio/accel/adxl313_core.c | 2 +- drivers/iio/accel/adxl345_core.c | 2 +- drivers/iio/accel/adxl355_core.c | 4 +- drivers/iio/accel/adxl367.c | 4 +- drivers/iio/accel/adxl372.c | 2 +- drivers/iio/accel/adxl380.c | 4 +- drivers/iio/accel/bma180.c | 10 ++--- drivers/iio/accel/bma220_core.c | 2 +- drivers/iio/accel/bma400_core.c | 4 +- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/cros_ec_accel_legacy.c | 2 +- drivers/iio/accel/fxls8962af-core.c | 4 +- drivers/iio/accel/hid-sensor-accel-3d.c | 2 +- drivers/iio/accel/kionix-kx022a.c | 2 +- drivers/iio/accel/kxcjk-1013.c | 2 +- drivers/iio/accel/kxsd9.c | 4 +- drivers/iio/accel/mma7455_core.c | 2 +- drivers/iio/accel/mma8452.c | 4 +- drivers/iio/accel/msa311.c | 2 +- drivers/iio/accel/mxc4005.c | 2 +- drivers/iio/accel/sca3000.c | 4 +- drivers/iio/accel/sca3300.c | 6 +-- drivers/iio/accel/stk8312.c | 2 +- drivers/iio/accel/stk8ba50.c | 2 +- drivers/iio/adc/ad4000.c | 8 ++-- drivers/iio/adc/ad4030.c | 10 ++--- drivers/iio/adc/ad4062.c | 8 ++-- drivers/iio/adc/ad4080.c | 2 +- drivers/iio/adc/ad4130.c | 2 +- drivers/iio/adc/ad4170-4.c | 12 ++--- drivers/iio/adc/ad4695.c | 24 +++++----- drivers/iio/adc/ad4851.c | 12 ++--- drivers/iio/adc/ad7124.c | 4 +- drivers/iio/adc/ad7173.c | 6 +-- drivers/iio/adc/ad7191.c | 6 +-- drivers/iio/adc/ad7192.c | 2 +- drivers/iio/adc/ad7266.c | 6 +-- drivers/iio/adc/ad7280a.c | 4 +- drivers/iio/adc/ad7298.c | 4 +- drivers/iio/adc/ad7380.c | 44 +++++++++---------- drivers/iio/adc/ad7405.c | 2 +- drivers/iio/adc/ad7476.c | 2 +- drivers/iio/adc/ad7606.c | 14 +++--- drivers/iio/adc/ad7625.c | 2 +- drivers/iio/adc/ad7766.c | 2 +- drivers/iio/adc/ad7768-1.c | 8 ++-- drivers/iio/adc/ad7779.c | 2 +- drivers/iio/adc/ad7780.c | 2 +- drivers/iio/adc/ad7791.c | 2 +- drivers/iio/adc/ad7793.c | 2 +- drivers/iio/adc/ad7887.c | 2 +- drivers/iio/adc/ad7923.c | 2 +- drivers/iio/adc/ad7944.c | 8 ++-- drivers/iio/adc/ad799x.c | 2 +- drivers/iio/adc/ad9467.c | 4 +- drivers/iio/adc/ade9000.c | 4 +- drivers/iio/adc/at91-sama5d2_adc.c | 10 ++--- drivers/iio/adc/at91_adc.c | 4 +- drivers/iio/adc/cc10001_adc.c | 4 +- drivers/iio/adc/cpcap-adc.c | 2 +- drivers/iio/adc/dln2-adc.c | 4 +- drivers/iio/adc/hx711.c | 4 +- drivers/iio/adc/ina2xx-adc.c | 8 ++-- drivers/iio/adc/ingenic-adc.c | 12 ++--- drivers/iio/adc/max1027.c | 4 +- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max11205.c | 2 +- drivers/iio/adc/max11410.c | 2 +- drivers/iio/adc/max1363.c | 4 +- drivers/iio/adc/mcp3911.c | 2 +- drivers/iio/adc/mt6359-auxadc.c | 2 +- drivers/iio/adc/mt6360-adc.c | 2 +- drivers/iio/adc/mxs-lradc-adc.c | 6 +-- drivers/iio/adc/nxp-sar-adc.c | 2 +- drivers/iio/adc/pac1921.c | 8 ++-- drivers/iio/adc/pac1934.c | 32 +++++++------- drivers/iio/adc/rockchip_saradc.c | 2 +- drivers/iio/adc/rtq6056.c | 16 +++---- drivers/iio/adc/sd_adc_modulator.c | 2 +- drivers/iio/adc/stm32-adc.c | 4 +- drivers/iio/adc/stm32-dfsdm-adc.c | 2 +- drivers/iio/adc/ti-adc081c.c | 2 +- drivers/iio/adc/ti-adc0832.c | 4 +- drivers/iio/adc/ti-adc084s021.c | 2 +- drivers/iio/adc/ti-adc108s102.c | 2 +- drivers/iio/adc/ti-adc12138.c | 4 +- drivers/iio/adc/ti-adc161s626.c | 4 +- drivers/iio/adc/ti-ads1015.c | 4 +- drivers/iio/adc/ti-ads1018.c | 6 +-- drivers/iio/adc/ti-ads1100.c | 2 +- drivers/iio/adc/ti-ads1119.c | 2 +- drivers/iio/adc/ti-ads124s08.c | 2 +- drivers/iio/adc/ti-ads1298.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-ads7950.c | 2 +- drivers/iio/adc/ti-ads8688.c | 2 +- drivers/iio/adc/ti-lmp92064.c | 4 +- drivers/iio/adc/ti-tlc4541.c | 2 +- drivers/iio/adc/ti-tsc2046.c | 2 +- drivers/iio/adc/ti_am335x_adc.c | 2 +- drivers/iio/adc/vf610_adc.c | 4 +- drivers/iio/adc/xilinx-ams.c | 2 +- drivers/iio/adc/xilinx-xadc-core.c | 10 ++--- drivers/iio/addac/ad74115.c | 2 +- drivers/iio/addac/ad74413r.c | 2 +- drivers/iio/chemical/atlas-ezo-sensor.c | 4 +- drivers/iio/chemical/atlas-sensor.c | 12 ++--- drivers/iio/chemical/bme680_core.c | 8 ++-- drivers/iio/chemical/ccs811.c | 4 +- drivers/iio/chemical/ens160_core.c | 4 +- drivers/iio/chemical/pms7003.c | 2 +- drivers/iio/chemical/scd30_core.c | 2 +- drivers/iio/chemical/scd4x.c | 6 +-- drivers/iio/chemical/sps30.c | 2 +- .../common/cros_ec_sensors/cros_ec_activity.c | 2 +- .../cros_ec_sensors/cros_ec_lid_angle.c | 2 +- .../common/cros_ec_sensors/cros_ec_sensors.c | 4 +- drivers/iio/common/scmi_sensors/scmi_iio.c | 4 +- .../iio/common/ssp_sensors/ssp_iio_sensor.h | 4 +- drivers/iio/dac/ad3552r-hs.c | 2 +- drivers/iio/dac/ad3552r.c | 2 +- drivers/iio/dac/ad5064.c | 2 +- drivers/iio/dac/ad5360.c | 2 +- drivers/iio/dac/ad5380.c | 2 +- drivers/iio/dac/ad5421.c | 2 +- drivers/iio/dac/ad5446.h | 2 +- drivers/iio/dac/ad5449.c | 2 +- drivers/iio/dac/ad5504.c | 2 +- drivers/iio/dac/ad5592r-base.c | 2 +- drivers/iio/dac/ad5624r_spi.c | 2 +- drivers/iio/dac/ad5686.c | 2 +- drivers/iio/dac/ad5755.c | 2 +- drivers/iio/dac/ad5761.c | 2 +- drivers/iio/dac/ad5764.c | 2 +- drivers/iio/dac/ad5766.c | 2 +- drivers/iio/dac/ad5791.c | 4 +- drivers/iio/dac/ad7303.c | 2 +- drivers/iio/dac/ad8460.c | 2 +- drivers/iio/dac/ad9739a.c | 2 +- drivers/iio/dac/ltc1660.c | 2 +- drivers/iio/dac/max5522.c | 2 +- drivers/iio/dac/mcp4922.c | 2 +- drivers/iio/dac/stm32-dac.c | 2 +- drivers/iio/dummy/iio_simple_dummy.c | 8 ++-- drivers/iio/gyro/adis16136.c | 4 +- drivers/iio/gyro/adxrs290.c | 4 +- drivers/iio/gyro/bmg160_core.c | 2 +- drivers/iio/gyro/fxas21002c_core.c | 2 +- drivers/iio/gyro/hid-sensor-gyro-3d.c | 2 +- drivers/iio/gyro/itg3200_core.c | 2 +- drivers/iio/gyro/mpu3050-core.c | 4 +- drivers/iio/health/afe440x.h | 2 +- drivers/iio/health/max30100.c | 4 +- drivers/iio/health/max30102.c | 2 +- drivers/iio/humidity/am2315.c | 4 +- drivers/iio/humidity/hdc100x.c | 4 +- drivers/iio/humidity/hid-sensor-humidity.c | 2 +- drivers/iio/humidity/hts221_core.c | 4 +- drivers/iio/imu/adis.c | 2 +- drivers/iio/imu/adis16400.c | 16 +++---- drivers/iio/imu/adis16460.c | 4 +- drivers/iio/imu/adis16475.c | 6 +-- drivers/iio/imu/adis16480.c | 6 +-- drivers/iio/imu/adis16550.c | 6 +-- drivers/iio/imu/bmi160/bmi160_core.c | 2 +- drivers/iio/imu/bmi270/bmi270_core.c | 4 +- drivers/iio/imu/bmi323/bmi323_core.c | 4 +- drivers/iio/imu/bno055/bno055.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 +- .../iio/imu/inv_icm42600/inv_icm42600_temp.h | 2 +- drivers/iio/imu/inv_icm45600/inv_icm45600.h | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_accel.c | 2 +- .../iio/imu/inv_icm45600/inv_icm45600_gyro.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 +-- drivers/iio/imu/kmx61.c | 4 +- drivers/iio/imu/smi240.c | 4 +- drivers/iio/imu/smi330/smi330_core.c | 6 +-- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 +- drivers/iio/industrialio-buffer.c | 4 +- drivers/iio/light/acpi-als.c | 2 +- drivers/iio/light/adjd_s311.c | 2 +- drivers/iio/light/apds9960.c | 2 +- drivers/iio/light/as73211.c | 6 +-- drivers/iio/light/bh1745.c | 2 +- drivers/iio/light/cros_ec_light_prox.c | 4 +- drivers/iio/light/gp2ap020a00f.c | 6 +-- drivers/iio/light/hid-sensor-als.c | 2 +- drivers/iio/light/hid-sensor-prox.c | 2 +- drivers/iio/light/isl29125.c | 2 +- drivers/iio/light/ltr501.c | 4 +- drivers/iio/light/max44000.c | 4 +- drivers/iio/light/opt4060.c | 4 +- drivers/iio/light/rohm-bu27034.c | 4 +- drivers/iio/light/rpr0521.c | 6 +-- drivers/iio/light/si1145.c | 2 +- drivers/iio/light/st_uvis25_core.c | 2 +- drivers/iio/light/tcs3414.c | 2 +- drivers/iio/light/tcs3472.c | 2 +- drivers/iio/light/vcnl4000.c | 2 +- drivers/iio/light/vcnl4035.c | 4 +- drivers/iio/light/veml6030.c | 8 ++-- drivers/iio/light/veml6046x00.c | 8 ++-- drivers/iio/light/vl6180.c | 6 +-- drivers/iio/magnetometer/af8133j.c | 2 +- drivers/iio/magnetometer/ak8974.c | 2 +- drivers/iio/magnetometer/ak8975.c | 2 +- drivers/iio/magnetometer/als31300.c | 4 +- drivers/iio/magnetometer/bmc150_magn.c | 2 +- drivers/iio/magnetometer/hid-sensor-magn-3d.c | 2 +- drivers/iio/magnetometer/hmc5843_core.c | 4 +- drivers/iio/magnetometer/mag3110.c | 4 +- drivers/iio/magnetometer/rm3100-core.c | 2 +- drivers/iio/magnetometer/tlv493d.c | 4 +- drivers/iio/magnetometer/tmag5273.c | 8 ++-- drivers/iio/magnetometer/yamaha-yas530.c | 4 +- drivers/iio/orientation/hid-sensor-incl-3d.c | 2 +- drivers/iio/orientation/hid-sensor-rotation.c | 2 +- .../position/hid-sensor-custom-intel-hinge.c | 6 +-- drivers/iio/potentiostat/lmp91000.c | 2 +- drivers/iio/pressure/abp2030pa.c | 4 +- drivers/iio/pressure/bmp280-core.c | 18 ++++---- drivers/iio/pressure/cros_ec_baro.c | 4 +- drivers/iio/pressure/dlhl60d.c | 4 +- drivers/iio/pressure/hid-sensor-press.c | 2 +- drivers/iio/pressure/hsc030pa.c | 4 +- drivers/iio/pressure/mpl3115.c | 4 +- drivers/iio/pressure/mprls0025pa.c | 2 +- drivers/iio/pressure/ms5611_core.c | 4 +- drivers/iio/pressure/rohm-bm1390.c | 4 +- drivers/iio/pressure/st_pressure_core.c | 12 ++--- drivers/iio/pressure/zpa2326.c | 4 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/hx9023s.c | 2 +- drivers/iio/proximity/irsd200.c | 2 +- drivers/iio/proximity/isl29501.c | 2 +- drivers/iio/proximity/mb1232.c | 2 +- .../iio/proximity/pulsedlight-lidar-lite-v2.c | 2 +- drivers/iio/proximity/srf08.c | 2 +- drivers/iio/proximity/sx9310.c | 2 +- drivers/iio/proximity/sx9324.c | 2 +- drivers/iio/proximity/sx9360.c | 4 +- drivers/iio/proximity/sx9500.c | 2 +- drivers/iio/proximity/vl53l0x-i2c.c | 2 +- drivers/iio/resolver/ad2s1210.c | 4 +- .../iio/temperature/hid-sensor-temperature.c | 2 +- drivers/iio/temperature/maxim_thermocouple.c | 6 +-- drivers/iio/temperature/tmp006.c | 4 +- include/linux/iio/common/st_sensors.h | 2 +- include/linux/iio/iio.h | 6 +-- include/linux/iio/imu/adis.h | 6 +-- 252 files changed, 511 insertions(+), 511 deletions(-)
Documentation/driver-api/iio/buffers.rst +2 -2
@@ -78,7 +78,7 @@ fields in iio_chan_spec definition:: /* other members */ int scan_index struct { - char sign; + char format; u8 realbits; u8 storagebits; u8 shift;
@@ -98,7 +98,7 @@ following channel definition:: /* other stuff here */ .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 12, .storagebits = 16, .shift = 4,
drivers/iio/accel/adxl313_core.c +1 -1
@@ -259,7 +259,7 @@ static const int adxl313_odr_freqs[][2] = { .info_mask_shared_by_type_available = \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 13, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/accel/adxl345_core.c +1 -1
@@ -254,7 +254,7 @@ static const struct iio_event_spec adxl345_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = (index), \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/accel/adxl355_core.c +2 -2
@@ -725,7 +725,7 @@ static irqreturn_t adxl355_trigger_handler(int irq, void *p)BIT (IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =20 , \ .storagebits =32 , \ .shift =4 , \
@@ -745,7 +745,7 @@ static const struct iio_chan_spec adxl355_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 3, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_BE ,
drivers/iio/accel/adxl367.c +2 -2
@@ -1344,7 +1344,7 @@ static const struct iio_event_spec adxl367_events[] = { .num_event_specs = ARRAY_SIZE(adxl367_events), \ .scan_index = (index), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -1360,7 +1360,7 @@ static const struct iio_event_spec adxl367_events[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (index), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/accel/adxl372.c +1 -1
@@ -262,7 +262,7 @@ static const struct iio_event_spec adxl372_events[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .shift =4 , \
drivers/iio/accel/adxl380.c +2 -2
@@ -1789,7 +1789,7 @@ static const struct iio_event_spec adxl380_events[] = {BIT (IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
@@ -1810,7 +1810,7 @@ static const struct iio_chan_spec adxl380_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 3, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .shift =4 ,
drivers/iio/accel/bma180.c +5 -5
@@ -541,7 +541,7 @@ static int bma180_read_raw(struct iio_dev *indio_dev,iio_device_release_direct (indio_dev);if (ret <0 )return ret; -if (chan->scan_type.sign =='s' ) { +if (chan->scan_type.format =='s' ) { *val =sign_extend32 (ret >> chan->scan_type.shift, chan->scan_type.realbits -1 ); }else {
@@ -663,7 +663,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = _bits, \ .storagebits =16 , \ .shift =16 - _bits, \
@@ -677,7 +677,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = TEMP, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 16, \ }, \
@@ -692,7 +692,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = _bits, \ .storagebits =16 , \ .shift =16 - _bits, \
@@ -706,7 +706,7 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 8, \ .storagebits = 16, \ }, \
drivers/iio/accel/bma220_core.c +1 -1
@@ -107,7 +107,7 @@BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =6 , \ .storagebits =8 , \ .shift =2 , \
drivers/iio/accel/bma400_core.c +2 -2
@@ -399,7 +399,7 @@ static const struct attribute_group bma400_event_attribute_group = { .ext_info = bma400_ext_info, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -428,7 +428,7 @@ static const struct iio_chan_spec bma400_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 8, .storagebits = 8, .endianness = IIO_LE,
drivers/iio/accel/bmc150-accel-core.c +1 -1
@@ -1059,7 +1059,7 @@ static const struct iio_event_spec bmc150_accel_event = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
drivers/iio/accel/cros_ec_accel_legacy.c +1 -1
@@ -189,7 +189,7 @@ static const struct iio_info cros_ec_accel_legacy_info = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .ext_info = cros_ec_sensors_ext_info, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =CROS_EC_SENSOR_BITS , \ .storagebits =CROS_EC_SENSOR_BITS , \ }, \
drivers/iio/accel/fxls8962af-core.c +2 -2
@@ -731,7 +731,7 @@ static const struct iio_event_spec fxls8962af_event[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .endianness =IIO_LE , \
@@ -748,7 +748,7 @@ static const struct iio_event_spec fxls8962af_event[] = {BIT (IIO_CHAN_INFO_OFFSET ),\ .scan_index = -1, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =8 , \ .storagebits =8 , \ }, \
drivers/iio/accel/hid-sensor-accel-3d.c +1 -1
@@ -123,7 +123,7 @@ static const struct iio_chan_spec gravity_channels[] = {static void accel_3d_adjust_channel_bit_mask (struct iio_chan_spec *channels,int channel,int size) { - channels[channel].scan_type.sign ='s' ; + channels[channel].scan_type.format ='s' ;/* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size *8 ;/* Maximum size of a sample to capture is u32 */
drivers/iio/accel/kionix-kx022a.c +1 -1
@@ -348,7 +348,7 @@ static const struct iio_chan_spec_ext_info kx022a_ext_info[] = { .address = reg, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/accel/kxcjk-1013.c +1 -1
@@ -1147,7 +1147,7 @@ static const struct iio_chan_spec_ext_info kxcjk1013_ext_info[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =12 , \ .storagebits =16 , \ .shift =4 , \
drivers/iio/accel/kxsd9.c +2 -2
@@ -284,7 +284,7 @@ static const struct iio_chan_spec_ext_info kxsd9_ext_info[] = { .address = KXSD9_REG_##axis, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
@@ -303,7 +303,7 @@ static const struct iio_chan_spec kxsd9_channels[] = { .address = KXSD9_REG_AUX, .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, .shift = 4,
drivers/iio/accel/mma7455_core.c +1 -1
@@ -219,7 +219,7 @@ static const struct iio_info mma7455_info = {BIT (IIO_CHAN_INFO_SCALE ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =10 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/accel/mma8452.c +2 -2
@@ -1233,7 +1233,7 @@ static const struct iio_chan_spec_ext_info mma8452_ext_info[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
@@ -1255,7 +1255,7 @@ static const struct iio_chan_spec_ext_info mma8452_ext_info[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = idx, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =16 - (bits), \
drivers/iio/accel/msa311.c +1 -1
@@ -382,7 +382,7 @@ enum msa311_si { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = MSA311_SI_##axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/accel/mxc4005.c +1 -1
@@ -306,7 +306,7 @@ static const unsigned long mxc4005_scan_masks[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/accel/sca3000.c +2 -2
@@ -485,7 +485,7 @@ static const struct iio_event_spec sca3000_event = { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 13, \ .storagebits = 16, \ .shift = 3, \
@@ -528,7 +528,7 @@ static const struct iio_chan_spec sca3000_channels_with_temp[] = {/* No buffer support */ .scan_index = -1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 9, .storagebits = 16, .shift = 5,
drivers/iio/accel/sca3300.c +3 -3
@@ -70,7 +70,7 @@ enum sca3300_scan_indexes {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
@@ -87,7 +87,7 @@ enum sca3300_scan_indexes { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -100,7 +100,7 @@ enum sca3300_scan_indexes { .scan_index = index, \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/accel/stk8312.c +1 -1
@@ -80,7 +80,7 @@ static const struct {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =8 , \ .storagebits =8 , \ .endianness =IIO_CPU , \
drivers/iio/accel/stk8ba50.c +1 -1
@@ -108,7 +108,7 @@ struct stk8ba50_data {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =10 , \ .storagebits =16 , \ .shift =STK8BA50_DATA_SHIFT , \
drivers/iio/adc/ad4000.c +4 -4
@@ -51,7 +51,7 @@ .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\ .scan_index = 0, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _real_bits, \ .storagebits = _storage_bits, \ .shift = (_offl ? 0 : _storage_bits - _real_bits), \
@@ -89,7 +89,7 @@ .info_mask_separate_available = _reg_access ? BIT(IIO_CHAN_INFO_SCALE) : 0,\ .scan_index = 0, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _real_bits, \ .storagebits = _storage_bits, \ .shift = (_offl ? 0 : _storage_bits - _real_bits), \
@@ -540,7 +540,7 @@ static void ad4000_fill_scale_tbl(struct ad4000_state *st,* ADCs that output two's complement code have one less bit to express * voltage magnitude. */ -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) scale_bits = chan->scan_type.realbits -1 ;else scale_bits = chan->scan_type.realbits;
@@ -657,7 +657,7 @@ static int ad4000_single_conversion(struct iio_dev *indio_dev, sample >>= chan->scan_type.shift; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (sample, chan->scan_type.realbits -1 );else *val = sample;
drivers/iio/adc/ad4030.c +5 -5
@@ -196,7 +196,7 @@ struct ad4030_state { .channel = ((_idx) - (_ch)) * 2 + (_ch), \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .storagebits = 8, \ .realbits = 8, \ .endianness = IIO_BE, \
@@ -1083,14 +1083,14 @@ static const unsigned long ad4630_channel_masks[] = {static const struct iio_scan_type ad4030_24_scan_types[] = { [AD4030_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =24 , .shift =8 , .endianness =IIO_BE , }, [AD4030_SCAN_TYPE_AVG ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =30 , .shift =2 ,
@@ -1100,14 +1100,14 @@ static const struct iio_scan_type ad4030_24_scan_types[] = {static const struct iio_scan_type ad4030_16_scan_types[] = { [AD4030_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =16 , .shift =16 , .endianness =IIO_BE , }, [AD4030_SCAN_TYPE_AVG ] = { - .sign ='s' , + .format ='s' , .storagebits =32 , .realbits =30 , .shift =2 ,
drivers/iio/adc/ad4062.c +4 -4
@@ -122,13 +122,13 @@ enum {static const struct iio_scan_type ad4062_scan_type_12_s[] = { [AD4062_SCAN_TYPE_SAMPLE ] = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_BE , }, [AD4062_SCAN_TYPE_BURST_AVG ] = { - .sign ='s' , + .format ='s' , .realbits =14 , .storagebits =16 , .endianness =IIO_BE ,
@@ -137,13 +137,13 @@ static const struct iio_scan_type ad4062_scan_type_12_s[] = {static const struct iio_scan_type ad4062_scan_type_16_s[] = { [AD4062_SCAN_TYPE_SAMPLE ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE , }, [AD4062_SCAN_TYPE_BURST_AVG ] = { - .sign ='s' , + .format ='s' , .realbits =20 , .storagebits =32 , .endianness =IIO_BE ,
drivers/iio/adc/ad4080.c +1 -1
@@ -432,7 +432,7 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[] = { .ext_info = ad4080_ext_info, \ .scan_index = 0, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = (storage), \ }, \
drivers/iio/adc/ad4130.c +1 -1
@@ -1002,7 +1002,7 @@ static const struct iio_chan_spec ad4130_channel_template = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), .ext_info = ad4130_ext_info, .scan_type = { - .sign ='u' , + .format ='u' , .endianness =IIO_BE , }, };
drivers/iio/adc/ad4170-4.c +6 -6
@@ -955,7 +955,7 @@ static const struct iio_chan_spec ad4170_temp_channel_template = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), .info_mask_separate_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , .shift =8 ,
@@ -1101,7 +1101,7 @@ static int ad4170_get_input_range(struct ad4170_state *st,struct iio_chan_spec const *chan, unsigned int ch_reg, unsigned int ref_sel) { - bool bipolar = chan->scan_type.sign == 's'; + bool bipolar = chan->scan_type.format == 's';struct device *dev = &st->spi->dev;int refp, refn, ain_voltage, ret;
@@ -1228,7 +1228,7 @@ static int __ad4170_read_sample(struct iio_dev *indio_dev,if (ret)return ret; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );return 0 ;
@@ -1353,7 +1353,7 @@ static int ad4170_fill_scale_tbl(struct iio_dev *indio_dev,struct ad4170_state *st =iio_priv (indio_dev);struct ad4170_chan_info *chan_info = &st->chan_infos[chan->address];struct device *dev = &st->spi->dev; -int bipolar = chan->scan_type.sign =='s' ?1 :0 ; +int bipolar = chan->scan_type.format =='s' ?1 :0 ;int precision_bits = chan->scan_type.realbits;int pga, ainm_voltage, ret;unsigned long long offset;
@@ -2335,9 +2335,9 @@ static int ad4170_parse_channel_node(struct iio_dev *indio_dev, bipolar =fwnode_property_read_bool (child,"bipolar" ); setup->afe |=FIELD_PREP (AD4170_AFE_BIPOLAR_MSK , bipolar);if (bipolar) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;else - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; ret =ad4170_validate_channel (st, chan);if (ret)
drivers/iio/adc/ad4695.c +12 -12
@@ -314,25 +314,25 @@ enum {static const struct iio_scan_type ad4695_scan_type_offload_u[] = { [AD4695_SCAN_TYPE_OSR_1 ] = { - .sign ='u' , + .format ='u' , .realbits =16 , .shift =3 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_4 ] = { - .sign ='u' , + .format ='u' , .realbits =17 , .shift =2 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_16 ] = { - .sign ='u' , + .format ='u' , .realbits =18 , .shift =1 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_64 ] = { - .sign ='u' , + .format ='u' , .realbits =19 , .storagebits =32 , },
@@ -340,25 +340,25 @@ static const struct iio_scan_type ad4695_scan_type_offload_u[] = {static const struct iio_scan_type ad4695_scan_type_offload_s[] = { [AD4695_SCAN_TYPE_OSR_1 ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .shift =3 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_4 ] = { - .sign ='s' , + .format ='s' , .realbits =17 , .shift =2 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_16 ] = { - .sign ='s' , + .format ='s' , .realbits =18 , .shift =1 , .storagebits =32 , }, [AD4695_SCAN_TYPE_OSR_64 ] = { - .sign ='s' , + .format ='s' , .realbits =19 , .storagebits =32 , },
@@ -375,7 +375,7 @@ static const struct iio_chan_spec ad4695_channel_template = { .info_mask_separate_available = BIT(IIO_CHAN_INFO_CALIBSCALE) | BIT(IIO_CHAN_INFO_CALIBBIAS), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
@@ -388,7 +388,7 @@ static const struct iio_chan_spec ad4695_temp_channel_template = {BIT (IIO_CHAN_INFO_SCALE ) | BIT(IIO_CHAN_INFO_OFFSET), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, },
@@ -1037,7 +1037,7 @@ static int __ad4695_read_info_raw(struct ad4695_state *st,if (ret)return ret; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (st->raw_data, realbits -1 );else *val = st->raw_data;
@@ -1603,7 +1603,7 @@ static int ad4695_parse_channel_cfg(struct ad4695_state *st) fwnode_get_name(child));if (chan_cfg->bipolar) - iio_chan->scan_type.sign ='s' ; + iio_chan->scan_type.format ='s' ; ret =ad4695_write_chn_cfg (st, chan_cfg);if (ret)
drivers/iio/adc/ad4851.c +6 -6
@@ -891,12 +891,12 @@ static int ad4851_read_avail(struct iio_dev *indio_dev,static const struct iio_scan_type ad4851_scan_type_20_u[] = { [AD4851_SCAN_TYPE_NORMAL ] = { - .sign ='u' , + .format ='u' , .realbits =20 , .storagebits =32 , }, [AD4851_SCAN_TYPE_RESOLUTION_BOOST ] = { - .sign ='u' , + .format ='u' , .realbits =24 , .storagebits =32 , },
@@ -904,12 +904,12 @@ static const struct iio_scan_type ad4851_scan_type_20_u[] = {static const struct iio_scan_type ad4851_scan_type_20_b[] = { [AD4851_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .realbits =20 , .storagebits =32 , }, [AD4851_SCAN_TYPE_RESOLUTION_BOOST ] = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , },
@@ -949,7 +949,7 @@ static int ad4851_get_current_scan_type(const struct iio_dev *indio_dev, { \ AD4851_IIO_CHANNEL, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ }, \
@@ -997,7 +997,7 @@ static int ad4851_parse_channels_common(struct iio_dev *indio_dev, st->bipolar_ch[reg] =fwnode_property_read_bool (child,"bipolar" );if (st->bipolar_ch[reg]) { - channels->scan_type.sign ='s' ; + channels->scan_type.format ='s' ; }else { ret =regmap_write (st->regmap,AD4851_REG_CHX_SOFTSPAN (reg),AD4851_SOFTSPAN_0V_40V );
drivers/iio/adc/ad7124.c +2 -2
@@ -1182,7 +1182,7 @@ static const struct iio_chan_spec ad7124_channel_template = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_type = { - .sign ='u' , + .format ='u' , .realbits =24 , .storagebits =32 , .endianness =IIO_BE ,
@@ -1308,7 +1308,7 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,* measurement yields an unsigned value, but * this matches the device's manual. */ - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7173.c +3 -3
@@ -1549,7 +1549,7 @@ static const struct iio_info ad7173_info = { };static const struct iio_scan_type ad4113_scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -1561,7 +1561,7 @@ static const struct iio_chan_spec ad7173_channel_template = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -1577,7 +1577,7 @@ static const struct iio_chan_spec ad7173_temp_iio_channel_template = {BIT (IIO_CHAN_INFO_SCALE ) |BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7191.c +3 -3
@@ -437,7 +437,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -458,7 +458,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
@@ -479,7 +479,7 @@ static const struct iio_chan_spec ad7191_channels[] = { .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7192.c +1 -1
@@ -1151,7 +1151,7 @@ static const struct iio_info ad7195_info = { .ext_info = (_ext_info), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/ad7266.c +3 -3
@@ -160,7 +160,7 @@ static int ad7266_read_raw(struct iio_dev *indio_dev,if (ret <0 )return ret; *val = (*val >>2 ) &0xfff ; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );
@@ -196,7 +196,7 @@ static int ad7266_read_raw(struct iio_dev *indio_dev, | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = (_chan), \ .scan_type = { \ - .sign = (_sign), \ + .format = (_sign), \ .realbits =12 , \ .storagebits =16 , \ .shift =2 , \
@@ -244,7 +244,7 @@ static AD7266_DECLARE_SINGLE_ENDED_CHANNELS_FIXED(s, 's'); | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = (_chan), \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits =12 , \ .storagebits =16 , \ .shift =2 , \
drivers/iio/adc/ad7280a.c +2 -2
@@ -621,7 +621,7 @@ static void ad7280_common_fields_init(struct iio_chan_spec *chan, int addr, chan->info_mask_shared_by_all =BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); chan->address = addr; chan->scan_index = cnt; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =32 ; }
@@ -638,7 +638,7 @@ static void ad7280_total_voltage_channel_init(struct iio_chan_spec *chan, chan->info_mask_separate =BIT (IIO_CHAN_INFO_RAW ); chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); chan->scan_index = cnt; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =32 ; chan->scan_type.storagebits =32 ; }
drivers/iio/adc/ad7298.c +2 -2
@@ -63,7 +63,7 @@ struct ad7298_state { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -81,7 +81,7 @@ static const struct iio_chan_spec ad7298_channels[] = { .address = AD7298_CH_TEMP, .scan_index = -1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, },
drivers/iio/adc/ad7380.c +22 -22
166 lines not on this page · raw message
drivers/iio/adc/ad7405.c +1 -1
@@ -133,7 +133,7 @@ static const struct iio_chan_spec ad7405_channel = { .differential = 1, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
drivers/iio/adc/ad7476.c +1 -1
@@ -160,7 +160,7 @@ static int ad7476_read_raw(struct iio_dev *indio_dev, .info_mask_separate = _info_mask_sep, \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (_shift), \
drivers/iio/adc/ad7606.c +7 -7
@@ -413,7 +413,7 @@ static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev,/* Bipolar single-ended ranges start at 0 (b0000) */ ci->reg_offset =0 ; ci->range =3 ; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -424,7 +424,7 @@ static int ad7606c_18bit_chan_scale_setup(struct iio_dev *indio_dev,/* Unipolar single-ended ranges start at 5 (b0101) */ ci->reg_offset =5 ; ci->range =1 ; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ;return 0 ; }
@@ -458,7 +458,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev, ci->range =1 ; chan->differential =1 ; chan->channel2 = chan->channel; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -472,7 +472,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev,/* Bipolar single-ended ranges start at 0 (b0000) */ ci->reg_offset =0 ; ci->range =3 ; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;return 0 ; }
@@ -483,7 +483,7 @@ static int ad7606c_16bit_chan_scale_setup(struct iio_dev *indio_dev,/* Unipolar single-ended ranges start at 5 (b0101) */ ci->reg_offset =5 ; ci->range =1 ; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ;return 0 ; }
@@ -703,7 +703,7 @@ static int ad7606_scan_direct(struct iio_dev *indio_dev, unsigned int ch, *val &=GENMASK (realbits -1 ,0 ); -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, realbits -1 ); error_ret:
@@ -1412,7 +1412,7 @@ static int ad7606_probe_channels(struct iio_dev *indio_dev) chan->indexed =1 ; chan->channel = i; chan->scan_index = i; - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ; chan->scan_type.realbits = st->chip_info->bits;/* * If in SPI offload mode, storagebits are set based
drivers/iio/adc/ad7625.c +1 -1
@@ -54,7 +54,7 @@ struct ad7625_chip_info { .info_mask_separate = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = 0, \ - .scan_type.sign = 's', \ + .scan_type.format = 's', \ .scan_type.storagebits = (_bits) > 16 ? 32 : 16, \ .scan_type.realbits = (_bits), \ }
drivers/iio/adc/ad7766.c +1 -1
@@ -154,7 +154,7 @@ static const struct iio_chan_spec ad7766_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/adc/ad7768-1.c +4 -4
@@ -254,14 +254,14 @@ static const char * const ad7768_filter_enum[] = {static const struct iio_scan_type ad7768_scan_type[] = { [AD7768_SCAN_TYPE_NORMAL ] = { - .sign ='s' , + .format ='s' , .realbits =24 , .storagebits =32 , .shift =8 , .endianness =IIO_BE , }, [AD7768_SCAN_TYPE_HIGH_SPEED ] = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -541,7 +541,7 @@ static void ad7768_fill_scale_tbl(struct iio_dev *dev)u64 tmp2; scan_type =iio_get_current_scan_type (dev, &dev->channels[0 ]); -if (scan_type->sign =='s' ) +if (scan_type->format =='s' ) val2 = scan_type->realbits -1 ;else val2 = scan_type->realbits;
@@ -1102,7 +1102,7 @@ static int ad7768_write_raw(struct iio_dev *indio_dev,if (!st->chip->has_pga)return -EOPNOTSUPP ; -if (scan_type->sign =='s' ) +if (scan_type->format =='s' ) gain_mode =ad7768_calc_pga_gain (st, val, val2, scan_type->realbits -1 );else
drivers/iio/adc/ad7779.c +1 -1
@@ -690,7 +690,7 @@ static const struct iio_chan_spec_ext_info ad7779_ext_filter[] = { .scan_index = (index), \ .ext_info = (_ext_info), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/ad7780.c +1 -1
@@ -217,7 +217,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = { .info_mask_shared_by_all = _mask_all, \ .scan_index = 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 32, \ .shift = (_wordsize) - (_bits), \
drivers/iio/adc/ad7791.c +1 -1
@@ -80,7 +80,7 @@ .info_mask_shared_by_all = _mask_all, \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = (_storagebits), \ .shift = (_shift), \
drivers/iio/adc/ad7793.c +1 -1
@@ -568,7 +568,7 @@ static const struct iio_info ad7797_info = { .info_mask_shared_by_all = _mask_all, \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = (_storagebits), \ .shift = (_shift), \
drivers/iio/adc/ad7887.c +1 -1
@@ -188,7 +188,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev, .address = (x), \ .scan_index = (x), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .shift = 0, \
drivers/iio/adc/ad7923.c +1 -1
@@ -91,7 +91,7 @@ enum ad7923_id { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/adc/ad7944.c +4 -4
@@ -135,7 +135,7 @@ static const struct ad7944_chip_info _name##_chip_info = { \ .channel = 0, \ .channel2 = _diff ? 1 : 0, \ .scan_index = 0, \ - .scan_type.sign = _diff ? 's' : 'u', \ + .scan_type.format = _diff ? 's' : 'u', \ .scan_type.realbits = _bits, \ .scan_type.storagebits = _bits > 16 ? 32 : 16, \ .scan_type.endianness = IIO_CPU, \
@@ -152,7 +152,7 @@ static const struct ad7944_chip_info _name##_chip_info = { \ .channel = 0, \ .channel2 = _diff ? 1 : 0, \ .scan_index = 0, \ - .scan_type.sign = _diff ? 's' : 'u', \ + .scan_type.format = _diff ? 's' : 'u', \ .scan_type.realbits = _bits, \ .scan_type.storagebits = 32, \ .scan_type.endianness = IIO_CPU, \
@@ -364,7 +364,7 @@ static int ad7944_single_conversion(struct ad7944_adc *adc, *val = adc->sample.raw.u16; } -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 );else *val &=GENMASK (chan->scan_type.realbits -1 ,0 );
@@ -410,7 +410,7 @@ static int ad7944_read_raw(struct iio_dev *indio_dev,case IIO_VOLTAGE : *val = adc->ref_mv; -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val2 = chan->scan_type.realbits -1 ;else *val2 = chan->scan_type.realbits;
drivers/iio/adc/ad799x.c +1 -1
@@ -586,7 +586,7 @@ static const struct iio_event_spec ad799x_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_realbits), \ .storagebits = 16, \ .shift = 12 - (_realbits), \
drivers/iio/adc/ad9467.c +2 -2
@@ -319,7 +319,7 @@ static void __ad9467_get_scale(struct ad9467_state *st, int index, .info_mask_shared_by_type_available = avai_mask, \ .scan_index = _si, \ .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _bits, \ .storagebits = 16, \ }, \
@@ -343,7 +343,7 @@ static const struct iio_chan_spec ad9434_channels[] = {BIT (IIO_CHAN_INFO_CALIBBIAS ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , },
drivers/iio/adc/ade9000.c +2 -2
@@ -451,7 +451,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = { .scan_index = num, \ .indexed = 1, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -471,7 +471,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = { .scan_index = num + 1, /* interleave with current channels */ \ .indexed = 1, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/at91-sama5d2_adc.c +5 -5
@@ -337,7 +337,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .address = addr, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = rbits, \ .storagebits = 16, \ }, \
@@ -366,7 +366,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .address = addr, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = rbits, \ .storagebits = 16, \ }, \
@@ -394,7 +394,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .channel2 = mod, \ .scan_index = num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -411,7 +411,7 @@ static const struct at91_adc_reg_layout sama7g5_layout = { .channel = num, \ .scan_index = num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -1787,7 +1787,7 @@ static int at91_adc_read_info_raw(struct iio_dev *indio_dev,if (ret >0 ) { *val = st->conversion_value; ret =at91_adc_adjust_val_osr (st, val); -if (chan->scan_type.sign =='s' ) +if (chan->scan_type.format =='s' ) *val =sign_extend32 (*val, chan->scan_type.realbits -1 ); st->conversion_done = false;
drivers/iio/adc/at91_adc.c +2 -2
@@ -514,7 +514,7 @@ static int at91_adc_channel_init(struct iio_dev *idev) chan->indexed =1 ; chan->channel = bit; chan->scan_index = idx; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits = st->res; chan->scan_type.storagebits =16 ; chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE );
@@ -526,7 +526,7 @@ static int at91_adc_channel_init(struct iio_dev *idev) timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = idx; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/cc10001_adc.c +2 -2
@@ -281,7 +281,7 @@ static int cc10001_adc_channel_init(struct iio_dev *indio_dev, chan->indexed =1 ; chan->channel = bit; chan->scan_index = idx; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =10 ; chan->scan_type.storagebits =16 ; chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE );
@@ -293,7 +293,7 @@ static int cc10001_adc_channel_init(struct iio_dev *indio_dev, timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = idx; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/cpcap-adc.c +1 -1
@@ -340,7 +340,7 @@ static const int temp_map[CPCAP_MAX_TEMP_LVL][2] = {BIT (IIO_CHAN_INFO_PROCESSED ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =10 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
drivers/iio/adc/dln2-adc.c +2 -2
@@ -438,7 +438,7 @@ static int dln2_update_scan_mode(struct iio_dev *indio_dev, lval.info_mask_shared_by_all =BIT (IIO_CHAN_INFO_SCALE ) | \BIT (IIO_CHAN_INFO_SAMP_FREQ ); \ lval.scan_index = idx; \ - lval.scan_type.sign ='u' ; \ + lval.scan_type.format ='u' ; \ lval.scan_type.realbits =DLN2_ADC_DATA_BITS ; \ lval.scan_type.storagebits =16 ; \ lval.scan_type.endianness =IIO_LE ; \
@@ -449,7 +449,7 @@ static int dln2_update_scan_mode(struct iio_dev *indio_dev, lval.type =IIO_TIMESTAMP ; \ lval.channel =-1 ; \ lval.scan_index = _si; \ - lval.scan_type.sign ='s' ; \ + lval.scan_type.format ='s' ; \ lval.scan_type.realbits =64 ; \ lval.scan_type.storagebits =64 ; \ }
drivers/iio/adc/hx711.c +2 -2
@@ -432,7 +432,7 @@ static const struct iio_chan_spec hx711_chan_spec[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_CPU,
@@ -446,7 +446,7 @@ static const struct iio_chan_spec hx711_chan_spec[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 24, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/adc/ina2xx-adc.c +4 -4
@@ -623,7 +623,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev, .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -641,7 +641,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev,BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_CPU , \
@@ -666,7 +666,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev, .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .shift = _shift, \ .realbits = 16 - _shift, \ .storagebits = 16, \
@@ -686,7 +686,7 @@ static ssize_t ina2xx_shunt_resistor_store(struct device *dev,BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = (_index), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/adc/ingenic-adc.c +6 -6
@@ -456,7 +456,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XP, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -467,7 +467,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YP, .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -478,7 +478,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XN, .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -489,7 +489,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YN, .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -500,7 +500,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_XD, .scan_index = 4, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -511,7 +511,7 @@ static const struct iio_chan_spec jz4770_channels[] = { .channel = INGENIC_ADC_TOUCH_YD, .scan_index = 5, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
drivers/iio/adc/max1027.c +2 -2
@@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = index + 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = depth, \ .storagebits = 16, \ .shift = (depth == 10) ? 2 : 0, \
@@ -119,7 +119,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/adc/max1118.c +1 -1
@@ -54,7 +54,7 @@ struct max1118 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = ch, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
drivers/iio/adc/max11205.c +1 -1
@@ -75,7 +75,7 @@ static const struct iio_chan_spec max11205_channels[] = { .type = IIO_VOLTAGE, .indexed = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/adc/max11410.c +1 -1
@@ -156,7 +156,7 @@ static const struct iio_chan_spec chanspec_template = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 24, .storagebits = 32, .endianness = IIO_LE,
drivers/iio/adc/max1363.c +2 -2
@@ -473,7 +473,7 @@ static const struct iio_event_spec max1363_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .datasheet_name = "AIN"#num, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = (bits > 8) ? 16 : 8, \ .endianness = IIO_BE, \
@@ -496,7 +496,7 @@ static const struct iio_event_spec max1363_events[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .datasheet_name = "AIN"#num"-AIN"#num2, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = bits, \ .storagebits = (bits > 8) ? 16 : 8, \ .endianness = IIO_BE, \
drivers/iio/adc/mcp3911.c +1 -1
@@ -446,7 +446,7 @@ static int mcp3911_calc_scale_table(u32 vref_mv) .info_mask_separate_available = \ BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/adc/mt6359-auxadc.c +1 -1
@@ -196,7 +196,7 @@ struct mtk_pmic_auxadc_info { .scan_index = PMIC_AUXADC_CHAN_##_ch_idx, \ .datasheet_name = __stringify(_name), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = _nbits, \ .storagebits =16 , \ .endianness = IIO_CPU \
drivers/iio/adc/mt6360-adc.c +1 -1
@@ -230,7 +230,7 @@ static const struct iio_info mt6360_adc_iio_info = { .scan_index = MT6360_CHAN_##_idx, \ .datasheet_name = #_idx, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/mxs-lradc-adc.c +3 -3
@@ -582,7 +582,7 @@ static const struct iio_buffer_setup_ops mxs_lradc_adc_buffer_ops = { .channel = (idx), \ .address = (idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = LRADC_RESOLUTION, \ .storagebits = 32, \ }, \
@@ -607,7 +607,7 @@ static const struct iio_chan_spec mx23_lradc_chan_spec[] = {BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SCALE), .channel = 8, - .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,}, + .scan_type = {.format = 'u', .realbits = 18, .storagebits = 32,}, .datasheet_name = "TEMP_DIE", },/* Hidden channel to keep indexes */
@@ -643,7 +643,7 @@ static const struct iio_chan_spec mx28_lradc_chan_spec[] = {BIT (IIO_CHAN_INFO_OFFSET ) | BIT(IIO_CHAN_INFO_SCALE), .channel = 8, - .scan_type = {.sign = 'u', .realbits = 18, .storagebits = 32,}, + .scan_type = {.format = 'u', .realbits = 18, .storagebits = 32,}, .datasheet_name = "TEMP_DIE", },/* Hidden channel to keep indexes */
drivers/iio/adc/nxp-sar-adc.c +1 -1
@@ -167,7 +167,7 @@ struct nxp_sar_adc_data {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = (_idx), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =12 , \ .storagebits =16 , \ }, \
drivers/iio/adc/pac1921.c +4 -4
@@ -937,7 +937,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VBUS, .scan_index = PAC1921_CHAN_VBUS, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -960,7 +960,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VSENSE, .scan_index = PAC1921_CHAN_VSENSE, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -983,7 +983,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VSENSE, .scan_index = PAC1921_CHAN_CURRENT, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
@@ -1005,7 +1005,7 @@ static const struct iio_chan_spec pac1921_channels[] = { .address = PAC1921_REG_VPOWER, .scan_index = PAC1921_CHAN_POWER, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 10, .storagebits =16 , .endianness = IIO_CPU
drivers/iio/adc/pac1934.c +16 -16
@@ -330,7 +330,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 48, \ .storagebits = 64, \ .endianness = IIO_CPU, \
@@ -348,7 +348,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -366,7 +366,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -384,7 +384,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -402,7 +402,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -420,7 +420,7 @@ struct pac1934_chip_info { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 28, \ .storagebits = 32, \ .shift = 4, \
@@ -839,7 +839,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VBUS_AVG_3_ADDR :case PAC1934_VBUS_AVG_4_ADDR : *val =PAC1934_VOLTAGE_MILLIVOLTS_MAX ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 =PAC1934_VOLTAGE_U_RES ;else *val2 =PAC1934_VOLTAGE_S_RES ;
@@ -858,7 +858,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VSENSE_AVG_3_ADDR :case PAC1934_VSENSE_AVG_4_ADDR : *val =PAC1934_MAX_VSENSE_RSHIFTED_BY_16B ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -873,7 +873,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,case PAC1934_VPOWER_3_ADDR :case PAC1934_VPOWER_4_ADDR : *val =PAC1934_MAX_VPOWER_RSHIFTED_BY_28B ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -888,7 +888,7 @@ static int pac1934_read_raw(struct iio_dev *indio_dev,*/ *val =PAC1934_SCALE_CONSTANT ; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val2 = info->shunts[channel];else *val2 = info->shunts[channel] >>1 ;
@@ -1393,17 +1393,17 @@ static int pac1934_prep_iio_channels(struct pac1934_chip_info *info, struct iio_* whole chip rail(channel) is bi-directional */ if (info->bi_dir[cnt]) { - ch_sp[PAC1934_CH_ENERGY ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_ENERGY ].scan_type.format ='s' ; ch_sp[PAC1934_CH_ENERGY ].scan_type.realbits =47 ; - ch_sp[PAC1934_CH_POWER ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_POWER ].scan_type.format ='s' ; ch_sp[PAC1934_CH_POWER ].scan_type.realbits =27 ; - ch_sp[PAC1934_CH_VOLTAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_VOLTAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_VOLTAGE ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_CURRENT ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_CURRENT ].scan_type.format ='s' ; ch_sp[PAC1934_CH_CURRENT ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_VOLTAGE_AVERAGE ].scan_type.realbits =15 ; - ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.sign ='s' ; + ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.format ='s' ; ch_sp[PAC1934_CH_CURRENT_AVERAGE ].scan_type.realbits =15 ; } tmp_data +=sizeof (pac1934_single_channel);
drivers/iio/adc/rockchip_saradc.c +1 -1
@@ -221,7 +221,7 @@ static const struct iio_info rockchip_saradc_iio_info = { .datasheet_name = _id, \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = _res, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/rtq6056.c +8 -8
@@ -127,7 +127,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -146,7 +146,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -164,7 +164,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -181,7 +181,7 @@ static const struct iio_chan_spec rtq6056_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -210,7 +210,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -228,7 +228,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -246,7 +246,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -263,7 +263,7 @@ static const struct iio_chan_spec rtq6059_channels[RTQ6056_MAX_CHANNEL + 1] = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), .scan_index = 3, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/sd_adc_modulator.c +1 -1
@@ -21,7 +21,7 @@ static const struct iio_chan_spec iio_sd_mod_ch = { .type = IIO_VOLTAGE, .indexed = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 1, .shift = 0, },
drivers/iio/adc/stm32-adc.c +2 -2
@@ -2109,7 +2109,7 @@ static void stm32_adc_chan_init_one(struct iio_dev *indio_dev, chan->info_mask_shared_by_all |=BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); chan->info_mask_shared_by_all_available =BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ); } - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits = adc->cfg->adc_info->resolutions[adc->res]; chan->scan_type.storagebits =16 ; chan->ext_info = stm32_adc_ext_info;
@@ -2448,7 +2448,7 @@ static int stm32_adc_chan_fw_init(struct iio_dev *indio_dev, bool timestamping) timestamp->type =IIO_TIMESTAMP ; timestamp->channel =-1 ; timestamp->scan_index = scan_index; - timestamp->scan_type.sign ='s' ; + timestamp->scan_type.format ='s' ; timestamp->scan_type.realbits =64 ; timestamp->scan_type.storagebits =64 ;
drivers/iio/adc/stm32-dfsdm-adc.c +1 -1
@@ -1559,7 +1559,7 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev, struct iio_c }else { ch->scan_type.shift =8 ; } - ch->scan_type.sign ='s' ; + ch->scan_type.format ='s' ; ch->scan_type.realbits =24 ; ch->scan_type.storagebits =32 ;
drivers/iio/adc/ti-adc081c.c +1 -1
@@ -81,7 +81,7 @@ static int adc081c_read_raw(struct iio_dev *iio, .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 12 - (_bits), \
drivers/iio/adc/ti-adc0832.c +2 -2
@@ -49,7 +49,7 @@ struct adc0832 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = chan, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
@@ -66,7 +66,7 @@ struct adc0832 { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = si, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ }, \
drivers/iio/adc/ti-adc084s021.c +1 -1
@@ -46,7 +46,7 @@ struct adc084s021 { .indexed = 1, \ .scan_index = (num), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 16, \ .shift = 4, \
drivers/iio/adc/ti-adc108s102.c +1 -1
@@ -90,7 +90,7 @@ struct adc108s102_state { .address = index, \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = ADC108S102_BITS, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/adc/ti-adc12138.c +2 -2
@@ -67,7 +67,7 @@ struct adc12138 { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = chan, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .shift =3 , \
@@ -87,7 +87,7 @@ struct adc12138 { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = si, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =13 , \ .storagebits =16 , \ .shift =3 , \
drivers/iio/adc/ti-adc161s626.c +2 -2
@@ -38,7 +38,7 @@ static const struct iio_chan_spec ti_adc141s626_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =14 , .storagebits =16 , },
@@ -55,7 +55,7 @@ static const struct iio_chan_spec ti_adc161s626_channels[] = {BIT (IIO_CHAN_INFO_OFFSET ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , },
drivers/iio/adc/ti-ads1015.c +2 -2
@@ -193,7 +193,7 @@ static const struct iio_event_spec ads1015_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = _addr, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (_realbits), \ .storagebits =FIT_CHECK ((_realbits) + (_shift),16 ), \ .shift = (_shift), \
@@ -219,7 +219,7 @@ static const struct iio_event_spec ads1015_events[] = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = _addr, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits = (_realbits), \ .storagebits =FIT_CHECK ((_realbits) + (_shift),16 ), \ .shift = (_shift), \
drivers/iio/adc/ti-ads1018.c +3 -3
@@ -105,7 +105,7 @@ struct ads1018 { .channel2 = _chan2, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
@@ -125,7 +125,7 @@ struct ads1018 { .channel = _chan, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
@@ -143,7 +143,7 @@ struct ads1018 { .type = IIO_TEMP, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _realbits, \ .storagebits = 16, \ .shift = 16 - _realbits, \
drivers/iio/adc/ti-ads1100.c +1 -1
@@ -60,7 +60,7 @@ static const struct iio_chan_spec ads1100_channel = { .info_mask_shared_by_all_available = BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/ti-ads1119.c +1 -1
@@ -586,7 +586,7 @@ static int ads1119_alloc_and_config_channels(struct iio_dev *indio_dev)BIT (IIO_CHAN_INFO_SCALE ) | BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/adc/ti-ads124s08.c +1 -1
@@ -117,7 +117,7 @@ struct ads124s_private { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ }, \
drivers/iio/adc/ti-ads1298.c +1 -1
@@ -149,7 +149,7 @@ struct ads1298_private {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), \ .scan_index = index, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =ADS1298_BITS_PER_SAMPLE , \ .storagebits =32 , \ .endianness =IIO_CPU , \
drivers/iio/adc/ti-ads131e08.c +1 -1
@@ -768,7 +768,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)BIT (IIO_CHAN_INFO_SCALE ); channels[i].info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SAMP_FREQ ); channels[i].scan_index = channel; - channels[i].scan_type.sign ='s' ; + channels[i].scan_type.format ='s' ; channels[i].scan_type.realbits =24 ; channels[i].scan_type.storagebits =32 ; channels[i].scan_type.shift =8 ;
drivers/iio/adc/ti-ads7950.c +1 -1
@@ -144,7 +144,7 @@ enum ti_ads7950_id { .datasheet_name = "CH##index", \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/adc/ti-ads8688.c +1 -1
@@ -157,7 +157,7 @@ static const struct attribute_group ads8688_attribute_group = { | BIT(IIO_CHAN_INFO_OFFSET), \ .scan_index = index, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
drivers/iio/adc/ti-lmp92064.c +2 -2
@@ -96,7 +96,7 @@ static const struct iio_chan_spec lmp92064_adc_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = TI_LMP92064_CHAN_INC, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
@@ -109,7 +109,7 @@ static const struct iio_chan_spec lmp92064_adc_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = TI_LMP92064_CHAN_INV, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 12, .storagebits = 16, },
drivers/iio/adc/ti-tlc4541.c +1 -1
@@ -60,7 +60,7 @@ enum tlc4541_id { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (bitshift), \
drivers/iio/adc/ti-tsc2046.c +1 -1
@@ -192,7 +192,7 @@ struct tsc2046_adc_priv { .datasheet_name = "#name", \ .scan_index = index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = bits, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/adc/ti_am335x_adc.c +1 -1
@@ -417,7 +417,7 @@ static int tiadc_channel_init(struct device *dev, struct iio_dev *indio_dev, chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); chan->datasheet_name = chan_name_ain[chan->channel]; chan->scan_index = i; - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =16 ; }
drivers/iio/adc/vf610_adc.c +2 -2
@@ -515,7 +515,7 @@ static const struct iio_chan_spec_ext_info vf610_ext_info[] = { .ext_info = vf610_ext_info, \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
@@ -527,7 +527,7 @@ static const struct iio_chan_spec_ext_info vf610_ext_info[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), \ .scan_index = (_idx), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
drivers/iio/adc/xilinx-ams.c +1 -1
@@ -1208,7 +1208,7 @@ static int ams_get_ext_chan(struct fwnode_handle *chan_node,memcpy (chan, &ams_pl_channels[ext_chan],sizeof (*channels));if (fwnode_property_read_bool (child,"xlnx,bipolar" )) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ; num_channels++; }
drivers/iio/adc/xilinx-xadc-core.c +5 -5
@@ -928,7 +928,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev,return ret; val16 >>= chan->scan_type.shift; -if (chan->scan_type.sign =='u' ) +if (chan->scan_type.format =='u' ) *val = val16;else *val =sign_extend32 (val16, bits -1 );
@@ -1066,7 +1066,7 @@ static const struct iio_event_spec xadc_voltage_events[] = { .num_event_specs = ARRAY_SIZE(xadc_temp_events), \ .scan_index = (_scan_index), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
@@ -1086,7 +1086,7 @@ static const struct iio_event_spec xadc_voltage_events[] = { .num_event_specs = (_alarm) ? ARRAY_SIZE(xadc_voltage_events) : 0, \ .scan_index = (_scan_index), \ .scan_type = { \ - .sign = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \ + .format = ((_addr) == XADC_REG_VREFN) ? 's' : 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
@@ -1265,7 +1265,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)continue ;if (fwnode_property_read_bool (child,"xlnx,bipolar" )) - chan->scan_type.sign ='s' ; + chan->scan_type.format ='s' ;if (reg ==0 ) { chan->scan_index =11 ;
@@ -1420,7 +1420,7 @@ static int xadc_probe(struct platform_device *pdev) bipolar_mask =0 ;for (i =0 ; i < indio_dev->num_channels; i++) { -if (indio_dev->channels[i].scan_type.sign =='s' ) +if (indio_dev->channels[i].scan_type.format =='s' ) bipolar_mask |=BIT (indio_dev->channels[i].scan_index); }
drivers/iio/addac/ad74115.c +1 -1
@@ -1280,7 +1280,7 @@ static const struct iio_info ad74115_info = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = index, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =16 , \ .storagebits =32 , \ .shift =8 , \
drivers/iio/addac/ad74413r.c +1 -1
@@ -1120,7 +1120,7 @@ static const struct iio_info ad74413r_info = { .info_mask_separate_available = \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 32, \ .shift = 8, \
drivers/iio/chemical/atlas-ezo-sensor.c +2 -2
@@ -52,7 +52,7 @@ struct atlas_ezo_data { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_CPU, \
@@ -74,7 +74,7 @@ static const struct iio_chan_spec atlas_hum_ezo_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/chemical/atlas-sensor.c +6 -6
@@ -118,7 +118,7 @@ static const struct iio_chan_spec atlas_ph_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -145,7 +145,7 @@ static const struct iio_chan_spec atlas_ph_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _idx + 1, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -160,7 +160,7 @@ static const struct iio_chan_spec atlas_ec_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -187,7 +187,7 @@ static const struct iio_chan_spec atlas_orp_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -204,7 +204,7 @@ static const struct iio_chan_spec atlas_do_channels[] = { BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -228,7 +228,7 @@ static const struct iio_chan_spec atlas_rtd_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
drivers/iio/chemical/bme680_core.c +4 -4
@@ -172,7 +172,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 0, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =16 , .storagebits =16 , .endianness =IIO_CPU ,
@@ -187,7 +187,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 1, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =32 , .storagebits =32 , .endianness =IIO_CPU ,
@@ -202,7 +202,7 @@ static const struct iio_chan_spec bme680_channels[] = {BIT (IIO_CHAN_INFO_OVERSAMPLING_RATIO ), .scan_index = 2, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =32 , .storagebits =32 , .endianness =IIO_CPU ,
@@ -213,7 +213,7 @@ static const struct iio_chan_spec bme680_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .scan_index = 3, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 32, .storagebits = 32, .endianness = IIO_CPU,
drivers/iio/chemical/ccs811.c +2 -2
@@ -105,7 +105,7 @@ static const struct iio_chan_spec ccs811_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = 0, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
@@ -118,7 +118,7 @@ static const struct iio_chan_spec ccs811_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = 1, .scan_type = { - .sign ='u' , + .format ='u' , .realbits =16 , .storagebits =16 , .endianness =IIO_BE ,
drivers/iio/chemical/ens160_core.c +2 -2
@@ -76,7 +76,7 @@ static const struct iio_chan_spec ens160_channels[] = { .address = ENS160_REG_DATA_TVOC, .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -91,7 +91,7 @@ static const struct iio_chan_spec ens160_channels[] = { .address = ENS160_REG_DATA_ECO2, .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
drivers/iio/chemical/pms7003.c +1 -1
@@ -178,7 +178,7 @@ static const struct iio_info pms7003_info = { .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 10, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/chemical/scd30_core.c +1 -1
@@ -455,7 +455,7 @@ static const struct iio_info scd30_info = { };#define SCD30_CHAN_SCAN_TYPE (_sign, _realbits) .scan_type = { \ - .sign = _sign, \ + .format = _sign, \ .realbits = _realbits, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/chemical/scd4x.c +3 -3
@@ -583,7 +583,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_CO2, .scan_index = SCD4X_CO2, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -598,7 +598,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_TEMP, .scan_index = SCD4X_TEMP, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -611,7 +611,7 @@ static const struct iio_chan_spec scd4x_channels[] = { .address = SCD4X_HR, .scan_index = SCD4X_HR, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/chemical/sps30.c +1 -1
@@ -299,7 +299,7 @@ static const struct iio_info sps30_info = { .address = _mod, \ .scan_index = _index, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 19, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/common/cros_ec_sensors/cros_ec_activity.c +1 -1
@@ -283,7 +283,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->scan_index = index; channel->type =IIO_TIMESTAMP ; channel->channel =-1 ; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ; channel->scan_type.realbits =64 ; channel->scan_type.storagebits =64 ;
drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c +1 -1
@@ -36,7 +36,7 @@ static const struct iio_chan_spec cros_ec_lid_angle_channels[] = { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), .scan_type.realbits = CROS_EC_SENSOR_BITS, .scan_type.storagebits = CROS_EC_SENSOR_BITS, - .scan_type.sign = 'u', + .scan_type.format = 'u', .type =IIO_ANGL },IIO_CHAN_SOFT_TIMESTAMP (1 )
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +2 -2
@@ -260,7 +260,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->ext_info = cros_ec_sensors_ext_info; channel->modified =1 ; channel->channel2 =IIO_MOD_X + i; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ;/* Sensor specific */ switch (state->core.type) {
@@ -283,7 +283,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev) channel->type =IIO_TIMESTAMP ; channel->channel =-1 ; channel->scan_index =CROS_EC_SENSOR_MAX_AXIS ; - channel->scan_type.sign ='s' ; + channel->scan_type.format ='s' ; channel->scan_type.realbits =64 ; channel->scan_type.storagebits =64 ;
drivers/iio/common/scmi_sensors/scmi_iio.c +2 -2
@@ -425,7 +425,7 @@ static void scmi_iio_set_timestamp_channel(struct iio_chan_spec *iio_chan, iio_chan->type =IIO_TIMESTAMP ; iio_chan->channel =-1 ; iio_chan->scan_index = scan_index; - iio_chan->scan_type.sign ='u' ; + iio_chan->scan_type.format ='u' ; iio_chan->scan_type.realbits =64 ; iio_chan->scan_type.storagebits =64 ; }
@@ -443,7 +443,7 @@ static void scmi_iio_set_data_channel(struct iio_chan_spec *iio_chan, iio_chan->info_mask_shared_by_type_available =BIT (IIO_CHAN_INFO_SAMP_FREQ ); iio_chan->scan_index = scan_index; - iio_chan->scan_type.sign ='s' ; + iio_chan->scan_type.format ='s' ; iio_chan->scan_type.realbits =64 ; iio_chan->scan_type.storagebits =64 ; iio_chan->scan_type.endianness =IIO_LE ;
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h +2 -2
@@ -10,7 +10,7 @@ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ),\ .scan_index = _index,\ .scan_type = {\ - .sign = 's',\ + .format = 's',\ .realbits = 16,\ .storagebits = 16,\ .shift = 0,\
@@ -24,7 +24,7 @@ .channel = -1, \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 64, \ .storagebits = 64, \ }, \
drivers/iio/dac/ad3552r-hs.c +1 -1
@@ -766,7 +766,7 @@ static const struct iio_buffer_setup_ops ad3552r_hs_buffer_setup_ops = { .channel = (ch), \ .scan_index = (ch), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/dac/ad3552r.c +1 -1
@@ -128,7 +128,7 @@ static int ad3552r_update_reg_field(struct ad3552r_desc *dac, u8 addr, u16 mask, .channel = _idx, \ .scan_index = _idx, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/dac/ad5064.c +1 -1
@@ -402,7 +402,7 @@ static const struct iio_chan_spec_ext_info ltc2617_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \ .address = addr, \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =16 , \ .shift = (_shift), \
drivers/iio/dac/ad5360.c +1 -1
@@ -109,7 +109,7 @@ enum ad5360_type {BIT (IIO_CHAN_INFO_CALIBSCALE ) | \ BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 16 - (bits), \
drivers/iio/dac/ad5380.c +1 -1
@@ -258,7 +258,7 @@ static const struct iio_chan_spec_ext_info ad5380_ext_info[] = {BIT (IIO_CHAN_INFO_CALIBBIAS ), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =14 - (_bits), \
drivers/iio/dac/ad5421.c +1 -1
@@ -116,7 +116,7 @@ static const struct iio_chan_spec ad5421_channels[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET), .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, },
drivers/iio/dac/ad5446.h +1 -1
@@ -20,7 +20,7 @@ extern const struct iio_chan_spec_ext_info ad5446_ext_info_powerdown[]; .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = (storage), \ .shift = (_shift), \
drivers/iio/dac/ad5449.c +1 -1
@@ -203,7 +203,7 @@ static const struct iio_info ad5449_info = {BIT (IIO_CHAN_INFO_SCALE ), \ .address = (chan), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =16 , \ .shift =12 - (bits), \
drivers/iio/dac/ad5504.c +1 -1
@@ -254,7 +254,7 @@ static const struct iio_chan_spec_ext_info ad5504_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = AD5504_ADDR_DAC(_chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 12, \ .storagebits = 16, \ }, \
drivers/iio/dac/ad5592r-base.c +1 -1
@@ -480,7 +480,7 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev, chan->channel = id; chan->info_mask_separate =BIT (IIO_CHAN_INFO_RAW ); chan->info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ); - chan->scan_type.sign ='u' ; + chan->scan_type.format ='u' ; chan->scan_type.realbits =12 ; chan->scan_type.storagebits =16 ; chan->ext_info = ad5592r_ext_info;
drivers/iio/dac/ad5624r_spi.c +1 -1
@@ -172,7 +172,7 @@ static const struct iio_chan_spec_ext_info ad5624r_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = (_chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5686.c +1 -1
@@ -197,7 +197,7 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\ .address = addr, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = (_shift), \
drivers/iio/dac/ad5755.c +1 -1
@@ -534,7 +534,7 @@ static const struct iio_chan_spec_ext_info ad5755_ext_info[] = {BIT (IIO_CHAN_INFO_CALIBSCALE ) | \ BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5761.c +1 -1
@@ -257,7 +257,7 @@ static const struct iio_info ad5761_info = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (_bits), \ .storagebits = 16, \ .shift = 16 - (_bits), \
drivers/iio/dac/ad5764.c +1 -1
@@ -84,7 +84,7 @@ enum ad5764_type {BIT (IIO_CHAN_INFO_CALIBBIAS ), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =16 - (_bits), \
drivers/iio/dac/ad5766.c +1 -1
@@ -449,7 +449,7 @@ static const struct iio_chan_spec_ext_info ad5766_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \ .scan_index = (_chan), \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (_bits), \ .storagebits =16 , \ .shift =16 - (_bits), \
drivers/iio/dac/ad5791.c +2 -2
@@ -323,7 +323,7 @@ static const struct ad5791_chip_info _name##_chip_info = { \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ BIT(IIO_CHAN_INFO_OFFSET), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 32, \ .shift = (_shift), \
@@ -341,7 +341,7 @@ static const struct ad5791_chip_info _name##_chip_info = { \BIT (IIO_CHAN_INFO_OFFSET ), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),\ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits = (bits), \ .storagebits =32 , \ .shift = (_shift), \
drivers/iio/dac/ad7303.c +1 -1
@@ -185,7 +185,7 @@ static const struct iio_chan_spec_ext_info ad7303_ext_info[] = { .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .address = (chan), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 8, \ .storagebits = 8, \ .shift = 0, \
drivers/iio/dac/ad8460.c +1 -1
@@ -742,7 +742,7 @@ static const struct iio_event_spec ad8460_events[] = { .channel = 0, \ .scan_index = 0, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 14, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/dac/ad9739a.c +1 -1
@@ -335,7 +335,7 @@ static struct iio_chan_spec ad9739a_channels[] = { .output = 1, .ext_info = ad9739a_ext_info, .scan_type = { - .sign = 's', + .format = 's', .storagebits = 16, .realbits = 16, },
drivers/iio/dac/ltc1660.c +1 -1
@@ -109,7 +109,7 @@ static int ltc1660_write_raw(struct iio_dev *indio_dev, .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/dac/max5522.c +1 -1
@@ -45,7 +45,7 @@ struct max5522_state { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = 10, \ .storagebits = 16, \ .shift = 2, \
drivers/iio/dac/mcp4922.c +1 -1
@@ -41,7 +41,7 @@ struct mcp4922_state { .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 12 - (bits), \
drivers/iio/dac/stm32-dac.c +1 -1
@@ -255,7 +255,7 @@ static const struct iio_chan_spec_ext_info stm32_dac_ext_info[] = {BIT (IIO_CHAN_INFO_SCALE ), \/* scan_index is always 0 as num_channels is 1 */ \ .scan_type = { \ - .sign ='u' , \ + .format ='u' , \ .realbits =12 , \ .storagebits =16 , \ }, \
drivers/iio/dummy/iio_simple_dummy.c +4 -4
@@ -128,7 +128,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {/* The ordering of elements in the buffer via an enum */ .scan_index = DUMMY_INDEX_VOLTAGE_0, .scan_type = { /* Description of storage in buffer */ - .sign = 'u', /* unsigned */ + .format = 'u', /* unsigned */ .realbits = 13, /* 13 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
@@ -167,7 +167,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = {*/ .scan_index = DUMMY_INDEX_DIFFVOLTAGE_1M2, .scan_type = { /* Description of storage in buffer */ - .sign = 's', /* signed */ + .format = 's', /* signed */ .realbits = 12, /* 12 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
@@ -185,7 +185,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = { .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = DUMMY_INDEX_DIFFVOLTAGE_3M4, .scan_type = { - .sign = 's', + .format = 's', .realbits = 11, .storagebits = 16, .shift = 0,
@@ -212,7 +212,7 @@ static const struct iio_chan_spec iio_dummy_channels[] = { .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = DUMMY_INDEX_ACCELX, .scan_type = { /* Description of storage in buffer */ - .sign = 's', /* signed */ + .format = 's', /* signed */ .realbits = 16, /* 16 bits */ .storagebits = 16, /* 16 bits used for storage */ .shift = 0, /* zero shift */
drivers/iio/gyro/adis16136.c +2 -2
@@ -361,7 +361,7 @@ static const struct iio_chan_spec adis16136_channels[] = { .address = ADIS16136_REG_GYRO_OUT2, .scan_index = ADIS16136_SCAN_GYRO, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, .endianness = IIO_BE,
@@ -375,7 +375,7 @@ static const struct iio_chan_spec adis16136_channels[] = { .address = ADIS16136_REG_TEMP_OUT, .scan_index = ADIS16136_SCAN_TEMP, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/gyro/adxrs290.c +2 -2
@@ -538,7 +538,7 @@ static irqreturn_t adxrs290_trigger_handler(int irq, void *p) BIT(IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY), \ .scan_index = ADXRS290_IDX_##axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -555,7 +555,7 @@ static const struct iio_chan_spec adxrs290_channels[] = {BIT (IIO_CHAN_INFO_SCALE ), .scan_index = ADXRS290_IDX_TEMP, .scan_type = { - .sign ='s' , + .format ='s' , .realbits =12 , .storagebits =16 , .endianness =IIO_LE ,
drivers/iio/gyro/bmg160_core.c +1 -1
@@ -833,7 +833,7 @@ static const struct iio_event_spec bmg160_event = {BIT (IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY ), \ .scan_index = AXIS_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_LE , \
drivers/iio/gyro/fxas21002c_core.c +1 -1
@@ -696,7 +696,7 @@ static const struct attribute_group fxas21002c_attrs_group = {BIT (IIO_CHAN_INFO_SAMP_FREQ ), \ .scan_index = CHANNEL_SCAN_INDEX_##_axis, \ .scan_type = { \ - .sign ='s' , \ + .format ='s' , \ .realbits =16 , \ .storagebits =16 , \ .endianness =IIO_BE , \
drivers/iio/gyro/hid-sensor-gyro-3d.c +1 -1
@@ -86,7 +86,7 @@ static const struct iio_chan_spec gyro_3d_channels[] = {static void gyro_3d_adjust_channel_bit_mask (struct iio_chan_spec *channels,int channel,int size) { - channels[channel].scan_type.sign ='s' ; + channels[channel].scan_type.format ='s' ;/* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size *8 ;/* Maximum size of a sample to capture is u32 */
drivers/iio/gyro/itg3200_core.c +1 -1
@@ -257,7 +257,7 @@ static const struct iio_chan_spec_ext_info itg3200_ext_info[] = { };#define ITG3200_ST \ - { .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE } + { .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE }#define ITG3200_GYRO_CHAN (_mod) { \ .type = IIO_ANGL_VEL, \
drivers/iio/gyro/mpu3050-core.c +2 -2
@@ -697,7 +697,7 @@ static const struct iio_chan_spec_ext_info mpu3050_ext_info[] = { .ext_info = mpu3050_ext_info, \ .scan_index = index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -713,7 +713,7 @@ static const struct iio_chan_spec mpu3050_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/health/afe440x.h +1 -1
@@ -87,7 +87,7 @@ .address = _index, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 24, \ .storagebits = 32, \ .endianness = IIO_CPU, \
drivers/iio/health/max30100.c +2 -2
@@ -124,7 +124,7 @@ static const struct iio_chan_spec max30100_channels[] = { .scan_index = 0, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
@@ -137,7 +137,7 @@ static const struct iio_chan_spec max30100_channels[] = { .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/health/max30102.c +1 -1
@@ -135,7 +135,7 @@ static const unsigned long max30105_scan_masks[] = { .modified = 1, \ .scan_index = _si, \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .shift = 8, \ .realbits = 18, \ .storagebits = 32, \
drivers/iio/humidity/am2315.c +2 -2
@@ -51,7 +51,7 @@ static const struct iio_chan_spec am2315_channels[] = { BIT(IIO_CHAN_INFO_SCALE), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
@@ -63,7 +63,7 @@ static const struct iio_chan_spec am2315_channels[] = { BIT(IIO_CHAN_INFO_SCALE), .scan_index = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_CPU,
drivers/iio/humidity/hdc100x.c +2 -2
@@ -100,7 +100,7 @@ static const struct iio_chan_spec hdc100x_channels[] = { BIT(IIO_CHAN_INFO_OFFSET), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
@@ -114,7 +114,7 @@ static const struct iio_chan_spec hdc100x_channels[] = { BIT(IIO_CHAN_INFO_INT_TIME), .scan_index = 1, .scan_type = { - .sign = 'u', + .format = 'u', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/humidity/hid-sensor-humidity.c +1 -1
@@ -47,7 +47,7 @@ static const struct iio_chan_spec humidity_channels[] = { static void humidity_adjust_channel_bit_mask(struct iio_chan_spec *channels, int channel, int size) { - channels[channel].scan_type.sign = 's'; + channels[channel].scan_type.format = 's'; /* Real storage bits will change based on the report desc. */ channels[channel].scan_type.realbits = size * 8; /* Maximum size of a sample to capture is s32 */
drivers/iio/humidity/hts221_core.c +2 -2
@@ -100,7 +100,7 @@ static const struct iio_chan_spec hts221_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 0, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
@@ -116,7 +116,7 @@ static const struct iio_chan_spec hts221_channels[] = { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), .scan_index = 1, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_LE,
drivers/iio/imu/adis.c +1 -1
@@ -482,7 +482,7 @@ int adis_single_conversion(struct iio_dev *indio_dev, return ret; } - if (chan->scan_type.sign == 's') + if (chan->scan_type.format == 's') *val = sign_extend32(uval, chan->scan_type.realbits - 1); else *val = uval & ((1 << chan->scan_type.realbits) - 1);
drivers/iio/imu/adis16400.c +8 -8
@@ -653,7 +653,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = (si), \ .scan_type = { \ - .sign = 'u', \ + .format = 'u', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -679,7 +679,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = addr, \ .scan_index = ADIS16400_SCAN_GYRO_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -699,7 +699,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16400_SCAN_ACC_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -718,7 +718,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16400_SCAN_MAGN_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -744,7 +744,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16350_SCAN_TEMP_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -763,7 +763,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16350_SCAN_TEMP_X, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -781,7 +781,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p) .address = (addr), \ .scan_index = ADIS16300_SCAN_INCLI_ ## mod, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (bits), \ .storagebits = 16, \ .shift = 0, \
@@ -834,7 +834,7 @@ static const struct iio_chan_spec adis16448_channels[] = { .address = ADIS16448_BARO_OUT, .scan_index = ADIS16400_SCAN_BARO, .scan_type = { - .sign = 's', + .format = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE,
drivers/iio/imu/adis16460.c +2 -2
@@ -242,7 +242,7 @@ enum { .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_bits), \ .storagebits = (_bits), \ .endianness = IIO_BE, \
@@ -270,7 +270,7 @@ enum { .address = ADIS16460_REG_TEMP_OUT, \ .scan_index = ADIS16460_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/adis16475.c +3 -3
@@ -671,7 +671,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_r_bits), \ .storagebits = (_s_bits), \ .endianness = IIO_BE, \
@@ -699,7 +699,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = ADIS16475_REG_TEMP_OUT, \ .scan_index = ADIS16475_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
@@ -717,7 +717,7 @@ static int adis16475_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_r_bits), \ .storagebits = (_s_bits), \ .endianness = IIO_BE, \
drivers/iio/imu/adis16480.c +3 -3
@@ -741,7 +741,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = (_bits), \ .storagebits = (_bits), \ .endianness = IIO_BE, \
@@ -798,7 +798,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = ADIS16480_REG_BAROM_OUT, \ .scan_index = ADIS16480_SCAN_BARO, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -816,7 +816,7 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, .address = ADIS16480_REG_TEMP_OUT, \ .scan_index = ADIS16480_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/adis16550.c +3 -3
@@ -706,7 +706,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = (_si), \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -731,7 +731,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = ADIS16550_REG_TEMP, \ .scan_index = ADIS16550_SCAN_TEMP, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 32, \ .endianness = IIO_BE, \
@@ -748,7 +748,7 @@ static int adis16550_write_raw(struct iio_dev *indio_dev, .address = (_address), \ .scan_index = _si, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 32, \ .storagebits = 32, \ .endianness = IIO_BE, \
drivers/iio/imu/bmi160/bmi160_core.c +1 -1
@@ -105,7 +105,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bmi270/bmi270_core.c +2 -2
@@ -1275,7 +1275,7 @@ static const struct iio_info bmi270_info = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = BMI270_SCAN_ACCEL_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -1296,7 +1296,7 @@ static const struct iio_info bmi270_info = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = BMI270_SCAN_GYRO_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bmi323/bmi323_core.c +2 -2
@@ -248,7 +248,7 @@ static const struct iio_event_spec bmi323_accel_event[] = { BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -272,7 +272,7 @@ static const struct iio_event_spec bmi323_accel_event[] = { BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/bno055/bno055.c +1 -1
@@ -444,7 +444,7 @@ static void bno055_uninit(void *arg) .info_mask_shared_by_type_available = _avail, \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +1 -1
@@ -42,7 +42,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +1 -1
@@ -39,7 +39,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_BE, \
drivers/iio/imu/inv_icm42600/inv_icm42600_temp.h +1 -1
@@ -17,7 +17,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ }, \
drivers/iio/imu/inv_icm45600/inv_icm45600.h +1 -1
@@ -346,7 +346,7 @@ inv_icm45600_get_mount_matrix(const struct iio_dev *indio_dev, BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm45600/inv_icm45600_accel.c +1 -1
@@ -52,7 +52,7 @@ static const struct iio_chan_spec_ext_info inv_icm45600_accel_ext_infos[] = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_icm45600/inv_icm45600_gyro.c +1 -1
@@ -52,7 +52,7 @@ static const struct iio_chan_spec_ext_info inv_icm45600_gyro_ext_infos[] = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +3 -3
@@ -1469,7 +1469,7 @@ static const struct iio_event_spec inv_wom_events[] = { BIT(IIO_CHAN_INFO_CALIBBIAS), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .shift = 0, \
@@ -1486,7 +1486,7 @@ static const struct iio_event_spec inv_wom_events[] = { | BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .shift = 0, \
@@ -1578,7 +1578,7 @@ static const unsigned long inv_mpu_scan_masks[] = { BIT(IIO_CHAN_INFO_RAW), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = _bits, \ .storagebits = 16, \ .shift = 0, \
drivers/iio/imu/kmx61.c +2 -2
@@ -234,7 +234,7 @@ static const struct iio_event_spec kmx61_event = { .address = KMX61_ACC, \ .scan_index = KMX61_AXIS_ ## _axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 12, \ .storagebits = 16, \ .shift = 4, \
@@ -254,7 +254,7 @@ static const struct iio_event_spec kmx61_event = { BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = KMX61_AXIS_ ## _axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 14, \ .storagebits = 16, \ .shift = 2, \
drivers/iio/imu/smi240.c +2 -2
@@ -80,7 +80,7 @@ BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
@@ -96,7 +96,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_CPU, \
drivers/iio/imu/smi330/smi330_core.c +3 -3
@@ -85,7 +85,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = SMI330_SCAN_ACCEL_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -110,7 +110,7 @@ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = SMI330_SCAN_GYRO_##_axis, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -124,7 +124,7 @@ BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = _index, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +2 -2
@@ -92,7 +92,7 @@ enum st_lsm6dsx_hw_id { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
@@ -113,7 +113,7 @@ enum st_lsm6dsx_hw_id { .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \ - .sign = 's', \ + .format = 's', \ .realbits = 16, \ .storagebits = 16, \ .endianness = IIO_LE, \
drivers/iio/industrialio-buffer.c +2 -2
@@ -421,7 +421,7 @@ static ssize_t iio_show_fixed_type(struct device *dev, if (scan_type->repeat > 1) return sysfs_emit(buf, "%s:%c%d/%dX%d>>%u\n", iio_endian_prefix[type], - scan_type->sign, + scan_type->format, scan_type->realbits, scan_type->storagebits, scan_type->repeat,
@@ -429,7 +429,7 @@ static ssize_t iio_show_fixed_type(struct device *dev, else return sysfs_emit(buf, "%s:%c%d/%d>>%u\n", iio_endian_prefix[type], - scan_type->sign, + scan_type->format, scan_type->realbits, scan_type->storagebits, scan_type->shift);
drivers/iio/light/acpi-als.c +1 -1
@@ -38,7 +38,7 @@ static const struct iio_chan_spec acpi_als_channels[] = { { .type = IIO_LIGHT, .scan_type = { - .sign = 's', + .format = 's', .realbits = 32, .storagebits = 32, },
drivers/iio/light/adjd_s311.c +1 -1
@@ -152,7 +152,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p) .channel2 = (IIO_MOD_LIGHT_##_color), \ .scan_index = (_scan_idx), \ .scan_type = { \ - .sign = 'u', \
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/hid-sensor-magn-3d.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/hmc5843_core.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/iio/magnetometer/yamaha-yas530.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/iio/orientation/hid-sensor-incl-3d.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/orientation/hid-sensor-rotation.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/position/hid-sensor-custom-intel-hinge.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/iio/pressure/hid-sensor-press.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/pressure/st_pressure_core.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/temperature/hid-sensor-temperature.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/iio/temperature/maxim_thermocouple.c +3 -3
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.5
Part of the diff is not shown here. View the raw message.
David Lechner
reviewerRe: [PATCH v6 4/7] iio: Rename 'sign' field to `format` in struct iio_scan_type
Quoted 5 lines · Francesco Lavra
This field is used to differentiate between signed and unsigned integers. A following commit will extend its use to in order to add support for non- integer scan elements; therefore, change its name from 'sign' to a more generic 'format'.
Maybe Jonathan is OK with doing this all at once, but another alternative could be to introduce a union to allow both names at the same time, then we could make the change more gradually.
Jonathan Cameron
maintainerRe: [PATCH v6 4/7] iio: Rename 'sign' field to `format` in struct iio_scan_type
Quoted 10 lines · On Wed, 25 Feb 2026 15:27:01 -0600 David Lechner <[email protected]> wrote:
Quoted 5 lines · Francesco Lavra
This field is used to differentiate between signed and unsigned integers. A following commit will extend its use to in order to add support for non- integer scan elements; therefore, change its name from 'sign' to a more generic 'format'.
Maybe Jonathan is OK with doing this all at once, but another alternative could be to introduce a union to allow both names at the same time, then we could make the change more gradually.
Please do the union for v7. Not so much because I mind a global change, but more because the chances of merge conflicts are too high.
Perhaps for this series just introduce the union and use it in the driver here. We can then chase it through the rest of the tree as a separate step.
Alternatively leave it with a misleading name for now (so allow 'f' to be a magic sign value) and we can do the rename as a follow up.
Jonathan
PATCH v6 5/7 iio: ABI: Add support for floating-point numbers in buffer scan elements
In reply to Francesco LavraIn the data storage description of a scan element, the first character after the colon can have the values 's' and 'u' to specify signed and unsigned integers, respectively.
Add 'f' as an allowed value to specify floating-point numbers formatted according to the IEEE 754 standard.
--- Documentation/ABI/testing/sysfs-bus-iio | 33 +++++++++++++----------- Documentation/driver-api/iio/buffers.rst | 5 ++-- Documentation/iio/iio_devbuf.rst | 3 ++- 3 files changed, 23 insertions(+), 18 deletions(-)
Documentation/ABI/testing/sysfs-bus-iio +18 -15
@@ -1510,21 +1510,24 @@ Contact: [email protected] Description: Description of the scan element data storage within the buffer and hence the form in which it is read from user-space. - Form is [be|le]:[s|u]bits/storagebits[>>shift]. - be or le specifies big or little endian. s or u specifies if - signed (2's complement) or unsigned. bits is the number of bits - of data and storagebits is the space (after padding) that it - occupies in the buffer. shift if specified, is the shift that - needs to be applied prior to masking out unused bits. Some - devices put their data in the middle of the transferred elements - with additional information on both sides. Note that some - devices will have additional information in the unused bits - so to get a clean value, the bits value must be used to mask - the buffer output value appropriately. The storagebits value - also specifies the data alignment. So s48/64>>2 will be a - signed 48 bit integer stored in a 64 bit location aligned to - a 64 bit boundary. To obtain the clean value, shift right 2 - and apply a mask to zero the top 16 bits of the result. + Form is [be|le]:[s|u|f]bits/storagebits[>>shift]. + be or le specifies big or little endian. s means signed (two's + complement), u means unsigned, f means floating-point (IEEE 754 + binary format). bits is the number of bits of data and storagebits + is the space (after padding) that it occupies in the buffer; when + using a floating-point format, bits must be one of the width values + defined in the IEEE 754 standard for binary interchange formats + (e.g. 16 indicates the binary16 format for half-precision numbers). + shift, if specified, is the shift that needs to be applied prior to + masking out unused bits. Some devices put their data in the middle + of the transferred elements with additional information on both + sides. Note that some devices will have additional information in + the unused bits, so to get a clean value the bits value must be + used to mask the buffer output value appropriately. The storagebits + value also specifies the data alignment. So s48/64>>2 will be a + signed 48 bit integer stored in a 64 bit location aligned to a 64 + bit boundary. To obtain the clean value, shift right 2 and apply a + mask to zero the top 16 bits of the result. For other storage combinations this attribute will be extended appropriately.
Documentation/driver-api/iio/buffers.rst +3 -2
@@ -37,10 +37,11 @@ directory contains attributes of the following form: * :file:`index`, the scan_index of the channel. * :file:`type`, description of the scan element data storage within the buffer and hence the form in which it is read from user space. - Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . + Format is [be|le]:[s|u|f]bits/storagebits[Xrepeat][>>shift] . * *be* or *le*, specifies big or little endian. - * *s* or *u*, specifies if signed (2's complement) or unsigned. + * *s* or *u* or *f*, specifies if signed (2's complement) or unsigned or + floating-point. * *bits*, is the number of valid data bits. * *storagebits*, is the number of bits (after padding) that it occupies in the buffer.
Documentation/iio/iio_devbuf.rst +2 -1
@@ -86,7 +86,8 @@ within the buffer and hence the form in which it is read from userspace. Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift], where: - **be** or **le** specifies big or little-endian. -- **s** or **u** specifies if signed (2's complement) or unsigned. +- **s** or **u** or **f** specifies if signed (2's complement) or unsigned or + floating-point. - **bits** is the number of valid data bits. - **storagebits** is the number of bits (after padding) that it occupies in the buffer.
Signature · 1 line
2.39.5
Re: [PATCH v6 5/7] iio: ABI: Add support for floating-point numbers in buffer scan elements
Quoted 5 lines · Francesco Lavra
In the data storage description of a scan element, the first character after the colon can have the values 's' and 'u' to specify signed and unsigned integers, respectively.
Add 'f' as an allowed value to specify floating-point numbers formatted according to the IEEE 754 standard.
Main Q here: How will behave iio-tools and other existing user space when it sees this? Shouldn't you prepare the user space first for such a change?
...
Documentation/driver-api/iio/buffers.rst directory contains attributes of the following form: · line 40
Quoted 2 lines
Documentation/driver-api/iio/buffers.rst +1
-1- Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . + Format is [be|le]:[s|u|f]bits/storagebits[Xrepeat][>>shift] .
I would probably keep order as [f|s|u] and...
Documentation/driver-api/iio/buffers.rst directory contains attributes of the following form: · line 44
Quoted 3 lines
Documentation/driver-api/iio/buffers.rst +2
-1- * *s* or *u*, specifies if signed (2's complement) or unsigned. + * *s* or *u* or *f*, specifies if signed (2's complement) or unsigned or + floating-point.
* *f*, specifies if floating-point.
* *s* or *u*, specifies if signed (2's complement) or unsigned.
...
Quoted 4 lines
- **be** or **le** specifies big or little-endian.
-- **s** or **u** specifies if signed (2's complement) or unsigned.+- **s** or **u** or **f** specifies if signed (2's complement) or unsigned or + floating-point.
Ditto.
Signature · 2 lines
With Best Regards, Andy Shevchenko
David Lechner
reviewerRe: [PATCH v6 5/7] iio: ABI: Add support for floating-point numbers in buffer scan elements
In reply to Francesco LavraQuoted 27 lines · Francesco Lavra
In the data storage description of a scan element, the first character after the colon can have the values 's' and 'u' to specify signed and unsigned integers, respectively.
Add 'f' as an allowed value to specify floating-point numbers formatted according to the IEEE 754 standard.Signed-off-by Francesco Lavra <[email protected]>--- Documentation/ABI/testing/sysfs-bus-iio | 33 +++++++++++++----------- Documentation/driver-api/iio/buffers.rst | 5 ++-- Documentation/iio/iio_devbuf.rst | 3 ++- 3 files changed, 23 insertions(+), 18 deletions(-)Documentation/ABI/testing/sysfs-bus-iio +0
-6@@ -1510,21 +1510,24 @@ Contact: [email protected] Description: Description of the scan element data storage within the buffer and hence the form in which it is read from user-space. - Form is [be|le]:[s|u]bits/storagebits[>>shift]. - be or le specifies big or little endian. s or u specifies if - signed (2's complement) or unsigned. bits is the number of bits - of data and storagebits is the space (after padding) that it - occupies in the buffer. shift if specified, is the shift that - needs to be applied prior to masking out unused bits. Some
Documentation/ABI/testing/sysfs-bus-iio Contact: [email protected] · line 1513
Quoted 10 lines
Documentation/ABI/testing/sysfs-bus-iio +1
-9- devices put their data in the middle of the transferred elements - with additional information on both sides. Note that some - devices will have additional information in the unused bits - so to get a clean value, the bits value must be used to mask - the buffer output value appropriately. The storagebits value - also specifies the data alignment. So s48/64>>2 will be a - signed 48 bit integer stored in a 64 bit location aligned to - a 64 bit boundary. To obtain the clean value, shift right 2 - and apply a mask to zero the top 16 bits of the result. + Form is [be|le]:[s|u|f]bits/storagebits[>>shift].
Not related to this patch, but I notice that this is missing "repeat". \
PATCH v6 6/7 iio: ABI: Add custom data type
In reply to Francesco LavraThis type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace.
--- Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++ drivers/iio/industrialio-core.c | 1 + include/uapi/linux/iio/types.h | 1 + 3 files changed, 21 insertions(+)
Documentation/ABI/testing/sysfs-bus-iio +19 -0
@@ -450,6 +450,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_offset What: /sys/bus/iio/devices/iio:deviceX/in_rot_offset What: /sys/bus/iio/devices/iio:deviceX/in_angl_offset What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_custom_offset +What: /sys/bus/iio/devices/iio:deviceX/in_customY_offset KernelVersion: 2.6.35 Contact: [email protected] Description:
@@ -507,6 +509,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale What: /sys/bus/iio/devices/iio:deviceX/in_concentration_co2_scale +What: /sys/bus/iio/devices/iio:deviceX/in_custom_scale +What: /sys/bus/iio/devices/iio:deviceX/in_customY_scale KernelVersion: 2.6.35 Contact: [email protected] Description:
@@ -1486,6 +1490,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_en What: /sys/.../iio:deviceX/bufferY/in_pressure_en What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_en What: /sys/.../iio:deviceX/bufferY/in_proximity_en +What: /sys/.../iio:deviceX/bufferY/in_custom_en +What: /sys/.../iio:deviceX/bufferY/in_customZ_en KernelVersion: 5.11 Contact: [email protected] Description:
@@ -1505,6 +1511,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_type What: /sys/.../iio:deviceX/bufferY/in_pressure_type What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_type What: /sys/.../iio:deviceX/bufferY/in_proximity_type +What: /sys/.../iio:deviceX/bufferY/in_custom_type +What: /sys/.../iio:deviceX/bufferY/in_customZ_type KernelVersion: 5.11 Contact: [email protected] Description:
@@ -1566,6 +1574,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_index What: /sys/.../iio:deviceX/bufferY/in_pressure_index What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_index What: /sys/.../iio:deviceX/bufferY/in_proximity_index +What: /sys/.../iio:deviceX/bufferY/in_custom_index +What: /sys/.../iio:deviceX/bufferY/in_customZ_index KernelVersion: 5.11 Contact: [email protected] Description:
@@ -2393,6 +2403,15 @@ Description: The x and y light color coordinate on the CIE 1931 chromaticity diagram. +What: /sys/bus/iio/devices/iio:deviceX/in_custom_raw +What: /sys/bus/iio/devices/iio:deviceX/in_customY_raw +KernelVersion: 7.1 +Contact: [email protected] +Description: + Custom input value, whose type is driver-specific and is described + in a separate document. It can have a modifier Y, in which case it + is a measuremement from channel Y. + What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_either_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_rising_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_thresh_falling_label
drivers/iio/industrialio-core.c +1 -0
@@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CHROMATICITY] = "chromaticity", [IIO_ATTENTION] = "attention", [IIO_ALTCURRENT] = "altcurrent", + [IIO_CUSTOM ] ="custom" };static const char *const iio_modifier_names[] = {
include/uapi/linux/iio/types.h +1 -0
@@ -53,6 +53,7 @@ enum iio_chan_type {IIO_CHROMATICITY ,IIO_ATTENTION ,IIO_ALTCURRENT , +IIO_CUSTOM }; enum iio_modifier {
Signature · 1 line
2.39.5
Re: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 5 lines · Francesco Lavra
This type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace.
This rises the same Q as for other firmware-hidden algos, et cetera: How can we prevent the kernel from being just a simple proxy between HW and the userspace? What would be the point of having the "driver" in the kernel space?
...
drivers/iio/industrialio-core.c static const char * const iio_chan_type_name_spec[] = { · line 101
Quoted 6 lines
static const char * const iio_chan_type_name_spec[] = {
drivers/iio/industrialio-core.c +1
-0[IIO_CHROMATICITY] = "chromaticity", [IIO_ATTENTION] = "attention", [IIO_ALTCURRENT] = "altcurrent", + [IIO_CUSTOM ] ="custom"
No more channel types after this? Why?
Quoted 1 line
};
...
include/uapi/linux/iio/types.h enum iio_chan_type { · line 56
Quoted 6 lines
enum
iio_chan_type{include/uapi/linux/iio/types.h +1
-0IIO_CHROMATICITY ,IIO_ATTENTION ,IIO_ALTCURRENT , +IIO_CUSTOM
Ditto.
Quoted 1 line
};
Signature · 2 lines
With Best Regards, Andy Shevchenko
David Lechner
reviewerRe: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 7 lines · Andy Shevchenko
Quoted 5 lines · Francesco Lavra
This type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace.
Quoted 5 lines
This rises the same Q as for other firmware-hidden algos, et cetera: How can we prevent the kernel from being just a simple proxy between HW and the userspace? What would be the point of having the "driver" in the kernel space?
I tend to agree that this opens the door for misuse or an excuse to not make the effort to develop something more generally useful on future drivers.
For this patch series, could we still use IIO_ROT and introduce a new IIO_MOD_PARTIAL_QUATERNION that is defined according to the description in the documentation patch in this series? This may be the only driver that ever uses it, but it is still clearly defined.
Or perhaps we could even say that if a IIO_MOD_QUATERNION has .repeat = 3 instead of .repeat = 4, then it should be interpreted this way?
Re: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 16 lines · David Lechner
Quoted 11 lines · Andy Shevchenko
Quoted 5 lines · Francesco Lavra
This type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace.
This rises the same Q as for other firmware-hidden algos, et cetera: How can we prevent the kernel from being just a simple proxy between HW and the userspace? What would be the point of having the "driver" in the kernel space?
I tend to agree that this opens the door for misuse or an excuse to not make the effort to develop something more generally useful on future drivers.
Quoted 8 lines
For this patch series, could we still use
IIO_ROTand introduce a newIIO_MOD_PARTIAL_QUATERNIONthat is defined according to the description in the documentation patch in this series? This may be the only driver that ever uses it, but it is still clearly defined.Or perhaps we could even say that if a
IIO_MOD_QUATERNIONhas .repeat = 3 instead of .repeat = 4, then it should be interpreted this way?
Not sure about the latter, but something explicit like IIO_MOD_PARTIAL_QUATERNION sounds good to me.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 30 lines · Andy Shevchenko
Quoted 29 lines · David Lechner
Quoted 11 lines · Andy Shevchenko
Quoted 9 lines · Francesco Lavra
This type is used when the data received from or sent to a device cannot be
identified with a standard type and must be processed by custom userspace.
Any driver using the custom type must provide a driver-specific document
that explains what the data represents and how it is to be interpreted by
userspace.Quoted 7 lines
This rises the same Q as for other firmware-hidden algos, et cetera:
How
can we prevent the kernel from being just a simple proxy between HW and
the userspace? What would be the point of having the "driver" in the kernel
space?I tend to agree that this opens the door for misuse or an excuse to not make the effort to develop something more generally useful on future drivers.
For this patch series, could we still use
IIO_ROTand introduce a newIIO_MOD_PARTIAL_QUATERNIONthat is defined according to the description in the documentation patch in this series? This may be the only driver that ever uses it, but it is still clearly defined.
Quoted 6 lines
Quoted 3 lines
Or perhaps we could even say that if a
IIO_MOD_QUATERNIONhas .repeat = 3 instead of .repeat = 4, then it should be interpreted this way?Not sure about the latter, but something explicit like
IIO_MOD_PARTIAL_QUATERNIONsounds good to me.
Another option could be having a custom iio_modifier instead of a custom iio_chan_type. I think this would address the concern of drivers being just a proxy between hardware and userspace. A custom modifier would be used when the data representation for a given channel is too exotic to warrant a generic iio_modifier enum value (but would still need to be documented so that userspace can make use of it).
I can imagine a generic userspace application that interfaces with (in this case) rotation sensors (i.e. looks for IIO_ROT channels) and can support not only "standard" rotation data types (yaw, pitch, roll, quaternion, etc) but also "manufacturer-specific" types.
We could even think about allowing more than one custom modifier (e.g. everything >= IIO_MOD_CUSTOM is a custom modifier) so that a sensor can have its "manufacturer-specific" data in multiple separate channels; and of course each such custom modifier would have to be described in a per-driver doc.
Re: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 2 lines · Francesco Lavra
Quoted 1 line · Andy Shevchenko
On Wed, Feb 25, 2026 at 03:27:55PM -0600, David Lechner wrote:
...
Quoted 13 lines
Quoted 2 lines
Not sure about the latter, but something explicit like
IIO_MOD_PARTIAL_QUATERNIONsounds good to me.Another option could be having a custom
iio_modifierinstead of a customiio_chan_type. I think this would address the concern of drivers being just a proxy between hardware and userspace. A custom modifier would be used when the data representation for a given channel is too exotic to warrant a genericiio_modifierenum value (but would still need to be documented so that userspace can make use of it).
I can imagine a generic userspace application that interfaces with (in this case) rotation sensors (i.e. looks forIIO_ROTchannels) and can support not only "standard" rotation data types (yaw, pitch, roll, quaternion, etc) but also "manufacturer-specific" types.
And I am against this. It will provoke a vendor to escape the standards, common libraries and other tools. If we need something which is too exotic, the driver should convert it to the standard one. This way we will support HW and won't require or allow some dirty tricks based on vendor-locked approaches.
I'm talking from the experience on what vendors are doing or want to do IRL in other areas. One of the infamous example, is Broadcom Bluetooth used back in Nokia phones, the so called "driver" is useless completely in the kernel as it's just a proxy for the HW <--> userspace link.
TL;DR: I'm in favour for anything that does not touch user space at all, or has explicit meanings. NAK for CUSTOM, manufactirer-specific, et cetera from me is warranted.
Quoted 5 lines
We could even think about allowing more than one custom modifier (e.g. everything >=
IIO_MOD_CUSTOMis a custom modifier) so that a sensor can have its "manufacturer-specific" data in multiple separate channels; and of course each such custom modifier would have to be described in a per-driver doc.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerRe: [PATCH v6 6/7] iio: ABI: Add custom data type
Quoted 26 lines · On Thu, 26 Feb 2026 17:57:53 +0200 Andy Shevchenko…
Quoted 2 lines · Francesco Lavra
Quoted 1 line · Andy Shevchenko
On Wed, Feb 25, 2026 at 03:27:55PM -0600, David Lechner wrote:
...
Quoted 13 lines
Quoted 2 lines
Not sure about the latter, but something explicit like
IIO_MOD_PARTIAL_QUATERNIONsounds good to me.Another option could be having a custom
iio_modifierinstead of a customiio_chan_type. I think this would address the concern of drivers being just a proxy between hardware and userspace. A custom modifier would be used when the data representation for a given channel is too exotic to warrant a genericiio_modifierenum value (but would still need to be documented so that userspace can make use of it).
I can imagine a generic userspace application that interfaces with (in this case) rotation sensors (i.e. looks forIIO_ROTchannels) and can support not only "standard" rotation data types (yaw, pitch, roll, quaternion, etc) but also "manufacturer-specific" types.And I am against this. It will provoke a vendor to escape the standards, common libraries and other tools. If we need something which is too exotic, the driver should convert it to the standard one. This way we will support HW and won't require or allow some dirty tricks based on vendor-locked approaches.
Quoted 8 lines
I'm talking from the experience on what vendors are doing or want to do IRL in other areas. One of the infamous example, is Broadcom Bluetooth used back in Nokia phones, the so called "driver" is useless completely in the kernel as it's just a proxy for the HW <--> userspace link.
TL;DR: I'm in favour for anything that does not touch user space at all, or has explicit meanings. NAK for CUSTOM, manufactirer-specific, et cetera from me is warranted.
The representation here is to my mind 'odd' enough that I'm be surprised if another manufacturer ever used it. Maybe I'm wrong though, I'm out of touch with IMUs these days and defacto standards do arise sometimes. I'm not sure we can paper over it in the kernel without going to floating point maths and I don't want to start a precedence for doing that. If anyone can figure out an efficient integer solution, then that would be great.
I'm not against a specific modifier, but that space is only so big so I don't want to end up running out of space. Maybe this is a case for a low impact
experiment: We add a specific modifier for this format - with full documentation (and userspace code in the tools that come with the kernel) and see if that opens the flood gates to requests for other custom channels.
It's worth noting I was relaxed on this once before for pulse oximeters (the things under drivers/iio/health) because for various odd historical reasons I happened to know a bit about the maths needed to get data from those and there was a plausible channel type for the channels (as they were always light sensing, be it against a light source that was varying). That one didn't lead to a deluge but then it was more a case of allowing a minor abuse of the ABI than adding an official custom path.
Also worth noting this sensor provides all of the real channels in normal ABI compliant fashion, it's just this odd derived channel that is tripping us up.
Jonathan
Quoted 7 lines
Quoted 6 lines
We could even think about allowing more than one custom modifier (e.g. everything >=
IIO_MOD_CUSTOMis a custom modifier) so that a sensor can have its "manufacturer-specific" data in multiple separate channels; and of course each such custom modifier would have to be described in a per-driver doc.
PATCH v6 7/7 iio: imu: st_lsm6dsx: Add support for rotation sensor
In reply to Francesco LavraSome IMU chips in the LSM6DSX family have sensor fusion features that combine data from the accelerometer and gyroscope. One of these features generates rotation vector data and makes it available in the hardware FIFO as a quaternion (more specifically, the X, Y and Z components of the quaternion vector, expressed as 16-bit half-precision floating-point numbers).
Add support for a new sensor instance that allows receiving sensor fusion data, by defining a new struct st_lsm6dsx_sf_settings (which contains chip-specific details for the sensor fusion functionality), and adding this struct as a new field in struct st_lsm6dsx_settings. In st_lsm6dsx_core.c, populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the logic to initialize an additional IIO device if this struct is populated for the hardware type being probed.
Note: a new IIO device is being defined (as opposed to adding channels to an existing device) because the rate at which sensor fusion data is generated may not match the data rate from any of the existing devices.
Tested on LSMDSV16X.
--- Documentation/iio/index.rst | 1 + Documentation/iio/st_lsm6dsx.rst | 44 ++++ drivers/iio/imu/st_lsm6dsx/Makefile | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 26 +- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 58 +++++ .../iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 235 ++++++++++++++++++ 7 files changed, 368 insertions(+), 7 deletions(-) create mode 100644 Documentation/iio/st_lsm6dsx.rst create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
Documentation/iio/index.rst +1 -0
@@ -39,3 +39,4 @@ Industrial I/O Kernel Drivers bno055 ep93xx_adc opt4060 + st_lsm6dsx
Documentation/iio/st_lsm6dsx.rst new file +44 -0
44 lines not on this page · raw message
drivers/iio/imu/st_lsm6dsx/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only st_lsm6dsx-y := st_lsm6dsx_core.o st_lsm6dsx_buffer.o \ - st_lsm6dsx_shub.o + st_lsm6dsx_shub.o st_lsm6dsx_fusion.o obj-$(CONFIG_IIO_ST_LSM6DSX) += st_lsm6dsx.o obj-$(CONFIG_IIO_ST_LSM6DSX_I2C) += st_lsm6dsx_i2c.o
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +21 -5
@@ -294,6 +294,7 @@ enum st_lsm6dsx_sensor_id {ST_LSM6DSX_ID_EXT0 ,ST_LSM6DSX_ID_EXT1 ,ST_LSM6DSX_ID_EXT2 , +ST_LSM6DSX_ID_SF , ST_LSM6DSX_ID_MAX };
@@ -301,6 +302,15 @@ enum st_lsm6dsx_ext_sensor_id { ST_LSM6DSX_ID_MAGN, }; +struct st_lsm6dsx_sf_settings { +const struct iio_chan_spec *chan; +int chan_len; +struct st_lsm6dsx_odr_table_entry odr_table; +struct st_lsm6dsx_reg fifo_enable; +struct st_lsm6dsx_reg page_mux; +struct st_lsm6dsx_reg enable; +}; +/** * struct st_lsm6dsx_ext_dev_settings - i2c controller slave settings * @i2c_addr: I2c slave address list.
@@ -388,6 +398,7 @@ struct st_lsm6dsx_settings {struct st_lsm6dsx_hw_ts_settings ts_settings;struct st_lsm6dsx_shub_settings shub_settings;struct st_lsm6dsx_event_settings event_settings; +struct st_lsm6dsx_sf_settings sf_settings; };enum st_lsm6dsx_fifo_mode {
@@ -510,6 +521,9 @@ int st_lsm6dsx_check_odr(struct st_lsm6dsx_sensor *sensor, u32 odr, u8 *val);int st_lsm6dsx_shub_probe (struct st_lsm6dsx_hw *hw,const char *name);int st_lsm6dsx_shub_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable);int st_lsm6dsx_shub_read_output (struct st_lsm6dsx_hw *hw,u8 *data,int len); +int st_lsm6dsx_sf_probe (struct st_lsm6dsx_hw *hw,const char *name); +int st_lsm6dsx_sf_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable); +int st_lsm6dsx_sf_set_odr (struct st_lsm6dsx_sensor *sensor,bool enable);int st_lsm6dsx_set_page (struct st_lsm6dsx_hw *hw,bool enable); static inline int
@@ -564,12 +578,14 @@ st_lsm6dsx_get_mount_matrix(const struct iio_dev *iio_dev,static inline int st_lsm6dsx_device_set_enable (struct st_lsm6dsx_sensor *sensor,bool enable) { -if (sensor->id ==ST_LSM6DSX_ID_EXT0 || - sensor->id ==ST_LSM6DSX_ID_EXT1 || - sensor->id ==ST_LSM6DSX_ID_EXT2 ) +switch (sensor->id) { + case ST_LSM6DSX_ID_EXT0 ... ST_LSM6DSX_ID_EXT2:return st_lsm6dsx_shub_set_enable (sensor, enable); - -return st_lsm6dsx_sensor_set_enable (sensor, enable); +case ST_LSM6DSX_ID_SF : +return st_lsm6dsx_sf_set_enable (sensor, enable); +default : +return st_lsm6dsx_sensor_set_enable (sensor, enable); + } } static const
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +8 -1
@@ -88,6 +88,7 @@ enum st_lsm6dsx_fifo_tag {ST_LSM6DSX_EXT0_TAG =0x0f ,ST_LSM6DSX_EXT1_TAG =0x10 ,ST_LSM6DSX_EXT2_TAG =0x11 , + ST_LSM6DSX_ROT_TAG = 0x13, }; static const
@@ -226,8 +227,11 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor,u8 data;/* Only internal sensors have a FIFO ODR configuration register. */ -if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) +if (sensor->id >=ARRAY_SIZE (hw->settings->batch)) { +if (sensor->id ==ST_LSM6DSX_ID_SF ) +return st_lsm6dsx_sf_set_odr (sensor, enable);return 0 ; + } batch_reg = &hw->settings->batch[sensor->id];if (batch_reg->addr) {
@@ -578,6 +582,9 @@ st_lsm6dsx_push_tagged_data(struct st_lsm6dsx_hw *hw, u8 tag,case ST_LSM6DSX_EXT2_TAG : iio_dev = hw->iio_devs[ST_LSM6DSX_ID_EXT2 ];break ; +case ST_LSM6DSX_ROT_TAG : + iio_dev = hw->iio_devs[ST_LSM6DSX_ID_SF ]; +break ;default :return -EINVAL ; }
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +58 -0
82 lines not on this page · raw message
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +235 -0
235 lines not on this page · raw message
Signature · 1 line
2.39.5
Re: [PATCH v6 7/7] iio: imu: st_lsm6dsx: Add support for rotation sensor
Quoted 19 lines · Francesco Lavra
Some IMU chips in the LSM6DSX family have sensor fusion features that combine data from the accelerometer and gyroscope. One of these features generates rotation vector data and makes it available in the hardware FIFO as a quaternion (more specifically, the X, Y and Z components of the quaternion vector, expressed as 16-bit half-precision floating-point numbers).
Add support for a new sensor instance that allows receiving sensor fusion data, by defining a new struct
st_lsm6dsx_sf_settings(which contains chip-specific details for the sensor fusion functionality), and adding this struct as a new field in structst_lsm6dsx_settings. Inst_lsm6dsx_core.c, populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the logic to initialize an additional IIO device if this struct is populated for the hardware type being probed.
Note: a new IIO device is being defined (as opposed to adding channels to an existing device) because the rate at which sensor fusion data is generated may not match the data rate from any of the existing devices.Tested on LSMDSV16X.
...
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c line 207
Quoted 5 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +5
-0+int st_lsm6dsx_sf_probe (struct st_lsm6dsx_hw *hw,const char *name) +{ +const struct st_lsm6dsx_sf_settings *settings; +struct st_lsm6dsx_sensor *sensor; +struct iio_dev *iio_dev;
Maybe
int ret; // choose better name if any
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +8
-0+ iio_dev =devm_iio_device_alloc (hw->dev,sizeof (*sensor)); +if (!iio_dev) +return -ENOMEM ; + + settings = &hw->settings->sf_settings; + sensor =iio_priv (iio_dev); + sensor->id =ST_LSM6DSX_ID_SF ; + sensor->hw = hw;
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c line 225
Quoted 10 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +9
-0+ sensor->hwfifo_odr_mHz = settings->odr_table.odr_avl[0 ].milli_hz; + sensor->watermark =1 ; + iio_dev->modes =INDIO_DIRECT_MODE ; + iio_dev->info = &st_lsm6dsx_sf_info; + iio_dev->channels = settings->chan; + iio_dev->num_channels = settings->chan_len; +if (snprintf (sensor->name,sizeof (sensor->name),"%s_sf" , name) >= +sizeof (sensor->name)) +return -E2BIG ;
ret = snprintf(sensor->name, sizeof(sensor->name), "%s_sf", name); if (ret >= sizeof(sensor->name)) return -E2BIG;
I find this easier to read and follow.
Quoted 10 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +10
-0+ iio_dev->name = sensor->name; + +/* +* Put the IIO device pointer in the iio_devs array so that the caller +* can set up a buffer and register this IIO device. +*/ + hw->iio_devs[ST_LSM6DSX_ID_SF ] = iio_dev; + +return 0 ; +}
Signature · 2 lines
With Best Regards, Andy Shevchenko
David Lechner
reviewerRe: [PATCH v6 7/7] iio: imu: st_lsm6dsx: Add support for rotation sensor
In reply to Francesco LavraQuoted 22 lines · Francesco Lavra
Some IMU chips in the LSM6DSX family have sensor fusion features that combine data from the accelerometer and gyroscope. One of these features generates rotation vector data and makes it available in the hardware FIFO as a quaternion (more specifically, the X, Y and Z components of the quaternion vector, expressed as 16-bit half-precision floating-point numbers).
Add support for a new sensor instance that allows receiving sensor fusion data, by defining a new struct
st_lsm6dsx_sf_settings(which contains chip-specific details for the sensor fusion functionality), and adding this struct as a new field in structst_lsm6dsx_settings. Inst_lsm6dsx_core.c, populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the logic to initialize an additional IIO device if this struct is populated for the hardware type being probed.
Note: a new IIO device is being defined (as opposed to adding channels to an existing device) because the rate at which sensor fusion data is generated may not match the data rate from any of the existing devices.Tested on LSMDSV16X.
Signed-off-by Francesco Lavra <[email protected]>Acked-by Lorenzo Bianconi <[email protected]>
Quoted 11 lines
--- Documentation/iio/index.rst | 1 + Documentation/iio/st_lsm6dsx.rst | 44 ++++ drivers/iio/imu/st_lsm6dsx/Makefile | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 26 +- .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 58 +++++ .../iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 235 ++++++++++++++++++ 7 files changed, 368 insertions(+), 7 deletions(-) create mode 100644 Documentation/iio/st_lsm6dsx.rst create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
It makes things easier to review if we put the documentation changes in a separate patch from the code changes.
Quoted 41 lines
Documentation/iio/index.rst +1
-0@@ -39,3 +39,4 @@ Industrial I/O Kernel Drivers bno055 ep93xx_adc opt4060 + st_lsm6dsxDocumentation/iio/st_lsm6dsx.rst new file +25
-0@@ -0,0 +1,44 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +================= +ST LSM6DSX driver +================= + +Device driver for STMicroelectronics LSM6DSx, LSM9DS1, ASM330, and ISM330 series +of 6-axis inertial measurement units. The core module is called ``st_lsm6dsx``, +and the transport-specific modules are called ``st_lsm6dsx_i2c``, +``st_lsm6dsx_spi``, and ``st_lsm6dsx_i3c``. + +IIO devices +=========== + +This driver instantiates multiple IIO devices: + +* accelerometer (IIO_ACCEL channel) +* gyroscope (IIO_ANGL_VEL channel) +* (optionally) magnetometer (IIO_MAGN channel), if the device has a secondary + I2C interface connected to a slave sensor device (sensor hub functionality) +* (optionally) sensor fusion (IIO_CUSTOM channel), which combines acceleration + and angular velocity data + +Sensor Fusion +-------------
Documentation/iio/st_lsm6dsx.rst line 35
Quoted 10 lines
Documentation/iio/st_lsm6dsx.rst new file +10
-0+ +Some chips supported by this driver implement an internal algorithm that takes +input data from the accelerometer and gyroscope, and calculates the device +orientation in 3D space, which is then made available in the hardware FIFO. +Orientation is expressed in the form of a 4-dimensional quaternion vector, whose +components are typically represented in an array as ``[x, y, z, w]``. +The sensor device outputs the ``[x, y, z]`` components of the quaternion, +expressed as half-precision (16-bit) floating-point numbers. + +The ``z`` component is not output by the device, but its value can be derived
Should be ``w``.
Quoted 9 lines
Documentation/iio/st_lsm6dsx.rst new file +9
-0+from the rest of the data, due to the following constraints: + +* the quaternion vector is normalized, i.e. :math:`x^2 + y^2 + z^2 + w^2 = 1` +* the rotation angle :math:`\theta` remains within + :math:`[-180^\circ, 180^\circ]`, i.e. the ``w`` component is non-negative: + :math:`w = \cos(\theta/2) \geq 0` + +These constraints allow the ``w`` value to be calculated from the other +components: :math:`w = \sqrt{1 - (x^2 + y^2 + z^2)}`.
...
Documentation/iio/st_lsm6dsx.rst struct st_lsm6dsx_settings { · line 401
Quoted 9 lines
Documentation/iio/st_lsm6dsx.rst new file +2
-0+ /** * struct st_lsm6dsx_ext_dev_settings - i2c controller slave settings * @i2c_addr: I2c slave address list.@@ -388,6 +398,7 @@ struct st_lsm6dsx_settings { struct st_lsm6dsx_hw_ts_settings ts_settings; struct st_lsm6dsx_shub_settings shub_settings; struct st_lsm6dsx_event_settings event_settings; + struct st_lsm6dsx_sf_settings sf_settings;
Can we spell out "fusion"? I don't think this is a common abbreviation.
Quoted 2 lines
Documentation/iio/st_lsm6dsx.rst new file +0
-0};
...
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c line 2
Quoted 8 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +2
-0@@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0-only +/*
Copyright?
Quoted 3 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +3
-0+* STMicroelectronics st_lsm6dsx IMU sensor fusion +*/ +
...
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c line 190
Quoted 5 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +5
-0+static IIO_DEV_ATTR_SAMP_FREQ_AVAIL (st_lsm6dsx_sf_sampling_freq_avail); +static struct attribute *st_lsm6dsx_sf_attributes[] = { + &iio_dev_attr_sampling_frequency_available.dev_attr.attr, +NULL +};
Can we not use the .read_avail callback for this instead of a manual attribute?
Quoted 11 lines
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c new file +11
-0+ +static const struct attribute_group st_lsm6dsx_sf_attribute_group = { + .attrs = st_lsm6dsx_sf_attributes, +}; + +static const struct iio_info st_lsm6dsx_sf_info = { + .attrs = &st_lsm6dsx_sf_attribute_group, + .read_raw = st_lsm6dsx_sf_read_raw, + .write_raw = st_lsm6dsx_sf_write_raw, + .hwfifo_set_watermark = st_lsm6dsx_set_watermark, +};