From patchwork Fri Nov 15 22:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13877378 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2057.outbound.protection.outlook.com [40.107.20.57]) (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 6ABE4191F9E; Fri, 15 Nov 2024 22:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731710269; cv=fail; b=dBfLy2X4a2eeveQknsmfEU5cssoSWZ/3aAbenPK5BlahR0Z0GUWUrBx5HKJixwxfLRnmwj3QXvaCug8k77v5RLgd5LVuHZTu67s9d2IhsJpPzC0xR2BOjT0qdipRv2/gdyDNe0EgkiIwZUa3uZ+cLx50fzS1NB4RRXv1YiPSk0Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731710269; c=relaxed/simple; bh=FDDrqPlnyl/sdvCPbVvgQp8p9sp4AIhD9RaXQeXf3/Q=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Mj+mbHQfhzEJpPEH3LGE+MKj2x9iTCyLpsE7l57CUkMuOV89yja8jT5hcJi03ZJwgsz1xQDnNj1qitQ/aVWXeEwbl/tO+1er3hYrgj/tEe6H+FanurjcOY1n3mxpFco0D/MOSCxYRq8/0Yyop/YFdfk7u6apz81LT8KKNqd7c2c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=U0JXOKlE; arc=fail smtp.client-ip=40.107.20.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="U0JXOKlE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iAv25ank1tDZre9N9C0dOHw5KyOhue875/cHnFApCC9iP6yuoykw1R+65mfrWGJxiSvcMTkVSF3xkNTXuGAAkexxSqAzd3l/hacLQYjwyyMx0SxpWjK6+gM0yrkHAYSWGkKjQdMMdg0hIT+HCn7mIx6VL+InsdbmyF1bXtd9JEKTd/j2vmT785d1SABhBCVwnP6ZfvexLLZyXjM6fuVPRjmV4bYQO/e8RG33/zujAKwUv1I3U1nLkx7ji/x2yQHVnKbGIoTOmc37GeH6brg9QJHACFJujAQalhqXmdcoaRzc6tHOd5aLdeY8/dZrPfkDRzpnp2iqpQWw6z2t8hsEkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HU2SqsMj5xP7YYeKSVmX3Kxay8BL1maRjECnNSuk2lA=; b=TQWHltsJbn1vYjnQXpVwyUxxVYbaL4Ndx3oUY6m/iNc6v8m7YS6txnlhQNqc99m0pPuBdG5qssZ13Sm1O/dXfP4j46+OsHcOaSJaT8rHt+5yMTyVTdi/a5lYC1Iu5k2ySSybTlrORCsF3fg8aAODvHdykTMpUMf15Y27bweF9b48mdQ4+oaIbI4WgKHLOEIOP9e9YIrzHyq7QtDR740ZuUlyFh1kX4gxyIujNkju1tloV8L2uMjq/1yfN/d/maLGn5p5zrWPsl3PXmCtekmjStpfiYgOv56hen8tEJNPvyQIdKXxXFO01v4bqvULWNT6TaOp+K/hCgtmxq4MrPhAFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HU2SqsMj5xP7YYeKSVmX3Kxay8BL1maRjECnNSuk2lA=; b=U0JXOKlE96OxR56y+kw5UaxszYN6A8bw9MwtD8V2vpvmMLMtvOJ667Deyf/pXFxnFwfGyfvDE5kdRH0kkMLOuGVxsigFcfr45UYoEWJloAgv0gjHwCnTW91BwqPSaAvGN4P9NEPIiMupUvsk1aKtv0b1rtWpH4I041c8yOt+e76gbGOiKFSLK+vheLJP2neZB44vCJHrPcD2K6PeIMpuyCP70ihEpvzUKg+eQ6XS0qI8VoaG6wV/149GJh2ZoCF9TBlr0L+9en5+QjcZEmmbnI6PE64eqSNh7mXH80mbKZsXzZDRltRhDQ9ns/kcfGGJHfrZHWd+19fEW4NhsjRIUw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PR3PR04MB7259.eurprd04.prod.outlook.com (2603:10a6:102:8a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.19; Fri, 15 Nov 2024 22:37:45 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8158.017; Fri, 15 Nov 2024 22:37:45 +0000 From: Frank Li Date: Fri, 15 Nov 2024 17:37:23 -0500 Subject: [PATCH v2 2/2] iio: gyro: Add support for iam20380 sensor Message-Id: <20241115-iam20380-v2-2-d8d9dc6891f5@nxp.com> References: <20241115-iam20380-v2-0-d8d9dc6891f5@nxp.com> In-Reply-To: <20241115-iam20380-v2-0-d8d9dc6891f5@nxp.com> To: Jean-Baptiste Maneyrol , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Li , Han Xu X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1731710256; l=5654; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=CMmtuhdRuMMh3YhsOTZ5BJ35QqXyp4F+xikGDKq82Rw=; b=2mWb6W1YhTMlhzpoD332q0oRLDCVma56oN0R5W/gexegqaQD2fMNdwtVzm5sAi+XTYujD/k1X ZSYIdNMMTfFB2IXPMTTxQXW+ohu2fIoll2YOqas/aVMe5TPBMPOBAuQ X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR11CA0053.namprd11.prod.outlook.com (2603:10b6:a03:80::30) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PR3PR04MB7259:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d8a6445-7441-4ee9-0adb-08dd05c62029 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+h8F1ywI/2YkrNzxEutUajjt5lzfBou?= =?utf-8?q?0QNOKSh+PApL9Jmxso2m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IURaNiA8+EYWcxgazdGhYMPozsqlyIZCCDTwii4Ni3gbI?= =?utf-8?q?YUhYht8Yj0VddzyipU8jz4Z6Wx4XgZiUBmoqmcsi74hzjAEmrBUI50wQoEwnZlN+Q?= =?utf-8?q?TBcPUJlB+2DaZV2yBqwQKj22Ue5SrFHMAzPidvwFBiaI4BBrPkmUnyAX+XKwdtLfa?= =?utf-8?q?5Gl7M2K1YZH58uqUrs5/RORTc4thQYptaJZrnDIraV672Iq0CFYRJ7Oo9HVFcD9ZC?= =?utf-8?q?vmGDDpHDl3VxrQY0PBj0Fm1zzrvaWakZdtZD8KKK4RpuZYLGK0X47Z8hqu/r389o6?= =?utf-8?q?raVLtiGleA5n+wdgrl9kAP7XWyZM4F5JkWPfFhN8kQfpP2a7ieCU2KW7m4TYtMHOO?= =?utf-8?q?BlELarSQrqBfsPutCgW43hKBcEzmaWpL8tw//F+1kPS5whFAexsb8CgA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?FDR9Li7E3IcOopLb5p+uf0OeH76e?= =?utf-8?q?uLaOKzjhh5pIeWwoTMEvYISi7n5zBvHI1BUTLqDdN+cCaVSqZcZ8p0mVjImeUTh7y?= =?utf-8?q?KKLwb1Z5BUffhey9ZKvUErNfIQUUhRhWxYKS65a36/ZIaTqUpjJwwOPpZEMUPE5Sp?= =?utf-8?q?SewefT+MluQiWbo53cq3ueOk2tbXhdPjfnRuwUdpEnlquTErdq0LlWRznL9wIKirP?= =?utf-8?q?YcYyKs68+x8MUg5OEMH01NtFODYXjW//NbBs1GHY8srBy91/E7KB7y1wnARSYFcjp?= =?utf-8?q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/xBcxE+Ns8kIDYFItdmjFN2aJXRD50ftNxoybaHLF34n5gMD18iSFX6cF9Y/N8x?= =?utf-8?q?eJUfGG9uYJ60huiOc2ApMRVmkTEeJ8s3oBKBkQwyy7y+TnUXxFJoOyJRD2XdWXfXq?= =?utf-8?q?h+zdTG/tTRc6Gj53Yd9xsDFwwV3Ttok2eScURGe+ghikMnsyWWx3JsRxOl/FV3JL8?= =?utf-8?q?sUAzMSSY/Wx5N3eTOMk1mYIw4GGRMoNZv3w7tbAlmZdyQsOx6prGGH+8WQ5c6z8Sm?= =?utf-8?q?80BdNPxzmSaTrCK7TIPtvPYaM5Xkj6R6WY7xbJcgAA7TshFRfVtx7fHLIU4XfNnf5?= =?utf-8?q?xPDrNPfMWikazX4Ig1duoTn87YkqIyUReI9aeuzbZZFqo1+HTHOYwcrWDa04XxwX0?= =?utf-8?q?mn6RfuNLVJiv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d8a6445-7441-4ee9-0adb-08dd05c62029 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2024 22:37:45.8880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wBDhRM5YcKzoQimYB1COWT2kQ/2KoKAfw8gu5+Wou1EP45Xt7V3ud7J62wgMms/yybHS2rW6GTGka8C00P0v8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7259 From: Han Xu Add support for the Invensense IAM20380 sensor to the MPU6050 driver. It is similar to the IAM20680. But IAM20380 only supports gyro and WHOAMI register data is difference. Signed-off-by: Han Xu Signed-off-by: Frank Li --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 25 +++++++++++++++++++++++++ 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 +++++ 4 files changed, 38 insertions(+) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 40271352b02cf..a7535cbc214e9 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -277,6 +277,14 @@ static const struct inv_mpu6050_hw hw_info[] = { .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, .startup_time = {INV_ICM20690_GYRO_STARTUP_TIME, INV_ICM20690_ACCEL_STARTUP_TIME}, }, + { .whoami = INV_IAM20380_WHOAMI_VALUE, + .name = "IAM20380", + .reg = ®_set_6500, + .config = &chip_config_6500, + .fifo_size = 512, + .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME}, + }, { .whoami = INV_IAM20680_WHOAMI_VALUE, .name = "IAM20680", @@ -1519,6 +1527,14 @@ static const struct iio_chan_spec inv_mpu6050_channels[] = { INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z), }; +static const struct iio_chan_spec inv_iam20380_channels[] = { + IIO_CHAN_SOFT_TIMESTAMP(INV_MPU6050_SCAN_TIMESTAMP), + + INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_MPU6050_SCAN_GYRO_X), + INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Y, INV_MPU6050_SCAN_GYRO_Y), + INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Z, INV_MPU6050_SCAN_GYRO_Z), +}; + static const struct iio_chan_spec inv_mpu6500_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(INV_MPU6050_SCAN_TIMESTAMP), @@ -1623,6 +1639,10 @@ static const struct iio_chan_spec inv_mpu9250_channels[] = { | BIT(INV_MPU9X50_SCAN_MAGN_Y) \ | BIT(INV_MPU9X50_SCAN_MAGN_Z)) +static const unsigned long inv_iam20380_scan_masks[] = { + INV_MPU6050_SCAN_MASK_3AXIS_GYRO, +}; + static const unsigned long inv_mpu9x50_scan_masks[] = { /* 3-axis accel */ INV_MPU6050_SCAN_MASK_3AXIS_ACCEL, @@ -2026,6 +2046,11 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, indio_dev->num_channels = ARRAY_SIZE(inv_mpu9250_channels); indio_dev->available_scan_masks = inv_mpu9x50_scan_masks; break; + case INV_IAM20380: + indio_dev->channels = inv_iam20380_channels; + indio_dev->num_channels = ARRAY_SIZE(inv_iam20380_channels); + indio_dev->available_scan_masks = inv_iam20380_scan_masks; + break; case INV_ICM20600: case INV_ICM20602: indio_dev->channels = inv_mpu6500_channels; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index 7a5926ba6b97d..62f7d16c2ddcb 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -34,6 +34,7 @@ static bool inv_mpu_i2c_aux_bus(struct device *dev) case INV_ICM20689: case INV_ICM20600: case INV_ICM20602: + case INV_IAM20380: case INV_IAM20680: /* no i2c auxiliary bus on the chip */ return false; @@ -187,6 +188,7 @@ static const struct i2c_device_id inv_mpu_id[] = { {"icm20600", INV_ICM20600}, {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, + {"iam20380", INV_IAM20380}, {"iam20680", INV_IAM20680}, {"iam20680hp", INV_IAM20680HP}, {"iam20680ht", INV_IAM20680HT}, @@ -252,6 +254,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20690", .data = (void *)INV_ICM20690 }, + { + .compatible = "invensense,iam20380", + .data = (void *)INV_IAM20380 + }, { .compatible = "invensense,iam20680", .data = (void *)INV_IAM20680 diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index a6862cf426396..211901f8b8eb6 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -84,6 +84,7 @@ enum inv_devices { INV_ICM20600, INV_ICM20602, INV_ICM20690, + INV_IAM20380, INV_IAM20680, INV_IAM20680HP, INV_IAM20680HT, @@ -425,6 +426,7 @@ struct inv_mpu6050_state { #define INV_ICM20600_WHOAMI_VALUE 0x11 #define INV_ICM20602_WHOAMI_VALUE 0x12 #define INV_ICM20690_WHOAMI_VALUE 0x20 +#define INV_IAM20380_WHOAMI_VALUE 0xB5 #define INV_IAM20680_WHOAMI_VALUE 0xA9 #define INV_IAM20680HP_WHOAMI_VALUE 0xF8 #define INV_IAM20680HT_WHOAMI_VALUE 0xFA diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index e6a291fcda958..cd54e9dbf99ce 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -79,6 +79,7 @@ static const struct spi_device_id inv_mpu_id[] = { {"icm20600", INV_ICM20600}, {"icm20602", INV_ICM20602}, {"icm20690", INV_ICM20690}, + {"iam20380", INV_IAM20380}, {"iam20680", INV_IAM20680}, {"iam20680hp", INV_IAM20680HP}, {"iam20680ht", INV_IAM20680HT}, @@ -140,6 +141,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20690", .data = (void *)INV_ICM20690 }, + { + .compatible = "invensense,iam20380", + .data = (void *)INV_IAM20380 + }, { .compatible = "invensense,iam20680", .data = (void *)INV_IAM20680