From patchwork Wed Sep 4 14:05:04 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: 13790910 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) (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 78C881CCEFC; Wed, 4 Sep 2024 14:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725458738; cv=fail; b=P91a4GlOhhd2bTXIbB4Jn+g2LwCq1bw14jPX0UzGyOL9VP0WlzBxfZw0vKvSNG2ZS7GK6fsUlulViEo1Nl18lDtS1EEJF9ff818aKsoNtEipGsen4pYxg+zwuZFpsU78/UrMFMmR8zj80WQyTn20EFQxAHhPUPxf9UdE+RJxcUY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725458738; c=relaxed/simple; bh=K7nkVC/oMz1JNOnRN3l1ONHaE5MMpz/jfpx92AWWsBA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=QvKRXgEgzJ+yk0JVDRb4DD+XKDPMo8ad6JPole+zuOmfsVePQ70cNsijGMsWn2Q8yDqmSVHpi8XiNKKTWbe3Ti4F5Ck5bOQeUvgX1t8z0azVNbxgKQ7Q6cyZdg5+4MzuIUbtUM64Y6MP1LpUnDAs2R6MXIvIA27E4I5q3eSsPyY= 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=pIQMXak2; arc=fail smtp.client-ip=40.107.20.58 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="pIQMXak2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q38Gsh5D1b+shp62ySYTkj4ZExoLAgADnNvKyHLjlDgoYpnT0zOCuO+HT472u8/cXIye7CVzI6b0nBAH7X6suuqEizVtG5guA3oilG3icpPIF7tA89+Jb41y9KU7/qjGMgFWWeNXLdvsbxrRBzyFGSOI8xjwaz7AIHea1bjHePXC0foKL1LgrOHt94OvM3XredgjtxfXSDspvR/wMc2YyZKFwBkillqDbAjMeDa5s+MlZ3KBiVJqRWWl3Ln5mWDSawcL3y68OJRP2pZHQv0Yru09PlKjl701VAWOWNJPQfmb8KjcB/FKWwqjeoMF+IjtN4gGP6hEyngoK6m3JG0s2Q== 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=KFVUcETo4Vu0Tq4WPMxlS5tiVGRDhMPhTZDas14e5mY=; b=ly4DKBlc+W0+LXSPaf4SwAOQ+VeD1JmpHuikIja+IsKvFPvgYx4VfL8tcNfTIRLgZRLEGJcj91lU9/HulR03wMYM8jqUCU0634svHQHMueJcsbRKdg4PgocB5DpV8OS9ozUYXSMh4EAtPbE+uYegCLASi6ig7Un8A29CdZIUeq7EJsvdee3PIY65agl7NkgfJoJgXKdfnLb08ieQrFgDzIC9jo894sFBisnIRJiEF8pjKzd8pgskAhb1agSeNjCPwUL4LYDlQ/joYgBUEDwGHUyK6zZSnbzl68fCM0WeJCvf24l55SAxJkS8TWOJzgkXCFG8Jh679hwPJA+mzEZflw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 139.15.153.205) 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=KFVUcETo4Vu0Tq4WPMxlS5tiVGRDhMPhTZDas14e5mY=; b=pIQMXak2Zx8A9qH/OtiMWQGn08mvahoZrOGJtAgH4koLCaDowna7VqInTTI96MjXHtFV23M5JxG0DJmFnpc0+xehybfVMK2vt6U911BuutyCCznD62HS+H/dSvtclmZdnWxPeByGDvRBtPYzml0SwIZsdJQjzbkIbQWo0tp3y+T3k6Q8eAUMzSKcoQuWtJUFJCYbQkjZkWHVjKxUjaRtOeyW6nEIAi9aigrAbKJAFDoKy+sIhQ5H15L9uoi1++3XE2JNV7tY81N9CAhU1ZbMq6NnbAtdO/HMJbkVaA8w4PDhA8FRLVeALhLe6ZHDj6DdSxnp5FybPbwiJk3+HULAoA== Received: from PA7P264CA0298.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:370::17) by DUZPR10MB8233.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:4ae::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.24; Wed, 4 Sep 2024 14:05:30 +0000 Received: from AM4PEPF00025F9C.EURPRD83.prod.outlook.com (2603:10a6:102:370:cafe::91) by PA7P264CA0298.outlook.office365.com (2603:10a6:102:370::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Wed, 4 Sep 2024 14:05:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 139.15.153.205) 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.205 as permitted sender) receiver=protection.outlook.com; client-ip=139.15.153.205; helo=eop.bosch-org.com; pr=C Received: from eop.bosch-org.com (139.15.153.205) by AM4PEPF00025F9C.mail.protection.outlook.com (10.167.16.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.2 via Frontend Transport; Wed, 4 Sep 2024 14:05:30 +0000 Received: from FE-EXCAS2001.de.bosch.com (10.139.217.200) by eop.bosch-org.com (139.15.153.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 4 Sep 2024 16:05:19 +0200 Received: from LR-C-0008DVM.rt.de.bosch.com (10.139.217.196) by FE-EXCAS2001.de.bosch.com (10.139.217.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 4 Sep 2024 16:05:19 +0200 From: To: , , , , , , , , , , , , , Subject: [PATCH v5 0/2] iio: imu: smi240: add bosch smi240 driver Date: Wed, 4 Sep 2024 16:05:04 +0200 Message-ID: <20240904140506.4741-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: AM4PEPF00025F9C:EE_|DUZPR10MB8233:EE_ X-MS-Office365-Filtering-Correlation-Id: 74e0ea2b-585c-4100-c283-08dccceaa2b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?LP4G6FAu2UnCh9Wcja6h2k+mfd13ZTJ?= =?utf-8?q?atzRwBY4Hijbur3Z1NXzM3KKRcV/YqdyyumLgrUgg5XHmtWDYYxZswCVl9fY84x4O?= =?utf-8?q?bEsN54C9MvzAzCCYqiM4B3qv9BySE3ZJsWQ5+FpKXgnfwtj1MN+x2whllrX28dpa+?= =?utf-8?q?B+9SHe/QgnYvc8D11P48/frAclLR8vSYGy07WS9sS7+a5XiLCRn7/gRGC4VpfPfix?= =?utf-8?q?GddD/WH4K88D4BLhTyJMf6XLgGSfNC5RUu3edH96V0mFirWVORwFWy6axkY6O54dn?= =?utf-8?q?H5ACglZWcgSHWkIHRgiyNdT3EIhQn9qQVoRxpoZceyBTbDB1SbIxs7+PZoY2rFpSm?= =?utf-8?q?rav4Zeocuy5xt01uizKhePiNQAsV9upnVo3OuhK7NUW4DxrgLrNzNV52pkSEiCAc6?= =?utf-8?q?mtQk1gDRTeIMi1o3iOJfuVvCYYg6pcax8nmxeNhSgEsOj6R/iqkzE8izi9/FGF1eZ?= =?utf-8?q?V2hbUJpmI21oMEFiAISkOv3Gome1XTqlwXcNcvw0QpNXHKyEk+SkRPSdweBXBLWsK?= =?utf-8?q?VjwXxiT/jZaZSQ718sOZJ/TW2L9cFmbdM9sgDRNbDjNCzBpQFp3tOdzJaV/FKQ92s?= =?utf-8?q?cAplcW4qCdMWuuSX+giXjAPSBTTpDq+iJmk4WEDiYEjieeQUVeFWIciYxJCyVAphf?= =?utf-8?q?uAZBYxPoZmKZr0V2KYL17Phaaix4t1VOge9MGlLztkqcfKJ2+2wSQlPRD8MNN50t5?= =?utf-8?q?CnevHuJIfvfzBYida9zQEKNLFaNxDESFb1NwjFMOBVZ6FpLaXHGI73UFyvbpvIP80?= =?utf-8?q?ho3vywmcjbVLUCQ2cIV1xotq4PX61g8wwS1zRAmoUF3Aw94NeM2/aza0wRDiuPa7O?= =?utf-8?q?vQUFVcXpPRxB3CLVLaNbg6QAvZ0TSgU64tVVQjnWU/xpbwflDbhvIdOQ6Xj4rGDL+?= =?utf-8?q?G6sit+fMPxb2774Z6jTIp4y9KZLT2ce+ZoEmrW83Xp+xYls/9w7BtzQvhnmLC7n1D?= =?utf-8?q?wYkykZZBPwhRP8h9iDqRkM2pEzGz9kELzsu8bXjKlKtLODMae7tXazMMNPpBy93F0?= =?utf-8?q?6YWzkl6A76+LDgig2e7fD+7LqQfzwcBP4mCRQm3mP07U6u53SvcSFndpw6Jl1Kpku?= =?utf-8?q?KjS8qEsg57zt3kYIsrLAD3CNrvyl3zMgyLz1pvEdHv3SDpnmQsVCbkAwgi6FwSuHX?= =?utf-8?q?WaRRx6ogFPHO+9j2zpp6IKnccmqgwY1+LLnSKTrIHglII7guLKQQtijbGlceGV62f?= =?utf-8?q?5hWYe7ECE3eNw1qidwgT3juO0yqb3UTmYB5HGiJ1LbnfGQbNMrpXy8jocz+TtQ+yF?= =?utf-8?q?QJkW488MUReTgf8FLjOGQQf3sLDXsdeRtfS3UZzYAu1xa72J20T7hX4YEPvpSou9m?= =?utf-8?q?FabmjL7EFdhkwmJXygiLe6RDGqHrfOJiLu+VJ/01ut0Q6EZ/yclpm/VvTO3uP2zdS?= =?utf-8?q?2Mutv3zc368?= X-Forefront-Antispam-Report: CIP:139.15.153.205;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:eop.bosch-org.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: de.bosch.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 14:05:30.3508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74e0ea2b-585c-4100-c283-08dccceaa2b7 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.205];Helo=[eop.bosch-org.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00025F9C.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR10MB8233 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 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 Shen Jianping (2): dt-bindings: iio: imu: smi240: add Bosch smi240 iio: imu: smi240: add driver .../bindings/iio/imu/bosch,smi240.yaml | 52 ++ drivers/iio/imu/Kconfig | 14 + drivers/iio/imu/Makefile | 2 + drivers/iio/imu/smi240.c | 578 ++++++++++++++++++ 4 files changed, 646 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,smi240.yaml create mode 100644 drivers/iio/imu/smi240.c