Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dimitri Fedrau <dima.fedrau@gmail.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Andrew Hepp <andrew.hepp@ahepp.dev>,
	Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] iio: temperature: mcp9600: set channel2 member
Date: Sun, 5 May 2024 11:15:41 +0100	[thread overview]
Message-ID: <20240505111541.13b94920@jic23-huawei> (raw)
In-Reply-To: <20240430122157.GA46332@debian>

On Tue, 30 Apr 2024 14:21:57 +0200
Dimitri Fedrau <dima.fedrau@gmail.com> 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 <dima.fedrau@gmail.com> 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 <dima.fedrau@gmail.com>
> > > ---
> > >  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),
> > >  	},  
> >   
> 


  reply	other threads:[~2024-05-05 10:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 12:05 [PATCH 0/5] Add threshold events support and some minor cleanup Dimitri Fedrau
2024-04-30 12:05 ` [PATCH 1/5] iio: temperature: mcp9600: set channel2 member Dimitri Fedrau
2024-04-30 12:11   ` Jonathan Cameron
2024-04-30 12:21     ` Dimitri Fedrau
2024-05-05 10:15       ` Jonathan Cameron [this message]
2024-05-09 19:31         ` Dimitri Fedrau
2024-04-30 12:05 ` [PATCH 2/5] iio: temperature: mcp9600: Share scale by all channels Dimitri Fedrau
2024-04-30 12:09   ` Jonathan Cameron
2024-04-30 12:23     ` Dimitri Fedrau
2024-04-30 12:05 ` [PATCH 3/5] iio: temperature: mcp9600: add newlines after if statements Dimitri Fedrau
2024-04-30 12:05 ` [PATCH 4/5] iio: temperature: mcp9600: Fix line exceeding 80 columns Dimitri Fedrau
2024-04-30 12:05 ` [PATCH 5/5] iio: temperature: mcp9600: add threshold events support Dimitri Fedrau
2024-04-30 20:41   ` kernel test robot
2024-05-05 17:47   ` Jonathan Cameron
2024-05-09 20:45     ` Dimitri Fedrau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240505111541.13b94920@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andrew.hepp@ahepp.dev \
    --cc=dima.fedrau@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox