Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2019050lqo; Sun, 19 May 2024 09:15:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcMZLLTabcjQIadr22pqyvHbZHvy4aSktDp79HHiM6CnDt+WYY3zrcKXUIZr3yFszIZHH45vSw3N18JiH5nScFZEMlNtc6rgZXwtv4xw== X-Google-Smtp-Source: AGHT+IHxF8hsuxOhsjumvWV4MXl4jdC3bbpUYs5syC6OqxxO4XMO6xAP88625fgOznEgcs9Qvq9a X-Received: by 2002:a05:6808:1795:b0:3c9:64ad:da8b with SMTP id 5614622812f47-3c9971dcfbamr29958037b6e.57.1716135308006; Sun, 19 May 2024 09:15:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716135307; cv=pass; d=google.com; s=arc-20160816; b=jWGJjN9wpfEmS9Mtt6aenT1U9Yf5rhglhwBYBbgVogKuJJbF4w5lqUB6b9t68yWDX1 vd3zTD0DN85ORN1cfQz16HS1uEoiyDWo9I2IS1gvB5zxFOcqA+57UZmpwC554gAOgI3i /gPwPtfOYcKweKa96OhcO2rQ0Fg+a2eGkDph3gLyjsst4bfBe45nfOaLoZhM8ZDklQ8A bCjqc8iIRZrOcZM+6Bw9mBNX5jhXI9jA3SjJyfbXfXmaZZiCsh+MKoU4oTVTq8pIqyYI qIf085GmgFvp4v0ZRBfkml9PT/aK9VnmH701wMe+D3MAwwK/Rt/9mWhKe4tQeaRWlngO R5mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=AOMPdQys4VuCQv4aSWxYVkICaQfiLg51XQYQYdtIncc=; fh=5bi4AMtp9+e9pTmQZ/1jsYzzezWqSSGcX3S83Vb5hN8=; b=I6vcLUGi70COlwlGbna8N7ww8k+RIcNGfpwHIcZLDlodwOLZyaR7DJGKw1GYDachpl dae/IadevHHorezBPZDjsWntciBaudPrZ9Yn/ccyi/oPpfnAxbAV2ZRO5hQP4YmkgSIn rLTM4edXLDr8kxCdy1KfhE2mI5ax6l488SaYUd7t0gbdQVbf9qM+u5Qe3ulZYuQre0cs fksc4pZaE8iCMBvgRNo7OafRoe/WFD/hTR4lEIUfdg7ABgH1cNBC8gLI61P4aFvLx99t ovsym2OyqwUjcKw0M6gWdHXU1TqoKYOhP7GXT9Ryk6qyy6T0khqTrlyLyD0Tn6HGGt9z FsZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rdsRavyb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf277dd6si242223285a.30.2024.05.19.09.15.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 09:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rdsRavyb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 609901C212B8 for ; Sun, 19 May 2024 16:15:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDB5A47F46; Sun, 19 May 2024 16:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rdsRavyb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED0C345BF9; Sun, 19 May 2024 16:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716135290; cv=none; b=jMcxYjHFT0ZV9wdTdFCZK84K3+zI0M6FiQ+PUr+9J2kmB0+zPxa2VeAQyeTfjSNlSHKAD6/c+p21G0cGApbeWl3ONuw6ChRGnJU3fF3eZSCJrPLlKOWyGTKNfsokVvJ4fx6wqfeaC3V4G+/+eGC91YanDGqYrlNQgs4xKejFXlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716135290; c=relaxed/simple; bh=aQvXmZMW77qc8tNgoHxBHcZ4dYBBQ/RlOSDN1pdnJAg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P9nEg6cJFVsZ4x3ybUNckPeZMgId5x/rannURhrUr76e6nyMnzdkPIf/h/YWTp2nusL5Jb3lJqntL8vMYp/1WTJYFaT+S7jBS2G+6WCqejWecBFYMpjIIUn3duRpX2P4WoDAK0d/z2oDOMhwrk9XgdTQlkw3DHC0KmvxQ7yg7uI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rdsRavyb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A83C4AF0D; Sun, 19 May 2024 16:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716135289; bh=aQvXmZMW77qc8tNgoHxBHcZ4dYBBQ/RlOSDN1pdnJAg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rdsRavybRhyl1N4rxKMHALpswrTaWdeis5Ujm7sdFLpdehH9AABSVMk0U2o47LZ8w JotiUKEyaY6XLMadtgsyCBF09tA3h2ddWGMLX35pfutMlY1g1e7SEtxPvZib5+pKAK x6lZStnNTD4Yt78fef0LMNIy17coLfkt8/wUq/n6NR8YJsGuMsc7hIKI1woOP1w1OB e/omRDQtXqeuoXUcZNiWwwlWPAEdA4FJ/TPqimAWfArtrdDs9D+iRbc+JTIWtw5Oqu oQ8HNLfLBwhYRtfS4tWW0GmVdTDuQKMVv8i9RHgpw/BC5unbtmRDVoUBavN7oQdGG5 sgTWENbNa9Vsw== Date: Sun, 19 May 2024 17:14:38 +0100 From: Jonathan Cameron To: Dimitri Fedrau Cc: Lars-Peter Clausen , Andrew Hepp , Marcelo Schmitt , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nuno =?UTF-8?B?U8Oh?= Subject: Re: [PATCH v2 1/2] iio: temperature: mcp9600: Provide index for both channels Message-ID: <20240519171438.08810789@jic23-huawei> In-Reply-To: <20240517081050.168698-2-dima.fedrau@gmail.com> References: <20240517081050.168698-1-dima.fedrau@gmail.com> <20240517081050.168698-2-dima.fedrau@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 17 May 2024 10:10:49 +0200 Dimitri Fedrau wrote: > The mapping from cold junction to ambient temperature is inaccurate. We > provide an index for hot and cold junction temperatures. > > Suggested-by: Jonathan Cameron > Signed-off-by: Dimitri Fedrau Hi Dmitri, I'm not sure you replied to the question in previous review of what sysfs files exist for this device. Whilst I am at least a little open to changing the ABI, I'd like to fully understand what is currently presented and why iio_info is having trouble with it. I also want an ack from Andrew on this one given might break it existing usage. The current interface is perhaps less than ideal, but I don't think it is wrong as such. Whilst I wasn't particularly keen on the cold junction == ambient I'm not sure moving to just indexed is an improvement. Hence looking for input from Andrew. +CC Nuno as someone who is both active in IIO and has written thermocouple front end drivers in the past. Jonathan > --- > drivers/iio/temperature/mcp9600.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c > index 46845804292b..22451d1d9e1f 100644 > --- a/drivers/iio/temperature/mcp9600.c > +++ b/drivers/iio/temperature/mcp9600.c > @@ -14,6 +14,9 @@ > > #include > > +#define MCP9600_CHAN_HOT_JUNCTION 0 > +#define MCP9600_CHAN_COLD_JUNCTION 1 > + > /* MCP9600 registers */ > #define MCP9600_HOT_JUNCTION 0x0 > #define MCP9600_COLD_JUNCTION 0x2 > @@ -25,17 +28,19 @@ > static const struct iio_chan_spec mcp9600_channels[] = { > { > .type = IIO_TEMP, > + .channel = MCP9600_CHAN_HOT_JUNCTION, > .address = MCP9600_HOT_JUNCTION, > .info_mask_separate = > BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), > + .indexed = 1, > }, > { > .type = IIO_TEMP, > + .channel = MCP9600_CHAN_COLD_JUNCTION, > .address = MCP9600_COLD_JUNCTION, > - .channel2 = IIO_MOD_TEMP_AMBIENT, > - .modified = 1, > .info_mask_separate = > BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), > + .indexed = 1, > }, > }; >