Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2226037pxv; Sat, 17 Jul 2021 07:30:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2BFMHdbAIycjXBLs9SuCMLBGlwxKgaw0Mtn9Fxv+BurwTqRA0F8xoD9Qll1LdlXHKX3Ev X-Received: by 2002:a92:cf0c:: with SMTP id c12mr9871502ilo.56.1626532255749; Sat, 17 Jul 2021 07:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626532255; cv=none; d=google.com; s=arc-20160816; b=kQOmZQAmO2AsF+h07oCVbsCRZx87SG6KNxnddwngthvcZBRuWLehxlQjQORL0iCdwy IOAV2XLHjlhdzL8qL/KfZ8+REvShM5Y9c1w+zY+PhXlz5Mbdlf2HtcEf62JhMSPX7+MT CDeSyQZH/qGVPOeXyZjKtbvH5Xen9E2EDnGFedbDc0qIeztidIyU8r7fX7jykekC0+Tz 39VYPVSzGP+OdcjrhTom/wSDdRvxDLknoIfoBkNWvliupSslVIYkrli1KxZTJeHZPKmw EGGNfJfNQusFSyAi+CdjT3w0TO6YuberaWfN60wUihlKeA78gBBUvawhfHCNnm65baRB hjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=eAZPtJY45NbY1DdBlbeNqhoc2VTMfFp3ysgsN8WwES4=; b=APbNXSv0d4OFjnX4UqRPy49jvUBa2TGBaVP525ZbXQ990/nkJCHbV/YXc0wpm9QhwE 9S/YytJ/YxSAXrH4gDa0mV3sTIzeqnlRz/oAzjEd6F9BUJpIuyP4MHJvfSIglhFNmvux yMDfqiyyYuQGXiaX1lWgWNLTWm4OKGRbPjogiAg26oFrgtYEbpo1syVwL/S2IX+AhEwt VKgSi5XGjkQnEJsbm8sSK2effMtfNhbPHE4hunjqBqC1MIhg+uWZXWEJjtX3HQLtOgUy B8cjmWOpQyFRsrMtiyiCy6xfsoXhldk0QJ0Hne/IeDh5/a0U4B172/ECdL9VBZkPNHGI n8Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si3241748iof.82.2021.07.17.07.30.42; Sat, 17 Jul 2021 07:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234214AbhGQOdJ (ORCPT + 99 others); Sat, 17 Jul 2021 10:33:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:51542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbhGQOdJ (ORCPT ); Sat, 17 Jul 2021 10:33:09 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CB1E60E0C; Sat, 17 Jul 2021 14:30:09 +0000 (UTC) Date: Sat, 17 Jul 2021 15:32:32 +0100 From: Jonathan Cameron To: Andrea Merello Cc: lars@metafoo.de, robh+dt@kernel.org, matt.ranostay@konsulko.com, andriy.shevchenko@linux.intel.com, vlad.dogaru@intel.com, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Andrea Merello Subject: Re: [PATCH 1/4] iio: add modifiers for linear acceleration Message-ID: <20210717153232.2860b7ef@jic23-huawei> In-Reply-To: <20210715141742.15072-2-andrea.merello@gmail.com> References: <20210715141742.15072-1-andrea.merello@gmail.com> <20210715141742.15072-2-andrea.merello@gmail.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Jul 2021 16:17:39 +0200 Andrea Merello wrote: > 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_ACCEL_LINEAR_X, IIO_MOD_ACCEL_LINEAR_Y and > IIO_MOD_ACCEL_LINEAR_Z modifiers to te IIO core. > > Signed-off-by: Andrea Merello > Cc: Andrea Merello > Cc: Rob Herring > Cc: Matt Ranostay > Cc: Andy Shevchenko > Cc: Vlad Dogaru > Cc: linux-kernel@vger.kernel.org > Cc: linux-iio@vger.kernel.org > --- > 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 6d2175eb7af2..e378f48240ad 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_ACCEL_LINEAR_X] = "linear_x", > + [IIO_MOD_ACCEL_LINEAR_Y] = "linear_y", > + [IIO_MOD_ACCEL_LINEAR_Z] = "linear_z" So this is an interesting question. Should we treat this as 'modified' or is it better treated as a different channel type? I guess it's similar in some ways to the magn varients for magnetic north and true north, so we have precedence for modifier. It's also a little bit similar to calculating illuminance from intensity channels which we did as two different channel types. Anyhow, I'm fine with this, but open to hearing opinions from others! Either way we definitely need something new. Thanks, Jonathan > }; > > /* 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..db00f7c45f48 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_ACCEL_LINEAR_X, > + IIO_MOD_ACCEL_LINEAR_Y, > + IIO_MOD_ACCEL_LINEAR_Z, > }; > > enum iio_event_type { > @@ -114,4 +117,3 @@ enum iio_event_direction { > }; > > #endif /* _UAPI_IIO_TYPES_H_ */ > -