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: <723a8253-a936-4901-9a05-a20f27fdb07c@wanadoo.fr>
Date: Fri, 13 Dec 2024 19:31:45 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Kim Seer Paller <kimseer.paller@...log.com>
Cc: linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, Kim Seer Paller <kimseer.paller@...log.com>,
 Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Mike Looijmans <mike.looijmans@...ic.nl>
Subject: Re: [PATCH v6 2/2] power/supply: Add support for ltc4162-f/s and
 ltc4015

Le 13/12/2024 à 03:37, Kim Seer Paller a écrit :
> LTC4162-L 35V/3.2A Multi-Cell Lithium-Ion Step-Down Battery Charger
> LTC4162-F 35V/3.2A Multi-Cell LiFePO4 Step-Down Battery Charger
> LTC4162-S 35V/3.2A Lead-Acid Step-Down Battery Charger
> LTC4015 35V/3.2A Multichemistry Buck Battery Charger Controller

...

> +static int ltc4015_get_vcharge(struct ltc4162l_info *info,
> +			       unsigned int reg,
> +			       union power_supply_propval *val)
>   {
> -	u8 cell_count = ltc4162l_get_cell_count(info);
> +	unsigned int regval, chem_type;
> +	int ret;
> +	u32 voltage;
> +
> +	ret = regmap_read(info->regmap, reg, &regval);
> +	if (ret)
> +		return ret;
>   
> -	if (!cell_count)
> -		return -EBUSY; /* Not available yet, try again later */
> +	regval &= BIT(6) - 1; /* Only the lower 5 bits */

Nitpick, should there be a v7:
	Would using GENMASK(5, 0) be clearer and self-explanatory?

> +
> +	/*
> +	 * charge voltage setting can be computed from:
> +	 * cell_count × (vcharge_setting × a + b)
> +	 * where vcharge_setting ranges from 0 to c (d).
...

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ