All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/3] Add Xiaomi 12 Lite 5G (taoyao) battery support
@ 2026-08-21 12:37 Stanislav Zaikin
  2026-08-21 12:37 ` [RFC PATCH v3 1/3] dt-bindings: soc: qcom: add xiaomi,taoyao-pmic-glink compatible Stanislav Zaikin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stanislav Zaikin @ 2026-08-21 12:37 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Sebastian Reichel
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-pm,
	Stanislav Zaikin

Xiaomi 12 Lite 5G (taoyao) has an additional property with ID 12 that
breaks the parsing in qcom_battmgr. Fix that by introducing separate
maps for lookups properties in both directions.

The other approach that I tried is manual shifting properties:

+	if (battmgr->variant == QCOM_BATTMGR_TAOYAO && prop > BATT_CHG_CTRL_LIM_MAX)
+		prop++;
...
+		if (battmgr->variant == QCOM_BATTMGR_TAOYAO && property > BATT_CHG_CTRL_LIM_MAX + 1)
+			property--;

But I found that more obscure.

Will be happy to switch if the maintainers prefer this one.

Changes in v3:
- Fix QCOM_BATTMGR_TAOYAO enum ordering (patch #2)
- Order in qcom_battmgr_of_variants[] is already right (no change)
- Revert the qcom,sm7325-pmic-glink SoC fallback (patch #1 and #3)
- Rephrased commit message (patch #3)
- Design question from v1/v2 still open: lookup tables vs. inline shift

Changes in v2:
- Keep the qcom,sm7325-pmic-glink SoC fallback in the compatible chain
  of the taoyao pmic-glink node (review feedback, patch #1 and #3)

Stanislav Zaikin (3):
  dt-bindings: soc: qcom: add xiaomi,taoyao-pmic-glink compatible
  power: supply: qcom_battmgr: add Xiaomi taoyao support
  arm64: dts: qcom: sm7325-xiaomi-taoyao: switch to device-specific
    pmic-glink compatible

 .../bindings/soc/qcom/qcom,pmic-glink.yaml    |  1 +
 .../boot/dts/qcom/sm7325-xiaomi-taoyao.dts    |  2 +-
 drivers/power/supply/qcom_battmgr.c           | 86 ++++++++++++++++++-
 3 files changed, 84 insertions(+), 5 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-11  9:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 12:37 [RFC PATCH v3 0/3] Add Xiaomi 12 Lite 5G (taoyao) battery support Stanislav Zaikin
2026-08-21 12:37 ` [RFC PATCH v3 1/3] dt-bindings: soc: qcom: add xiaomi,taoyao-pmic-glink compatible Stanislav Zaikin
2026-09-09 21:16   ` Sebastian Reichel
2026-09-11  9:52     ` Stanislav Zaikin
2026-08-21 12:37 ` [RFC PATCH v3 2/3] power: supply: qcom_battmgr: add Xiaomi taoyao support Stanislav Zaikin
2026-08-25  8:42   ` Konrad Dybcio
2026-08-21 12:37 ` [RFC PATCH v3 3/3] arm64: dts: qcom: sm7325-xiaomi-taoyao: switch to device-specific pmic-glink compatible Stanislav Zaikin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.