Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Chen-Yu Tsai <wens@csie.org>
Cc: Evgeny Boger <boger@wirenboard.com>,
	linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
	Quentin Schulz <quentin.schulz@bootlin.com>,
	Quentin Schulz <quentin.schulz@free-electrons.com>
Subject: Re: [PATCH v2] iio: adc: axp20x_adc: fix charging current reporting on AXP22x
Date: Sun, 21 Nov 2021 11:32:40 +0000	[thread overview]
Message-ID: <20211121113240.67f49851@jic23-huawei> (raw)
In-Reply-To: <CAGb2v66_+HWrJM7i3HmaeOE7oh6h+MUxOsp7J=GObZPovnfS3g@mail.gmail.com>

On Sun, 21 Nov 2021 01:58:08 +0800
Chen-Yu Tsai <wens@csie.org> wrote:

> Hi,
> 
> On Sun, Nov 21, 2021 at 1:44 AM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > On Wed, 17 Nov 2021 00:37:46 +0300
> > Evgeny Boger <boger@wirenboard.com> wrote:
> >  
> > > Both the charging and discharging currents on AXP22x are stored as
> > > 12-bit integers, in accordance with the datasheet.
> > > It's also confirmed by vendor BSP (axp20x_adc.c:axp22_icharge_to_mA).
> > >
> > > The scale factor of 0.5 is never mentioned in datasheet, nor in the
> > > vendor source code. I think it was here to compensate for
> > > erroneous addition bit in register width.
> > >
> > > Tested on custom A40i+AXP221s board with external ammeter as
> > > a reference.
> > >
> > > Signed-off-by: Evgeny Boger <boger@wirenboard.com>  
> >
> > I know Quentin has moved on from Bootlin, so looking for input from Chen-Yu Tsai
> > for these as I have no idea :)  
> 
> The datasheet only lists the registers for reading the value, but nothing
> is said about how to interpret the data read. And the datasheet lists 13
> bits split between two registers.
> 
> Evgeny mentioned that the original code is wrong, and the BSP code is
> likely right, and has test results that match. That's good enough for
> me. Unfortunately I don't have any way to double check it right now. So
> 
> Acked-by: Chen-Yu Tsai <wens@csie.org>

Applied to the fixes-togreg branch of iio.git with a fixes tag for the original
driver introduction (as it seems this dates back that far) and marked for stable.

Thanks,

Jonathan

      reply	other threads:[~2021-11-21 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 21:37 [PATCH v2] iio: adc: axp20x_adc: fix charging current reporting on AXP22x Evgeny Boger
2021-11-20 17:49 ` Jonathan Cameron
2021-11-20 17:58   ` Chen-Yu Tsai
2021-11-21 11:32     ` 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=20211121113240.67f49851@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=boger@wirenboard.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=quentin.schulz@bootlin.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=wens@csie.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