From nobody Fri Nov 29 06:53:10 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F0E5823C8; Mon, 23 Sep 2024 14:53:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727103211; cv=none; b=UFl9Yl20L9Zcy7+zJJvRA+o9riWllO852if+tlboNppkwbNIqw+rnr8vkLWT3ghCiXTw4KVZ911HR4ChKANg5cQaZv/QqjdNxbqrpBgtDl7QYY3BAUPTJkAcKRPYToL8Hcc9qtQYdvxz1x3ZQkGvQ7ATWS6torrQTDsEgXBOUl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727103211; c=relaxed/simple; bh=VuPNt5LDOWSfaq89oAC0gvvYnsAuvvma7caUqfV5UXM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H7k9tujvM4sCFuqyINKfPvQ83/4r6xqDwZgSdztoqCg3Sd03jevA1cnaAM15uUvPsO1syy7CFtHE0TYlZ0up4uwWfcLRftz8qAL4IF61NMwOT4su2RPoRGEC6Z1APiEqCe0qyTt2BeSFP58TAdxR17w6qDJg83FwnMBnsKNyt4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r33j7OIw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r33j7OIw" Received: by smtp.kernel.org (Postfix) with ESMTPS id C52A7C4CECD; Mon, 23 Sep 2024 14:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727103210; bh=VuPNt5LDOWSfaq89oAC0gvvYnsAuvvma7caUqfV5UXM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=r33j7OIwmmAq5LOTudPUkqZFd1CpPD9njK6ufx83uapsuZghGpk7gKQ2z+bsXO2+F rvIdO7Qi76vf2AAQjsHGi6qgU0pdJnOIMTgOmTO/yb4UJgvQKf7O2uuePHn8BSN991 p6X+vd9gPxgrjGlePCj0pG5MVqkPPyp5lgPdc7LnYxjCGc1OxR72vB8KEwNk4sobqR 5F4qOGU51es2f5YXvqk5zeFgei9BsZ2AuaLj/5GJQi8fFL/3N4xTTru2LBc4zkh6wX BDUCXsOEgk0XlqmAeRT298chsmCgSbLANW/1rzU1x31I25GAjFv3hPPOfr9jjO2Y3G lkrNdCjjdWB7A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B542DCF9C72; Mon, 23 Sep 2024 14:53:30 +0000 (UTC) From: Jean-Baptiste Maneyrol via B4 Relay Date: Mon, 23 Sep 2024 16:53:21 +0200 Subject: [PATCH v2 1/2] dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-1-48290e0b9931@tdk.com> References: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-0-48290e0b9931@tdk.com> In-Reply-To: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-0-48290e0b9931@tdk.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean-Baptiste Maneyrol Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jean-Baptiste Maneyrol X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727103209; l=1050; i=jean-baptiste.maneyrol@tdk.com; s=20240923; h=from:subject:message-id; bh=ZthZoNTpOuOO9Sxm7Iz9x4o4wm0yXFBWMbSVi9NoBzI=; b=9NRRBdsm61njSLL+FGMFNqtKsoZxxk5X04Is3Rkh4MQV8Be8u58UIDow0kURXWFosWRtJJRFt QLNd/k7A5apBPS0F9AjdtHnr6PCd9AJArEo2khEkakFhGe/jsgo9+Z7 X-Developer-Key: i=jean-baptiste.maneyrol@tdk.com; a=ed25519; pk=bRqF1WYk0hR3qrnAithOLXSD0LvSu8DUd+quKLxCicI= X-Endpoint-Received: by B4 Relay for jean-baptiste.maneyrol@tdk.com/20240923 with auth_id=218 X-Original-From: Jean-Baptiste Maneyrol Reply-To: jean-baptiste.maneyrol@tdk.com From: Jean-Baptiste Maneyrol IAM-20680HT & HP are 2 variants of IAM-20680 fully compatible. They just have better specs, temperature range and a bigger FIFO. Signed-off-by: Jean-Baptiste Maneyrol Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.y= aml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml index 587ff2bced2ddd42e767f72b8e84c334d0e90481..a8d30ef015faaca02a11af7def6= e06057bde3909 100644 --- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml +++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml @@ -36,6 +36,11 @@ properties: - items: - const: invensense,icm20608d - const: invensense,icm20608 + - items: + - enum: + - invensense,iam20680hp + - invensense,iam20680ht + - const: invensense,iam20680 =20 reg: maxItems: 1 --=20 2.34.1 From nobody Fri Nov 29 06:53:10 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E8777F2F; Mon, 23 Sep 2024 14:53:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727103211; cv=none; b=q0IRLGa4xh57jAiyNoomysf71d47pTsIArwxW3HvJmmUspP8PznMmnTa99vFzLRsNM4PXNVc8DMSXv/STPSU4y7FkaXojRkSS0s7ix3qdYsTmVBQyIRwZmIp0iZ1YjbMK69VWKpoGLc4dIe+PKpWz4VyKuQ+sAe8lySR+qT5xzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727103211; c=relaxed/simple; bh=q/6vWTasDLm0W9z2hsovz3RuFO+UgGAJrDn3blh7EE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q4NtNcSh6fqnBtC6InylaW2IDioKcRTBYmIxuKZJWuavQ0aZwK06aHXpM4obzVUSHhb2zeJGd5tzh9pTCUx8oIKgB6Lkn+i1gjhpbD2DWJ0+bUDFUG2z7ElgAJk8wTEzJtiQ84gL1bTWUrFv4hArLCbxA231RspCu+e6d+4Pni4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VIDAUuz9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VIDAUuz9" Received: by smtp.kernel.org (Postfix) with ESMTPS id D229EC4CEC7; Mon, 23 Sep 2024 14:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727103210; bh=q/6vWTasDLm0W9z2hsovz3RuFO+UgGAJrDn3blh7EE8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=VIDAUuz9lXzSxKgM+wqIeYXSLEpLBDlw2y5GiiivR5jr7e8pjyiXn/Ujlfx5nkdsj pcCuX1RXr3V0S0TTl3WIAxtMXi6HtMXDFdPliotU7uPKnPhW0Lj0kKjrLlsoadnK1L nRMlgqsMOIcg27fwvfW0LNOhBlji2ajxkmSfce8KjENGqTTWJqUgXdT5NSH7eRWPC3 fWZEEMWnsYP3yUPcx5ZcDnqo47NImQeYKzcI6KVzOHYglawi71CTDCv8LaGnbBH8nZ DcBzwfIaTLL/qBKOWj1tdcBFDZWhCF6dSD9L8E78Y5h0iocU4MclHLJ+uTzl8zHLhh gNZUpw8eFu6LA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2E05CF9C74; Mon, 23 Sep 2024 14:53:30 +0000 (UTC) From: Jean-Baptiste Maneyrol via B4 Relay Date: Mon, 23 Sep 2024 16:53:22 +0200 Subject: [PATCH v2 2/2] iio: imu: inv_mpu6050: add support for IAM-20680HT/HP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-2-48290e0b9931@tdk.com> References: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-0-48290e0b9931@tdk.com> In-Reply-To: <20240923-inv-mpu6050-add-iam20680-ht-hp-v2-0-48290e0b9931@tdk.com> To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jean-Baptiste Maneyrol Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jean-Baptiste Maneyrol X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1727103209; l=4819; i=jean-baptiste.maneyrol@tdk.com; s=20240923; h=from:subject:message-id; bh=/ldj+ehtICzWHkHGTke2yP8V+ZJuIQcCfLCxa5OZgXg=; b=OTzZplcLjGZjfqicjharfREu1ibD25Dz1ovfVdAT/MlhsqduSpbnb5d/V+D9KB96DKTJ8xA5O ugvQQPeszuuD91dSDs6aamelS+bwSaUFz3ayZrI8H0262EElJ0+66Xa X-Developer-Key: i=jean-baptiste.maneyrol@tdk.com; a=ed25519; pk=bRqF1WYk0hR3qrnAithOLXSD0LvSu8DUd+quKLxCicI= X-Endpoint-Received: by B4 Relay for jean-baptiste.maneyrol@tdk.com/20240923 with auth_id=218 X-Original-From: Jean-Baptiste Maneyrol Reply-To: jean-baptiste.maneyrol@tdk.com From: Jean-Baptiste Maneyrol IAM-20680HT & HP are 2 variants of IAM-20680 with better specs, wider temperature range, and a bigger FIFO (4k). Fully compatible with IAM-20680, FIFO is 512 bytes by default and with correct register setting we expand it to full 4k. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 20 ++++++++++++++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 10 ++++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 4 ++++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 10 ++++++++++ 4 files changed, 44 insertions(+) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/i= nv_mpu6050/inv_mpu_core.c index 14d95f34e981c8b71dd0892fbeb12735a8857d6c..6b0adb7f9ae301878d9b4d6febe= c0309bd77a256 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -286,6 +286,24 @@ 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_IAM20680HP_WHOAMI_VALUE, + .name =3D "IAM20680HP", + .reg =3D ®_set_6500, + .config =3D &chip_config_6500, + .fifo_size =3D 4 * 1024, + .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_IAM20680HT_WHOAMI_VALUE, + .name =3D "IAM20680HT", + .reg =3D ®_set_6500, + .config =3D &chip_config_6500, + .fifo_size =3D 4 * 1024, + .temp =3D {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + .startup_time =3D {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STAR= TUP_TIME}, + }, }; =20 static int inv_mpu6050_pwr_mgmt_1_write(struct inv_mpu6050_state *st, bool= sleep, @@ -510,6 +528,8 @@ static int inv_mpu6050_set_accel_lpf_regs(struct inv_mp= u6050_state *st, return 0; case INV_ICM20689: case INV_ICM20690: + case INV_IAM20680HT: + case INV_IAM20680HP: /* set FIFO size to maximum value */ val |=3D INV_ICM20689_BITS_FIFO_SIZE_MAX; break; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/in= v_mpu6050/inv_mpu_i2c.c index 0e03137fb3d40d4753989522cf5168ef358a1014..7a5926ba6b97d5e5fbdd08e0c90= b58afb3f0131a 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -188,6 +188,8 @@ static const struct i2c_device_id inv_mpu_id[] =3D { {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, + {"iam20680hp", INV_IAM20680HP}, + {"iam20680ht", INV_IAM20680HT}, {} }; =20 @@ -254,6 +256,14 @@ static const struct of_device_id inv_of_match[] =3D { .compatible =3D "invensense,iam20680", .data =3D (void *)INV_IAM20680 }, + { + .compatible =3D "invensense,iam20680hp", + .data =3D (void *)INV_IAM20680HP + }, + { + .compatible =3D "invensense,iam20680ht", + .data =3D (void *)INV_IAM20680HT + }, { } }; MODULE_DEVICE_TABLE(of, inv_of_match); diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/in= v_mpu6050/inv_mpu_iio.h index e1c0c51468761ab18188a224e44e09f919d81f9a..a6862cf426396cbaf3452bb3451= cd58e4f30a4ec 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -85,6 +85,8 @@ enum inv_devices { INV_ICM20602, INV_ICM20690, INV_IAM20680, + INV_IAM20680HP, + INV_IAM20680HT, INV_NUM_PARTS }; =20 @@ -424,6 +426,8 @@ struct inv_mpu6050_state { #define INV_ICM20602_WHOAMI_VALUE 0x12 #define INV_ICM20690_WHOAMI_VALUE 0x20 #define INV_IAM20680_WHOAMI_VALUE 0xA9 +#define INV_IAM20680HP_WHOAMI_VALUE 0xF8 +#define INV_IAM20680HT_WHOAMI_VALUE 0xFA =20 /* scan element definition for generic MPU6xxx devices */ enum inv_mpu6050_scan { diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/in= v_mpu6050/inv_mpu_spi.c index 05451ca1580b637a66a30efe82fbd2a2b63e55d5..e6a291fcda958c56e889e581519= 29a2f602b0426 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -80,6 +80,8 @@ static const struct spi_device_id inv_mpu_id[] =3D { {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, + {"iam20680hp", INV_IAM20680HP}, + {"iam20680ht", INV_IAM20680HT}, {} }; =20 @@ -142,6 +144,14 @@ static const struct of_device_id inv_of_match[] =3D { .compatible =3D "invensense,iam20680", .data =3D (void *)INV_IAM20680 }, + { + .compatible =3D "invensense,iam20680hp", + .data =3D (void *)INV_IAM20680HP + }, + { + .compatible =3D "invensense,iam20680ht", + .data =3D (void *)INV_IAM20680HT + }, { } }; MODULE_DEVICE_TABLE(of, inv_of_match); --=20 2.34.1