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  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]
Date:   Sun, 3 May 2020 00:23:49 +0200
From:   Sebastian Reichel <sebastian.reichel@...labora.com>
To:     Michał Mirosław <mirq-linux@...e.qmqm.pl>
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

Hi,

On Fri, May 01, 2020 at 05:11:18PM +0200, Michał Mirosław wrote:
> Introduce input voltage and current limits and measurements.
> This makes room for e.g. VBUS measurements in USB chargers.

We already have properties for charger input voltage/current.
Unfortunately the naming is not as straight forward, as it
could be. Basically the properties have been added over time
and are ABI now. Things are documented in

Documentation/ABI/testing/sysfs-class-power

I provided the relevant properties below.

> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>

[...]

> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -273,7 +273,9 @@ static struct device_attribute power_supply_attrs[] = {
>  	POWER_SUPPLY_ATTR(charge_control_limit_max),
>  	POWER_SUPPLY_ATTR(charge_control_start_threshold),
>  	POWER_SUPPLY_ATTR(charge_control_end_threshold),
> +	POWER_SUPPLY_ATTR(input_current_now),
>  	POWER_SUPPLY_ATTR(input_current_limit),
> +	POWER_SUPPLY_ATTR(input_voltage_now),
>  	POWER_SUPPLY_ATTR(input_voltage_limit),
>  	POWER_SUPPLY_ATTR(input_power_limit),
>  	POWER_SUPPLY_ATTR(energy_full_design),
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 6a34df65d4d1..5313d1284aad 100644
> --- 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

>  	POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
> +	POWER_SUPPLY_PROP_INPUT_VOLTAGE_NOW,

What:           /sys/class/power_supply/<supply_name>/voltage_now    
Date:           May 2007    
Contact:        linux-pm@...r.kernel.org    
Description:    
                Reports the VBUS voltage supplied now. This value is generally    
                read-only reporting, unless the 'online' state of the supply    
                is set to be programmable, in which case this value can be set    
                within the reported min/max range.    
    
                Access: Read, Write    
                Valid values: Represented in microvolts    

>  	POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT,
>  	POWER_SUPPLY_PROP_INPUT_POWER_LIMIT,
>  	POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists