From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 891692797B1; Thu, 24 Jul 2025 15:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753370554; cv=none; b=uGmUole4L0MqJlKCr1eK8qJxIuPiMpXnPnsbHQERXHXMo0JmzcVeMvxrhbi4MAk0GTJIMasHu6InjimcDRn6DJ2y18Z24G1ZL8ITv2klj2H1pLq5BC/JiSJ5TYmvKyZXYb7HBrRD4zCBzjbz3y9hWWaTsTBQo444WzRTEy4C5x8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753370554; c=relaxed/simple; bh=kCc9+bv8prY7vXYH1dhbb3wufC7xyXoXKhvFlF8VvVw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KllgbuKJTzhMHkniU5Ux4hrSH7yzrO3pm5aCK3SzjlubIMg7hG3hK0mHnXGe+qlpT+PW3QILd0r2DAPHLrw56JvNef7GdglOxbFu/fRKaMSytP7OMdANbOxDO/Z69ZvGw1HLTlmPD8UbGXx1xgppRV9ooPm5Ragx84fRA4tJZcM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k8DTsl4I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k8DTsl4I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49462C4CEED; Thu, 24 Jul 2025 15:22:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753370554; bh=kCc9+bv8prY7vXYH1dhbb3wufC7xyXoXKhvFlF8VvVw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k8DTsl4I23MMfQo4NKAPI7MSebhFYaBPGUp9Fp6hiCUBwsm5rVp+uqQQ5I3iDgKLI Wptoq50sRQQ+l2iM0Wb4CFi9oiq8oBCsmLOezRDj/W8mmz70LyK2Bf6smqKEiyMLBD mbif1CdT0MFEZygdIJcU9mtqRutHaT8xEpOqGW5sKPkiqS/7ICk5/DiccmJqXoen/1 zU2sVZeCIJIT/C7QOLtCMnwbMAQjbbAqKSntFAnndsOqqa6MLQoOTe8YKHs4w/fmTr Ou49Rw7TPRdXeKEIeklvscOVLhkKQZWiMQNz/7OvK8OXqENkNIViOO+4Y47QV3/PBD UhwA+4QayPoKg== Date: Thu, 24 Jul 2025 16:22:27 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Gustavo Silva , Alex Lanzano , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lothar Rubusch Subject: Re: [PATCH v4 3/3] iio: imu: bmi270: add support for motion events Message-ID: <20250724162227.065d20a0@jic23-huawei> In-Reply-To: References: <20250711-bmi270-events-v4-0-53ec7da35046@gmail.com> <20250711-bmi270-events-v4-3-53ec7da35046@gmail.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 16 Jul 2025 12:53:55 +0300 Andy Shevchenko wrote: > On Tue, Jul 15, 2025 at 08:55:35PM -0300, Gustavo Silva wrote: > > On Tue, Jul 15, 2025 at 10:49:25AM +0300, Andy Shevchenko wrote: > > > On Tue, Jul 15, 2025 at 10:37:22AM +0300, Andy Shevchenko wrote: > > > > On Fri, Jul 11, 2025 at 08:36:03PM -0300, Gustavo Silva wrote: > > ... > > > > > > +/* 9.81 * 1000000 m/s^2 */ > > > > > +#define BMI270_G_MEGA_M_S_2 9810000 > > > > > > > > I thought this is MICRO... > > > > > > Btw, what if we use the device on poles and on equator (or even on orbital > > > station)? I'm wondering if this constant should be defined in units.h or > > > even in uAPI that user space may add a correction if needed. > > > > > I certainly hadn't thought about these scenarios. > > FWIW, the accelerometer scale values also assume g = 9.81 m/s^2. > > For example, 0.000598 = 2 * 9.81 / 32768 > > Right, but this should be supplied to user space somehow. OTOH the measure error > may be high enough (what is the precision of the measurements by the way?) that > it will neglect the differences in the 'g' constant. > > All the details are given in [1]. > > [1]: https://en.wikipedia.org/wiki/Gravity_of_Earth#:~:text=The%20precise%20strength%20of%20Earth's,/s2)%20by%20definition. > These sensors don't measure relative to g. That's annoying marketing which is why I held firm for m/s^2 for IIO :) So what they measure for a given acceleration does not change depending on where we are on earth. You should use a 'fixed' standard value for conversion from marketing values in g to m/s^2.. Or maybe I'm missing something! Jonathan