From patchwork Tue May 10 14:17:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845092 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 A7C24C4321E for ; Tue, 10 May 2022 14:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345273AbiEJO5Z (ORCPT ); Tue, 10 May 2022 10:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345563AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50131.outbound.protection.outlook.com [40.107.5.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5AAD24EA1D; Tue, 10 May 2022 07:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJv7MgTsQPsDgjgZKF/ZLwpJ3P/mdDgP6E5FRXotI8ESDA8G1rT8WfJ9J3vvgiN8yL0SgC2hNHO2CD1un4SV24YbL9dNpHK0KrGziWlgQg8s9oG3NEHN6RSrzR4WJOfPncemJUo/8Mfoh1YJ5nxJKVA0Mdjjurt6eOVj0pSzEF0pI6a3cnHlJ9NRdvul/PvEhfsCDHY7+dQqv9hgANyARA5Uj66QmUPGhxW1/xAA+gpVz+Bex9IM7v5m8vN3taJyyFF21v8nRKz8s+XTiwqE7lxY3jpO9oMXWxzaPQ/ZkMrUxsE6LabRoJ+JsgUZlgcjxNaixPW1Dc6bjxNv5pw80A== 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=AdlnJKotzwLcTK+w90fDGpieY/qimhwVO2XrhgD2/cA=; b=SBaakzde4JXhMNj4SGXnOLG++hUXPxy9JKiOXdVhnmQMEXK0ZT1ozbM9fW+PcumO1iOXcDtSjjBCrbNcIri3yaRRZHGOyPJHtmUGoF3CfJ+Km0QgFibZ3i2yI+/zFjQYOYsAwOHGcwCfzNCYzSIniL2KI6A51kVMoCqnC89bR5TD05MoNJAs97BRlP+E58MB0Vo3/vMkKstT0DvbvMpBQYKKviGByfO2BFqUKCnGYEm/xhZ2lgqPzS9SrF6M1h9sQy/Y8ae2MA6UeBUhEEuZEtY0iRtEl0NUrrBFSzDb74bPORpZRdfDErXrGOjBDspfF5UDtzK7XB90vnMs1ru7Tg== 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=AdlnJKotzwLcTK+w90fDGpieY/qimhwVO2XrhgD2/cA=; b=hXhOtBT9UbhAq8lZGY41q9e11krBS+ItTKLW1x16zjOyv07QRAufWCDxno23lVBeNLbwAHkKJI8lTbPXG/d5xzfr1jZl+9yD4uR/UyHfvUzOfz3V7HNcPJBD0708raS1rMNTtWECNHmQuRtmEytYbBwYmO6utcf3mvpk3J/w7kM= Received: from AS9PR06CA0341.eurprd06.prod.outlook.com (2603:10a6:20b:466::14) by AM0PR06MB6337.eurprd06.prod.outlook.com (2603:10a6:208:174::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Tue, 10 May 2022 14:17:57 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::7) by AS9PR06CA0341.outlook.office365.com (2603:10a6:20b:466::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Tue, 10 May 2022 14:17:57 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:17:56 +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 Subject: [PATCH V2 1/6] iio: accel: bmi088: Modified the scale calculate Date: Tue, 10 May 2022 14:17:48 +0000 Message-Id: <20220510141753.3878390-2-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: 1c10b9ae-9c40-45d0-e3dc-08da328fe183 X-MS-TrafficTypeDiagnostic: AM0PR06MB6337: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: txXvBx4SlAMRMOnoQ5VEG1yAGBqfK5HGglmIl0axVAUaZpTSqbop6aEDDAgsgyCXFnk9gXdbTz1cjW6DlF77q88rW0HuVraL5Q+m+SX7rQHpmQDcNesdSNJjekMraNFRELBHilL//Rt4SrtweLRzA332SHFhEFBlv0eHu2oT1xtFV+6yKc82XrKke71VQ+tkfIBvNDLHievwTpMYUbwZ4/0bWa39dpCju+WxqWT/pEhPxwLqTSTh0XU+hSOM9qyWvdBELWtnE/9SwNTdToH99LjtDtxRNcXc9ko3TiBaC/1TEX+W1HjqmrVfnynJGhq73rJAVTPlZi8EOHIgKAtQfM7xMA3pUZYGjlK6I3u/ILW4xI2NAXkXuk+d0BrHvLu92H3vYQo6udIHzn0HDSNn17JCwwCvysM7u46TU7UQX/exfgCAVxNLJKm8otfqS+iUg0Qd7zcKWvZvyCs80GTnbC1B2s6TYop7ImkSTFJXXUaayCoRwlX0I66wlN7eItOonjrV7WQHigMzJy6uyt/vF59brWh4w15zsBXFmRy1DjVsSgPgJa8wHJgra+qujGuCOFI5HzK3dBf6XjbubkZPzrzbgTRSFDxpsyMNwhIhISZp9jOi7pIB61Zy4ygs5ftSqQCt52R0GnZhbOvyta/836JbYccQVekgq+kLXi2QL7fj6e0a48NZPpKdakaf4SGsbTBf7GJCs1iHR1RNX3fsWA== 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)(40470700004)(36840700001)(26005)(81166007)(8676002)(86362001)(6512007)(36860700001)(956004)(2616005)(6506007)(118246002)(6666004)(2906002)(356005)(6486002)(921005)(83380400001)(316002)(1076003)(8936002)(508600001)(40460700003)(5660300002)(36736006)(186003)(36756003)(82310400005)(70206006)(70586007)(47076005)(336012);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:17:56.9232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c10b9ae-9c40-45d0-e3dc-08da328fe183 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR06MB6337 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 formula to a scale list. The scales in the list are calculated by 1/sensitivity*9.8. The new units after the application of scale are m/s^2. Signed-off-by: LI Qingwu Reviewed-by: Alexandru Ardelean --- drivers/iio/accel/bmi088-accel-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index a06dae5c971d..9300313b63cb 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -119,6 +119,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 +281,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 +332,12 @@ 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; + *val = data->chip_info->scale_table[reg&0x03][0]; + *val2 = data->chip_info->scale_table[reg&0x03][1]; + ret = IIO_VAL_INT_PLUS_MICRO; goto out_read_raw_pm_put; default: @@ -432,6 +433,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, 1795}, {0, 3590}, {0, 7179}}, }, }; From patchwork Tue May 10 14:17:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845094 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 DCB00C433F5 for ; Tue, 10 May 2022 14:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345309AbiEJO50 (ORCPT ); Tue, 10 May 2022 10:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345564AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70102.outbound.protection.outlook.com [40.107.7.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D961A24EA3A; Tue, 10 May 2022 07:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8wWBgK5xw87XbT1t5OC65XjQQFUCykfZUPKjsfWkaRm9C/XxwLccK5NJvKpspqY00YIF/KeGOIziNKp3evl0mNQXzntR4HvPM7+vQqHd059pTrnmyRb8485HoYFOMADGP6kfzqBF5KRcNtCHSph8hl4Nj7yc5uTkaU0eCbH9q0PzzOsTQ5rYztNIwnjeNM5Ef4u/AICWgpJT1EYB9rxHARvw6QP9vavjaV5G8DusqYkTDQmSAEQ8npUx4t0vVD/ZJCiZHV5/XQ7EGR7aHZhDmCH5Repqyo3CB54wsDNllH8RsYVmGkdARt99fGXM2iwIrKMiv+uqnbYmN1B9LNIAg== 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=SYTEKVbUjPMn5eH+c2JWdsjS0bjJuWIkyRiz/qC/Jic=; b=SA0UR+wQzzHetUPJLkEH7yXXQvt8f6ZYlpqHmVWGxePr1T/7ykSvyuTcSFlbCSyiHag26dadyqV414Kuo5bG4jDelt2ZBG0eyDj18RFcjhgvlQ0jAP/U+3mgNsyDIOZYLDAz3Zax6xIgjtBaukt2QERkSzi+HjhZvygSNvqqZ09nLIDoRsvTupji1sGQWmT2VaIcE/0i/XySaa6uUEYF/e+2Vbtmve+CPW6cDzytpOWm2tsPX1kNlPeZiW3x8FcxJFZQTalmvSCE1CHO1B5nEGI5oP9aTtQT/FzmccjmHFnOWZo3cbhJlT/UjndHkdhqxh+TWajMw3fpm1fz+TXZLQ== 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=SYTEKVbUjPMn5eH+c2JWdsjS0bjJuWIkyRiz/qC/Jic=; b=xqT89u00HbsmCJ1rfskGoJpjqELPSQ7SgdESFdf/ZGHCCVqrO2DFzJGFgBOqVDuXRp8lMImaom7XKlGJE0pshuHtvUb7+NcBodQQWCYZpVkvBHmyjHlWgu72vEREUPjX6fd5/iJK/17k3K4MFA9/BnGR+L78E9gPc8Hn/y+VK64= Received: from AS9PR06CA0344.eurprd06.prod.outlook.com (2603:10a6:20b:466::27) by PR1PR06MB5738.eurprd06.prod.outlook.com (2603:10a6:102:6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Tue, 10 May 2022 14:17:58 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::87) by AS9PR06CA0344.outlook.office365.com (2603:10a6:20b:466::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18 via Frontend Transport; Tue, 10 May 2022 14:17:57 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:17:57 +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 Subject: [PATCH V2 2/6] iio: accel: bmi088: Make it possible to config scales Date: Tue, 10 May 2022 14:17:49 +0000 Message-Id: <20220510141753.3878390-3-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: a48117f4-e70f-45c1-7c08-08da328fe1de X-MS-TrafficTypeDiagnostic: PR1PR06MB5738: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: 8ExpKYZlYfeG82XTYRI2scJXPYdYHQIus7VEY0VyIruTMhXp36XBcsVgyYRMm4lxa5rQuKgLB5DLSTMfxFK6TY/PCafD9ulNXnMgp/5HgskH2peYW08InXEL/1iqUMAE0RTjY/nCtNIalGLJug0/WJsKlgjqed2osuiHaGXTrF8VBGC3C7MbW/EFtjglg2hPyYJXSmC4eRxb1PmIYQsr+7pZY3vzVyLmd6jiDa/lUk8Fhp4NyJ4dzv8JNkNboPJfDMQCQmtb5XoP26d45qDmY/D5ajD98Dn1OZL4lHANW5GX1cpEA5xQGZGMN3n8TR/fPwbg1hse1DEq1lut+Qkw1Agc7GYZd9Ff4FjWjlME6fLqJxZ11E7lprIszUVpPk+Sb8mSM4OBq+E3veJVHupXItgFhWrgoJzlkzdq+4oJEsUYArIA+HPqJ4nFZJ+pFtFsRO9DXjsPfbY6x0wcWZ7qBCFJ7/h0JP1jR62zNbBVEVrAfbUVT5Yuj1Uk6esGVgAwnuFMb2eVK63FT7HKAU6c/Hcc2Ys0wl4q59BI0LRK4y0DDnNmunZoTvCJ8e4WiakodXA8YTTYM0Sf/S5FKwAVGZZ3FW94y0NjWVItK4T5y/ObJltyWp1XS6PbKoOpXkho97n4Aa/aUQbul5Tgeu10LTZxk7ln+8qRxORHnZx4AazzFA8Bfj/vRf9mskfpZagY 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)(82310400005)(6512007)(26005)(186003)(356005)(921005)(1076003)(2616005)(956004)(70206006)(70586007)(8676002)(47076005)(5660300002)(36756003)(316002)(2906002)(36736006)(8936002)(6486002)(508600001)(6506007)(86362001)(36860700001)(81166007)(118246002)(83380400001)(40460700003)(336012)(6666004);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:17:57.5169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a48117f4-e70f-45c1-7c08-08da328fe1de 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR1PR06MB5738 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 | 32 ++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index 9300313b63cb..8fee1d02e773 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -237,6 +237,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; @@ -368,7 +383,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; @@ -388,6 +409,14 @@ 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) @@ -409,7 +438,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 Tue May 10 14:17:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845093 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 1C883C4167D for ; Tue, 10 May 2022 14:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345304AbiEJO50 (ORCPT ); Tue, 10 May 2022 10:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345562AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70105.outbound.protection.outlook.com [40.107.7.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65F324F0EC; Tue, 10 May 2022 07:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a5eMHorbsDu17GTg7nznZsu9tDGY0DI5EQPldpZ+oPAgo42ikg65fyCux6/LIrFRRwqmQkQPh6pnmdIXyYEhU4fNmhJCsDCvNXaSkMr3JaNLeU9QM9uikfeuOPjwGTJEh5h1hyyR+UaMqzFnIQ4mW+DPZ2lclKlKj+AI1VDBTzEGJWmo3NlPRiRlN8Nl5HNR0B2P4dvGmCRe0xxKW6ojrDcFHh0rHgUm2r44v2igkyEOSiG85Yx8okWKxFkMRVJeVVBCSX5EdggGmfkWHWWsCV6gYmQtxUBxwrCpVONXKBv8p9x1Puon6by6mrR6+ClfmuPZWVT8wZFq0MpXQpWLNg== 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=L3cMHB+LzBVsn+w7tvL/rA+OnSjsKpw6mWub0Ro73ck=; b=RijBpcToZ4MVjtRYbruIzDB/oheFAaO6lg2CXBQIc3uk+sMPC6t/Kxcjs/7VkVgL/93rWI7hsI8whquYkcUjK1l2qNmRs/VoalQcASTEJDcR92Rn7mzzEwekB3OKLjav9mIUo5N9u3Q6oV3pGRPFIkrGoPrUC8CqYkToJG+84U+73ZWZrZJR1rt26Anarb82VLzKdYf4gHRi4Kkd9ejpOLfhwTj1vDf62s8Jn8lvQ62kZdOtw6Fb4Zi+DTTRHc1Otuf0iMXpFzUt0DhUpCQkMkVtLDHYBbv+DmUXZNY55wLt0h8L2qXVF2IdkZ8iiit0Ij7b3FlRse1ZPDCi9QhztQ== 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=L3cMHB+LzBVsn+w7tvL/rA+OnSjsKpw6mWub0Ro73ck=; b=oKWoYlzvWHNPJOnE7bOZ0nHs7kQkFY/Y2TsRNLIEbZ4qfENsL8XCP9ij3xElk75jo/oiKefrO0GpSPMC94XipO7vNV9dEj+fxRP1VQqsfiW2/lxLmdeO8Ovhp0krSBO+zEQ8V+gGifcYVxTZVIfx9N+J84C5l0vTlTZdn0QPvFE= Received: from AS9PR06CA0338.eurprd06.prod.outlook.com (2603:10a6:20b:466::32) by AM6PR06MB5955.eurprd06.prod.outlook.com (2603:10a6:20b:34::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Tue, 10 May 2022 14:17:58 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::c) by AS9PR06CA0338.outlook.office365.com (2603:10a6:20b:466::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Tue, 10 May 2022 14:17:58 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:17:58 +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 Subject: [PATCH V2 3/6] iio: accel: bmi088: modified the device name Date: Tue, 10 May 2022 14:17:50 +0000 Message-Id: <20220510141753.3878390-4-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: 99fbe679-65cd-4b65-26d0-08da328fe24c X-MS-TrafficTypeDiagnostic: AM6PR06MB5955: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: WnNV4LEoPfSR/C2bLGyDb1CiIo+rHjicDRqDIWWxHfWAWETapVys5LH85PVdTvFlyi9Nc5Ns/F9Z2TH7kMMMI6TC6xtcD//DGaMU+XoB4wE3cM4G4y/4sVlSreq7ghB9St6OfUjxtpTyiJ8hTXB/HIVmo0FAIeXLW9O9qEsbad0nihhfx5HOT3GGjhIRRgDkuwIKFdjESnEPLUioo4ak9VtL5ymuUL+3l0b7ljeqBVOi82OLceczU7UNH5dB7U15OqsWZIviSeKOQ4PwdWhboYXggCIU+tvKvZBrn5Yw1skU3pfEKA1Iengm8CzPh3GNm5atpm8vX6fqr4EoMe5Q/EG4lC8yTbBznTm8Uv04Apwty+DIFn9dGXdUMQ9e/lM2raKZq1G5xu+5r90jlEqiaL6Nt3Ru1cVA/wQepWnt9Lz3jS5lJ7z58SHCm0i3EpBqw6o5P9SkvZv3CwCD/dq4Jr08XtyQ2xLt1V3REsIU2aVe3p3K3B4uKy+B/VlREGEFSmI/5XBnlgYxmki706fWFjA+OSB7vJSuGHbS+ZUSV0lniRaHy7YYT9zB/0557n+ULrrd7KIWlRH/yyBTBE3XJVl+PUYmrCxfyIPbZ2koE/hSCatslnmyIhQr0mELxMz9nXrWtfd4p15mvZLEPBFLH5BHzDZIOIKmeh0/B5tECAVnmxL1jq+65Lyc8MIjprBKBQ7dzYPbMY1HdyhA2X1csA== 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)(82310400005)(921005)(81166007)(118246002)(83380400001)(36756003)(2616005)(8936002)(70586007)(70206006)(36736006)(8676002)(26005)(47076005)(40460700003)(6486002)(956004)(6512007)(36860700001)(336012)(508600001)(316002)(2906002)(5660300002)(186003)(6666004)(1076003)(6506007)(86362001);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:17:58.2356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99fbe679-65cd-4b65-26d0-08da328fe24c 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR06MB5955 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org It is possible to have multiple sensors connected on the same platform, To support multiple sensors, the commit makes it possible to obtain the device name by reading the chip ID instead of the device-tree name. To be compatible with previous versions, renam bmi088a to bmi088-accel. Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 6 +++--- drivers/iio/accel/bmi088-accel-spi.c | 4 +--- drivers/iio/accel/bmi088-accel.h | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index 8fee1d02e773..de2385e4dad5 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -459,7 +459,7 @@ static const struct iio_chan_spec bmi088_accel_channels[] = { static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = { [0] = { - .name = "bmi088a", + .name = "bmi088-accel", .chip_id = 0x1E, .channels = bmi088_accel_channels, .num_channels = ARRAY_SIZE(bmi088_accel_channels), @@ -524,7 +524,7 @@ static int bmi088_accel_chip_init(struct bmi088_accel_data *data) } int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, - int irq, const char *name, bool block_supported) + int irq, bool block_supported) { struct bmi088_accel_data *data; struct iio_dev *indio_dev; @@ -545,7 +545,7 @@ int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, indio_dev->channels = data->chip_info->channels; indio_dev->num_channels = data->chip_info->num_channels; - indio_dev->name = name ? name : data->chip_info->name; + indio_dev->name = data->chip_info->name; indio_dev->available_scan_masks = bmi088_accel_scan_masks; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &bmi088_accel_info; diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index dd1e3f6cf211..0fed0081e1fd 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -42,7 +42,6 @@ static struct regmap_bus bmi088_regmap_bus = { static int bmi088_accel_probe(struct spi_device *spi) { struct regmap *regmap; - const struct spi_device_id *id = spi_get_device_id(spi); regmap = devm_regmap_init(&spi->dev, &bmi088_regmap_bus, spi, &bmi088_regmap_conf); @@ -52,8 +51,7 @@ static int bmi088_accel_probe(struct spi_device *spi) return PTR_ERR(regmap); } - return bmi088_accel_core_probe(&spi->dev, regmap, spi->irq, id->name, - true); + return bmi088_accel_core_probe(&spi->dev, regmap, spi->irq, true); } static int bmi088_accel_remove(struct spi_device *spi) diff --git a/drivers/iio/accel/bmi088-accel.h b/drivers/iio/accel/bmi088-accel.h index 5c25f16b672c..c32afe9606a8 100644 --- a/drivers/iio/accel/bmi088-accel.h +++ b/drivers/iio/accel/bmi088-accel.h @@ -12,7 +12,7 @@ extern const struct regmap_config bmi088_regmap_conf; extern const struct dev_pm_ops bmi088_accel_pm_ops; int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, - const char *name, bool block_supported); + bool block_supported); int bmi088_accel_core_remove(struct device *dev); #endif /* BMI088_ACCEL_H */ From patchwork Tue May 10 14:17:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845097 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 70A72C433FE for ; Tue, 10 May 2022 14:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345328AbiEJO5n (ORCPT ); Tue, 10 May 2022 10:57:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345565AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2111.outbound.protection.outlook.com [40.107.21.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E6A237276; Tue, 10 May 2022 07:18:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lZzi5LUULo98sYngxuUKHGy/BMG1ISPFdJT60Pri5hGnbqGecoEHoKhG40A7fBEuOsrg3117xTdv0Z0B/UYL62KQ2e50YcBnW8ZnhqyMwNAg0XSFVvi+S6lnxUCtZkWPC74MRid8q+fCqwadfWdRmdjXHuXEj5H0DDxE77lmSVxILrw1yq4UxbprKO305nhSuSQiwynbicShAiFlpLi+rGZ3/ufrPGx6M/Lchhxa9Dkf0PhvhfLrsWgl7k9vtOKzBCGGW8tt45lfNMda/b24u81Qvj7v5YOnI9sOMjxVj56DmlIRwA74izu8LUC9mAUW2TrqrC6OHwwYWLnIAe3M/Q== 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=7A7WWVA43TAKcQUTkVh7sMPLv6MeYPk75wIlP1Hoxeo=; b=i3LTKnSOQ+2NZff9bxgz1pCmYXH2e42DP2fLpoVHnF7mcqTpWgcnCUo+R+OX0LfhlR3TscnqHtNUI4I86qgQ0IltLXmGOGePPeU9QUEu+YjNlpzfdoQSLeMZX9kZpuVelZJf0K9M8/Vi9SMVmJIpjFcDRRCfRixh4DcA47CAkaphSNbQtb1WE1yv/gBAhGpE4+UdOF4IsFGRtHWLWFsYEFrOmMxOJRofQwIWE3SgnC+qfz64p+RqetmmKwZfS7TuXZh3V9GuBU0M/3qU34PDY3BPqkMlqLj+XK6thOVxoxkrF97jA5q10ShmB4fXEmq48yQ0zPiZWLTfLYQTsWJl1Q== 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=7A7WWVA43TAKcQUTkVh7sMPLv6MeYPk75wIlP1Hoxeo=; b=LdlGjhilojU6Sc0iqJV23uWZJMqy4fMjz51lVwpJ0w2KhFW7itQoZFt/SSG9Y4i94PLyZRx9UTpgROwPbdqktBVErVLijHTwD4aKmx7cjxyHjKwbH2icaG7CDz8nZZZDijMubSSBubjxvQx9jHoTUNFt/DwxnZSnwGK4F2dR45E= Received: from AS9PR06CA0338.eurprd06.prod.outlook.com (2603:10a6:20b:466::32) by DB7PR06MB4695.eurprd06.prod.outlook.com (2603:10a6:10:57::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Tue, 10 May 2022 14:17:59 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::70) by AS9PR06CA0338.outlook.office365.com (2603:10a6:20b:466::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Tue, 10 May 2022 14:17:59 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:17:58 +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 Subject: [PATCH V2 4/6] iio: accel: bmi088: Add support for bmi085 accel Date: Tue, 10 May 2022 14:17:51 +0000 Message-Id: <20220510141753.3878390-5-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: 123d3e46-02c9-455e-4852-08da328fe2b0 X-MS-TrafficTypeDiagnostic: DB7PR06MB4695: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: F3xAy7fmf7Gq2tPShBuo4E8L9coojDlxVesNkulc374ovQED1cbUuZaalHfYjLmYdYSh7Yc3cSLI+rb/PVLk/kkeUFOhkDe/gusW5GEj+ceE9vXeq0D8nl8FdCioMffTTp47Gt/7kzJacRerV0NXSjmPyMkzUeRpXhwjSNuDVhctin1zuvElk140Y+4JSL7lQVdo/fgmHl53lBrg1spdY0jsm0tSujXG+FO95fZflRlIYA+kGNkX2B5/R/Nm39vb88U1usvUNRyqwtg5N0BGJFFpT9WBfr+lQbwOXq7bPiiRUsKXPNBeqfLaAyeOa26gUx6ZX98PzCXmEpD26D77NCeTgOwa/Ks1KkwAvlHtCjoHFr7Gd54Ozjpv8yEd6ywpLGOW5+kRcOuWfIHl6eHvYtiOMCJA9aQpAWJudInD9GqMNYeOMNYy2vTXcML2JOZqNMz3+QQTrpAqeG5S0Yh2p5qveasxVPdEsjnDbaufw0f9urOXVSzIyoaVfncFzXMeRZmtZdiC+lTFdwlo5YLyFBbR1AJZRsxJerxo1aviZ8aLC5GFdjFaIDyYpaihI4/q4H6WP8UVPV5CbBN+aw7+Q8uwy4gSJLrSQ1nzUan7pTv69aiqCEWiZFjWMXmoNbVj0shG3Q2pch+DL78oEsm7wj0/2cXKe15trUwng9GqnklqR1o38XHXlD5sniUkGS8EilbKT11BA1vOj/IyeBDMLg== 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)(118246002)(5660300002)(6506007)(6666004)(26005)(70586007)(8676002)(70206006)(6512007)(2906002)(8936002)(47076005)(186003)(36756003)(336012)(82310400005)(1076003)(2616005)(956004)(36860700001)(508600001)(6486002)(86362001)(921005)(356005)(316002)(81166007)(36736006)(40460700003);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:17:58.8918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 123d3e46-02c9-455e-4852-08da328fe2b0 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR06MB4695 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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. Different from BMI088, the BMI085 accelerometer has the range of +/-2, 4, 6, and 8g. Reviewed-by: Alexandru Ardelean Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 7 +++++++ drivers/iio/accel/bmi088-accel-spi.c | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index de2385e4dad5..13bb3d96a3a6 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -465,6 +465,13 @@ static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = { .num_channels = ARRAY_SIZE(bmi088_accel_channels), .scale_table = {{0, 897}, {0, 1795}, {0, 3590}, {0, 7179}}, }, + [1] = { + .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}}, + }, }; static const struct iio_info bmi088_accel_info = { diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index 0fed0081e1fd..e7a1daab8f3c 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -61,6 +61,7 @@ static int bmi088_accel_remove(struct spi_device *spi) static const struct spi_device_id bmi088_accel_id[] = { {"bmi088-accel", }, + {"bmi085-accel", }, {} }; MODULE_DEVICE_TABLE(spi, bmi088_accel_id); From patchwork Tue May 10 14:17:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845096 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 67BE1C433EF for ; Tue, 10 May 2022 14:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243034AbiEJO5q (ORCPT ); Tue, 10 May 2022 10:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345561AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150125.outbound.protection.outlook.com [40.107.15.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 299D524F237; Tue, 10 May 2022 07:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LC9qFwWYORGGl5pzsOQk1ItxvfLqLdM2iM/K9OiJfQpfgE1VJClTbFpxo6MB5zfinrDDsFoHbNJvNCpL0P7Wd1QvdHT2HzVLvg/10SNmw7ARXbzIs+xaqNQutIeyX3VxiluSFxOAinNqw85I34cZamBsTWdnm5jNwXah/+guGVdYwUzRKupHtZc2DuMbQ1sP/PR2zBpLW1z0tbB7zjlABHXKNQbkBg5oe/GXU+V4Z/MF2nJbzz2CCXegvWq9AHVD1kpypD8++wwX2DsRTK9zihass2jtl0DewMH+t3J2e/Uh13uDo6ySjv1v15XvWAuPGoreWeETw6lZ7zo0Er7BHA== 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=rePnLGKrCiQJJOX1zpZir3zA8/cvqQHZMrJeaP6b1RY=; b=IMB2XgYDb5N0yGCUWhW5MS9NsHiARRE0REj7fDdcoEBhSip1MHfo9/+Yg5CDso15FV6tJqp1H8hskFziTLzYfX1hAnjGRw6bxffGJ42Az8EnPcUP2iqzG0SaXMfeZ8zPGA4dha0GiLJiFziewsA1x9Ke+e6uejsuioycAE1kRZ0H9Y3rVNPbx3M+4DdtbaJ0IjYViEjxXybBdjBaJMqUByEuYPo+i5gQUqqGXLtcCU4Zoq+97YElrp7Coz9VbVHV9UIRLonqMx36Pb8D3FCrJVz0LgdTzSD+yHKkY540M6c4b7vUWhEFW1Oo9fQWbRr+IaHkyqB86xx0PKKuQd5Kug== 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=rePnLGKrCiQJJOX1zpZir3zA8/cvqQHZMrJeaP6b1RY=; b=0Triu3Gj7KuHMmVyRPpxA8BRAh6d614uXivwMC4+pb9BH9rANp0sooJzyrltSWqUTHMkpmc7FU6lhSFefRPiztfhbwjkZwXWWxp5NFPVgc6c/klgPMvJRg5JbzdQlcVgoagt7KdSF7gxz7FiR/iZE/9u6XakW9oT0F4mFtRcq5c= Received: from AS9PR06CA0332.eurprd06.prod.outlook.com (2603:10a6:20b:466::11) by DB7PR06MB5337.eurprd06.prod.outlook.com (2603:10a6:10:77::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.18; Tue, 10 May 2022 14:18:00 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::8b) by AS9PR06CA0332.outlook.office365.com (2603:10a6:20b:466::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Tue, 10 May 2022 14:17:59 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:17:59 +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 Subject: [PATCH V2 5/6] iio: accel: bmi088: Add support for bmi090l accel Date: Tue, 10 May 2022 14:17:52 +0000 Message-Id: <20220510141753.3878390-6-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: 51eb8d02-6d5b-4d62-1a0c-08da328fe325 X-MS-TrafficTypeDiagnostic: DB7PR06MB5337: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: T4hupG6XmGK2Rs6V5Gbi7N+rm2T1zK8dBXgrNMDAafzoK9nK6vilhbQd67jBSjKkzhGr9Io+8tVVM//9DfFG3CeebBgBjSzn+hQS9el6JBECHsK+8bbPH/qgqnF27jdD4P2I4E4tUJJUYREngMlA1vr8HXB6aIjV3xmZntukSsp9+hgdpaYIrK4oR28cT/EGIr+pMM6l2EXaSupVgR/Brk0xtdL6R9I7tUMoc27m2NtPTlQhoUGX3xu0S3oE2boZDBSqG0OSuMCtqtVg/X+gvajSAkXx2iPeOz2Q2JdYlduZPA5f02r5zxKOpSB/2ETJCf++V5q5xIB1UF1PYnGUttEuIDZQ6834mIZKKWxPBTEsy2t5kkz2MnIHqk5cu5spcTAdv2InazwFPu3NPBFiXCsM43g9AlVkxm48uzx/xz+vRK7DXYE67V/XERoLEtunNLpUkC7C6ELbF7x0kAaJ5lXmXBRoajWNfdv6Npg/NPxg6x8slfwlWxI8E8nXSueag8rxbhTvI6t6eBs/rkeH4CfP4muu5nzI3KOkvJVSChWJvoS9X1eq4/K+gynvLYvcaOlhOJL+j3zc9n/y2cYJkFNsZpWUTOkJb+vrksdmZoJX+p7za8kpWEszjR6fBaNIwZ9o1LmUcMZ+bS3gute5zMKlgOSTyCXLcsV4b9VHrgBDdaNXY2RD60SpAq/bTd5GqQBH2QZGIXvrsyfFAIvCBg== 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)(36756003)(6506007)(508600001)(36860700001)(6486002)(956004)(921005)(2616005)(6512007)(5660300002)(356005)(316002)(1076003)(8936002)(118246002)(36736006)(70206006)(70586007)(6666004)(81166007)(82310400005)(186003)(8676002)(26005)(47076005)(336012)(2906002)(40460700003)(86362001);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:17:59.6574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51eb8d02-6d5b-4d62-1a0c-08da328fe325 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR06MB5337 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add supports for BMI090L, it's a high-performance 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. Same as BMI088, BMI090L have the range of +/-3, 6, 12, and 24g. Reviewed-by: Alexandru Ardelean Signed-off-by: LI Qingwu --- drivers/iio/accel/bmi088-accel-core.c | 7 +++++++ drivers/iio/accel/bmi088-accel-spi.c | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index 13bb3d96a3a6..6d44e97b4906 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -472,6 +472,13 @@ static const struct bmi088_accel_chip_info bmi088_accel_chip_info_tbl[] = { .num_channels = ARRAY_SIZE(bmi088_accel_channels), .scale_table = {{0, 598}, {0, 1196}, {0, 2393}, {0, 4785}}, }, + [2] = { + .name = "bmi090l-accel", + .chip_id = 0x1A, + .channels = bmi088_accel_channels, + .num_channels = ARRAY_SIZE(bmi088_accel_channels), + .scale_table = {{0, 897}, {0, 1795}, {0, 3590}, {0, 7179}}, + }, }; static const struct iio_info bmi088_accel_info = { diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index e7a1daab8f3c..58be73ebd2dd 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -62,6 +62,7 @@ static int bmi088_accel_remove(struct spi_device *spi) static const struct spi_device_id bmi088_accel_id[] = { {"bmi088-accel", }, {"bmi085-accel", }, + {"bmi090l-accel", }, {} }; MODULE_DEVICE_TABLE(spi, bmi088_accel_id); From patchwork Tue May 10 14:17:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LI Qingwu X-Patchwork-Id: 12845095 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 EF2F9C433F5 for ; Tue, 10 May 2022 14:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344421AbiEJO5a (ORCPT ); Tue, 10 May 2022 10:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345566AbiEJO4m (ORCPT ); Tue, 10 May 2022 10:56:42 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10107.outbound.protection.outlook.com [40.107.1.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B069824F217; Tue, 10 May 2022 07:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AYHwaJTEOFWk0bUhwQH8yt6XYS97wi7ORm6pI2MO1UTgkq1HHta4iiks3n7W4nY2sGhdFO6lCXaCAgnLw6P6wx55xL+6wfZJZe2BYYvD/epHBF9tiPHsQK5LjmRaa9qEqlXfwrMkMuyxvBBNcMJkEHU95+dpAD81/+oxGfa168avWu47DikoohjtUe0TgDB8EFtSmAHkFTGkIbUnx8TEq9eV7IlaEiGtzFbOVD/trdzpqVZZCiHQkaTmZ0PFqAoCSRUmS0GuztMgZQdeIq7CkomcnfY71Ln//32bwOtW2EUfEAEGoUsGeTAXWHNlR4jP7Beg2sCUv7Ukyrm8b1UTMQ== 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=pJDzayEN0JebeyElP0WpVK+TgjcJr8C8bCFTilKbOec=; b=lyhn8XXwb6LHu0Q/wmtW39WsEEcdKmWAB/g5sTGYTfNAfvhHnWUg2R2q9aWCM+3V6A4YHSC+LzDeBX4/FJKiZwdUAjpT0tK0CjXBN4QVnoMolsp57fRdXBrA3BkJSuhvAn9pfKcBYoQFc2ite6i25Oizpvu7weUQTFHGiff+qWYHHCym5vTwK/6bdUaHfPA0CH9L2A9Raf4cdhLzpWCCLQgB0KCSr6j71zYHT3kFDkZfiagUELQKn9HlS70GqpkHIDylAdJNpqlJZXTE8j/lt/bj/w1KMLZxSCiVfG41bxc1xrOCb4s/gytS7PFh7+5w7mDHiHhHU7xaXY6V9R6h6Q== 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=pJDzayEN0JebeyElP0WpVK+TgjcJr8C8bCFTilKbOec=; b=mB4yPJcQntO8OfCEAvaV+Cw1KyfP6b8Hobab2lyM+Zq1Mua/JRmZDGUqeHn/U+lAE0xwUD/DsscORMAKTuD6jhs3TxuJi1M0dl/PI0R2U/Ft93CmEJo20YZrkBSf9ApBXpan/cw7NIeiusXB6hz2lmsjigzQ2aB0iEu+bvjZbNk= Received: from AS9PR06CA0339.eurprd06.prod.outlook.com (2603:10a6:20b:466::31) by AM5PR0601MB2386.eurprd06.prod.outlook.com (2603:10a6:203:7a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.22; Tue, 10 May 2022 14:18:00 +0000 Received: from VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::ce) by AS9PR06CA0339.outlook.office365.com (2603:10a6:20b:466::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Tue, 10 May 2022 14:18:00 +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; Received: from aherlnxbspsrv01.lgs-net.com (193.8.40.94) by VE1EUR02FT083.mail.protection.outlook.com (10.152.13.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Tue, 10 May 2022 14:18:00 +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 Subject: [PATCH V2 6/6] dt-bindings: iio: accel: Add bmi085 and bmi090l bindings Date: Tue, 10 May 2022 14:17:53 +0000 Message-Id: <20220510141753.3878390-7-Qing-wu.Li@leica-geosystems.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220510141753.3878390-1-Qing-wu.Li@leica-geosystems.com.cn> References: <20220510141753.3878390-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: c88501dd-c103-476e-2722-08da328fe395 X-MS-TrafficTypeDiagnostic: AM5PR0601MB2386: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: VZxzpk4d7jDE7nr61ZgsPGIy8tZQj80p5q33WZjzZhBKA0FNanFmOUxasCTW8ZtWJFkdTBPIbIgbPbck4YfwWoL38klwLKSdP1n3gq5rKW/7JBcZpAIX9kCJ1ImbP910VhNyjyU+vji37XB9haq6VBYiGGFm262+HDlVqz4ZNVeFGQrYGl1hsXOWWd6x5yP5vq85jQonLlh/bX5xZdVYlgCKYInPYtFyHNocDUNtZLneEBM+7U/UEERx/ACQ7Vhv/ytILyApFU1t78w/7A1xRLjGBOF5s/04SRSEMwPmQ8Rcjp+XOG1gR71iNMkXj8NE4+gHJUGlaGx5cVLW8IMdV0JefOgDpU9UPXsRtKwR6lrpxax4ICV9W7YET1NhHWSsn0rkMivsM+cYOjREz6o7p59a7eIM4vShNG1wE8J4SJTIJT0+VpVBZncL8Cby1LWo6HGMLR/3E+012WJ1IbB4XTYvawCNYJHU4GwsnHzind8BorSWe/YfyylKQeWnKhL/ZxyWBF9G+vur7ysEXbIhVstjgDM1JiWx2Y7i4BUnf4ZQm2VQDBZktR9iIrLtJXJyyQYNIAz+9f/7UXpbQARxfIrwkL2EEnhqilYsXuSp5ywDf206HfAOcCg/4e5up8dFJ2xkyAkV5JyPfl/5hEsaDomfDkvgCA10Omic+4WmuwpOWrGxOZo6qvgU/pPZJg+I1CLAp1mT+DWgCzgFiD0xZA== 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)(40470700004)(46966006)(36840700001)(1076003)(86362001)(8676002)(70586007)(8936002)(70206006)(36736006)(2616005)(316002)(356005)(6506007)(921005)(26005)(6512007)(956004)(6666004)(81166007)(508600001)(40460700003)(2906002)(47076005)(36756003)(336012)(118246002)(82310400005)(36860700001)(186003)(5660300002)(4744005)(6486002);DIR:OUT;SFP:1102; X-OriginatorOrg: leica-geosystems.com.cn X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 14:18:00.3917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c88501dd-c103-476e-2722-08da328fe395 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: VE1EUR02FT083.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0601MB2386 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Adds the device-tree bindings for the Bosch BMI085 and BMI090L IMU, the accelerometer part. 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..4290f5f88a8f 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bmi088.yaml @@ -18,6 +18,8 @@ properties: compatible: enum: - bosch,bmi088-accel + - bosch,bmi085-accel + - bosch,bmi090l-accel reg: maxItems: 1