Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp984415rdb; Wed, 6 Dec 2023 05:48:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+vMr81J9fnhhTNV6Bv19gX6KizZZc5/U4A0S5N9NTEomkW7TzudeESm2lrwhdbjfSPsti X-Received: by 2002:a05:6e02:1d12:b0:35d:59a2:a31f with SMTP id i18-20020a056e021d1200b0035d59a2a31fmr1447416ila.33.1701870527222; Wed, 06 Dec 2023 05:48:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701870527; cv=none; d=google.com; s=arc-20160816; b=XALcuoXowcx/d0SH9YTDkWPLVzVNX1YpzYtSQ/IKDo6F0acYdQ4vkN1t+L0kzWToFc dwPp/ztITQeNinknAIYiu2phEY6bdtsCeuBZFRo6DqB4W2YOAZwQE5JAAtXScdreeUZf +g9LEMxZtMN152bIPJaapEJ6jVOJITP2u7EuwMT4i0J2bw/NdxmF10SwBTaPxVq4bhF3 CgNo0emI2biDYeb33iSWNLx3sgA+4TbRNggn420luE2ZfexF1kcl8ux0ENXG7y9ZbkTl 8qCMdfp9hIrF9/sKfah7GWNm6aBON6PBv06fasSdB3Xbyh3ZyKVdFT2if6KaDdtSBEhR 7PlA== 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=VuRiXX+tHD8qpaoQh6okUrfYXevnVhYrWjiozg0Jp5A=; fh=HzygofV25W43v1wAm9HKFP+ccA5kLvhZMvQ35aTTsXY=; b=o65eUmPjiWkpUVbth3ingeaCIEz4onW49ZMFY7UUGuu/iH0d4NpjWm6oDrq4fLN+Eq 7CG8kXxmg0TMlI7ikzK8GapRzOiOWWf86BY91IQ2qJYzw/vYhrAUR/Y9zKnuMV22i8hh thsO9LJ3VYZKY7mI0FSO5HvijLnCG8kSggpI1PoaqGa4DgVNjtLNvDWyfvz94dZ1ef6z vQj6uuqzVp4ilriY/WvuZ2Y+WNCMnv8DgshkCO32OGh/R7LeayzPo7aqLhRpPR3953gh 3LXvzRXMEsMiS1cItxVgPqaw2Ch1asQiBX9vhmvneHKLakYOipv38h910PIPQCi8cNJD 4sEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UJvXA19L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bv9-20020a632e09000000b005c66c22569csi6986101pgb.17.2023.12.06.05.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:48:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UJvXA19L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 71C0A80C8DCC; Wed, 6 Dec 2023 05:48:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378545AbjLFNsb (ORCPT + 99 others); Wed, 6 Dec 2023 08:48:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378499AbjLFNsa (ORCPT ); Wed, 6 Dec 2023 08:48:30 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF5CAC3; Wed, 6 Dec 2023 05:48:36 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-1d0ccda19eeso11718615ad.1; Wed, 06 Dec 2023 05:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701870516; x=1702475316; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VuRiXX+tHD8qpaoQh6okUrfYXevnVhYrWjiozg0Jp5A=; b=UJvXA19LveTth5rIb+QtqYfTJiXYlRue04PwaX1gggDwVZ3kydnyH2gUEGXfYcMVmR NdkAIHJmGwQ++Ray+Hra2BiLHhddEN8qjtakywsRxHxhqAijLdiMphwiPrBjifuo89Tl VZiF7kg6dXaWe0Qx4RBaW3HBNGVIZ985n+7FKRsHji4IYFx+tLbgGWf+8AH5m3xTq4Xc 6niRLdoycjNig5WtQ5tb96jghtfXn9+OVfm94aB/BAXxA4pGEbs6sZcACMIXTNvVpQac Ln0u07GzmXhlqdV+LK7h7PDyLF7UyzEtBkJhIraLTlAFSouHHH4WuWlhPyHfLf6bKlVG Mz7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701870516; x=1702475316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VuRiXX+tHD8qpaoQh6okUrfYXevnVhYrWjiozg0Jp5A=; b=nZAdDiIecLjD+f6BNBK1UpiCb2T0SPbPpCBOkSq+9Ouy67dcp9dNyHHn8FiyvlJLeP Bf5Tr3HqaD8BAr7OYmc7N01pXOKDS+UtxuznATvYEt6CSWHx7KIyAcYzmTYNFkU8V3pY /W0hKfrKiB549kpi+r+BF6ADTDXJ0L2Y0AiS/KkLKYdxu3y7EJzqEkmFgG37p83xIVWi L+jTS8HNNlnuQgzQ8EoOPvOxS3LmNk/2RvSyM+jm+aDg8z0Qd+oyyF77wjSUx3Q9Omdn JPKBvzd8adt7QVktCdXcvkOo3G9asPOFPj8Pdjg1/PwoYvIVFcRCEFkhQIwN6+wQQcc1 8AFg== X-Gm-Message-State: AOJu0YwY35qj957yqbx96jW4CGN1ZnkjNtrQ+KRItcjV6uq9fBnvcev6 wQx3b1kQ53eTEGxknfYzHz0= X-Received: by 2002:a17:902:c40d:b0:1d0:6ffe:1e90 with SMTP id k13-20020a170902c40d00b001d06ffe1e90mr639926plk.115.1701870515952; Wed, 06 Dec 2023 05:48:35 -0800 (PST) Received: from dawn-virtual-machine.localdomain ([183.198.59.249]) by smtp.gmail.com with ESMTPSA id l4-20020a170902eb0400b001d055328e1dsm3525812plb.223.2023.12.06.05.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:48:35 -0800 (PST) From: Li peiyu <579lpy@gmail.com> To: jic23@kernel.org Cc: javier.carrasco.cruz@gmail.com, lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/4] iio: core: introduce trough modifier for minimum values Date: Wed, 6 Dec 2023 21:48:19 +0800 Message-Id: <20231206134819.559496-1-579lpy@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206134655.559474-1-579lpy@gmail.com> References: <20231206134655.559474-1-579lpy@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 06 Dec 2023 05:48:44 -0800 (PST) From: Javier Carrasco The IIO_CHAN_INFO_PEAK modifier is used for maximum values and currently there is no equivalent for minimum values. Instead of overloading the existing peak modifier, a new modifier can be added. In principle there is no need to add a _TROUGH_SCALE modifier as the scale will be the same as the one required for the INFO_PEAK modifier, which in turn is sometimes omitted if a single scale for peaks and raw values is required. Add an IIO_CHAN_INFO_TROUGH modifier for minimum values. Signed-off-by: Javier Carrasco --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index c77745b594bd..351c64c2f4da 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -182,6 +182,7 @@ static const char * const iio_chan_info_postfix[] = { [IIO_CHAN_INFO_THERMOCOUPLE_TYPE] = "thermocouple_type", [IIO_CHAN_INFO_CALIBAMBIENT] = "calibambient", [IIO_CHAN_INFO_ZEROPOINT] = "zeropoint", + [IIO_CHAN_INFO_TROUGH] = "trough_raw", }; /** * iio_device_id() - query the unique ID for the device diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 117bde7d6ad7..d89982c98368 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -68,6 +68,7 @@ enum iio_chan_info_enum { IIO_CHAN_INFO_THERMOCOUPLE_TYPE, IIO_CHAN_INFO_CALIBAMBIENT, IIO_CHAN_INFO_ZEROPOINT, + IIO_CHAN_INFO_TROUGH, }; #endif /* _IIO_TYPES_H_ */ -- 2.34.1