From: Jonathan Cameron <jic23@kernel.org>
To: <Victor.Duicu@microchip.com>
Cc: <Jonathan.Cameron@huawei.com>, <dlechner@baylibre.com>,
<nuno.sa@analog.com>, <linux-iio@vger.kernel.org>,
<devicetree@vger.kernel.org>, <robh@kernel.org>,
<andy@kernel.org>, <krzk+dt@kernel.org>,
<linux-kernel@vger.kernel.org>, <Marius.Cristea@microchip.com>,
<conor+dt@kernel.org>
Subject: Re: [PATCH v2 2/2] iio: temperature: add support for MCP998X
Date: Sat, 7 Jun 2025 18:28:13 +0100 [thread overview]
Message-ID: <20250607182813.64230171@jic23-huawei> (raw)
In-Reply-To: <e5756eaf53fb5a702274cc707fcdf6196773fc65.camel@microchip.com>
On Mon, 2 Jun 2025 14:49:29 +0000
<Victor.Duicu@microchip.com> wrote:
> On Fri, 2025-05-30 at 17:53 +0100, Jonathan Cameron wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > know the content is safe
> >
> > On Thu, 29 May 2025 12:36:28 +0300
> > victor.duicu@microchip.com wrote:
> >
> > > From: Victor Duicu <victor.duicu@microchip.com>
> > >
> > > This is the driver for Microchip MCP998X/33 and MCP998XD/33D
> > > Multichannel Automotive Temperature Monitor Family.
> > >
> > > Signed-off-by: Victor Duicu <victor.duicu@microchip.com>
> > Hi Victor,
> >
> Hi Jonathan,
>
> ...
>
> >
> > > +
> > > +What: /sys/bus/iio/devices/iio:deviceX/in_beta1
> > > +KernelVersion: 6.17
> > > +Contact: linux-iio@vger.kernel.org
> > > +Description:
> > > + This attribute controls the value of beta correction
> > > + for channel 1.
> >
> > Is this something that we'd normally expect to manually update? What
> > is
> > it a characteristic of? If it is expected to the be related to the
> > diodes attached, that's a problem for firmware/dt, not sysfs
> > interfaces.
> >
>
> Beta is a characteristic of the diode/transistor placed on the setup.
> Different diodes require different betas.
> So yes, beta value should be in devicetree.
>
> ...
> > >
> > > +
> > > + priv->iio_chan[iio_idx++] = (struct
> > > iio_chan_spec)MCP9982_CHAN(reg_nr, reg_nr,
> > > +
> > > MCP9982_INT_VALUE_ADDR(reg_nr));
> >
> > Seems very likely that the (struct iio_chan_spec) should be in the
> > macro definition.
> >
>
> In version 1 the macro used to define the channels was:
>
> >
> #define MCP9982_CHAN(index, si, __address) ({ \
> struct iio_chan_spec __chan = { \
> .type = IIO_TEMP, \
> .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
> .info_mask_shared_by_all_available =
> BIT(IIO_CHAN_INFO_SAMP_FREQ), \
> .info_mask_shared_by_all =
> BIT(IIO_CHAN_INFO_SAMP_FREQ), \
> .channel = index, \
> .address = __address, \
> .scan_index = si, \
> .scan_type = { \
> .sign = 'u', \
> .realbits = 8, \
> .storagebits = 8, \
> .endianness = IIO_CPU \
> }, \
> .indexed = 1, \
> }; \
> __chan; \
> })
>
> which contains struct iio_chan_spec inside.
> Andy suggested to use compound literal, so I switched to version 2.
> I still use a macro because most of the parameters are common among the
> channels.
I think we can add the (struct iio_chan_spec) to the macro definition.
>
> With Kind Regards,
> Victor Duicu
prev parent reply other threads:[~2025-06-07 17:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 9:36 [PATCH v2 0/2] add support for MCP998X victor.duicu
2025-05-29 9:36 ` [PATCH v2 1/2] dt-bindings: iio: temperature: " victor.duicu
2025-05-29 18:13 ` David Lechner
2025-05-30 15:55 ` Conor Dooley
2025-06-02 14:48 ` Victor.Duicu
2025-06-06 15:15 ` Conor Dooley
2025-06-10 13:29 ` Victor.Duicu
2025-06-10 15:17 ` Conor Dooley
2025-05-29 9:36 ` [PATCH v2 2/2] " victor.duicu
2025-05-29 18:36 ` Andy Shevchenko
2025-05-30 4:39 ` kernel test robot
2025-05-30 16:53 ` Jonathan Cameron
2025-06-02 14:49 ` Victor.Duicu
2025-06-07 17:28 ` Jonathan Cameron [this message]
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=20250607182813.64230171@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=Marius.Cristea@microchip.com \
--cc=Victor.Duicu@microchip.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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