From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Iskren Chernev <me@iskren.info>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Matheus Castello <matheus@castello.eng.br>,
Rob Herring <robh+dt@kernel.org>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/4] power: max17040: add passing props from supplier
Date: Tue, 16 May 2023 00:41:45 +0200 [thread overview]
Message-ID: <20230515224145.u2fos4ln3n6hb567@mercury.elektranox.org> (raw)
In-Reply-To: <20230308084419.11934-4-clamor95@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1967 bytes --]
Hi,
On Wed, Mar 08, 2023 at 10:44:18AM +0200, Svyatoslav Ryhel wrote:
> Optionally pass status and health from supplier if
> it supports those props. If cell is online assume it
> is present as well.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Charger health might be different from battery health, so it's not
safe to inherit. Otherwise LGTM.
-- Sebastian
> ---
> drivers/power/supply/max17040_battery.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
> index 2778ed5b5c14..6dfce7b1309e 100644
> --- a/drivers/power/supply/max17040_battery.c
> +++ b/drivers/power/supply/max17040_battery.c
> @@ -390,6 +390,7 @@ static int max17040_get_property(struct power_supply *psy,
>
> switch (psp) {
> case POWER_SUPPLY_PROP_ONLINE:
> + case POWER_SUPPLY_PROP_PRESENT:
> val->intval = max17040_get_online(chip);
> break;
> case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> @@ -402,6 +403,10 @@ static int max17040_get_property(struct power_supply *psy,
> val->intval = chip->low_soc_alert;
> break;
>
> + case POWER_SUPPLY_PROP_STATUS:
> + case POWER_SUPPLY_PROP_HEALTH:
> + power_supply_get_property_from_supplier(psy, psp, val);
> + break;
> case POWER_SUPPLY_PROP_TECHNOLOGY:
> val->intval = chip->batt_info->technology;
> break;
> @@ -438,10 +443,13 @@ static const struct regmap_config max17040_regmap = {
>
> static enum power_supply_property max17040_battery_props[] = {
> POWER_SUPPLY_PROP_ONLINE,
> + POWER_SUPPLY_PROP_PRESENT,
> POWER_SUPPLY_PROP_VOLTAGE_NOW,
> POWER_SUPPLY_PROP_CAPACITY,
> POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN,
> POWER_SUPPLY_PROP_TECHNOLOGY,
> + POWER_SUPPLY_PROP_STATUS,
> + POWER_SUPPLY_PROP_HEALTH,
> POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
> POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
> POWER_SUPPLY_PROP_TEMP_MIN,
> --
> 2.37.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-05-15 22:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 8:44 [PATCH v1 0/4] Add optional properties to MAX17040 Svyatoslav Ryhel
2023-03-08 8:44 ` [PATCH v1 1/4] dt-bindings: power: supply: maxim,max17040: update properties Svyatoslav Ryhel
2023-03-08 9:04 ` Krzysztof Kozlowski
2023-03-08 9:15 ` Svyatoslav Ryhel
2023-03-08 10:44 ` Krzysztof Kozlowski
2023-03-08 10:51 ` Svyatoslav Ryhel
2023-03-08 10:53 ` Krzysztof Kozlowski
2023-03-08 11:06 ` Svyatoslav Ryhel
2023-03-08 11:12 ` Krzysztof Kozlowski
2023-05-15 22:17 ` Sebastian Reichel
2023-03-08 8:44 ` [PATCH v1 2/4] power: max17040: add simple battery cell support Svyatoslav Ryhel
2023-05-15 22:21 ` Sebastian Reichel
2023-03-08 8:44 ` [PATCH v1 3/4] power: max17040: add passing props from supplier Svyatoslav Ryhel
2023-05-15 22:41 ` Sebastian Reichel [this message]
2023-03-08 8:44 ` [PATCH v1 4/4] power: max17040: get thermal data from adc if available Svyatoslav Ryhel
2023-03-08 9:08 ` Krzysztof Kozlowski
2023-03-08 9:23 ` Svyatoslav Ryhel
2023-03-08 10:46 ` Krzysztof Kozlowski
2023-03-09 0:24 ` kernel test robot
2023-03-09 0:24 ` kernel test robot
2023-03-09 0:45 ` kernel test robot
2023-05-15 22:39 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230515224145.u2fos4ln3n6hb567@mercury.elektranox.org \
--to=sebastian.reichel@collabora.com \
--cc=clamor95@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=matheus@castello.eng.br \
--cc=me@iskren.info \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).