Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp814202lqh; Sun, 5 May 2024 03:16:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXh/QiqHHC5bCltPiG28I/J07QZezR9LrBFFFwcNJVZ+9rBB34wUpvuaBqXI2AdWQyOdGRbQj8Lw+5uF+ZGxBEB7lyGdFtrAxFBiMGVA== X-Google-Smtp-Source: AGHT+IHJHesr2QgHGi4Bl4rN9m0lvHpeMxgFvm4kvxSBlSq9t4ioL2jFWzpfwIQX9OIkjZE92wyf X-Received: by 2002:a50:8d14:0:b0:572:7b2b:d990 with SMTP id s20-20020a508d14000000b005727b2bd990mr6326420eds.30.1714904160328; Sun, 05 May 2024 03:16:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714904160; cv=pass; d=google.com; s=arc-20160816; b=IGgD08MunKJ3txiTAbG6yFNF2Qpc94akt5fYSRleH0wm79B/mcBmBqnG7q/3CgC/SN j6mNh1piFVl2vy4vcvegateLeWpWr0AMWrzL3I5jFn7imOvSFy352Kj0waZSd5XZQVYS bbhJfqzEJ/uQuV0ERXPOckHt7tvO/OJkaolJEOtErbdRFtO+Yfqx+aAYyfZT2SFzXfpm v0SLmge1f0u5zyb4YPIlZVmc64pinydWXBoMi2QsTIAyp/F7HbTPeIOsTfTiLmd81lYs kB8cHQXEiKt5mOh0CckTZJZe35l6Sk7LxZHJqz0Cn3d2ci/vFDOFZOxsBqM3JXq47G6T qbQw== 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=fK3FtGigU5WkTMeg0o5MUc/54I+3kRb37E4+m/1Vt/I=; fh=bGbW2LVGCI03ZS52hpbfxCAZ7TALz8sSD8RaIWhB71c=; b=XzK25N92otjHTUe/zeSzh7hSYjRa0HXPt/Ra70vx2oEad4V8nscKxrDF5ItZLWU2bI yZsyxoq7lfDzvIMEMNfKFFilUhcv9prMkc8D+mRAGZ3S5NOKI13fk1d6tAqSkQaz1ecs KoA3nhJ5x8a3E7cTue3iigE1gYlI5xjkQ6p+++AIJjeObLyCZ/mCQg2ATIaiA5lYnJaI QaW2yxpTaVyYXhWaObDvMz1ZqhjGO/Pdz/0ic/1Aj/wAeCK9OsyWcjB2cShgsqHYgEyu Zg8OGYXVReFKZBRzDJz1NVLZCxtSnkPq8FmZ8FWcxTH8MD0iwcWFGs9SvwSVz4thCU3n 8/Ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tek13VQM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l16-20020aa7d950000000b005705ec84930si3523343eds.607.2024.05.05.03.16.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 03:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tek13VQM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168942-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 14EB51F215C5 for ; Sun, 5 May 2024 10:16:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 511BCB66F; Sun, 5 May 2024 10:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tek13VQM" 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 744AC749C; Sun, 5 May 2024 10:15:52 +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=1714904152; cv=none; b=OAJdQcLcYHYxDbrwfEJbArT7cKJ3g83P7crNOFiE3AG/ZM14vWPiGS75FuGhS7Npf4HxE5BxHc4F4T/SvxJDfJsO8xuzjpNggVo5r9kbeZn5yO62Dm8c9NyoHM6pauCB92eImlWP6eTz+bUx2ZaeCxzsy6uIx7heQ1EmXVuOqkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714904152; c=relaxed/simple; bh=0XKn5KyE0UnxNmHj2HHee7Et02H9uYvYyVyAj3MOENs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IdTTyxfnj2sOH5HyKDQZvGqPg9YUrCv/AnIJlk/U0WbT5HshzUEGBNFyPckDXzmxdXy+9q6ITq3kVkPqL2h8yM2R5tqHcAP7QYcVECReh/5gYj5jBU2vqIOzfnECa3qJnng3I5mm6YDykAyrPvL1kfhCeW4u7V6DBku6mUFM5Ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tek13VQM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B7E4C113CC; Sun, 5 May 2024 10:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714904152; bh=0XKn5KyE0UnxNmHj2HHee7Et02H9uYvYyVyAj3MOENs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tek13VQMUAkg9kg+Xdntk+1i6ZClzuyUP+btZLoaRVGzvDqBIdxhRAqtFXVZ7dZXK MnkPCA+bALied8kiwlZNEmN2KIcUOXL7gknSmuRE3/tvQKugUAHELbGpthsxU4drRm 2Aq8iiSei0b2ONRIpAksfCmilAolxj0XruuwFWFrPPdKH2kF3siQm2EwsnrekPuXYN TdbYNVeYoXdbTblH9/CzLuMdOKRd8Bx7ul5JfTmHreqkuoimXjVrnazwE2FGkNMqIF l671OgXhlNmuCx+3gs9nL1wPuLFtJq77chFlZqNAyfNjlI3UUHTeYGAz/YrOzz8J4O y5VJq9sjDk7qQ== Date: Sun, 5 May 2024 11:15:41 +0100 From: Jonathan Cameron To: Dimitri Fedrau Cc: Jonathan Cameron , Lars-Peter Clausen , Andrew Hepp , Marcelo Schmitt , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] iio: temperature: mcp9600: set channel2 member Message-ID: <20240505111541.13b94920@jic23-huawei> In-Reply-To: <20240430122157.GA46332@debian> References: <20240430120535.46097-1-dima.fedrau@gmail.com> <20240430120535.46097-2-dima.fedrau@gmail.com> <20240430131102.00005e58@Huawei.com> <20240430122157.GA46332@debian> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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 Tue, 30 Apr 2024 14:21:57 +0200 Dimitri Fedrau wrote: > Am Tue, Apr 30, 2024 at 01:11:02PM +0100 schrieb Jonathan Cameron: > > On Tue, 30 Apr 2024 14:05:31 +0200 > > Dimitri Fedrau wrote: > > > > > Set channel2 member of channel 0 to IIO_MOD_TEMP_OBJECT and set modified > > > member to 1. > > This an ABI change, so needs a strong argument + must be a fix > > rather than an improvement. So why does this need to change? > > > Hi Jonathan, > > I don't know if it is an valid argument but when using tool "iio_info" > the temp_object wasn't displayed at all. After adding these two lines > the temp_object is displayed. Don't know if it is a problem with the > userspace tools. Just to check, it displayed not temperature channel for this? If you could send the file listing of the appropriate /sys/bus/iio/devices/iio\:deviceX/ directory that would be great. It is possible the tools don't cope with a mixture of modified and unmodified channels (without index). Whilst the ABI docs don't say you can't do this it is a rather obscure corner case. The maping from hotjunction to object isn't totally clear to me. Mind you neither is the mapping from cold junction to ambient (that one is a bit stronger as the datasheet tables assume Cold Junction Temperature == Ambient Temperature. Example of why I don't like this is object is no obvious if the hotjunction is in a gas or liquid. The object defintion was I think added for infrared temperature sensors where you get nothing meaningful without an object to emit the infrared. An alternative would be to provide an index for both channels. Also an ABI change, but avoids the object / hot junction issue and I would assume works fine with iio_info. Jonathan > > iio_info version: 0.25 (git tag:b6028fde) > Libiio version: 0.25 (git tag: b6028fd) backends: local xml ip usb serial > > Besides that it eases distinction between the two channels in the last > patch, but I think this argument is not strong enough. :) > > Best regards, > Dimitri > > > > > > > > > Signed-off-by: Dimitri Fedrau > > > --- > > > drivers/iio/temperature/mcp9600.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c > > > index 7a3eef5d5e75..e277edb4ae4b 100644 > > > --- a/drivers/iio/temperature/mcp9600.c > > > +++ b/drivers/iio/temperature/mcp9600.c > > > @@ -26,6 +26,8 @@ static const struct iio_chan_spec mcp9600_channels[] = { > > > { > > > .type = IIO_TEMP, > > > .address = MCP9600_HOT_JUNCTION, > > > + .channel2 = IIO_MOD_TEMP_OBJECT, > > > + .modified = 1, > > > .info_mask_separate = > > > BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), > > > }, > > >