mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <noname.nuno@gmail.com>
Cc: David Lechner <dlechner@baylibre.com>,
	Marcelo Schmitt  <marcelo.schmitt1@gmail.com>,
	Giorgi Tchankvetadze  <giorgitchankvetadze1997@gmail.com>,
	antoniu.miclaus@analog.com, lars@metafoo.de,
	Michael.Hennerich@analog.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] iio: adc: ad4030: fix calibscale read/write unit mismatch
Date: Sat, 28 Feb 2026 16:28:17 +0000	[thread overview]
Message-ID: <20260228162817.3d504e6e@jic23-huawei> (raw)
In-Reply-To: <446c20d78f9e990a90bf9d75ee82d056be6bfca8.camel@gmail.com>

On Thu, 26 Feb 2026 09:32:45 +0000
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Wed, 2026-02-25 at 09:20 -0600, David Lechner wrote:
> > On 2/25/26 5:53 AM, Marcelo Schmitt wrote:  
> > > On 02/25, Giorgi Tchankvetadze wrote:  
> > > > The read path returns calibscale in IIO_VAL_INT_PLUS_NANO but the write
> > > > path treats it as MICRO. Since no write_raw_get_fmt is provided, the
> > > > IIO core defaults to MICRO when parsing userspace input.
> > > > 
> > > > This means reading calibscale and writing it back results in a ~1000x
> > > > gain error.
> > > > 
> > > > Change the read path and available range to use MICRO to match the
> > > > write path.  
> > > 
> > > The updates to ad4030 driver will add write_raw_get_fmt() [1].
> > > [1]:
> > > https://lore.kernel.org/linux-iio/516cccc47e917bd26be29b016907f50a244a68b9.1771865684.git.marcelo.schmitt@analog.com/
> > > 
> > > At first glance, I think this could instead add a case to write_raw_get_fmt(),
> > > keeping calibscale nano precision (unless nano precision doesn't make sense
> > > for ad4030 calibscale (don't recall from top of my mind)).  
> > 
> > Since this is a fix and needs to be backported, it probably make sense
> > to not depend on a patch that is adding new features.
> >   
> 
> +1
> 
> - Nuno Sá
> 
> > I'm sure Jonathan will have an opinion about how he would like to handle
> > a conflict between the fixes and testing branches though.

Fixes in theory always go first.  That'll mean I end up holding the
other series back if this one is ready in the near future.

I'm not sure I fully understand the bug though!

Jonathan

  reply	other threads:[~2026-02-28 16:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 11:30 Giorgi Tchankvetadze
2026-02-25 11:53 ` Marcelo Schmitt
2026-02-25 12:21   ` Giorgi Tchankvetadze
2026-02-25 15:02     ` Andy Shevchenko
2026-02-25 15:20   ` David Lechner
2026-02-26  9:32     ` Nuno Sá
2026-02-28 16:28       ` Jonathan Cameron [this message]
2026-02-28 16:27 ` Jonathan Cameron

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=20260228162817.3d504e6e@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=giorgitchankvetadze1997@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=noname.nuno@gmail.com \
    --cc=nuno.sa@analog.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

all inboxes | Powered by JetHome®