From: sashiko-bot@kernel.org
To: user.email <zstaseg@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/3] power: supply: qcom_battmgr: add Xiaomi taoyao support
Date: Tue, 18 Aug 2026 15:24:59 +0000 [thread overview]
Message-ID: <20260818152459.E4F8B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818151039.409767-3-zstaseg@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing exposure of charge control thresholds for the Taoyao variant.
--
--- Patch [2]: [PATCH v2 2/3] power: supply: qcom_battmgr: add Xiaomi taoyao support ---
commit 7dca11719c74cb544dcbbafa2547e26c0a56fd43
Author: Stanislav Zaikin <zstaseg@gmail.com>
power: supply: qcom_battmgr: add Xiaomi taoyao support
The Xiaomi taoyao firmware defines an additional BATT_CONSTANT_CURRENT
property (ID 12) between BATT_CHG_CTRL_LIM_MAX and BATT_TEMP, shifting
all higher battery property IDs by one.
> diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
> index 7716eb9e1aff5..a16d226ac5b30 100644
> --- a/drivers/power/supply/qcom_battmgr.c
> +++ b/drivers/power/supply/qcom_battmgr.c
> @@ -452,16 +453,87 @@ static const u8 sm8350_bat_prop_map[] = {
> [POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD] = BATT_CHG_CTRL_END_THR,
> };
>
> +/*
> + * Xiaomi Taoyao firmware has BATT_CONSTANT_CURRENT (ID 12) inserted
> + * between BATT_CHG_CTRL_LIM_MAX and BATT_TEMP, shifting all subsequent
> + * IDs by one.
> + */
> +static const u8 taoyao_bat_prop_map[] = {
[ ... ]
> + [POWER_SUPPLY_PROP_POWER_NOW] = BATT_POWER_NOW + 1,
> + [POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD] = BATT_CHG_CTRL_START_THR + 1,
> + [POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD] = BATT_CHG_CTRL_END_THR + 1,
> +};
[Severity: Medium]
While you've explicitly mapped the charge control thresholds here for the
Taoyao variant, does qcom_battmgr_probe() actually assign a power supply
descriptor that exposes these properties?
Looking at qcom_battmgr_probe(), QCOM_BATTMGR_TAOYAO will fall through to
using sm8350_bat_psy_desc:
} else {
if (battmgr->variant == QCOM_BATTMGR_SM8550)
psy_desc = &sm8550_bat_psy_desc;
else
psy_desc = &sm8350_bat_psy_desc;
Since sm8350_bat_psy_desc lacks
POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD and
POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD, will these properties
be silently unavailable for Taoyao devices?
If they should be supported, does this require a dedicated power supply
descriptor or using sm8550_bat_psy_desc instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818151039.409767-1-zstaseg@gmail.com?part=2
next prev parent reply other threads:[~2026-08-18 15:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 15:10 [RFC PATCH v2 0/3] Add Xiaomi 12 Lite 5G (taoyao) battery support user.email
2026-08-18 15:10 ` [PATCH v2 1/3] dt-bindings: soc: qcom: add xiaomi,taoyao-pmic-glink compatible user.email
2026-08-18 15:10 ` [PATCH v2 2/3] power: supply: qcom_battmgr: add Xiaomi taoyao support user.email
2026-08-18 15:24 ` sashiko-bot [this message]
2026-08-18 15:10 ` [PATCH v2 3/3] arm64: dts: qcom: sm7325-xiaomi-taoyao: switch to device-specific pmic-glink compatible user.email
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=20260818152459.E4F8B1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zstaseg@gmail.com \
/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).