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 <[email protected]>
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/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.