From nobody Wed Dec 17 10:04:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59C3FC7EE2A for ; Fri, 5 May 2023 05:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230325AbjEEFts (ORCPT ); Fri, 5 May 2023 01:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbjEEFtm (ORCPT ); Fri, 5 May 2023 01:49:42 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0AF6150D7; Thu, 4 May 2023 22:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1683265773; x=1714801773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=By1zElzEqUICh73uUeUdo6GgTEEpWsDQwesL5Ji0Geg=; b=mwNcx39sU/dLrQPBQ+476T1RbJnsfSdomONlpb/WpssSp0kKTP/7gwO0 1o/HcK7uD9TI6HYu4JlZG2188qkRTgh4GngEibfNswkA/tEwlN1+NX/TR ANSRE3qgX/OfYvWI6IXOEhjWFWGbM7EKYjO1BFA8XV8AVUmAtmiEptb+m wXGsgsmOzx2trYdehAu3K+DUR1DYE4f4JQ4p0vjbXByKUg9Ud8/DD4xJf /BulwufqFRqjAzqXFaI3rqIQK/7vvLnmYYGAym3ylZRYbO61A8RdiKyA/ FErQOXFY1OjdsbaiVb+g+GtLqZZmSqNOplgsVH8B1w6Eqf7+W/G+cKoS/ Q==; From: Hermes Zhang To: , , , Jean-Baptiste Maneyrol CC: , , , Hermes Zhang , Krzysztof Kozlowski , Lars-Peter Clausen , Subject: [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Add icm20600 bindings to mpu6050 Date: Fri, 5 May 2023 13:48:52 +0800 Message-ID: <20230505054853.2155326-2-chenhuiz@axis.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230505054853.2155326-1-chenhuiz@axis.com> References: <20230505054853.2155326-1-chenhuiz@axis.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" ICM-20600 is almost same as ICM-20602 which already support in mpu6050 driver. Specify "invensense,icm20602" as a fallback compatible Signed-off-by: Hermes Zhang Reviewed-by: Krzysztof Kozlowski Acked-by: Jean-Baptiste Maneyrol --- Notes: v2: require specifying "invensense,icm20602" as a fallback compatible in the binding, as suggested v3: reorder "invensense,icm20602" entry before icm20608 and add Reviewed-by tag from Krzysztof .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.y= aml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml index ec64d7877fe5..1db6952ddca5 100644 --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml @@ -30,6 +30,9 @@ properties: - invensense,mpu9150 - invensense,mpu9250 - invensense,mpu9255 + - items: + - const: invensense,icm20600 + - const: invensense,icm20602 - items: - const: invensense,icm20608d - const: invensense,icm20608 --=20 2.30.2 From nobody Wed Dec 17 10:04:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30443C77B75 for ; Fri, 5 May 2023 05:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230376AbjEEFtx (ORCPT ); Fri, 5 May 2023 01:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbjEEFtn (ORCPT ); Fri, 5 May 2023 01:49:43 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06A4611D96; Thu, 4 May 2023 22:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1683265774; x=1714801774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cDIBRX8Ulk8P+kDO+DNb87Xtv4IZjVGMishO+Kq42zY=; b=i4K+PgPjwlObV0Y5cW/BW6Kv1ynf/QChun7ZvoJVfDmtwEeMXDw3xZO+ U9lfhVQrO/ac+YgNEs3Z0LoveHE27knZIRnxMUoMUiggOJP7wSgqB4lcF +EUvp4wmkbPtzMkYaOeqQxm13vgNQAyjjfO9B2lBs1tCF9w2vfo+IwZgW Byj8cJBCnLCUOlC2S0o9zBHmfafrhJqU//bKDAxPN8b4D+M/yZnNJSN4A B/OQQnBAsE22c0hbinHHQ9rnMt7I7g022psvsCM8OIlF1jfubRyGNenUW Tjux1ChiogQe80/wG5qOs7tJwcwj2GZptQMVSxyYDSAKpuqT8sElxmwZ7 w==; From: Hermes Zhang To: , , CC: , , , , Hermes Zhang , Lars-Peter Clausen Subject: [PATCH v3 2/2] iio: imu: mpu6050: Add support for the ICM 20600 IMU Date: Fri, 5 May 2023 13:48:53 +0800 Message-ID: <20230505054853.2155326-3-chenhuiz@axis.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230505054853.2155326-1-chenhuiz@axis.com> References: <20230505054853.2155326-1-chenhuiz@axis.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The Invensense ICM-20600 is a 6-axis MotionTracking device that combines a 3-axis gyroscope and an 3-axis accelerometer. It is very similar to the ICM20602 imu which is already supported by the mpu6050 driver. The main difference is that the ICM-20600 has a different WHOAMI value. Signed-off-by: Hermes Zhang Acked-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/Kconfig | 4 ++-- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 10 ++++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 6 ++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 ++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 5 +++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6= 050/Kconfig index 3636b1bc90f1..64dd73dcc4ba 100644 --- a/drivers/iio/imu/inv_mpu6050/Kconfig +++ b/drivers/iio/imu/inv_mpu6050/Kconfig @@ -16,7 +16,7 @@ config INV_MPU6050_I2C select REGMAP_I2C help This driver supports the Invensense MPU6050/9150, - MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20602/ICM20690 + MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20600/20602/20= 690 and IAM20680 motion tracking devices over I2C. This driver can be built as a module. The module will be called inv-mpu6050-i2c. @@ -28,7 +28,7 @@ config INV_MPU6050_SPI select REGMAP_SPI help This driver supports the Invensense MPU6000, - MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20602/ICM20690 + MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20600/20602/20= 690 and IAM20680 motion tracking devices over SPI. This driver can be built as a module. The module will be called inv-mpu6050-spi. diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/i= nv_mpu6050/inv_mpu_core.c index 8a129120b73d..592a6e60b413 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -244,6 +244,15 @@ static const struct inv_mpu6050_hw hw_info[] =3D { .temp =3D {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, .startup_time =3D {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STAR= TUP_TIME}, }, + { + .whoami =3D INV_ICM20600_WHOAMI_VALUE, + .name =3D "ICM20600", + .reg =3D ®_set_icm20602, + .config =3D &chip_config_6500, + .fifo_size =3D 1008, + .temp =3D {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + .startup_time =3D {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_ST= ARTUP_TIME}, + }, { .whoami =3D INV_ICM20602_WHOAMI_VALUE, .name =3D "ICM20602", @@ -1597,6 +1606,7 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq= , const char *name, indio_dev->num_channels =3D ARRAY_SIZE(inv_mpu9250_channels); indio_dev->available_scan_masks =3D inv_mpu9x50_scan_masks; break; + case INV_ICM20600: case INV_ICM20602: indio_dev->channels =3D inv_mpu_channels; indio_dev->num_channels =3D ARRAY_SIZE(inv_mpu_channels); diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/in= v_mpu6050/inv_mpu_i2c.c index 2f2da4cb7321..0e39877678df 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -32,6 +32,7 @@ static bool inv_mpu_i2c_aux_bus(struct device *dev) case INV_ICM20608D: case INV_ICM20609: case INV_ICM20689: + case INV_ICM20600: case INV_ICM20602: case INV_IAM20680: /* no i2c auxiliary bus on the chip */ @@ -183,6 +184,7 @@ static const struct i2c_device_id inv_mpu_id[] =3D { {"icm20608d", INV_ICM20608D}, {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, + {"icm20600", INV_ICM20600}, {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, @@ -236,6 +238,10 @@ static const struct of_device_id inv_of_match[] =3D { .compatible =3D "invensense,icm20689", .data =3D (void *)INV_ICM20689 }, + { + .compatible =3D "invensense,icm20600", + .data =3D (void *)INV_ICM20600 + }, { .compatible =3D "invensense,icm20602", .data =3D (void *)INV_ICM20602 diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/in= v_mpu6050/inv_mpu_iio.h index 94b54c501ec0..b4ab2c397d0f 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -79,6 +79,7 @@ enum inv_devices { INV_ICM20608D, INV_ICM20609, INV_ICM20689, + INV_ICM20600, INV_ICM20602, INV_ICM20690, INV_IAM20680, @@ -398,6 +399,7 @@ struct inv_mpu6050_state { #define INV_ICM20608D_WHOAMI_VALUE 0xAE #define INV_ICM20609_WHOAMI_VALUE 0xA6 #define INV_ICM20689_WHOAMI_VALUE 0x98 +#define INV_ICM20600_WHOAMI_VALUE 0x11 #define INV_ICM20602_WHOAMI_VALUE 0x12 #define INV_ICM20690_WHOAMI_VALUE 0x20 #define INV_IAM20680_WHOAMI_VALUE 0xA9 diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/in= v_mpu6050/inv_mpu_spi.c index 89f46c2f213d..05451ca1580b 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -76,6 +76,7 @@ static const struct spi_device_id inv_mpu_id[] =3D { {"icm20608d", INV_ICM20608D}, {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, + {"icm20600", INV_ICM20600}, {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, @@ -125,6 +126,10 @@ static const struct of_device_id inv_of_match[] =3D { .compatible =3D "invensense,icm20689", .data =3D (void *)INV_ICM20689 }, + { + .compatible =3D "invensense,icm20600", + .data =3D (void *)INV_ICM20600 + }, { .compatible =3D "invensense,icm20602", .data =3D (void *)INV_ICM20602 --=20 2.30.2