Re: [PATCH v2] iio: adc: axp20x_adc: fix charging current reporting on AXP22x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, Nov 21, 2021 at 1:44 AM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> On Wed, 17 Nov 2021 00:37:46 +0300
> Evgeny Boger <boger@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>
>
> 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@xxxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux