iio: imu: inv_icm42600: add icm40608

By comparing icm40608 datasheet with icm42600, it can
use icm426xx driver directly.

Change-Id: If856076ed4f57df6ba5bbb339a35b119937c6385
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
This commit is contained in:
Shunqian Zheng
2021-05-20 19:41:50 +08:00
committed by Tao Huang
parent 433f0ced6f
commit 15752dea8b
4 changed files with 13 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include "inv_icm42600_buffer.h"
enum inv_icm42600_chip {
INV_CHIP_ICM40608,
INV_CHIP_ICM42600,
INV_CHIP_ICM42602,
INV_CHIP_ICM42605,
@@ -298,6 +299,7 @@ struct inv_icm42600_state {
#define INV_ICM42600_INT_SOURCE0_UI_AGC_RDY_INT1_EN BIT(0)
#define INV_ICM42600_REG_WHOAMI 0x0075
#define INV_ICM42600_WHOAMI_ICM40608 0x39
#define INV_ICM42600_WHOAMI_ICM42600 0x40
#define INV_ICM42600_WHOAMI_ICM42602 0x41
#define INV_ICM42600_WHOAMI_ICM42605 0x42

View File

@@ -67,6 +67,11 @@ static const struct inv_icm42600_conf inv_icm42600_default_conf = {
};
static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] = {
[INV_CHIP_ICM40608] = {
.whoami = INV_ICM42600_WHOAMI_ICM40608,
.name = "icm40608",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42600] = {
.whoami = INV_ICM42600_WHOAMI_ICM42600,
.name = "icm42600",

View File

@@ -70,6 +70,9 @@ static int inv_icm42600_probe(struct i2c_client *client)
static const struct of_device_id inv_icm42600_of_matches[] = {
{
.compatible = "invensense,icm40608",
.data = (void *)INV_CHIP_ICM40608,
}, {
.compatible = "invensense,icm42600",
.data = (void *)INV_CHIP_ICM42600,
}, {

View File

@@ -69,6 +69,9 @@ static int inv_icm42600_probe(struct spi_device *spi)
static const struct of_device_id inv_icm42600_of_matches[] = {
{
.compatible = "invensense,icm40608",
.data = (void *)INV_CHIP_ICM40608,
}, {
.compatible = "invensense,icm42600",
.data = (void *)INV_CHIP_ICM42600,
}, {