devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add i2c driver for Bosch BMI260 IMU
@ 2024-10-18 23:36 Justin Weiss
  2024-10-18 23:36 ` [PATCH v2 1/6] iio: imu: bmi270: Use INFO_SAMP_FREQ instead of INFO_FREQUENCY Justin Weiss
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Justin Weiss @ 2024-10-18 23:36 UTC (permalink / raw)
  To: Alex Lanzano, Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Justin Weiss, linux-iio, devicetree, linux-kernel,
	Derek J . Clark, Philip Müller

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
-- 
2.47.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-10-20 11:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 23:36 [PATCH v2 0/6] Add i2c driver for Bosch BMI260 IMU Justin Weiss
2024-10-18 23:36 ` [PATCH v2 1/6] iio: imu: bmi270: Use INFO_SAMP_FREQ instead of INFO_FREQUENCY Justin Weiss
2024-10-19 11:30   ` Jonathan Cameron
2024-10-19 20:48     ` Justin Weiss
2024-10-18 23:36 ` [PATCH v2 2/6] iio: imu: bmi270: Provide chip info as configuration structure Justin Weiss
2024-10-19 11:33   ` Jonathan Cameron
2024-10-19 20:49     ` Justin Weiss
2024-10-18 23:36 ` [PATCH v2 3/6] dt-bindings: iio: imu: Add Bosch BMI260 Justin Weiss
2024-10-19 11:36   ` Jonathan Cameron
2024-10-19 20:49     ` Justin Weiss
2024-10-18 23:36 ` [PATCH v2 4/6] iio: imu: bmi270: Add support for BMI260 Justin Weiss
2024-10-19 11:40   ` Jonathan Cameron
2024-10-19 20:52     ` Justin Weiss
2024-10-20 11:00       ` Jonathan Cameron
2024-10-18 23:36 ` [PATCH v2 5/6] iio: imu: bmi270: Add triggered buffer for Bosch BMI270 IMU Justin Weiss
2024-10-19 11:41   ` Jonathan Cameron
2024-10-19 20:52     ` Justin Weiss
2024-10-18 23:36 ` [PATCH v2 6/6] iio: imu: bmi270: Add scale and sampling frequency to " Justin Weiss
2024-10-19 11:44   ` Jonathan Cameron
2024-10-19 20:52     ` Justin Weiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).