Skip to content

Add Xiaomi 12 Lite 5G (taoyao) battery support

Stanislav Zaikin linux-arm-msm linux-devicetree linux-pm lkml 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 3 repliesApplied
  2. v43 patches 4 repliesSuperseded
  3. v3 RFC3 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 RFC3 patches5 repliesSuperseded
v1 RFC3 patches0 repliesSuperseded

Changes in v5 from the cover letter

- Fixed the commit message (patch #1)

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/3dt-bindings: soc: qcom: qcom,pmic-glink: Document Xiaomi taoyao compatibleDocumentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml+1 -01 reply
2/3power: supply: qcom_battmgr: add Xiaomi taoyao supportdrivers/power/supply/qcom_battmgr.c+82 -40 replies
3/3arm64: dts: qcom: sm7325-xiaomi-taoyao: switch to device-specific pmic-glink compatiblearch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts+1 -11 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchKonrad DybcioRob Herring (Arm)
1/3A-b
2/3R-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/3] Add Xiaomi 12 Lite 5G (taoyao) battery support

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.

Changed in v5:
- Fixed the commit message (patch #1)

Changes in v4:
- Added Konrad's r-b (patch #2)
- Dropped RFC tag

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: qcom,pmic-glink: Document Xiaomi taoyao
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(-)
Signature · 1 line
2.55.0