Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1418214pxb; Thu, 28 Oct 2021 03:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpOQHwwswpW/yU6G69i7KgIVDPLa5O0A61WoYyWtPmsgkCHo2jwrqNDEhcmB5byjzfRUDT X-Received: by 2002:a05:6402:190e:: with SMTP id e14mr4927836edz.20.1635416503409; Thu, 28 Oct 2021 03:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635416503; cv=none; d=google.com; s=arc-20160816; b=yw5aNzpg8tVZzoGHkknC+fZPVcT23ehONRhOHXFoNZp+9kLi/CWFeNrhf/4qjoACVP 7a285M2jraF3oOnhj9D6d6bEgt/YpnG1NZD1sahI0X6Uo4KDccbQeg2XmV5N/AnLYo5u cijWKFZV1oogx7ZmDwQGjv6KEryNw62cSxsWacpwHs3XQaIvi0CYpbX57VKdW3h+bw/v 4KbVAdx/DEaUr6BynXOpqbIxeQhGQbcPRjEZqomEZ2UMwdTJ3fCMwM6zqB80fkKBKKwx A8J8Y/Zg/NK7H1ih6WOVcRf11KIkqpYd69FWNQLxSMqZYwXKBBSMhOoYe3QiT8tWHy4u Lk4Q== 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=+QFzjiOgZlkTkCXooTGKu0LNv93OJOH/5M4+aQNGloA=; b=QErW5cYu2GqhbOigIs9XkU2qN25RDiD+EeHvWDGMdgsHFej+DjP5+pld4dTZ5RlVa+ QEyBLZQZc8o+2SwQiQOarufuH4DHwJqZWGISFigg+vsK0gaflNtXhz6k9D5soJyoPo5T FdGGeVG2sGNC4J8RojLOHrGgbUa+GKGG8kzdo19bUYWgr0qTBVmDpbPsr7eBbWCKPDA4 gTXOqWQ5ZLCP28CyJ1+JVV/h67oiSfXuVh2+ONEFMElDQHTHcm9L74fAhDtIG/Og8dlt qnU1rDPkZuqXCblzjecOSMNt2EuSqWYAprqy+dcO/yxD8pdZ6hk1Zxpis0d7Ztykif/u romA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eYvJv7jS; 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 z13si3764346edc.73.2021.10.28.03.21.20; Thu, 28 Oct 2021 03:21:43 -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=20210112 header.b=eYvJv7jS; 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 S230162AbhJ1KVl (ORCPT + 99 others); Thu, 28 Oct 2021 06:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbhJ1KVV (ORCPT ); Thu, 28 Oct 2021 06:21:21 -0400 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 4A251C061570; Thu, 28 Oct 2021 03:18:54 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id s1so22708243edd.3; Thu, 28 Oct 2021 03:18:54 -0700 (PDT) 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; bh=+QFzjiOgZlkTkCXooTGKu0LNv93OJOH/5M4+aQNGloA=; b=eYvJv7jSeHtayGXTcpptwWrjEUI0SikAoklswFnshW9ED91ae7SOsZBz8Sw475kHBT rafZFRR4bzOfoFQrrc2gPHvOwGc9iJkJnabjO/7vX2/f/kr27E9GXd370uQQUcK29SLT l0jyjp4PANFOfJC2mwVaRMlmjREnXvpc8lN9eagPen9GgzsZxDHy5gRpz/bz8w6ChXiC dS+zliBOuUBbFq04Ck/HUHq2q9fNulvLr6atvpVOu6OpBSBWHIVPjNgb5esfWWoc/9CU BQmGVIiJZXoBXKeK5U8iwQle9jzDRSHuNqO5fmSTebr9s7i8zbXUJzodzkGp/MAEkQBL oozw== 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; bh=+QFzjiOgZlkTkCXooTGKu0LNv93OJOH/5M4+aQNGloA=; b=X2kTBkrgkDGs8qDjNjLxnbr1kVOqDIWadk/F/9EvGAwqqNfrxjr8/bTv4GaB1f4c1k ewek8yEQaRXO/DAbrc1tR2EBkHuT+ERY5Ccfu4Iqm4WMxTeHZuY72Jm6rWys3CmdjUJH sizNaTysZbUkSW8Qp1lJZpMD2nKaVBrSFEDNbnmcsjsHkW5Di/MEEb76yR4HQIFYGYdg 7CE3cXmhkOoSZsasQlzCGAvfS4STuN0bmT/VtkJibHROgEWZsv54635jgantXiyD03wx eolsBdtJlUMzrYOHxKGbP83XVUPIDbTfaduK3KWL+ZLlT2lImSKFMhXy3m4G6ecTigmp 3mqA== X-Gm-Message-State: AOAM531P2v6/J+Gyz2cDzSM3k6NrxYeZvwlSZSc4wDYQi7VU6/8pR9Zq t/tk7m+e0h7x+OmT+pZGUyk= X-Received: by 2002:a17:907:e8b:: with SMTP id ho11mr4331419ejc.300.1635416332774; Thu, 28 Oct 2021 03:18:52 -0700 (PDT) Received: from poker.lan (static.2-229-210-222.ip198.fastwebnet.it. [2.229.210.222]) by smtp.googlemail.com with ESMTPSA id mp9sm1175071ejc.48.2021.10.28.03.18.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 03:18:52 -0700 (PDT) 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: [v2 04/10] iio: add modifiers for linear acceleration Date: Thu, 28 Oct 2021 12:18:34 +0200 Message-Id: <20211028101840.24632-5-andrea.merello@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211028101840.24632-1-andrea.merello@gmail.com> References: <20210715141742.15072-1-andrea.merello@gmail.com> <20211028101840.24632-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 --- 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 2dbb37e09b8c..a79cb32207e4 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