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 DFBFB188000; Sun, 27 Jul 2025 15:49:18 +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=1753631360; cv=none; b=XQPjiJqbbjHsGlcBXiBY1aIfRFMVTh1PTbIE8tCXWF6YqOOS4E0PNW12TjNo0dqefk4ggZ4OUtGBCeFySor3AYPZrUivgQxhuSxfNONqGNk5cHulHlh1hf1i444GVPOmoiWQ9ha3j04nGYZBQXkMgAWaxyC/7zIhWY5omj2IWXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753631360; c=relaxed/simple; bh=ucj4qPcgvz282NusIKgE8khiyMabwuonkaXUh2ZglTM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R4kR97KhR9gKjr8kz+r+tHwBn6tKC//EYP1I+oBoqY7oCHP2L57RNuq0Kn3ET2yYgj9gbF3X4uxCJIpG0+RvFZhJ4eLf1fT+OoI+nxHdAUe0hfj8qU3HC7xhzKooNYislaBoBGHAOdIYVcNDWXnlnFAZg5g45bUyhliHglMtfEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JffGy/vu; 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="JffGy/vu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D816C4CEEB; Sun, 27 Jul 2025 15:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753631358; bh=ucj4qPcgvz282NusIKgE8khiyMabwuonkaXUh2ZglTM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JffGy/vuE+BvXG+YgI0M4Xw27rC+KVnMaj9Cz23tHrOzulQUSzzC7hHi2HEk6LzSB 5a4yXrKMi6Biuqk/84FAqXvbLOwhyjh3zAhSXgMcubKCFQ8PwasExZiheB4+vVvv3q RGlPxH/lfzZHJhHLKB3QpGxAhZs7+EeHORebo4n9hNIiR1AiqpztACZVPrfVuhuu3A NX/2na/VMeHTizVfMB+ykQeEkh7P3n1UZXBalHnE6x6lYT31HiqwDrQSPxSV9roSXN 7iZngLRSvyISnAWc2VViJ5ghvtHACMQcIX1Cgc5pqcLdmYJNCuTFidP2wuvew1nAF9 9KLyLFHSdBRhg== Date: Sun, 27 Jul 2025 16:49:09 +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: <20250727164909.1833c4bc@jic23-huawei> In-Reply-To: References: <20250711-bmi270-events-v4-0-53ec7da35046@gmail.com> <20250711-bmi270-events-v4-3-53ec7da35046@gmail.com> <20250724162227.065d20a0@jic23-huawei> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.49; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@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 Fri, 25 Jul 2025 00:26:35 +0300 Andy Shevchenko wrote: > On Thu, Jul 24, 2025 at 04:22:27PM +0100, Jonathan Cameron wrote: > > 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. > > What do they measure? Any links for me to study? m/s^2 (well actually not, but they derive that from change in properties of a capacitor like structure as it bends under the force generated by the acceleration. Which in the vertical direction is g if the device isn't moving. https://www.analog.com/en/resources/technical-articles/accelerometer-and-gyroscopes-sensors-operation-sensing-and-applications.html looks good as an intro from a very quick glance. > > > 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.. > > Hmm... But shouldn't that marketing value be exposed to user space? yes, but its 9.81 where ever you are. Or whatever the datasheet says they use. These things are rarely that well calibrated, so the exact value gets lost in the errors! Jonathan > >