mbox series

[v2,0/6] Add i2c driver for Bosch BMI260 IMU

Message ID 20241018233723.28757-1-justin@justinweiss.com (mailing list archive)
Headers show
Series Add i2c driver for Bosch BMI260 IMU | expand

Message

Justin Weiss Oct. 18, 2024, 11:36 p.m. UTC
Add support for the Bosch BMI260 IMU to the BMI270 device driver.

The BMI270 and BMI260 have nearly identical register maps, but have
different chip IDs and firmware.

The BMI260 is the IMU on a number of handheld PCs. Unfortunately,
these devices often misidentify it in ACPI as a BMI160 ("BMI0160," for
example), and it can only be correctly identified using the chip
ID. To avoid conflicts with the bmi160 driver, this driver will not
probe if it detects a BMI160 chip ID.

Also add triggered buffer and scale / sampling frequency attributes,
which the input tools commonly used on handheld PCs require to support
IMUs.

Like the BMI270, the BMI260 requires firmware to be provided.
Signed-off-by: Justin Weiss <justin@justinweiss.com>
---

Changelog:

V2
- Fix commit titles
- Fix: Change FREQUENCY to SAMP_FREQ
- Split chip_info refactor into a separate commit from adding bmi260
- Only fail probe when BMI160 is detected
- Update chip_info based on detected chip ID
- Add BMI260 to DT documentation
- Add BMI260 to of_device_id
- Add expected BMI260 ACPI ID to the SPI driver
- Remove unused/unexpected BMI260 ACPI IDs
- Remove trailing comma for null terminators
- Use DMA_MINALIGN for channel buffer
- Read channels in bulk
- Improve for loops for detecting scale / odr attrs
- Add missing masks
- Use FIELD_GET
- Use read_avail instead of custom attrs
- Misc. formatting and line wrapping improvements

v1: https://lore.kernel.org/all/20241011153751.65152-1-justin@justinweiss.com/

Justin Weiss (6):
  iio: imu: bmi270: Use INFO_SAMP_FREQ instead of INFO_FREQUENCY
  iio: imu: bmi270: Provide chip info as configuration structure
  dt-bindings: iio: imu: Add Bosch BMI260
  iio: imu: bmi270: Add support for BMI260
  iio: imu: bmi270: Add triggered buffer for Bosch BMI270 IMU
  iio: imu: bmi270: Add scale and sampling frequency to BMI270 IMU

 .../bindings/iio/imu/bosch,bmi260.yaml        |  77 +++
 MAINTAINERS                                   |   1 +
 drivers/iio/imu/bmi270/Kconfig                |   1 +
 drivers/iio/imu/bmi270/bmi270.h               |  25 +-
 drivers/iio/imu/bmi270/bmi270_core.c          | 441 +++++++++++++++++-
 drivers/iio/imu/bmi270/bmi270_i2c.c           |  24 +-
 drivers/iio/imu/bmi270/bmi270_spi.c           |  19 +-
 7 files changed, 574 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi260.yaml


base-commit: 96be67caa0f0420d4128cb67f07bbd7a6f49e03a