Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp540252pxv; Thu, 15 Jul 2021 09:48:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdest5Aziy35gsw9OhIEFtv0UPQrvLZxCloabjLwUCpCJYs2yT2eLWVyuyFI7513R0algH X-Received: by 2002:a17:907:1c01:: with SMTP id nc1mr6151712ejc.504.1626367642169; Thu, 15 Jul 2021 09:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626367642; cv=none; d=google.com; s=arc-20160816; b=wFxiM2dVD9KnErxkjC0WLnHHXcAdnOH9pb0ZJlYfKz/S262SrltAbOuZ/y6yE6wcNs /jKlbO1JxiAKcONPCLodmDeSvuXznFTlXR3AoY2hJ/62nFDUgDMoMviHzZak1v+4RvTZ eBq42BCF3VUzxA3Ae2cBXkdGIXxXUNYsPtO0kIaT02x2no4+tiUk3zsxgog0L+2BRVEU Q9tWkHZENBpqKuGBzR8Tjjkb0PryemO4TirLqoaqkL1Zo92ZleMvbrSs7mpA7vnE87lx 2RzjCz2tPKmU90iv6vGJkM7DsIiUSJyjwxBvgjCrA9h6ISprKZ7kw+U9hXxH4ZpNv5CU IEGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=euuNJ4QYLqPQyiZ3jGVxRpNge1xVHhts30tJq3NSewA=; b=ncWUg+MkkaCxeIFPGJjt+UDKDy78PzIVc42zvnkuXMwRBa55DX1Jk1wsi8h1y/xGTV 0WNh8fiKt9xg4zA1zWMpEGKoux53oL5t0iHWVnunNtlDpETW+KDgCJNatx3XA4gzqRaG zH/Ne73OCRPeXuLhwYjMVYLCfU1UREqk5Qe0EjyeLGpV1tFzUpD4mUIIgkuPFZAT6wtS 3qbj4sr7Xa7ZekePk2ivltDWsEqWTPbHRiSpDls7vjulpYsx1C16TAxtbme8t6l/pRGw 5qw4LSYAZHMX66UAGuduaad0++ARRoOUu/3tXwq3oR2tDI8KoY6uNkclQDIW5Prk5Slu bq6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iP9CnI8h; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw2si3872293ejc.730.2021.07.15.09.46.58; Thu, 15 Jul 2021 09:47:22 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iP9CnI8h; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238650AbhGOOUq (ORCPT + 99 others); Thu, 15 Jul 2021 10:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237908AbhGOOUq (ORCPT ); Thu, 15 Jul 2021 10:20:46 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F6D6C06175F; Thu, 15 Jul 2021 07:17:51 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso5358513wme.0; Thu, 15 Jul 2021 07:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=euuNJ4QYLqPQyiZ3jGVxRpNge1xVHhts30tJq3NSewA=; b=iP9CnI8hw5AucGUo4ibuV7X7+IOeU8Wz+IyyUELpEbqXZwRHL6AcgMDhawMKXHYK/a A4VbNiBdfvvPSsiB7x8w5TKMSNzg4Z6rmn+DoawQ37tAyGMTqN6xuhnNK8QDYfEesBNX N31JfgaId6hJcFP1yj2ci3tYKQ+U1tJDpQcPY8E+NJSoL2UYsTNO4RYYzKaCA7ahPpOK QKKgZsiUNhZzzfC32DBORQnH+4QoNzZh6qQEb1c340LgT+TsaHllPkpjtwIsNMOThy0N PxWzdaEndJ/rxio/VVEmcJSyksJHETquLxj8E9SuB3pO41FLYmLW6Vfv6nAvvWarbFzC WKUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=euuNJ4QYLqPQyiZ3jGVxRpNge1xVHhts30tJq3NSewA=; b=kq2m+feGSuBXKXlKH7RFlL4FYc5kxkL9nLDbcwbxagv1I+cjbiI2UoqDwO/7MMLMqj lSzD/V2n84rdEasdTYSCvK7NSfYLNeJQ7toqGLIbk2mzPnG5tY0dZMc12zsEKkR4eCCM xxR3Us3qnRI1bz0hdR5LjJqLWD/FtjTzCrMDxOBCYM1U+QtJsRkgIcXU2sZ/GSieauUP rdnKjxqCa54JV7Cep/vkNVmghh6EQn/MG6B0uKd5n+PvHcmoQr2eI+Lr1xu7OTZNpDYz KtiXgyg03Z+fg6Kwmc8f6bkAXA/BmDsSh74Xyhn0/rTdhIdPgjfOzekhyCZqW7lWnKlA QTLQ== X-Gm-Message-State: AOAM530AzOZVxv6+ysWy7YgUydAMlRS6a0+7Wcn7xXKudQTf4L03tX+W Mwqw40MPacYohI2kaxAdVT4fe6T7qqV4GUx4vmE= X-Received: by 2002:a05:600c:214a:: with SMTP id v10mr10397911wml.17.1626358670207; Thu, 15 Jul 2021 07:17:50 -0700 (PDT) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.gmail.com with ESMTPSA id u16sm7989094wrw.36.2021.07.15.07.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 07:17:49 -0700 (PDT) From: Andrea Merello To: jic23@kernel.org, lars@metafoo.de Cc: 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 , Andrea Merello Subject: [PATCH 1/4] iio: add modifiers for linear acceleration Date: Thu, 15 Jul 2021 16:17:39 +0200 Message-Id: <20210715141742.15072-2-andrea.merello@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210715141742.15072-1-andrea.merello@gmail.com> References: <20210715141742.15072-1-andrea.merello@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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_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" }; /* 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_ */ - -- 2.17.1