Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1150275rdb; Wed, 6 Dec 2023 09:53:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMri3jqsZgw+7PxLc2DnK0H5HuSPChgD6Gj1yE8yflCnuabSZtzsr+X4FsRDo+vUMixBSI X-Received: by 2002:a17:90a:1f44:b0:286:6cc1:5fcd with SMTP id y4-20020a17090a1f4400b002866cc15fcdmr1063333pjy.80.1701885186639; Wed, 06 Dec 2023 09:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701885186; cv=none; d=google.com; s=arc-20160816; b=Ixzh6y/d74VUohTcJG5Qh0fFnkL42sFyq21lWkJm4wtAQWj1Um/N02XxxeG4aKuVhV zUlowuu9YDyjymDB7Mare/3Atn9kkilBkm2VAvRPF8nAMT4E5P2yDsLk636nXr5M2NvL zg2904m6jvD3ywfCAedRR8Y93lv4K32ZKwgX4SWN1Z3OZgPshU6P2KztEXkye1goqqWC zWKWv8RVnFFVyLH8jh2N0RfBGgCpw2V7n3iOyuJnRQJL39NTG8D+gfU/qyt8D36etj99 MVCCdftgx7MWhR2E56bkKUVIgJfxLYyUOMjnGEpBzl/lyYPxo7WPTz/asrZ8C1lumKi3 Cvag== 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 :dkim-signature; bh=pf8QnXqL1jrsVcuCiipKJ6fS6PyujTXxRjbmMmnoUNg=; fh=sxV4ftuK+j+2kRPSg6sZNVslmiZEjjhzegb5cOA3Jhg=; b=ZelzGKNUw0Wbzt2qnbcXEG9ojZcoITjkl/kXdG+RZXI/ZNEsBNxAEM1T6scGg4zgG3 ExbRUqougzuXtd5jJQQaRyrnjUyDSnqu+bhh8Z6bIhFTLENETPKbEhAeHg1HS2jSZbqJ TreTxBRT2Tc+D//6ENAoQCcmZsKxXFYiuRZ2x+rge44vN4kavPzicf0rXCZJIbqfG5BD UK+WYeTOh32CEh2jIH3bf6zNMPlcjCUTIR3ge9hE9weI8CvCKMntiESaZWKHa78pPC71 ahaRGlvEQPCf44a6NpNtqD0fAzcRBWHsFPZYp1BEL/3xve84ZOjHOO5V0KVmp6vn+uMX zX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tiji+3Z5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id x6-20020a17090aca0600b00286550aeb78si182729pjt.102.2023.12.06.09.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:53:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tiji+3Z5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DECFE807BEEF; Wed, 6 Dec 2023 09:53:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442735AbjLFRwt (ORCPT + 99 others); Wed, 6 Dec 2023 12:52:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442677AbjLFRws (ORCPT ); Wed, 6 Dec 2023 12:52:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3565122 for ; Wed, 6 Dec 2023 09:52:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 149A4C433C8; Wed, 6 Dec 2023 17:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701885174; bh=eQj8MdTVfam+v/WP6NntKwGS4bt+2MoHIiUP3tMRNi0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tiji+3Z51wqG8estcOqphd6/JBkbTZPJWQxOJEzazaWuSVe13G1RbSCkb7JSG11w4 Es8CDs8cMM68uEOm20rl6EfvDqVWXRMZkLiUX48/iZYRS3qljnuOGkEoVwdn3URKkp sg5jNCcBuLSdIVP1HPVopouI1qitGMxh2x37eod52MFKRx3P5GogvqPZlkc3naUGiQ EFR3WzxGwyh8yjWEmCV0lH6qC3QoXxgItfyuvDcEnB5GYxYft9e2cDZiVmSBiQ/+GA cYd+WLRV1s3PIFQcW2BDtMtSjc06MgufJG+9NqmZ1iD82dJo6GeNmW1aPVMIH4EZnn vZJIVUtm5ZIbg== Date: Wed, 6 Dec 2023 17:52:45 +0000 From: Jonathan Cameron To: Li peiyu <579lpy@gmail.com> 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: Re: [PATCH v4 1/4] iio: core: introduce trough modifier for minimum values Message-ID: <20231206175245.73b91fe0@jic23-huawei> In-Reply-To: <20231206134819.559496-1-579lpy@gmail.com> References: <20231206134655.559474-1-579lpy@gmail.com> <20231206134819.559496-1-579lpy@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:53:04 -0800 (PST) On Wed, 6 Dec 2023 21:48:19 +0800 Li peiyu <579lpy@gmail.com> wrote: > 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. > Terminology is a bit mixed up in here. Modifiers in IIO are things like the axis or a color for light sensors. This is an info element that applies to a channel (modified or not). Other than that looks good to me. > 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_ */