Skip to content

iio: accel: add mount matrix support to 18 accelerometer drivers

He Xin b4-sent linux-iio 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20261130-work-ab0d96ec614e

Versions newest first · linked by author and title

  1. v2 Latest18 patches 1 replyIn review
  2. v118 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- move stk8ba50 to patch 1
- place the mount matrix before the __aligned(IIO_DMA_MINALIGN) members in adxl345, adxl355, adxl367, adxl380, bma220, bmi088 and sca3300, so the DMA buffers keep their own cacheline
- add the missing blank line after the mount matrix read in probe
- add the @orientation kernel-doc entry for msa311 and sca3300
- shorten the stk8ba50 test note to the behaviour observed on the device
- v1 lost its threading because the sending MTA rewrote Message-IDs while leaving References untouched; v2 is posted as a new series

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18iio: accel: stk8ba50: support mount matrixdrivers/iio/accel/stk8ba50.c+21 -00 replies
2/18iio: accel: adxl345_core: support mount matrixdrivers/iio/accel/adxl345_core.c+21 -00 replies
3/18iio: accel: adxl355_core: support mount matrixdrivers/iio/accel/adxl355_core.c+21 -00 replies
4/18iio: accel: adxl367: support mount matrixdrivers/iio/accel/adxl367.c+21 -00 replies
5/18iio: accel: adxl372: support mount matrixdrivers/iio/accel/adxl372.c+25 -00 replies
6/18iio: accel: adxl380: support mount matrixdrivers/iio/accel/adxl380.c+20 -00 replies
7/18iio: accel: bma220_core: support mount matrixdrivers/iio/accel/bma220_core.c+25 -00 replies
8/18iio: accel: bmi088-accel-core: support mount matrixdrivers/iio/accel/bmi088-accel-core.c+21 -00 replies
9/18iio: accel: da280: support mount matrixdrivers/iio/accel/da280.c+25 -00 replies
10/18iio: accel: da311: support mount matrixdrivers/iio/accel/da311.c+25 -00 replies
11/18iio: accel: dmard06: support mount matrixdrivers/iio/accel/dmard06.c+25 -00 replies
12/18iio: accel: dmard09: support mount matrixdrivers/iio/accel/dmard09.c+21 -00 replies
13/18iio: accel: dmard10: support mount matrixdrivers/iio/accel/dmard10.c+25 -00 replies
14/18iio: accel: mma7455_core: support mount matrixdrivers/iio/accel/mma7455_core.c+21 -00 replies
15/18iio: accel: msa311: support mount matrixdrivers/iio/accel/msa311.c+22 -00 replies
16/18iio: accel: mxc6255: support mount matrixdrivers/iio/accel/mxc6255.c+21 -00 replies
17/18iio: accel: sca3300: support mount matrixdrivers/iio/accel/sca3300.c+26 -00 replies
18/18iio: accel: stk8312: support mount matrixdrivers/iio/accel/stk8312.c+25 -00 replies

Reviews trailers per patch

None of the 18 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJoshua Crofts
SeriesR-b
1/18
2/18
3/18
4/18
5/18
6/18
7/18
8/18
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/18] iio: accel: add mount matrix support to 18 accelerometer drivers

These drivers ignore the "mount-matrix" property that other accelerometer drivers already honour, so userspace gets raw sensor axes on any board whose sensor is not mounted axis-aligned with the display. A udev/hwdb override does not cover it either: it keys off the sensor modalias and DMI, which do not tell such boards apart.

Each patch is mechanical and independent: store the matrix in the driver's private data, add an IIO_MOUNT_MATRIX() ext_info entry to the accelerometer channels, and read the property once in probe.

One behaviour change: a board whose firmware describes a matrix with the wrong number of entries now fails to probe with -EINVAL instead of being ignored, which is what the drivers that already support the property do.

Not converted here, because the change would not have the same shape:
adis16201, adis16209 and sca3000 list their channels as array literals, adxl313_core and fxls8962af-core keep the probe in the bus wrappers, and mma9551/mma9553 differ in both. hid-sensor-accel-3d, ssp_accel_sensor and cros_ec_accel_legacy take the orientation from the HID/SSP/EC side rather than from a firmware property.

Changes in v2:
- move stk8ba50 to patch 1
- place the mount matrix before the __aligned(IIO_DMA_MINALIGN) members in adxl345, adxl355, adxl367, adxl380, bma220, bmi088 and sca3300, so the DMA buffers keep their own cacheline
- add the missing blank line after the mount matrix read in probe
- add the @orientation kernel-doc entry for msa311 and sca3300
- shorten the stk8ba50 test note to the behaviour observed on the device
- v1 lost its threading because the sending MTA rewrote Message-IDs while leaving References untouched; v2 is posted as a new series

Build tested with allmodconfig: drivers/iio/accel, 71 objects, no warnings; checkpatch.pl is silent in default and in --strict mode. Only stk8ba50 was tested on hardware; the other 17 are compile tested.

---
He Xin (18):
iio: accel: stk8ba50: support mount matrix
iio: accel: adxl345_core: support mount matrix
iio: accel: adxl355_core: support mount matrix
iio: accel: adxl367: support mount matrix
iio: accel: adxl372: support mount matrix
iio: accel: adxl380: support mount matrix
iio: accel: bma220_core: support mount matrix
iio: accel: bmi088-accel-core: support mount matrix
iio: accel: da280: support mount matrix
iio: accel: da311: support mount matrix
iio: accel: dmard06: support mount matrix
iio: accel: dmard09: support mount matrix
iio: accel: dmard10: support mount matrix
iio: accel: mma7455_core: support mount matrix
iio: accel: msa311: support mount matrix
iio: accel: mxc6255: support mount matrix
iio: accel: sca3300: support mount matrix
iio: accel: stk8312: support mount matrix

 drivers/iio/accel/adxl345_core.c      | 21 +++++++++++++++++++++
 drivers/iio/accel/adxl355_core.c      | 21 +++++++++++++++++++++
 drivers/iio/accel/adxl367.c           | 21 +++++++++++++++++++++
 drivers/iio/accel/adxl372.c           | 25 +++++++++++++++++++++++++
 drivers/iio/accel/adxl380.c           | 20 ++++++++++++++++++++
 drivers/iio/accel/bma220_core.c       | 25 +++++++++++++++++++++++++
 drivers/iio/accel/bmi088-accel-core.c | 21 +++++++++++++++++++++
 drivers/iio/accel/da280.c             | 25 +++++++++++++++++++++++++
 drivers/iio/accel/da311.c             | 25 +++++++++++++++++++++++++
 drivers/iio/accel/dmard06.c           | 25 +++++++++++++++++++++++++
 drivers/iio/accel/dmard09.c           | 21 +++++++++++++++++++++
 drivers/iio/accel/dmard10.c           | 25 +++++++++++++++++++++++++
 drivers/iio/accel/mma7455_core.c      | 21 +++++++++++++++++++++
 drivers/iio/accel/msa311.c            | 22 ++++++++++++++++++++++
 drivers/iio/accel/mxc6255.c           | 21 +++++++++++++++++++++
 drivers/iio/accel/sca3300.c           | 26 ++++++++++++++++++++++++++
 drivers/iio/accel/stk8312.c           | 25 +++++++++++++++++++++++++
 drivers/iio/accel/stk8ba50.c          | 21 +++++++++++++++++++++
 18 files changed, 411 insertions(+)

---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261130-work-ab0d96ec614e

Best regards,

Signature · 1 line
He Xin <[email protected]>