From patchwork Thu Feb 17 16:26:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543493 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 D2DFBC433EF for ; Thu, 17 Feb 2022 16:27:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243110AbiBQQ1j (ORCPT ); Thu, 17 Feb 2022 11:27:39 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243105AbiBQQ1i (ORCPT ); Thu, 17 Feb 2022 11:27:38 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E1259AD9B; Thu, 17 Feb 2022 08:27:23 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id q17so10663196edd.4; Thu, 17 Feb 2022 08:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KSuUmbEeDLXS2kqjz3k+0c9MegG2g3h/fyFjY4bgFs8=; b=mSxm2wBBQzSJV97jikv7wxwCMeufivfazFsWydlImISPPEnfh857cWA76sowIR3aja fWJWAulXIkG1xOp3BpwqiBYVbHbCWKFFTY6DLpDdV+BBjdtT0O5FuxVftg3VjrdfS97r AtqlGZfyab+WbEQYD5RCoM6LEF5uDBag3AjlcHcrKxGfpFUXDTUMjrQebqd+33SR7doV G1RURDhxW4CUsGDpyTYHHKI1CyCau6XCYnSFgug+6/pkAm7SBxwCqH6LStIyqGij0QLo MwhCax51GKjbtV/6fD3Z/mU8ceb6u/gofePHvlDTbLrfo6aFDRZI3lg8lSn30ZMI+uss LFkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KSuUmbEeDLXS2kqjz3k+0c9MegG2g3h/fyFjY4bgFs8=; b=4AdJkfpW7IiXPunMAxZD3MuZvYUi+vVdhRoEDgRdBQTPoC3cc3UH54Wn5rzx3YI7fy //m/FrJ6vVnof41fBgimI9K2lamXVSrO4+HFW8bdCXdM1jSnOMpnRtiWpwGUHn43+zAT PaeRB16gTFsqJDRoaRAVjUfapZFLlI5jbhMOzT+qqg2ibh1WxtJNVNJtG/DxCyC2CWeV lo6vlfjGK2JbIfDOZCCwrHVz1XVUUVLN7JiXBj0i5TzGOycwSfloXN0MIRZ7gGVdLYFJ vWOa799Ft6PHeu6ACESpJNeGSpiFJ1i7Vfc4pJ/obQYaD1e3hRBi0A5WmWnecwF+FfA1 mczw== X-Gm-Message-State: AOAM530zQUT/bLyiwiQpTfeW2Hch1UvRLhhbsyLJHXlrzdJl/Y/qzHO0 mZWeJmadPsOmg1J1hfmR6bU= X-Google-Smtp-Source: ABdhPJzkLQa3VdybrilYvKXCKp+OQHX1LXQ2FfusdVo0VE/2wF9mlpVipP1dalBvEXpMNqYLAtU1Ig== X-Received: by 2002:a05:6402:5110:b0:403:dbc0:2a47 with SMTP id m16-20020a056402511000b00403dbc02a47mr3555636edd.197.1645115241997; Thu, 17 Feb 2022 08:27:21 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:21 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 01/13] iio: add modifiers for linear acceleration Date: Thu, 17 Feb 2022 17:26:58 +0100 Message-Id: <20220217162710.33615-2-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch is preparatory for adding the Bosh BNO055 IMU driver. The said IMU can report raw accelerations (among x, y and z axis) as well as the so called "linear accelerations" (again, among x, y and z axis) which is basically the acceleration after subtracting gravity. This patch adds IIO_MOD_LINEAR_X, IIO_MOD_LINEAR_Y and IIO_MOD_LINEAR_Z modifiers to te IIO core. Signed-off-by: Andrea Merello --- drivers/iio/industrialio-core.c | 3 +++ include/uapi/linux/iio/types.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index e1ed44dec2ab..252dbe3444cc 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -134,6 +134,9 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_ETHANOL] = "ethanol", [IIO_MOD_H2] = "h2", [IIO_MOD_O2] = "o2", + [IIO_MOD_LINEAR_X] = "linear_x", + [IIO_MOD_LINEAR_Y] = "linear_y", + [IIO_MOD_LINEAR_Z] = "linear_z", }; /* relies on pairs of these shared then separate */ diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 48c13147c0a8..387a1b5cd1a9 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -95,6 +95,9 @@ enum iio_modifier { IIO_MOD_ETHANOL, IIO_MOD_H2, IIO_MOD_O2, + IIO_MOD_LINEAR_X, + IIO_MOD_LINEAR_Y, + IIO_MOD_LINEAR_Z, }; enum iio_event_type { @@ -114,4 +117,3 @@ enum iio_event_direction { }; #endif /* _UAPI_IIO_TYPES_H_ */ - From patchwork Thu Feb 17 16:27:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543492 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 2637DC433FE for ; Thu, 17 Feb 2022 16:27:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243120AbiBQQ1m (ORCPT ); Thu, 17 Feb 2022 11:27:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243112AbiBQQ1l (ORCPT ); Thu, 17 Feb 2022 11:27:41 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF1A9A9A3; Thu, 17 Feb 2022 08:27:27 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id c6so7892591edk.12; Thu, 17 Feb 2022 08:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AUSQzyWXxaMbI2StNt6fPks9oaF2ya4dbWkQ8oow7Q8=; b=K8tHi1q0F0MS6DAc5fxAjW/gdRCCAZYCmMJAHFtP6RpvEnUE3b+opet9gSno4ViEo6 OD5z2sgTr7j0w19UzkMRzRJEjVkkEeUm0cyzz9/S6KLeaR7yYwseeDGJID/oIxRWWumZ bzeTm5NE5MCoXKR2JgUX8HmyBR6kXcPlfHcOscUqj7Exc81/zR10bMiPf04Yo5JOzmco kS2nfSubtHGnBhsrPyxVYUsl2thHNsA3pe5wvSbn07MnoRm94HQ1+R8oYRh/CozHGGcr CZUAYygKdfMWE7BX7rcLAQ+IXRaVKcideTLWr/aPR6A6sJ6vG9fLxBMLEesqivBOc1iY DnUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AUSQzyWXxaMbI2StNt6fPks9oaF2ya4dbWkQ8oow7Q8=; b=dKZk17kEeKxD9szda2hWk84gsFXTbGgN9S5KUd047p1g9gxVYpO5hutRy/PTmuNcu+ yPYYPZr6to5jItJXxK2Kw+nu2wR4wMkwrlRe2Yj0KHSFnKai5AdaL6Eke8nyFLbRngYn d4cWre1tIkmVA9RnC468PUYpAJ/Z7PPBRl3IlbHSU1nPzKfthtm5jERRJeD/oFytG4GW Xw64a18R4I6KSzRxKPO3OXb8W7d3OA3Hc2wKE996U6m+V5qaBHUULcfd35Hp7M9lr1WM R0kFgUZXxFHWv/KUd1LL4zIgdBYkM7N6dolPPJ4/ZNQXkAEY94JSk8vb17Qq6ZC5mRjW 4efQ== X-Gm-Message-State: AOAM5324qjMSMeOgYhCJfKy3fQ6g7meLwkSRJDgM6+ic2IKqfP4xTOnH OjMXc2Vn+nm2m/z6Ngo4M/8= X-Google-Smtp-Source: ABdhPJwrqGq7kWppBcG1ujF2Syq7eb/BIMxC6J3mTZy1sFxDccRqTGjlc6CR9+J99QAXAutgIc4Ayg== X-Received: by 2002:a05:6402:2922:b0:40f:7241:74d4 with SMTP id ee34-20020a056402292200b0040f724174d4mr3522116edb.43.1645115245788; Thu, 17 Feb 2022 08:27:25 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:23 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 03/13] iio: event_monitor: add linear acceleration modifiers Date: Thu, 17 Feb 2022 17:27:00 +0100 Message-Id: <20220217162710.33615-4-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Andrea Merello --- tools/iio/iio_event_monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index b94a16ba5c6c..84c90b8fdd91 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -121,6 +121,9 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_PM4] = "pm4", [IIO_MOD_PM10] = "pm10", [IIO_MOD_O2] = "o2", + [IIO_MOD_LINEAR_X] = "linear_x", + [IIO_MOD_LINEAR_Y] = "linear_y", + [IIO_MOD_LINEAR_Z] = "linear_z", }; static bool event_is_known(struct iio_event_data *event) From patchwork Thu Feb 17 16:27:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543491 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 BBE15C43217 for ; Thu, 17 Feb 2022 16:27:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243154AbiBQQ1s (ORCPT ); Thu, 17 Feb 2022 11:27:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243135AbiBQQ1p (ORCPT ); Thu, 17 Feb 2022 11:27:45 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A969D4FD; Thu, 17 Feb 2022 08:27:30 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id x5so10580035edd.11; Thu, 17 Feb 2022 08:27:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fyI2iByz/xYB8pZuuXPhbshZsKIQbcfM5MPfG9RLCsY=; b=nBs7uAcscx9WfUNJY3gcaoQY74z4LftQQuRgfAM8WoeXda5KHoWRwpyj9uvfpdhpYu vqQKGu3W67QhqnxQe/qthsJ5M3vO3kUiXdV69MaANkfZxLuQfqrylYxAACZZ3TLTGube AoNIol/LwnCNCuoPA9Vmpz07hsGheIE6HdWThoiSTzOT8PN0F4BkIaOaA2TKasmDwMZS ma2r+MJKiHyarg/iFhiccHBmTiWYX2aUShrYna0qSeeNV8uYp3D8cYUZueGPaXVK5VHD LEwyTzogmyaQxhVAUIi0CKuV5bbxaeYcdNrlSNDfGuh74hbuvNuwXgBWX7UZNMaMBs6+ tlDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fyI2iByz/xYB8pZuuXPhbshZsKIQbcfM5MPfG9RLCsY=; b=eJxnkxtp261jrXDwSrfIcIblp5l54K0Tn0gcwVQ8bBTq684Z5yAmqBISwhjPJhADNE N4pmrcTQrx0VPZbQq75dzPo4pwyGQRGuWgz0taGMUeDxCTnOdg6mXzYeiUXjSKChDYKR 3nv+Xn1fk+lAxqizTi2gNUr47hkkVQ0vRqwusC2rqMC/Fx/5UvRXuBy4kldy5PYgXbGc dUfIV9kenO+MYwDFhMNXmol1Oob1xWrxWAyqxSVD+Y5EfDQZRyyKhNKgCaN5XsTr3gHg 1GsY9bh529dwrSowRYNh4sJJYItyZJBszxyEELKhOGwYIbvMRxpbLIumxRdZsDKh/O24 lLRw== X-Gm-Message-State: AOAM532uN08CpIx/PBA2Wlc+XL+WVv+OI5ZktJSLcmz9D1nqS8xpyBre Xg4uGUgGXp+lfmcnyUYkbzM= X-Google-Smtp-Source: ABdhPJxSS5KNdV320jE2881gKcYrlsut0U5dhkFGzCu0fABv3gSNNHc+Dso7Q914nGnLlUPwIvWn7Q== X-Received: by 2002:aa7:c98a:0:b0:410:b8fa:6faa with SMTP id c10-20020aa7c98a000000b00410b8fa6faamr3508169edt.117.1645115248595; Thu, 17 Feb 2022 08:27:28 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:28 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 06/13] iio: event_monitor: add pitch, yaw and roll modifiers Date: Thu, 17 Feb 2022 17:27:03 +0100 Message-Id: <20220217162710.33615-7-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Andrea Merello --- tools/iio/iio_event_monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 84c90b8fdd91..436ac2f6b907 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -124,6 +124,9 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_LINEAR_X] = "linear_x", [IIO_MOD_LINEAR_Y] = "linear_y", [IIO_MOD_LINEAR_Z] = "linear_z", + [IIO_MOD_PITCH] = "pitch", + [IIO_MOD_YAW] = "yaw", + [IIO_MOD_ROLL] = "roll", }; static bool event_is_known(struct iio_event_data *event) From patchwork Thu Feb 17 16:27:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543489 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 AD5AAC43217 for ; Thu, 17 Feb 2022 16:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243173AbiBQQ1v (ORCPT ); Thu, 17 Feb 2022 11:27:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243144AbiBQQ1q (ORCPT ); Thu, 17 Feb 2022 11:27:46 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3723E9AD9B; Thu, 17 Feb 2022 08:27:32 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id hw13so8510709ejc.9; Thu, 17 Feb 2022 08:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pbdipNgGb568BK6JvdFqLj5QbJ/YCdKI9XyfVVughYc=; b=FDGQfbhXaaUO4B926RvwjtMRE/bI9kcTmB98/cTf39VoiK8IP0dTiIinIJLo/YylxV /KFEShizihxLpsRUXGYqHbxFrlnoO0U0+rTq4nmM5waEc+a3kbP8KVMSxp2kO/LeHm/B WXfS/4L8C7bu9HFT3G03cqKAx1KxSU5ha9Bl8alCK4vVSsrhsZYIZXwPsmmlo2gGDQl/ cpPdX74yIN60qPkxD9AdvPVXAn61GiUtOdnLRsXFNM6jPyvQ599S6vD+SsuAHlayIdtF 78CfMLgdqoC6IXvXCvmerVwgPQzPNA3Pq4a80+lSFvaQ2cDTrzFNhAnxBlNIGM43/Mjn j0Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pbdipNgGb568BK6JvdFqLj5QbJ/YCdKI9XyfVVughYc=; b=hacf/z2dr3ypIAhawvGCuonKD1W7eoONTujCYrkauiOOWqz14p/Lb5azEVGd9drEts pVaYDyN6q2GG9E7NMxZUG6+yulijR2O9SZRWfDjzf9x9cKxwvrwDtH64/+deBijDWMhG q3vXppNbZefjsSyri1nmprur/WQOBr0s0KMi1qg2dAFJ29q26yLqqs7/IQI4RYWj0Y5g 0EYtOHuB514uHIiTRMeH3ZTKgrY3NjjycFCAsNa/9Dkj1ow+JQqCASt90E3YMti/g3Qt UpYTeUf1i/CIUJ9JfyEi0ubeWlBlVZMzg3gqxo30t70yath5vNZ/dbUNr7NsxjRIfmwa YYvg== X-Gm-Message-State: AOAM530FSjPVBUaEku10xopNCYW+k1Ey+cuzR9JPjhe3Ytu7Y1nL0LGB gHA4ziOcNWSZrfVXEareAaM= X-Google-Smtp-Source: ABdhPJy3ChPqp5lo7a3SDO69C5a1yNib9JnENaNKabTlATHZxl+qvDSw+zEVHQ5eHDLiKC8wZDGGcA== X-Received: by 2002:a17:907:213b:b0:6cf:9c02:8964 with SMTP id qo27-20020a170907213b00b006cf9c028964mr2904604ejb.432.1645115250783; Thu, 17 Feb 2022 08:27:30 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:30 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 08/13] iio: document bno055 private sysfs attributes Date: Thu, 17 Feb 2022 17:27:05 +0100 Message-Id: <20220217162710.33615-9-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds ABI documentation for bno055 driver private sysfs attributes. Signed-off-by: Andrea Merello --- .../ABI/testing/sysfs-bus-iio-bno055 | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-bno055 diff --git a/Documentation/ABI/testing/sysfs-bus-iio-bno055 b/Documentation/ABI/testing/sysfs-bus-iio-bno055 new file mode 100644 index 000000000000..c239276f2b0f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-bno055 @@ -0,0 +1,81 @@ +What: /sys/bus/iio/devices/iio:deviceX/in_accel_raw_range +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Range for acceleration readings in m/s^2. Note that this does + not affects the scale (which should be used when changing the + maximum and minimum readable value affects also the reading + scaling factor). + +What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_raw_range +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Range for angular velocity readings in radians per second. Note + that this does not affects the scale (which should be used when + changing the maximum and minimum readable value affects also the + reading scaling factor). + +What: /sys/bus/iio/devices/iio:deviceX/in_accel_raw_range_available +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + List of allowed values for in_accel_raw_range attribute + +What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_raw_range_available +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + List of allowed values for in_anglvel_raw_range attribute + +What: /sys/bus/iio/devices/iio:deviceX/in_magn_calibration_fast_enable +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Can be 1 or 0. Enables/disables the "Fast Magnetometer + Calibration" HW function. + +What: /sys/bus/iio/devices/iio:deviceX/fusion_enable +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Can be 1 or 0. Enables/disables the "sensor fusion" (a.k.a. + NDOF) HW function. + +What: /sys/bus/iio/devices/iio:deviceX/calibration_data +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Reports the binary calibration data blob for the IMU sensors. + +What: /sys/bus/iio/devices/iio:deviceX/in_accel_calibration_auto_status +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Reports the autocalibration status for the accelerometer sensor. + Can be 0 (calibration non even enabled) or 1 to 5 where the greater + the number, the better the calibration status. + +What: /sys/bus/iio/devices/iio:deviceX/in_gyro_calibration_auto_status +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Reports the autocalibration status for the gyroscope sensor. + Can be 0 (calibration non even enabled) or 1 to 5 where the greater + the number, the better the calibration status. + +What: /sys/bus/iio/devices/iio:deviceX/in_magn_calibration_auto_status +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Reports the autocalibration status for the magnetometer sensor. + Can be 0 (calibration non even enabled) or 1 to 5 where the greater + the number, the better the calibration status. + +What: /sys/bus/iio/devices/iio:deviceX/sys_calibration_auto_status +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + Reports the status for the IMU overall autocalibration. + Can be 0 (calibration non even enabled) or 1 to 5 where the greater + the number, the better the calibration status. From patchwork Thu Feb 17 16:27:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543490 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 C61EEC4167E for ; Thu, 17 Feb 2022 16:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243161AbiBQQ1u (ORCPT ); Thu, 17 Feb 2022 11:27:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243147AbiBQQ1r (ORCPT ); Thu, 17 Feb 2022 11:27:47 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E5859BB8A; Thu, 17 Feb 2022 08:27:33 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id b13so10729385edn.0; Thu, 17 Feb 2022 08:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/GuBSZT3gYUl9WUuyRcBD5kTPc3HH/CTyiu6CHm9clg=; b=Wm8FALi5Hf4NclLp1g8m3iDtxtl6w8nxMgEgI0RyE85tZBf/JzcCJM5F95qY6pW9qf oNw3POdVmOrNecKK5Tm6j3C3P8VzZbBU/XX0/TkyPXgOQeQMyXVwshIR9lMqNQBAKlDM ON9EmoBVc7LoZsF5FFov5dhGo526GzjobehxQora6mdcCgP9FGr5l9QdnIxgCj3MzVjT WUaBn++cNiSNrYvpSjn7qE/4nPNfzSGXFQvTUi6Qnw39Y9uFHIVvF1sGv/XUDxk0+yAB DTTO+1+c8XHAPiCxwRYBQ6U20u/2coUBcSBwTU+sgz5T79ZV5A+ew7zyhSQsAihi+zs3 kI7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/GuBSZT3gYUl9WUuyRcBD5kTPc3HH/CTyiu6CHm9clg=; b=XN0lMV9RMJrXffMPl0lENgG2As5zKcdkhHcv3CKDwRjnjrC1A++emYpAxsbSt9gYmV EOAZiirjLpyXQI59DpHlef3WSA6mIQMGnC+B8cUOq4eAUh07W+Jam0+dOqRZd6fKZ3QB 43A37WDV8JtiDSeTzPTZh9gyftbq+akRGLTngKl1pECxhbS66vTOfsV0Sb75kRhFyUth 5P4nXRajjcdoOsUsC9V1SmRZKHc4XuKX8L1TzCBzQFlEITYfLhcgfp9R9J2V6WRkYUei x3LKUG1H41GDv0ynvlo4Zo2NGI7rbdrE3CCmwemTGqb/CZCFNmyB39BmBNckCsEWqNmz oatw== X-Gm-Message-State: AOAM533cp97/ETeG8Qk+AwesFNtLRe8L4fBBm2zzsYlBLVDBDR+MgJjw Z5LhZT0vBhrPxCK48K5m17EnB/m5DFJEFC8F X-Google-Smtp-Source: ABdhPJzUMjNQN/re+jPHV80Ub6x2ggTg2L7tiNQTBIFCtX39CG5GroijnFzdEuPZKjwpxYpwvaID2w== X-Received: by 2002:a05:6402:cb:b0:410:8094:872b with SMTP id i11-20020a05640200cb00b004108094872bmr3402607edu.378.1645115251649; Thu, 17 Feb 2022 08:27:31 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:31 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 09/13] iio: document "serial_number" sysfs attribute Date: Thu, 17 Feb 2022 17:27:06 +0100 Message-Id: <20220217162710.33615-10-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds ABI documentation for the new "serial_number" sysfs attribute. The first user is the bno055 IIO driver. Signed-off-by: Andrea Merello --- Documentation/ABI/testing/sysfs-bus-iio | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 1b8d77577608..224585f00147 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -2017,3 +2017,10 @@ Contact: linux-iio@vger.kernel.org Description: Raw (unscaled) euler angles readings. Units after application of scale are deg. + +What: /sys/bus/iio/devices/iio:deviceX/serial_number +KernelVersion: 5.17 +Contact: linux-iio@vger.kernel.org +Description: + 16-bytes, 2-digits-per-byte, HEX-string representing the sensor + unique ID number. From patchwork Thu Feb 17 16:27:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543488 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 DFA19C433FE for ; Thu, 17 Feb 2022 16:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243191AbiBQQ1z (ORCPT ); Thu, 17 Feb 2022 11:27:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243169AbiBQQ1v (ORCPT ); Thu, 17 Feb 2022 11:27:51 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F5F9AD9B; Thu, 17 Feb 2022 08:27:36 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id cm8so971039edb.3; Thu, 17 Feb 2022 08:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vzovTl/jqBctY9Wgr8NGlwjyey7kAE9qazeOjjaFmFE=; b=Y26qCVcbVhLSulZRd0QT6IR37Qk3jWFZlSoHlq/2WQAJUyOSoz7JsIhOS0Q8y0c+nI yW4QPuJU/nZZEy7UKl3Fg27esghnzTfHf8gJvtK2QcKThwDzFP1uCZdO6tAmFbyRgMrN 8bcIoq4i/4zSDBooGhqN5VizJWAvf1hMA4yJBGCroclO6XI+X4EBK71gx2hNfcuXOjBR I8yzV783dE4fzL1TEBmfGBrzSpU1Sf/vM5TwUfYLwqTvlISwQrTtMUwZ4sr5RQZ8Uj2F FZhkpny5K/OSPbUEyX4kx7XIvknyaExjfBw9IJeZThWwTZgFxXRslcQVCz0qBbRCyu8X oABg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vzovTl/jqBctY9Wgr8NGlwjyey7kAE9qazeOjjaFmFE=; b=djjWQsWeATlOmSXm5Bdcabuf97hJ35YU+mn/6CVPsjiRo0DOKdKbVVCKsIVB8KFvPN H4iL+/oeZAgjGgXf9ojkjubXynAJ6Z4q6AFhUKT+hiC3VAqXvP8E1ILIMEUL5CQa0uLT oh6sx93CjWuvfwRnFibhnYXJvU4gElIeOsiKcdjqiesPOWQO1qEIsCIGkVtUmHtqyaYS wOF+yUe/0tf+xDB+GADRSWSFL6PhzCWNR2aO5uxSNPNb3eDd4Ofi9+kuAazltqdLEBWB Qm0DTm6qvKvTe3lItiduDvzd8kePr0AUknmZWzCpvb/Macd4dwGKmead96x4S52zU6Ec SbRA== X-Gm-Message-State: AOAM533bVYwXpM1RYqriMArSvC9B5KZKuTItHmGuZ6diunewF/ndw0mL EiGn7of5JYXS9SUIBmfVOvs= X-Google-Smtp-Source: ABdhPJw33QZ9iKLv6ORoshM/pjgLfmYsDSLJ9+/KkoQa0lnqJqwD7eHAqlULIgO6+vXzpI+Bm8ASIQ== X-Received: by 2002:aa7:c582:0:b0:40a:92b2:1bc4 with SMTP id g2-20020aa7c582000000b0040a92b21bc4mr3520586edq.202.1645115254750; Thu, 17 Feb 2022 08:27:34 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:34 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 12/13] iio: imu: add BNO055 I2C driver Date: Thu, 17 Feb 2022 17:27:09 +0100 Message-Id: <20220217162710.33615-13-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This path adds an I2C driver for communicating to a BNO055 IMU via I2C bus and it enables the BNO055 core driver to work in this scenario. Signed-off-by: Andrea Merello --- drivers/iio/imu/bno055/Kconfig | 11 +++++++ drivers/iio/imu/bno055/Makefile | 1 + drivers/iio/imu/bno055/bno055_i2c.c | 50 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 drivers/iio/imu/bno055/bno055_i2c.c diff --git a/drivers/iio/imu/bno055/Kconfig b/drivers/iio/imu/bno055/Kconfig index 8a83639ad2a9..3693a408e270 100644 --- a/drivers/iio/imu/bno055/Kconfig +++ b/drivers/iio/imu/bno055/Kconfig @@ -12,3 +12,14 @@ config BOSCH_BNO055_SERIAL This driver can also be built as a module. If so, the module will be called bno055_sl. + +config BOSCH_BNO055_I2C + tristate "Bosch BNO055 attached via I2C bus" + depends on I2C + select REGMAP_I2C + select BOSCH_BNO055_IIO + help + Enable this to support Bosch BNO055 IMUs attached via I2C bus. + + This driver can also be built as a module. If so, the module will be + called bno055_i2c. diff --git a/drivers/iio/imu/bno055/Makefile b/drivers/iio/imu/bno055/Makefile index 416f0ff96de5..2fe2b0857903 100644 --- a/drivers/iio/imu/bno055/Makefile +++ b/drivers/iio/imu/bno055/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_BOSCH_BNO055_IIO) += bno055.o obj-$(CONFIG_BOSCH_BNO055_SERIAL) += bno055_sl.o +obj-$(CONFIG_BOSCH_BNO055_I2C) += bno055_i2c.o diff --git a/drivers/iio/imu/bno055/bno055_i2c.c b/drivers/iio/imu/bno055/bno055_i2c.c new file mode 100644 index 000000000000..9900e2a4d905 --- /dev/null +++ b/drivers/iio/imu/bno055/bno055_i2c.c @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Support for I2C-interfaced Bosch BNO055 IMU. + * + * Copyright (C) 2021 Istituto Italiano di Tecnologia + * Electronic Design Laboratory + * Written by Andrea Merello + */ + +#include +#include +#include + +#include "bno055.h" + +#define BNO055_I2C_XFER_BURST_BREAK_THRESHOLD 3 /* FIXME */ + +static int bno055_i2c_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct regmap *regmap = + devm_regmap_init_i2c(client, &bno055_regmap_config); + + if (IS_ERR(regmap)) { + dev_err(&client->dev, "Unable to init register map"); + return PTR_ERR(regmap); + } + + return bno055_probe(&client->dev, regmap, + BNO055_I2C_XFER_BURST_BREAK_THRESHOLD, true); +} + +static const struct i2c_device_id bno055_i2c_id[] = { + {"bno055", 0}, + { } +}; +MODULE_DEVICE_TABLE(i2c, bno055_i2c_id); + +static struct i2c_driver bno055_driver = { + .driver = { + .name = "bno055-i2c", + }, + .probe = bno055_i2c_probe, + .id_table = bno055_i2c_id +}; +module_i2c_driver(bno055_driver); + +MODULE_AUTHOR("Andrea Merello"); +MODULE_DESCRIPTION("Bosch BNO055 I2C interface"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Feb 17 16:27:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 543487 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 4BBF3C433FE for ; Thu, 17 Feb 2022 16:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243224AbiBQQ17 (ORCPT ); Thu, 17 Feb 2022 11:27:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243182AbiBQQ1z (ORCPT ); Thu, 17 Feb 2022 11:27:55 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 934ABB2E08; Thu, 17 Feb 2022 08:27:37 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id d10so8516236eje.10; Thu, 17 Feb 2022 08:27:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x0CAWbNuIuDfQpbJainmJSxgl05KS6pI1nwvw77TVRY=; b=XYjjMpDhaV3y4guUdwjcp7pgm0CCJvpxAYqNX/uRe1b80YfpnK0ARRNBQuuarUXsmt IuoP9UGADm0phg5YjhICWB2TYsr8Q15w9dvHc8shFxuizpjNbhIo8BnklYElCvt1LVfH aHEjCRuS/wUZhdmJDKGXCXZH2MeGUT5QgqowghefD1jO/9ZYE8o3eZGL/FRNKnJPk8ni ky4p5t2DWKWEzWnNXX/Q+f4T3nvBS9CpocYX9sHIJdlvOprs79hV9JmszQBdz25z9bUi Q2t7B+W8f1RiL4+buQH0S5DKRQ9D5BHYgteg7ctM8Z1DIkqdwZjesChIj/808a++1E4J cu2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x0CAWbNuIuDfQpbJainmJSxgl05KS6pI1nwvw77TVRY=; b=5v4SbT74eWBvdrpKEuR6C2yACdN6GvJI9LmPptnr80C4XKH56j6k/94iC/fPG0kybQ im6aGSLxQh6uBYqXTxJKmmQtRqO8SNfiSh6xLxyxsSS+Y7jxYXFmHtdhWCrU9c+Sc00p W9FtU3qCKZbP2L0M0GkrqGc/FbJz1XZS7jznZjLfueLvgrKQXi7ddoxlFerWoiEO+W+q DfJhkweC42W6z6eNGN2qZwp5lJpNmhsqJ75Hd7D3hBRDCrDZ1b1Q+6hiHfZese3VHmAl BY8rszViXilMVzRnQ/t8CSYNGgOKTl4kpYoT+Usp9L0nF0fComXmwOQt2Rj0w2+Sduwf eT0Q== X-Gm-Message-State: AOAM533VpJkhagUH9xAj/OKI/SxuLha4CIW8r+BTobfJMbVOCANbwcPT 6W5KizBWCro6mrguGc04n14= X-Google-Smtp-Source: ABdhPJzlwfwiOWxf+goTzxLgaAJ6/r/qIVfSm0JJTyMJULqZyhZQz20H7AUpWOyqFSUm3xkOn6AE4Q== X-Received: by 2002:a17:907:2bf6:b0:6b9:725e:4e1f with SMTP id gv54-20020a1709072bf600b006b9725e4e1fmr2943906ejc.527.1645115256153; Thu, 17 Feb 2022 08:27:36 -0800 (PST) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id j13sm3653742edw.24.2022.02.17.08.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 08:27:35 -0800 (PST) From: Andrea Merello To: jic23@kernel.org, mchehab+huawei@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: lars@metafoo.de, robh+dt@kernel.org, andy.shevchenko@gmail.com, matt.ranostay@konsulko.com, ardeleanalex@gmail.com, jacopo@jmondi.org, Andrea Merello , Andrea Merello Subject: [v3 13/13] docs: iio: add documentation for BNO055 driver Date: Thu, 17 Feb 2022 17:27:10 +0100 Message-Id: <20220217162710.33615-14-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217162710.33615-1-andrea.merello@gmail.com> References: <20220217162710.33615-1-andrea.merello@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Andrea Merello --- Documentation/iio/bno055.rst | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/iio/bno055.rst diff --git a/Documentation/iio/bno055.rst b/Documentation/iio/bno055.rst new file mode 100644 index 000000000000..4bb185075325 --- /dev/null +++ b/Documentation/iio/bno055.rst @@ -0,0 +1,53 @@ +.. SPDX-License-Identifier: GPL-2.0 +============================== +BNO055 driver +============================== + +1. Overview +=========== + +This driver supports Bosch BNO055 IMUs (on both serial and I2C busses). + +Accelerometer, magnetometer and gyroscope measures are always provided. +When "fusion_enable" sysfs attribute is set to 1, orientation (both Euler +angles and quaternion), linear velocity and gravity vector are also +provided, but some sensor settings (e.g. low pass filtering and range) +became locked (the IMU firmware controls them). + +IIO attributes for unavailable measurements (e.g. Euler angles when fusion +mode is disabled) just read zero. + +This driver supports also IIO buffers. + +2. Calibration +============== + +The IMU continuously performs an autocalibration procedure if (and only if) +operating in fusion mode. The magnetometer autocalibration can however be +disabled writing 0 in the sysfs in_magn_calibration_fast_enable attribute. + +The driver provides access to autocalibration flags (i.e. you can known if +the IMU has successfully autocalibrated) and to the calibration data blob. + +The user can save this blob in a firmware file (i.e. in /lib/firmware) that +the driver looks for at probe time. If found, then the IMU is initialized +with this calibration data. This saves the user from performing the +calibration procedure every time (which consist of moving the IMU in +various way). + +The driver looks for calibration data file using two different names: first +a file whose name is suffixed with the IMU unique ID (exposed in sysfs as +serial_number) is searched for; this is useful when there is more than one +IMU instance. If this file is not found, then a "generic" calibration file +is searched for (which can be used when only one IMU is present, without +struggling with fancy names, that change on each device). + +Valid calibration file names would be e.g. + bno055-caldata-0e7c26a33541515120204a35342b04ff.dat + bno055-caldata.dat + +In non-fusion mode the IIO 'offset' attributes provide access to the +offsets from calibration data (if any), so that the user can apply them to +the accel, angvel and magn IIO attributes. In fusion mode they are not +needed (the IMU firmware internally applies those corrections) and they +read as zero.