mbox series

[v3,0/2] Add I2C driver for Bosch BMI270 IMU

Message ID 20240909043254.611589-1-lanzano.alex@gmail.com (mailing list archive)
Headers show
Series Add I2C driver for Bosch BMI270 IMU | expand

Message

Alex Lanzano Sept. 9, 2024, 4:32 a.m. UTC
Add basic I2C support for the Bosch BMI270 IMU.

References:
https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270/

Signed-off-by: Alex Lanzano <lanzano.alex@gmail.com>
---
Changes in v3:
- Remove code pertaining to buffer / triggered buffer
- Move register definitions from struct to defines
- Add bit mask defines for registers and replace hardcoded values
- Create macros for accel and gryo channels
- Code style cleanup

Changes in v2:
- Remove spi example in binding documentation
- Add more properties to i2c example in binding documentation
---

Alex Lanzano (2):
  dt-bindings: iio: imu: add bmi270 bindings
  iio: imu: Add i2c driver for bmi270 imu

 .../bindings/iio/imu/bosch,bmi270.yaml        |  77 ++++++
 MAINTAINERS                                   |   7 +
 drivers/iio/imu/Kconfig                       |   1 +
 drivers/iio/imu/Makefile                      |   1 +
 drivers/iio/imu/bmi270/Kconfig                |  21 ++
 drivers/iio/imu/bmi270/Makefile               |   6 +
 drivers/iio/imu/bmi270/bmi270.h               |  62 +++++
 drivers/iio/imu/bmi270/bmi270_core.c          | 251 ++++++++++++++++++
 drivers/iio/imu/bmi270/bmi270_i2c.c           |  48 ++++
 9 files changed, 474 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi270.yaml
 create mode 100644 drivers/iio/imu/bmi270/Kconfig
 create mode 100644 drivers/iio/imu/bmi270/Makefile
 create mode 100644 drivers/iio/imu/bmi270/bmi270.h
 create mode 100644 drivers/iio/imu/bmi270/bmi270_core.c
 create mode 100644 drivers/iio/imu/bmi270/bmi270_i2c.c

Comments

Vasileios Amoiridis Sept. 10, 2024, 10:22 p.m. UTC | #1
Hi Alex!

I recently received a review for the code for the BMP280 sensors, and I think
it applies well to you as well. Since you are using the sleeping functions in
your code, maybe a comment on top that explains why this value or where you
found it in the datasheet would be helpful.

Specifically for the Bosch Sensors, because Bosch's datasheets have either
hidden or no information at all, and you need to search for stuff in the
respective C sensor API in the Bosch GitHub.

Cheers,
Vasilis
Alex Lanzano Sept. 11, 2024, 12:38 p.m. UTC | #2
On Wed, Sep 11, 2024 at 12:22:54AM GMT, Vasileios Amoiridis wrote:
> Hi Alex!
> 
> I recently received a review for the code for the BMP280 sensors, and I think
> it applies well to you as well. Since you are using the sleeping functions in
> your code, maybe a comment on top that explains why this value or where you
> found it in the datasheet would be helpful.
> 
> Specifically for the Bosch Sensors, because Bosch's datasheets have either
> hidden or no information at all, and you need to search for stuff in the
> respective C sensor API in the Bosch GitHub.

Thanks for the review! I'll be sure to comment the sleeping functions.

Best regards,
Alex