From patchwork Mon Sep 23 12:40:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Shen Jianping (ME-SE/EAD2)" X-Patchwork-Id: 13809554 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) (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 C2E4D195B1A; Mon, 23 Sep 2024 12:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727095255; cv=fail; b=IkTnPfJRUvzosDK4XhETnTgVZTt0qCHBq/iKrjt0nbKZsFGkFy2z4VLPEFH3p5u2CwThWdRNwxhaB57C0EAsfY0NJzdD95/945K/gMN29GqyNkjQ1SjGLbIjgpT2K+dV7WG/vFHy/oT3XlTSyOVL6JdlcffItxQRAtuRksxzebw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727095255; c=relaxed/simple; bh=llmlBn1l+72tBxiaVi4eHl8WtKpnOFZghtVxT7xFDBU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kl2dSD21oZDcihcWx6oOB7HBInT/vKLULFVd0RvSSjxWEmW8rdxLK6KBZbOu88l1Z54WILVviACEhxT0Tf00qejr216B22Xf12+Y55GTy219kIFCmCjJOZGOtm1XFsHlNGEqAATGGaaIbBLOUmvlYLXbf0gNZG1OFU6AkHdoFqs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=de.bosch.com; spf=pass smtp.mailfrom=de.bosch.com; dkim=pass (2048-bit key) header.d=de.bosch.com header.i=@de.bosch.com header.b=p6tMOHAX; arc=fail smtp.client-ip=40.107.20.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=de.bosch.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=de.bosch.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=de.bosch.com header.i=@de.bosch.com header.b="p6tMOHAX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uawIg7q/L2bchSUvizf5587Ns9sVh5BzL6YGJ5Up1LECbJbsCpBANS/qR1NXKMo4Ef/fWkwaaSV5ti6rDMFGJ/tqAslRQuA5JJ1lR/np3zRTiRXOvRNxChziT6Dq1Bg5W9rGJyzE1zs0xiuQhyd6txOA50hSPTJXmiBTOqSExnWsET1/a29asDRRoPnEqUjdWsVYcMlH6xn9mfP8onkoGGWRPvyp2niq58q/s23aofyZIVQTGVrpZlKh0O1Ou1Bpy88aWP/o574CfOLGB001TjafFo8Szhaxknjm75scJqdamvyR/MxwMeFFwVwj753CDBoHj28iQi8QeFipQsfDcg== 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=j8VEQ5LvxSajqirhl/H1BDdoQOf8N3eFxQ4YZR1h1WE=; b=CDxPGq0br6DMxyA0w7hHd8+FuiKRiQsCrFN2oWv6f3O4FaogdGED7NGha64tD9OQ/IHDOQlsS8rNPdpCmiN4iNEM9QXwqrr5BLmx4OA9ToO//jROpxrnARJ6BpaXqEasczEo3DkhVXpuObqE/rSf9lMS+2s3/Oqc9t+7SmKN+sEdpqSNvNtYmZo2Z+Cw9Uqb+CdH/4W9fmV+hlN6lRpbgmnDSrv8ieWoY3WIfyYBaM0x2D4L/f9frsUTAWLPOPcolWbeufFcptzlidGGKtquE4NTHuDut2hUwpDMe5Nu8H4tBHN2nLsY5UcIAvH/9csX8zGHEX8LlP1/0lk6fTY7Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 139.15.153.206) smtp.rcpttodomain=kernel.org smtp.mailfrom=de.bosch.com; dmarc=pass (p=reject sp=none pct=100) action=none header.from=de.bosch.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=de.bosch.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j8VEQ5LvxSajqirhl/H1BDdoQOf8N3eFxQ4YZR1h1WE=; b=p6tMOHAXZ2omMG7sufhTq/tNib4CQxvC4KT+GBqj1DQsgmZmA8XfwtvxI/KbLS9ew8w5D3vfh/YfQ5a562MUCgfjXmMS1YLq8upqWjvcCJu7uON0Sppk9qAAMirabyEm7wkRMuxe3ZAz2KkYZRMmh6PyZa+uOFnT0XAP5QQzfuNZCm1tzABlrXUYXQzSA7KfEWUGgqkETe7xT75ePAPNf970O9y/qTyr2lD2JgWQOLgyx+vyVBIY+zeFoykzZGeieQJrS4aSY1wahNnUPTNBydTkd1HOPSAwUSJuoTbcMK1K9/iGcgF4s5H/7XLYnGXywIoa4kjVmuAo/WIi6mJD+Q== Received: from AS9PR06CA0199.eurprd06.prod.outlook.com (2603:10a6:20b:45d::18) by DB9PR10MB6643.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:3d1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 12:40:42 +0000 Received: from AM1PEPF000252E0.eurprd07.prod.outlook.com (2603:10a6:20b:45d:cafe::8c) by AS9PR06CA0199.outlook.office365.com (2603:10a6:20b:45d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25 via Frontend Transport; Mon, 23 Sep 2024 12:40:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 139.15.153.206) smtp.mailfrom=de.bosch.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=de.bosch.com; Received-SPF: Pass (protection.outlook.com: domain of de.bosch.com designates 139.15.153.206 as permitted sender) receiver=protection.outlook.com; client-ip=139.15.153.206; helo=eop.bosch-org.com; pr=C Received: from eop.bosch-org.com (139.15.153.206) by AM1PEPF000252E0.mail.protection.outlook.com (10.167.16.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 12:40:42 +0000 Received: from SI-EXCAS2000.de.bosch.com (10.139.217.201) by eop.bosch-org.com (139.15.153.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 23 Sep 2024 14:40:31 +0200 Received: from LR-C-0008DVM.rt.de.bosch.com (10.139.217.196) by SI-EXCAS2000.de.bosch.com (10.139.217.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 23 Sep 2024 14:40:31 +0200 From: To: , , , , , , , , , , , , , Subject: [PATCH v8 0/2] iio: imu: smi240: add bosch smi240 driver Date: Mon, 23 Sep 2024 14:40:15 +0200 Message-ID: <20240923124017.43867-1-Jianping.Shen@de.bosch.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM1PEPF000252E0:EE_|DB9PR10MB6643:EE_ X-MS-Office365-Filtering-Correlation-Id: 214c016e-8a1b-42e3-533e-08dcdbccf023 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|7416014|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?wbNjJXEfAc42iHgdwDmuuhFewrlLGUO?= =?utf-8?q?roHA23CGdBRg5ehxre+K+RRqnQXf88+jUl57imRbviR2FJuiUItmzdcT3sbMMknfo?= =?utf-8?q?BCqGeDn5zfGq1HlF8hIfW31G6zj0CAFpIaWxP8XEXMDLKbdrjmSmLW/7T4JdPFeZO?= =?utf-8?q?rW56Mf7Ny/6I+Kr4HbURqSKx19Ivo9HOI65Ov+sWsmAErnvJxjwlnt46Lcqh57tHe?= =?utf-8?q?1TL4lMe7jtygsCKdaCY++IGQsnd1ltiw8R9ldn4ELJootyEB+n694cn+frsacCDSC?= =?utf-8?q?REfqyF5fTq7OcRzdXQ8FPqbl5L35KOeZvDW0cghXA3jjOZXOQU2AB1zzT7MlCNEZL?= =?utf-8?q?iE9iJyfKe5BhO6OGKLL55GG5y7qqJ5xu0iwVhB7queXUhQs56Ltyvfv3+8hZU/ZZU?= =?utf-8?q?F6m2cy0jlgKJ4iQP3nKSP32y7ncLgkmlIglW3uVSdy/w12PMcZe9ShU3PrSAMn6E3?= =?utf-8?q?d6VOpvPm4SyZwBoTVpAw3B3oCdytp5eukv9MtaStKWzFh4eH+S95GI8BgdtMdfoB0?= =?utf-8?q?LyWl7VIKJij24Td4FGkBhYvSPrbZwvcaYft1yOiU893xAjyEBW1KicWY1+zYkbo9C?= =?utf-8?q?p1ZisiI778lY9RDd/c2ih+c+7OkOtUTsWtvc/q8zS9o+geBUN9noKn1lzOiGfCTYu?= =?utf-8?q?lruxAM7bJGBr3lTrnS2KgNu0wGxseEUdlgLyRlf4Y+IHxdzmkCqfD/z+22EAntyBE?= =?utf-8?q?wj7/dlSmvr+Hb22Qrw2BzhG85L1wlAk5PL0HK8RiCmfqlJu2ZuJUXb702oqGdFZ/G?= =?utf-8?q?lV1M+ZbJVwk42VujAXfdMn7Huh7KyN87nVQdKvLek7QBxpw9OmKmtm8SGZLQOm3q0?= =?utf-8?q?VSh5TTo0BByKIU2lHsviFTAIF66gNN7lsBTgBWELoFxCA7lfMw/txYF5lDe3DzYxz?= =?utf-8?q?eiiwnt3pHq+qSMJxDaFXvdwQE5RQOsKzkMPE1TqzWUwMRvSeLiZAz4h7tWCr2h+nh?= =?utf-8?q?fH0mlbVfMUXstBy4zOdotMQMNh2QgLTFcUpg9feGLGZt4ph6xVarAZxNDOjSSksW6?= =?utf-8?q?TamuR6ycwehqCF7L/ZFWvvKwhicQSDQ8lmU/NXVbAtCegcLTDx1cqmuHSlnhZ8nL5?= =?utf-8?q?oSm/ShXzId/1A+MsI373Nb/f+JgtMKvbr8v6jI6ca4XHIFoW8dwHlmRiq16clxdQI?= =?utf-8?q?J3+v9ndTLAOUFn7WSUU8aaWJOFzLnkvlsp6wYmUB4NjUIxV2TsNlsSsUq7Ap+nIkE?= =?utf-8?q?OTCArrFhEwozVh2ybJtuOr/pda6/cqS966PoJp9cuxW6eQB9GUF/IKf1rdWZpc6ZE?= =?utf-8?q?4aJl9oAvqbdGwlQ6LPuy8Fm3AZVRfL38dyOArZxeb/cPrYIDpfz9C3zvwBmySOhpE?= =?utf-8?q?E1cCL8thPmj5zMQc19bE3FwmtWaMwh3kT447c6MafltzG+7PW/vhcxnjz6V5tRjkX?= =?utf-8?q?31CwW7pnz8n?= X-Forefront-Antispam-Report: CIP:139.15.153.206;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:eop.bosch-org.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(7416014)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: de.bosch.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 12:40:42.7644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 214c016e-8a1b-42e3-533e-08dcdbccf023 X-MS-Exchange-CrossTenant-Id: 0ae51e19-07c8-4e4b-bb6d-648ee58410f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0ae51e19-07c8-4e4b-bb6d-648ee58410f4;Ip=[139.15.153.206];Helo=[eop.bosch-org.com] X-MS-Exchange-CrossTenant-AuthSource: AM1PEPF000252E0.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR10MB6643 From: Shen Jianping Add the iio driver for bosch imu smi240. The smi240 is a combined three axis angular rate and three axis acceleration sensor module with a measurement range of +/-300°/s and up to 16g. This driver provides raw data access for each axis through sysfs, and tiggered buffer for continuous sampling. A synchronous acc and gyro sampling can be triggered by setting the capture bit in spi read command. dt-bindings: v1 -> v2 - Add more detail in description - Add maintainer - Add vdd and vddio power supply - Use generic node name - Order the properties according to DTS coding style v2 -> v3 - Improve description - Improve supply definition - Make supply definition as required - Add supply definition in example v3 -> v4 - No changes v4 -> v5 - No changes v5 -> v6 - Fix checkpatch findings v6 -> v7 - No changes v7 -> v8 - No changes imu driver: v1 -> v2 - Use regmap for register access - Redefine channel for each singel axis - Provide triggered buffer - Fix findings in Kconfig - Remove unimportant functions v2 -> v3 - Use enum für capture mode - Using spi default init value instead manual init - remove duplicated module declaration - Fix code to avoid warning v3 -> v4 - Use DMA safe buffer - Use channel info instead of custom ABI - Fix other findings v4 -> v5 - Merge the implementation in one simple file - Add channel info for acc/gyro data channel - Fix other findings v5 -> v6 - Fix checkpatch findings - Fix review findings v6 -> v7 - Fix offset and scale v7 -> v8 - Use memcpy in spi write to keep CPU endian - Fix some minor findings Shen Jianping (2): dt-bindings: iio: imu: smi240: add Bosch smi240 iio: imu: smi240: add driver .../bindings/iio/imu/bosch,smi240.yaml | 51 ++ drivers/iio/imu/Kconfig | 14 + drivers/iio/imu/Makefile | 2 + drivers/iio/imu/smi240.c | 622 ++++++++++++++++++ 4 files changed, 689 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml create mode 100644 drivers/iio/imu/smi240.c