lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200502231158.GB25127@qmqm.qmqm.pl>
Date:   Sun, 3 May 2020 01:11:58 +0200
From:   Michał Mirosław <mirq-linux@...e.qmqm.pl>
To:     Sebastian Reichel <sebastian.reichel@...labora.com>
Cc:     clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org
Subject: Re: [PATCH v4 2/4] power: supply: core: add input voltage/current
 measurements

On Sun, May 03, 2020 at 12:45:26AM +0200, Michał Mirosław wrote:
> On Sun, May 03, 2020 at 12:23:49AM +0200, Sebastian Reichel wrote:
> > On Fri, May 01, 2020 at 05:11:18PM +0200, Michał Mirosław wrote:
[...]
> > > --- a/include/linux/power_supply.h
> > > +++ b/include/linux/power_supply.h
> > > @@ -127,7 +127,9 @@ enum power_supply_property {
> > >  	POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
> > >  	POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD, /* in percents! */
> > >  	POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD, /* in percents! */
> > > +	POWER_SUPPLY_PROP_INPUT_CURRENT_NOW,
> > 
> > What:           /sys/class/power_supply/<supply_name>/current_avg    
> > Date:           May 2007
> > Contact:        linux-pm@...r.kernel.org                          
> > Description:                  
> >                 Reports an average IBUS current reading over a fixed period.   
> >                 Normally devices will provide a fixed interval in which they   
> >                 average readings to smooth out the reported value.             
> >                                                                                 
> >                 Access: Read    
> >                 Valid values: Represented in microamps
> > 
> 
> There are two entries for /sys/class/power_supply/<supply_name>/current_avg
> in the file, the other one mentions IBAT instead. "voltage_now" has the
> same problem.
[...]

So the general idea of the sysfs API seems to require separate devices for the
input (charger) and battery elements. Since what I'm looking at is an
integrated battery controller (bq25896) which has three connections: an USB
power (VBUS), a battery and the system load, but it creates only a single
power-class device. This is complicated by the fact that this is an OTG device
and so it can sink or source VBUS power.

Best Regards,
Michał Mirosław

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ