lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 May 2022 15:04:23 +0000
From:   LI Qingwu <Qing-wu.Li@...ca-geosystems.com.cn>
To:     jic23@...nel.org, lars@...afoo.de, mchehab+huawei@...nel.org,
        ardeleanalex@...il.com, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, Qing-wu.Li@...ca-geosystems.com.cn,
        robh+dt@...nel.org, mike.looijmans@...ic.nl,
        devicetree@...r.kernel.org, thomas.haemmerle@...ca-geosystems.com
Subject: [PATCH V3 4/6] iio: accel: bmi088: Add support for bmi085 accel

Add supports for BMI085, an Inertial Measurement Unit,
with an accelerometer and gyroscope.
The commit adds the accelerometer driver for the SPI interface.
The gyroscope part is already supported by the BMG160 driver.
Different from BMI088, the BMI085 accelerometer has the range of
+/-2, 4, 6, and 8g.

Reviewed-by: Alexandru Ardelean <ardeleanalex@...il.com>
Signed-off-by: LI Qingwu <Qing-wu.Li@...ca-geosystems.com.cn>
---
 drivers/iio/accel/bmi088-accel-core.c | 7 +++++++
 drivers/iio/accel/bmi088-accel-spi.c  | 2 ++
 drivers/iio/accel/bmi088-accel.h      | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c
index c30c2d510b92..d5e93ac7f1e1 100644
--- a/drivers/iio/accel/bmi088-accel-core.c
+++ b/drivers/iio/accel/bmi088-accel-core.c
@@ -464,6 +464,13 @@ static const struct iio_chan_spec bmi088_accel_channels[] = {
 };
 
 static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = {
+	[BOSCH_BMI085] = {
+		.name = "bmi085-accel",
+		.chip_id = 0x1F,
+		.channels = bmi088_accel_channels,
+		.num_channels = ARRAY_SIZE(bmi088_accel_channels),
+		.scale_table = {{0, 598}, {0, 1196}, {0, 2393}, {0, 4785}},
+	},
 	[BOSCH_BMI088] = {
 		.name = "bmi088-accel",
 		.chip_id = 0x1E,
diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c
index 24cdeb41d2a6..f2cd70f362b8 100644
--- a/drivers/iio/accel/bmi088-accel-spi.c
+++ b/drivers/iio/accel/bmi088-accel-spi.c
@@ -62,12 +62,14 @@ static int bmi088_accel_remove(struct spi_device *spi)
 }
 
 static const struct of_device_id bmi088_of_match[] = {
+	{ .compatible = "bosch,bmi085-accel" },
 	{ .compatible = "bosch,bmi088-accel" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, bmi088_of_match);
 
 static const struct spi_device_id bmi088_accel_id[] = {
+	{"bmi085-accel",  BOSCH_BMI085},
 	{"bmi088-accel",  BOSCH_BMI088},
 	{}
 };
diff --git a/drivers/iio/accel/bmi088-accel.h b/drivers/iio/accel/bmi088-accel.h
index b6a0281a847f..9b23f50c8271 100644
--- a/drivers/iio/accel/bmi088-accel.h
+++ b/drivers/iio/accel/bmi088-accel.h
@@ -9,6 +9,7 @@
 struct device;
 
 enum bmi_device_type {
+	BOSCH_BMI085,
 	BOSCH_BMI088,
 	BOSCH_UNKNOWN,
 };
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ