:: Re: [maemo-leste] [PATCH] power: su…
Top Page
Delete this message
Reply to this message
Author: Sicelo
Date:  
To: Sebastian Reichel
CC: linux-pm, maemo-leste, pali
Subject: Re: [maemo-leste] [PATCH] power: supply: bq2415x_charger: report online status
Hi Sebastian

On Tue, Feb 27, 2024 at 09:11:36PM +0100, Sebastian Reichel wrote:
> Hi,
>
> On Mon, Feb 26, 2024 at 09:44:32PM +0200, Sicelo A. Mhlongo wrote:
> > Provide the Online property. This chip does not have specific flags to
> > indicate the presence of an input voltage, but this can be inferred from
> > the reported charging status.
>
> The datasheet suggests, that you can get the status from the fault
> bits:
>
> 011 - Poor input source or VBUS < UVLO
>

Absolutely, yes. This particular state, which is a fault condition, clearly
indicates VBUS is present.

However, when there are no faults at all, then those bits always read
`000`. On a running system, one can check this by connecting and
disconnecting a charger (Nokia N900 used in my tests) while watching
/sys/class/power_supply/bq24150a-0/registers. Only bit 4 changes state.
In other words, the fault bits do not appear to be enough to determine
the presence of an input voltage.

However, looking at them more closely seems to suggest I should respin the
patch to also report VBUS online if a fault is reported instead of only
during charging and charge full states.

Please let me know if this sounds correct, or if I misunderstood your
reply.

Sincerely
Sicelo