Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp22959lfe; Fri, 15 Apr 2022 17:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAjuzdhhv7fj03FsDSfPoFuohg0eqDcZHqJTLdjeeQPjaRx9EXzjAi7H566IxPXeE0cq6H X-Received: by 2002:a17:90b:1642:b0:1c6:c6d0:fbfa with SMTP id il2-20020a17090b164200b001c6c6d0fbfamr1462614pjb.218.1650069476596; Fri, 15 Apr 2022 17:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650069476; cv=none; d=google.com; s=arc-20160816; b=oDiuPPK+OGrJw8r1pHtvnvUigomx7nk4DHZCvplq1YhvIJyp6vu+jbZTSepuHuth5o 1663W9qBUlaoiZybvlvn+qip5+xTqnNWO55qNdsSbbN9XsteacJ6A1DvoEYlFlxhMdZO In674JtQO9CFUimgXfP7kvKnLNcdmzbA96oyfh1vRKTIdpWl9RWnf1r9T9bAo4P8XxVp acfkyAf5sC1FwLRca5o/gb+i96QWfKTuNh9P9iSm6hmhJ1jSYuZRT4lnK3lUunIqufJa vMc50raZZ4PkIePWD1kPFcUj4HBeS0iuPpOt+ciSuRBOYk7Ap/YSxAYaRjtbSV5BVYXE YvTg== 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:date:subject:cc:to:from :dkim-signature; bh=29kCXmwo2u1Er8ko36SvdYgCgJQmCwCSFQr4e60M0d0=; b=J2xVOQbBAouib8h3DmFeF0RsDoL7gyD/KmD016YHp+1yz0YQzHQ25Ee6e72/b+n454 INt1/tpjMYZb+Nh0QYOt/X20CXA/5SG0Z4oTmaHykEFtmcXwKNuFY0u8fn22ETwBfQdk bXERd04dCdh78mYjO5I1bzTbL0vDM0WJmkP5mjUe0SJWzP/h64PL1xgYwGDhzl4Zli93 LhLq2MYJYjyAk1L0uk7sKNQwtsxikQKE42NrYyC1vwmE/NsyhXyHIuEohP2a3P5TMsH6 IwcpbHLv+sItGQknvzIbIfw2a+vOi2PDoQmM0OTx1kp+pOZJKhv4BTKWFQdIeihBc6ew Pw0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N1zj3zGs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d18-20020a056a0010d200b0050591ad7841si3068236pfu.237.2022.04.15.17.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:37:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N1zj3zGs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7BA8DFCBFD; Fri, 15 Apr 2022 17:33:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353873AbiDONC6 (ORCPT + 99 others); Fri, 15 Apr 2022 09:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353845AbiDONCy (ORCPT ); Fri, 15 Apr 2022 09:02:54 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCE2736695; Fri, 15 Apr 2022 06:00:25 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id bg10so15277574ejb.4; Fri, 15 Apr 2022 06:00:25 -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 :mime-version:content-transfer-encoding; bh=29kCXmwo2u1Er8ko36SvdYgCgJQmCwCSFQr4e60M0d0=; b=N1zj3zGsKaz38rLKJSLF7CFulZtyuk7SzaajDOQYddndqWkCyRIB1f46EA+ZmQegAA sKEGbfdv8yPv9BPgyPJ3NPSMxujD/6rDkvS4ahCUPNXSgR8eGVB3BsE/NbGtwulc/qqK +aXYETMJx2qvOYbg2Sbpf5mIJutAjdW3rIITVh/bhYhHroxCPU/Suy+3VY3Ce+ZFkWGu hBhfRRWbIH02JbpAN2zFRQBUEkohuKvSiNXi7QkF4Me2xamPVMDbYGKVFyEKj7atjQaL SbdeEuOu7E04Jb0ge09jK9XTsjH29/da+TO+lrB9IaN57H5GRkT7U+UXWkvfTZtTmUwY RZVg== 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:mime-version:content-transfer-encoding; bh=29kCXmwo2u1Er8ko36SvdYgCgJQmCwCSFQr4e60M0d0=; b=g/ECiUbZPcYHYBdqbT8TizmPQ76yCWfa0rDuNYhO6djRiqyRcME6Y4W/aMVKak59Kf ZysDroQmT8aYM4UYZNF4Lj+HBHniFYwHvnXc09MgxNa+oWsH9dY2elpXE+LNyZI97u82 OgU8JeYLM04CQr7T2VUNoD5LJoNzYSdaNrOtHUoLFy2fgzGRXJ/fuTA55eZee45b5viO cWHWZZ1lUEP3XP/k+CyOnY799A3MX1eAjG3O7+goZnm6EYf3u4JwtZ/WbKj+Q6s5KdcJ Onl4WWD32n/+kQwANjHMTvFzjqqIes7fxrNHTLLTGSSCXwC0cgGmrmB2LNzMQz6vJKlS vRpA== X-Gm-Message-State: AOAM531GkOcUby1cmOaVj2o/L7U/wIe1rnxRT0b+E8fow74EDuqyfdU6 BMpmQSD7P/VWBTZA9MBi0tDG2tTzoMMHkg== X-Received: by 2002:a17:906:314b:b0:6d6:da31:e545 with SMTP id e11-20020a170906314b00b006d6da31e545mr6375946eje.125.1650027624384; Fri, 15 Apr 2022 06:00:24 -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 i26-20020a50d75a000000b0041e84bb406fsm2704715edj.0.2022.04.15.06.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 06:00:23 -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 Subject: [v4 01/14] iio: add modifiers for linear acceleration Date: Fri, 15 Apr 2022 14:59:52 +0200 Message-Id: <20220415130005.85879-2-andrea.merello@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220415130005.85879-1-andrea.merello@gmail.com> References: <20220415130005.85879-1-andrea.merello@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Merello 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_LINEAR_X, IIO_MOD_LINEAR_Y and IIO_MOD_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 2f48e9a97274..d087b2607cc9 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_LINEAR_X] = "linear_x", + [IIO_MOD_LINEAR_Y] = "linear_y", + [IIO_MOD_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 472cead10d8d..0993f6b697fc 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_LINEAR_X, + IIO_MOD_LINEAR_Y, + IIO_MOD_LINEAR_Z, }; enum iio_event_type { @@ -115,4 +118,3 @@ enum iio_event_direction { }; #endif /* _UAPI_IIO_TYPES_H_ */ - -- 2.17.1