From patchwork Thu May 26 13:33:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 576317 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 289E4C4321E for ; Thu, 26 May 2022 13:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347488AbiEZNeM (ORCPT ); Thu, 26 May 2022 09:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbiEZNeJ (ORCPT ); Thu, 26 May 2022 09:34:09 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140130.outbound.protection.outlook.com [40.107.14.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96A5D80AC; Thu, 26 May 2022 06:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f63YuR6KlvUssD2en1JlJ3mGJnGtIFyl1+dPSEqUsUc5O4BSv1v+t9rP1FD4Q3UxK/+KWieeKdwq7BbyEqYIOwv2RtwHxLAu0qMT9xdV4WlINjS8xs5HcDeH0GB6u/s+mesn8yhqiny5aIxKuxeuxOPSAfgD0QIZ2cexaTZo51BzVUBtFlL/7Rsd8OCW/p6IyLFrZwWndSj/W8y5SBTNYa8UlJ5+bJmv8BcSgOZs99kuem5+YMqMVw5lq3WCpStyIWV81/cdVxhDMdpl0rJR8hJ+aKIpqcrD75t6QMusJV8RbTGa2c9SiADxHbuDb1fa91ImIGHjqBngSIlEKx9ybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=21Y26y7ZUZ+0wCnfwjyWGfVU1MS3F8zg9V2N6ayDMPk=; b=bhhOKOG7nPjG63CDDxey4Z4tOJnC0zr0e5f+GoY1UdsU773TKTJNTTYjVUfMa/swHHFt4m2a6yn7WxhKk7S0ISj+AyEZDQg/Uh5wUfdbfAxKxU9WNqXLAOF54i4aoyW0qkZbbyNd1WVhpAekTF8KGMeJly/YqvVXKyXpu6WOUGnipyWfTHTBO+NlvR8IpCJFU6PR6PkAm0mm9yP2RebFfOQFg55vnE+L3/0Sk84KFdyd+JfD8ZyBgehF2zebF/OtcDevbd/Na/e9vIG4ODLUNF+SRvBai3kZKzauoGOzIMQQvtjQQmANsraEfW53vIK8XPxqnYmWvX3KDeHD9IQWWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=kernel.org smtp.mailfrom=leica-geosystems.com.cn; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=leica-geosystems.com.cn; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com.cn; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=21Y26y7ZUZ+0wCnfwjyWGfVU1MS3F8zg9V2N6ayDMPk=; b=lC1GYdnCPqxafhh3QK6C4OGOzMpKQR0Bbca7tUgvgaFqlcS5j1sEDyyQSg0zZGQccEnKSXfNPBqLD8M8wTHQV1FMtk9BfyylQ4A2ixa2w0rXEnsTbzSMkDEikm74gpQ+16YCbKYUqasTQrJgJew5o7qtZG9MjUQHBRwv1wiyit4= Received: from AS9PR06CA0007.eurprd06.prod.outlook.com (2603:10a6:20b:462::19) by AM5PR06MB2994.eurprd06.prod.outlook.com (2603:10a6:206:a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 13:34:04 +0000 Received: from VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:462:cafe::5f) by AS9PR06CA0007.outlook.office365.com (2603:10a6:20b:462::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Thu, 26 May 2022 13:34:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com.cn; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com.cn; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com.cn designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=aherlnxbspsrv01.lgs-net.com; pr=C Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT025.mail.protection.outlook.com (10.152.12.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:03 +0000 From: LI Qingwu To: jic23@kernel.org, lars@metafoo.de, mchehab+huawei@kernel.org, ardeleanalex@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Qing-wu.Li@leica-geosystems.com.cn, robh+dt@kernel.org, mike.looijmans@topic.nl, devicetree@vger.kernel.org Cc: thomas.haemmerle@leica-geosystems.com Subject: [PATCH V5 1/6] iio: accel: bmi088: Modified the scale calculate Date: Thu, 26 May 2022 13:33:54 +0000 Message-Id: <20220526133359.2261928-2-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1528c77-7724-40df-9b2d-08da3f1c6671 X-MS-TrafficTypeDiagnostic: AM5PR06MB2994:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uf82L/0/+m6HgHHpnr9+PQOQF78SUFyoIwiBwasuSdoOchBDCPznKdUOZQIG8OdllQoja6013WpeMyd3ttrGmvr8oxk+Xny2dnjddkCs++Dt67aBOv0RepPUHsgVIlNbumxkglHrKqG/VpnCdEwqzqADOouuOgVBnybuCJTAAZtCcxkKoKabysvmtMUXFZMlmc9LzFedItNKktOH8Ie3K2qXA9oEI/FoX5zRLsGs4Co9Y1Y93fYjPUjUykRi/U4MiWLR3iX+GtQqhpfea39zy1SCxmEUUpzYTqcsw99g45ppOnAaYEfA6oZZm94vpOL0qBbGyAL6LEhosrCA9H7I4Q/g6XfSRELJg+IlLRvPYjfBQKjxoHBAYRHa58tf0K8gjhNl6/jRtoUL4YLh46yamohIkDyHPNtgoxQBfQyvNhBLI+IcwMlCpC3wv4w14n+7tTbmZICTvtqN+GZNcqQV1lD9znh111x1jCeGDmk1sHeWGCdG7zW78HYZ+kiOMbrPuUP5RJhVQh5nmjhs1ASJtA4i6CUJF8uT7xuvffZjVy0RWUJyWey0lTBL8XHYnAQP1aGNGO0V8lhOJBqyfA+yb1/9eWpEgBoCqzlvFsOzNia2ExNaLVu+FmAEHAuTSHOXYCka2wk7uY5UdWpNSwMsTj2lSQOFm93kItDJ9e48aR4yOcVkgfBcAHUhBDzItjjnEtlE7YLewfH7jcnfKNeJfA== X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:aherlnxbspsrv01.lgs-net.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(36736006)(186003)(956004)(1076003)(2616005)(316002)(8676002)(336012)(118246002)(86362001)(4326008)(6506007)(6512007)(6666004)(36756003)(107886003)(26005)(83380400001)(70206006)(70586007)(47076005)(81166007)(36860700001)(8936002)(2906002)(82310400005)(921005)(356005)(5660300002)(6486002)(508600001)(40460700003); DIR:OUT; SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2022 13:34:03.4202 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1528c77-7724-40df-9b2d-08da3f1c6671 X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[aherlnxbspsrv01.lgs-net.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR06MB2994 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The units after application of scale are 100*m/s^2, The scale calculation is only for the device with the range of 3, 6, 12, and 24g, but some other chips have a range of 2, 4, 6, and 8g. Modified the scales from formula to a list, the scales in the list are calculated as 9.8/32768*pow(2,reg41+1)*1.5, refer to datasheet 5.3.4. The new units after the application of scale are m/s^2. Reviewed-by: Alexandru Ardelean Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index d74465214feb..fd812802b71d 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -6,6 +6,7 @@ * Copyright (c) 2018-2021, Topic Embedded Products */ +#include #include #include #include @@ -73,6 +74,8 @@ #define BMI088_ACCEL_FIFO_MODE_FIFO 0x40 #define BMI088_ACCEL_FIFO_MODE_STREAM 0x80 +#define BMIO088_ACCEL_ACC_RANGE_MSK GENMASK(1, 0) + enum bmi088_accel_axis { AXIS_X, AXIS_Y, @@ -119,6 +122,7 @@ struct bmi088_accel_chip_info { u8 chip_id; const struct iio_chan_spec *channels; int num_channels; + const int scale_table[4][2]; }; struct bmi088_accel_data { @@ -280,6 +284,7 @@ static int bmi088_accel_read_raw(struct iio_dev *indio_dev, struct bmi088_accel_data *data = iio_priv(indio_dev); struct device *dev = regmap_get_device(data->regmap); int ret; + int reg; switch (mask) { case IIO_CHAN_INFO_RAW: @@ -330,13 +335,14 @@ static int bmi088_accel_read_raw(struct iio_dev *indio_dev, return ret; ret = regmap_read(data->regmap, - BMI088_ACCEL_REG_ACC_RANGE, val); + BMI088_ACCEL_REG_ACC_RANGE, ®); if (ret) goto out_read_raw_pm_put; - *val2 = 15 - (*val & 0x3); - *val = 3 * 980; - ret = IIO_VAL_FRACTIONAL_LOG2; + reg = FIELD_GET(BMIO088_ACCEL_ACC_RANGE_MSK, reg); + *val = data->chip_info->scale_table[reg][0]; + *val2 = data->chip_info->scale_table[reg][1]; + ret = IIO_VAL_INT_PLUS_MICRO; goto out_read_raw_pm_put; default: @@ -432,6 +438,7 @@ static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = { .chip_id = 0x1E, .channels = bmi088_accel_channels, .num_channels = ARRAY_SIZE(bmi088_accel_channels), + .scale_table = {{0, 897}, {0, 1794}, {0, 3589}, {0, 7178}}, }, }; From patchwork Thu May 26 13:33:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 576318 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 2D28DC433F5 for ; Thu, 26 May 2022 13:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243613AbiEZNeK (ORCPT ); Thu, 26 May 2022 09:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbiEZNeJ (ORCPT ); Thu, 26 May 2022 09:34:09 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70097.outbound.protection.outlook.com [40.107.7.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE793D80B5; Thu, 26 May 2022 06:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bSIpk2PyX8RPXmMRl0P3p/iCeqeDmE7TG5Euckc/t9xCmXHJNWXyyplfweEhADD4UyWvS8AbrNb+hbIMEz3oIk+XOJcOgWcqlcD7EoHWjOtJdZyqEkY3iHeNI1Gi/gk0Zcp/TfYrFfCXjDU39K+ggViqzygGO4CswjH3zxVJf6LpXDqRnZ24F8aYilC/4TFHAdTQHKUOwVCuK2N4otQYGDBln80moLH+Yk9KRPXSFxYP45daRcgQmrrlvsk/FUa+rryoS0b5jBwU1u5dZXxvadgsU/Io5tFnbEtitGKF375sPhCacUrm33Tdg8TlJa1+jOuA3kLWmObqxwRkiS0mzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=7j0k4hXL2RmH1aeoxuba3AmDLc28SHD03SYQXpnIzg4=; b=hmlyHGd3xL1rYsUUGQqiltxkx/feBzgSNUowWvxhkr2tbDtbbqq/PmWzpBDHhekNmWQSXz/pA4S06pBPMk7IRvfKdQEpoaeeBZNlXYRzHTCsXJj51MKlk1LcM0jSfhf+AoNjyS4YHH52Dzpq3QAjjNCtUP92bFe5B6or1FvE6vVfb0gTljiNev34i0XQ7z+GCgRqkC8brjBenXAftQIZ3MkUQCfAhLno9HLlVDsssXwBoyShsmozaYAVctNfmSRqm1MDYSARQix7dzpnPBLFgEVnXYDDGrYSkBm9VJXdBFWWWQz/FolEB36vNztEzJk1pvg/0kfpAQ9+gc3Fg0LKmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=kernel.org smtp.mailfrom=leica-geosystems.com.cn; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=leica-geosystems.com.cn; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com.cn; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7j0k4hXL2RmH1aeoxuba3AmDLc28SHD03SYQXpnIzg4=; b=ZwPV73VxKYFti8/6CyrthPXhOXLXaII6s279omcYYQ4CGXb1pixf64KWSzSO2hPYoEjGQ+pWDGTeQbgklJPVsJjjkn7fnTuAtpptuoyFtJ5HciRhnb2HGe8EVUPJFiHaSG8XMQ5gpvu7JVC9UU8Wx4/FAZbBadBrUuoxhtgC5U8= Received: from AS9PR06CA0006.eurprd06.prod.outlook.com (2603:10a6:20b:462::25) by AM8PR06MB7156.eurprd06.prod.outlook.com (2603:10a6:20b:1d9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 13:34:04 +0000 Received: from VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:462:cafe::e8) by AS9PR06CA0006.outlook.office365.com (2603:10a6:20b:462::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com.cn; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com.cn; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com.cn designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=aherlnxbspsrv01.lgs-net.com; pr=C Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT025.mail.protection.outlook.com (10.152.12.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:04 +0000 From: LI Qingwu To: jic23@kernel.org, lars@metafoo.de, mchehab+huawei@kernel.org, ardeleanalex@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Qing-wu.Li@leica-geosystems.com.cn, robh+dt@kernel.org, mike.looijmans@topic.nl, devicetree@vger.kernel.org Cc: thomas.haemmerle@leica-geosystems.com Subject: [PATCH V5 2/6] iio: accel: bmi088: Make it possible to config scales Date: Thu, 26 May 2022 13:33:55 +0000 Message-Id: <20220526133359.2261928-3-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef797fc2-70eb-42ff-a78a-08da3f1c6700 X-MS-TrafficTypeDiagnostic: AM8PR06MB7156:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iXD38aBr97Uji3+GXKfirOy/Fb4AFUXtcq57UAhMsqPM7iKXaEtFCTIwgRJ6IKe8kKgu2ZBm34VL4m4kSzCiuyVMuUXT/DUm/vFVT1W9FMG71WXT7gqN8aF9bnRJPRIXEsCSXmYAL9VMxb2+ofDtUPTeOjrD3GkxSLNd8nvVrrkEFcdqqhL6xwv5IB5kDhzDZJlO0ocBC7TdRNtdghVAyfT9HvAVMbe/MaMGsLHCiz0fGeRSTj6A+/0WT73UYu7xfsiSgyjZBf+tEJ0nhxTvcvXH64CD3e4VflMPJJNJodPqvuCJtYaMQ0Qjgu9l0qQVaFvCkY1akHxA6Pfr/3DtYbmTzJDEfP/Tfbdc+5f+oQu3XCE7FO2FdPiZv1bQrt9ophprlJ1WzdsJbT6R86keTNEEtfiEeRKeYP5ibfE2K1u4x5rfhUSaZpxw20PAkFuEi4mzD3TCscAuuwVNSI4ZYiDqj4ZeUlergZY69X6BC6cUhwis0eqKteB7MV9a6kIzU3iyNKMRVmbpVfT9n0FX9VQcVMJ5BjeYiv7zC6tKYYBM7i9gShQlOPKhTC+pKZdWs7fJ6fXTgLHdBsicMg9lnqsnDcgyG/8CONIGa2Y6Rfadp93sg1dlsfT6WyOHzbE49vqZk2hiFy8XUOJjlHCtBNXio7f7lvdeRI6x+mv7+wJ62tYTEhQ5S0GUnEdyqO4q X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:aherlnxbspsrv01.lgs-net.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(356005)(921005)(2616005)(36860700001)(956004)(5660300002)(47076005)(107886003)(336012)(83380400001)(186003)(82310400005)(1076003)(2906002)(81166007)(6506007)(8936002)(316002)(86362001)(40460700003)(36736006)(36756003)(6486002)(508600001)(26005)(6512007)(118246002)(70206006)(70586007)(8676002)(6666004)(4326008); DIR:OUT; SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2022 13:34:04.3576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef797fc2-70eb-42ff-a78a-08da3f1c6700 X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[aherlnxbspsrv01.lgs-net.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR06MB7156 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The sensor can set the scales by writing the range register 0x41, The current driver has no interface to configure it. The commit adds the interface for config the scales. Reviewed-by: Alexandru Ardelean Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 33 ++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index fd812802b71d..73c1e2aecd7e 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -240,6 +240,21 @@ static int bmi088_accel_set_sample_freq(struct bmi088_accel_data *data, int val) BMI088_ACCEL_MODE_ODR_MASK, regval); } +static int bmi088_accel_set_scale(struct bmi088_accel_data *data, int val, int val2) +{ + unsigned int i; + + for (i = 0; i < 4; i++) + if (val == data->chip_info->scale_table[i][0] && + val2 == data->chip_info->scale_table[i][1]) + break; + + if (i == 4) + return -EINVAL; + + return regmap_write(data->regmap, BMI088_ACCEL_REG_ACC_RANGE, i); +} + static int bmi088_accel_get_temp(struct bmi088_accel_data *data, int *val) { int ret; @@ -373,7 +388,13 @@ static int bmi088_accel_read_avail(struct iio_dev *indio_dev, const int **vals, int *type, int *length, long mask) { + struct bmi088_accel_data *data = iio_priv(indio_dev); switch (mask) { + case IIO_CHAN_INFO_SCALE: + *vals = (const int *)data->chip_info->scale_table; + *length = 8; + *type = IIO_VAL_INT_PLUS_MICRO; + return IIO_AVAIL_LIST; case IIO_CHAN_INFO_SAMP_FREQ: *type = IIO_VAL_INT_PLUS_MICRO; *vals = bmi088_sample_freqs; @@ -393,6 +414,15 @@ static int bmi088_accel_write_raw(struct iio_dev *indio_dev, int ret; switch (mask) { + case IIO_CHAN_INFO_SCALE: + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + ret = bmi088_accel_set_scale(data, val, val2); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + return ret; case IIO_CHAN_INFO_SAMP_FREQ: ret = pm_runtime_resume_and_get(dev); if (ret) @@ -414,7 +444,8 @@ static int bmi088_accel_write_raw(struct iio_dev *indio_dev, .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ - .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ + .info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SAMP_FREQ) | \ + BIT(IIO_CHAN_INFO_SCALE), \ .scan_index = AXIS_##_axis, \ } From patchwork Thu May 26 13:33:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 576316 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 A1D83C433FE for ; Thu, 26 May 2022 13:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347549AbiEZNeN (ORCPT ); Thu, 26 May 2022 09:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344624AbiEZNeK (ORCPT ); Thu, 26 May 2022 09:34:10 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50101.outbound.protection.outlook.com [40.107.5.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE958D9E81; Thu, 26 May 2022 06:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCcQWcs8W6vB0tqn4mm7xgCxpcfmdUaotFCsYfdTJGH+7EAp3/z1Cpsfdfy2HsuhoODtPcgnTBZYPadSgjMqcaSOHCuz87Jj7u1QukhnelAXg8y0PJspXR6adZ1I/V/Pl3E6v5qPdEOQVKJaKx+bqV1nnYcPh47NHNgxiGKhCV79hglWnNwrMQTCQPOjV4Y6Nm7Qce1c5JrOtXTlfUjl4D6aPoqVAmZXtwOTxQck0mbSVXS3LC9q/pW3/1Nmv9r5ljOw5bYatimKBLJyVCmrciuuBPg9kO+dr2MDvuTAjxnrYNBtDO0xoyd1qQ6uOo0OvhO2bJdl8O803NRFW4CwAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=mgCGdDDBSAqvRcdGjnIEp9nn9rDOS1bL+oaOpqShqpc=; b=mniGKrLXsQVbo8DrJUDdLMBov7MHN7yBXjfk1fZMBn965zkxLuXMVB0XUzC1duN0FdcpU8xWTNwh+EDDZEn+OtEQzEwsHTQk400ETIVxCAkWxAQ3VHSxLHP4D2d4djcHvqQD7qdHiW3Gr9dmkYnGrIjxevex+U4bw5di6Yl1MQ89CrihBd83qhSigZip4C66Pyvjo8KRf48mQhaFjHJp84WLr1bYs1KUbkwY30UdBHKliJxRnnqza2kWzZo9AQ528Xl1WsR80EYscvAUxFnwx4v7poQD2p58jIZi1vrBhs8WZiAzISj9c+lYa3N9z57xyWbMuyzmqpLEW/MFzoR8wA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=kernel.org smtp.mailfrom=leica-geosystems.com.cn; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=leica-geosystems.com.cn; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com.cn; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mgCGdDDBSAqvRcdGjnIEp9nn9rDOS1bL+oaOpqShqpc=; b=EWY0Ve5po+jIL61PFhJuR7O15KCCA/9AHFOHdpje0lbyttcFicwgaL6wZxcYw9fgXHVXzpFaFWOSYbLUhbynUlutQhwK6Zhrjfajfplve2yDTsPtDE8zBd0muo4pMUdYNAsf4AIyWU/i1/0CNDlCK71rzgENS/BQslV1aqwc/VE= Received: from AS9PR06CA0001.eurprd06.prod.outlook.com (2603:10a6:20b:462::31) by AM6PR0602MB3525.eurprd06.prod.outlook.com (2603:10a6:209:6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 13:34:06 +0000 Received: from VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:462:cafe::ef) by AS9PR06CA0001.outlook.office365.com (2603:10a6:20b:462::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com.cn; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com.cn; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com.cn designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=aherlnxbspsrv01.lgs-net.com; pr=C Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT025.mail.protection.outlook.com (10.152.12.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:05 +0000 From: LI Qingwu To: jic23@kernel.org, lars@metafoo.de, mchehab+huawei@kernel.org, ardeleanalex@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Qing-wu.Li@leica-geosystems.com.cn, robh+dt@kernel.org, mike.looijmans@topic.nl, devicetree@vger.kernel.org Cc: thomas.haemmerle@leica-geosystems.com Subject: [PATCH V5 4/6] iio: accel: bmi088: Add support for bmi085 accel Date: Thu, 26 May 2022 13:33:57 +0000 Message-Id: <20220526133359.2261928-5-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23bd680d-468b-4a32-b0c4-08da3f1c67cd X-MS-TrafficTypeDiagnostic: AM6PR0602MB3525:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hlhC+S2OsPP83jQWbEhLWP+v65+8CKISy2tikHFOvHtQZX5X4gakvZoBsXkB7FJbJC91MIuCatN4Q3yo2p3L5Waf9ge/ELHpAlziCICv9gWESzn+BoXZmJp3ivxC5tiDwVseDbyrPf8QGQGNnU+EN2sR8Wx+VI947C0nZeUe+7zdfX6i/7MZlT88pcqW6BidUYHcpJSuugc5LaECc0IdzEjH1U/GiDUs/rm+ix23WoGsek24+GkTf3EWdhysUTK6QdJLEGkUxkIKHMX8FXOVPNZexX7OPwFBrtuPUofMMf2Pjn5o7MLTvV9mLgnH3hEqlY3XbXxCSfRgEjCY1QhKK5uOOShw3MwSwhoVAr3DKdfimVQRGBFP9LyhbCLWvFn2/QOsSjRdVVw7I68iQYbQvre3Vhjmylph1qpFFnn95FtNyM3wvJREQHIDg3CUdu0ohXr6Bb+kDC8j5kIFfVvuf0VrrxRjMSyVQANALSg4ezTqiT62o7PvbAI+1AkWDEw3fvb4tzVUF/g21/PU9X+Jc0fDPlX3TAJGXi7qSfSj6aGhjjDz/fcWzwUyH9nLsjnrqeJmxvPX6aEeX8IEla+d9iFgzS76pSJ9Ah97wuangWxUy4MBFQXq+5luJgUWLIX83BjCguY7zps8o96gUUYHcRdgs91azMZD/QfuWy4aEXS/DFSXB3y1FGRRFeu81HVf X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:aherlnxbspsrv01.lgs-net.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(36756003)(2906002)(6486002)(1076003)(2616005)(508600001)(956004)(186003)(40460700003)(36860700001)(5660300002)(81166007)(107886003)(356005)(4326008)(921005)(8676002)(86362001)(6512007)(47076005)(336012)(36736006)(70206006)(82310400005)(70586007)(8936002)(316002)(26005)(6506007)(6666004)(118246002); DIR:OUT; SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2022 13:34:05.7014 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23bd680d-468b-4a32-b0c4-08da3f1c67cd X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[aherlnxbspsrv01.lgs-net.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0602MB3525 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add supports for BMI085, an Inertial Measurement Unit, with an accelerometer and gyroscope. The commit adds the accelerometer driver for the SPI interface. The gyroscope part is already supported by the BMG160 driver. Unlike BMI088, the BMI085 accelerometer ranges are +/-2, 4, 6, and 8g, the scales are calculated as 9.8/32768*pow(2,reg41+1). Reviewed-by: Alexandru Ardelean Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 7 +++++++ drivers/iio/accel/bmi088-accel-spi.c | 2 ++ drivers/iio/accel/bmi088-accel.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index f6e44b36f5fc..f6ecb081456b 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -465,6 +465,13 @@ static const struct iio_chan_spec bmi088_accel_channels[] = { }; static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = { + [BOSCH_BMI085] = { + .name = "bmi085-accel", + .chip_id = 0x1F, + .channels = bmi088_accel_channels, + .num_channels = ARRAY_SIZE(bmi088_accel_channels), + .scale_table = {{0, 598}, {0, 1196}, {0, 2393}, {0, 4785}}, + }, [BOSCH_BMI088] = { .name = "bmi088-accel", .chip_id = 0x1E, diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index c77aec01bc67..b14a1e5b986a 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -62,12 +62,14 @@ static void bmi088_accel_remove(struct spi_device *spi) } static const struct of_device_id bmi088_of_match[] = { + { .compatible = "bosch,bmi085-accel" }, { .compatible = "bosch,bmi088-accel" }, {} }; MODULE_DEVICE_TABLE(of, bmi088_of_match); static const struct spi_device_id bmi088_accel_id[] = { + {"bmi085-accel", BOSCH_BMI085}, {"bmi088-accel", BOSCH_BMI088}, {} }; diff --git a/drivers/iio/accel/bmi088-accel.h b/drivers/iio/accel/bmi088-accel.h index 65338a1bf97d..044999eb4fd6 100644 --- a/drivers/iio/accel/bmi088-accel.h +++ b/drivers/iio/accel/bmi088-accel.h @@ -9,6 +9,7 @@ struct device; enum bmi_device_type { + BOSCH_BMI085, BOSCH_BMI088, BOSCH_UNKNOWN, }; From patchwork Thu May 26 13:33:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 576315 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 61B87C4321E for ; Thu, 26 May 2022 13:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347557AbiEZNeP (ORCPT ); Thu, 26 May 2022 09:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347552AbiEZNeO (ORCPT ); Thu, 26 May 2022 09:34:14 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150131.outbound.protection.outlook.com [40.107.15.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BB50D80AC; Thu, 26 May 2022 06:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DB8B2L3P5fmkkzey3BvQCrXpvKiIrBc73m45xwbL/lYtte5excDXTyOb3+kcCWf2RwoPPtD3JDRcsfEZYo0JkMOyEbuqYq9ys08s4zdc+7+xR1vfa7iaCI0fhq+n6ryvjG0bZv4d9wFqTn36jeC2Up8TQ53iXmbMzCl9clSNQaqrAuDFDzMYbBiJ+nbwxf8KFk6h60lT3Tz5g/XBor1y4knU+UOeBzlWKNSKHveyQzleiayxO5yyJgSzmbb3RoQGUTPK3c57dfsd5/Vqhin4z+Rn8UH8cPp+MV2oufHRuWjHvFLDFW1oiAq+fxAE1LA90mHNQVJFxF+eHSPnzD47Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=MgOWtc0h84OfR0/XgjFODhvBKtLJ+qAcjYntEln1lJc=; b=P2zVj9yvj/mcCnk7PUbkdyBmkbFBy/UBbpGBYckkLAh34ExrkC4XT9V+P+d+Hre/J15dmS6PvVcYoQjKvHef0rXo/Sw982TkOw8TX4DaY7Usba7psslVAX5cgtvdr6qUNiO9nkmHDmLawu6eNE76XAQAjzsdE7Oiu1pfgP6fBqyPefeyXsOR8EKopc3Y7UskOhcbukFUSNwIH5pQ8+2WA2PJXtaoGOpw5v5+mq/NUOBTAvKzIemFUsg2W3SJFXN3fAYwA0JDbPeskckvi9PHdcxeZh4yrIvunrY5eJnbtjh3G5ZdqSsSMjnLuLeVTXVZ9yHQyGtANonw29fkR9kDQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=kernel.org smtp.mailfrom=leica-geosystems.com.cn; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=leica-geosystems.com.cn; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com.cn; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MgOWtc0h84OfR0/XgjFODhvBKtLJ+qAcjYntEln1lJc=; b=LkPwP9cPR8xmbPbmdhEIV9foJ9Xr1aDHGinMJHBGxjQ4dNz/i5fe5KPNzpMEXaIcDULjmfR6deM+Ps/Oec2JZWcRZ9fykF7I2ezLObn8eaOU5mokwj+MLVAUHMAs0hEovFOtlWs7qOHeUThxVxL2vBrJcgw8tg4mS8ggs+dUuBU= Received: from AS9PR06CA0018.eurprd06.prod.outlook.com (2603:10a6:20b:462::11) by VI1PR06MB4430.eurprd06.prod.outlook.com (2603:10a6:803:5a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 13:34:07 +0000 Received: from VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:462:cafe::99) by AS9PR06CA0018.outlook.office365.com (2603:10a6:20b:462::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Thu, 26 May 2022 13:34:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com.cn; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com.cn; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com.cn designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=aherlnxbspsrv01.lgs-net.com; pr=C Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT025.mail.protection.outlook.com (10.152.12.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 13:34:07 +0000 From: LI Qingwu To: jic23@kernel.org, lars@metafoo.de, mchehab+huawei@kernel.org, ardeleanalex@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Qing-wu.Li@leica-geosystems.com.cn, robh+dt@kernel.org, mike.looijmans@topic.nl, devicetree@vger.kernel.org Cc: thomas.haemmerle@leica-geosystems.com Subject: [PATCH V5 6/6] dt-bindings: iio: accel: Add bmi085 and bmi090l bindings Date: Thu, 26 May 2022 13:33:59 +0000 Message-Id: <20220526133359.2261928-7-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220526133359.2261928-1-Qing-wu.Li@leica-geosystems.com.cn> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d171cc8c-10ad-4875-68c5-08da3f1c68ca X-MS-TrafficTypeDiagnostic: VI1PR06MB4430:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZP2hpFKF7oZ43SZk825UTvw47rDxne4vPo2Impd44PNmcHIFZfAX21mU+6Tp4S3UfmuggnYc07/KIhoeg1Z8SM5ZzDt5uLFMp2F5R/vWF9GurswIyd9bXEj8Bs4U4oatWgiJu3Gf/sKM4GPkSQ9vLQMn7gIlw9pxNIgVHNBSAlGzbhmnny5KxZ4vwOwd7b8PmTSzY5EHm0iqs5DWO5jxx5kfvse90gHjyyFONTtsaz5yVy7gJLh/wTA1aVOzRKZerNllpiYnvrGBVwBM5Ul4RuDIaT+2dof1waFRbLNDhZzF0AFnsVu+LokcsYYqtEdjgHgco8IVnoFHE1W36o1lo0k41DTeMZjO4quZNPgW+9j/KkIseOI+Wh4zy3mvniXwOjuVj99wE2uDtTFidez6M8MVdnaOBpccsD5XU1yRQP36zx4Jfy8+QDAAklYZZWmGvQC0e1USyhJ4YyqZQZ4Y+dYqMAnquNb/6fAT7KAwwOgCIbnN4NFIY67w85K+vLZH+hR9LktX2UAaaVU8uiHn55Mxc1ijVEPM7R07a1zS0WGvLylgUlgaQIzIZeuC0yKHzQLkd1yCowxDhXapyZxdr2yPrlh5/n64/x188fahLN2PsQyP/xYtEJRyZtUjxUn3+tlIRFW/2vKcMYZnHYlnb9AnNu9ZjH3C7i4LcuRwhc1+Drdm5fr4QMEhVMe+S8BW85Tp/JlOydjUOf3PKHUj5V0WYnrsC6c+YQ3XpF/TTUsUo9TQQeaq4H/19nGd9Uo5zbAP57g8RpHcdCCJRKRlxMerawasN0UFxccJDirz7iM= X-Forefront-Antispam-Report: CIP:193.8.40.94; CTRY:CH; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:aherlnxbspsrv01.lgs-net.com; PTR:ahersrvdom50.leica-geosystems.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(186003)(1076003)(107886003)(336012)(921005)(83380400001)(356005)(81166007)(36860700001)(47076005)(8936002)(118246002)(36756003)(5660300002)(2906002)(4744005)(82310400005)(70206006)(6512007)(70586007)(508600001)(8676002)(4326008)(36736006)(2616005)(956004)(26005)(6506007)(316002)(6666004)(40460700003)(966005)(6486002)(86362001); DIR:OUT; SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2022 13:34:07.3576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d171cc8c-10ad-4875-68c5-08da3f1c68ca X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a; Ip=[193.8.40.94]; Helo=[aherlnxbspsrv01.lgs-net.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT025.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR06MB4430 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Adds the device-tree bindings for the Bosch BMI085 and BMI090L IMU, the accelerometer part. Datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmi085-ds001.pdf Datasheet: https://media.digikey.com/pdf/Data%20Sheets/Bosch/BST-BMI090L-DS000-00.pdf Signed-off-by: LI Qingwu --- Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml index 911a1ae9c83f..272eb48eef5a 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml @@ -17,7 +17,9 @@ description: | properties: compatible: enum: + - bosch,bmi085-accel - bosch,bmi088-accel + - bosch,bmi090l-accel reg: maxItems: 1