Battery / charger: SM5705 fuel gauge + charger (no power_supply at all) #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plasma Mobile shows no battery because there is no
power_supplydevice at all —/sys/class/power_supply/is empty and no fuel-gauge or charger driver ever probes. Not a userspace gap.Hardware
It's the SM5705 (SiliconMitus) — a combined fuel gauge + charger, the same PMIC whose MUIC/extcon side we already run. From
battery-data-gts6l-common.dtsi:sm5705-fuelgauge@71onqupv3_se11_i2c(= mainlinei2c11: i2c@a8c000), IRQtlmm 37(fuel_int), JIG ontlmm 120.CONFIG_CHARGER_SM5705,CONFIG_FUELGAUGE_SM5705,CONFIG_MFD_SM5705).battery-data-gts6l-common.dtsiunder the Samsungbattery,*bindings.Mainline coverage — partial, and only the part we don't need
drivers/extcon/extcon-sm5705.c— but that's the USB-cable-detect side, which we already use. It does not expose battery/charger.drivers/power/supply/sm5705*, nodrivers/mfd/sm5705*. So the fuel gauge (SoC/voltage/current) and the charger have no mainline driver. This is a port, not a config flip.i2c11.Two routes
Route A — port the downstream SM5705 fuel-gauge driver (pragmatic).
i2c11+ pinctrl in our DTS; add ansm5705-fuelgauge@71node.drivers/battery_v2/sm5705_fuelgauge.c(SiliconMitus, GPL) to a mainlinepower_supplyprovider. The fuel gauge is a self-contained I2C device reporting SoC / voltage / current / temp — a clean power_supply class driver, no MFD entanglement required for read-only reporting.battery-data-*dtsi.Route B — charger too (later). The SM5705 charger half (input current limit, charge enable, charging status) is a separate power_supply. Needs the MUIC/extcon (which we have) to tell it cable type. More work; not needed for the gauge to report.
Scope note
A read-only fuel-gauge port is small and high-value (battery indicator +
upower+ Plasma's power management all start working). Charging control is a follow-on. Downstreamdrivers/battery_v2/is large but most of it is Samsung's battery manager framework (sec_battery) — we want just the SM5705 fuelgauge chip driver reshaped as apower_supply, not that whole stack.Estimate: ~1 session for the read-only gauge; charger control a second.
2026-08-25: confirmed from the running device — and pm8150b is a dead end
Independent confirmation of this issue's diagnosis, from the device rather than the DT, plus one thing ruled out.
SM5705 confirmed as the whole battery/charging stack
TWRP's
/proc/last_kmsg(Samsung'ssec_log_buf) contains its own kernel logging the gauge live:So the gauge reports mV, mA (signed, negative = discharging), OCV and SoC in tenths of a percent, and the charger side is driven off the MUIC's cable-type detection — exactly the shape this issue describes. The stock DT confirms the full set:
sm,sm5705@0x49,sm5705-fuelgauge@0x71,samsung,sm5705-charger,samsung,sec-battery.pm8150b is NOT an alternative route — the part is not fitted
Worth recording because it looks like an obvious shortcut (mainline has
qcom,pm8150b-chargerandqcom,spmi-adc5drivers, so "just use the PMIC's charger" is tempting). It does not work on this device:qcom,pm8150b@2 { };andqcom,pm8150b@3 { };— no compatible, no children, while pm8150 and pm8150l have full trees.regulator_summaryhas none) and never mentions it in dmesg.pm8150b.dtsiregardless, and mainline duly tried to probe it. Its revision read fails at the arbiter:Removed from our DT — that was the only kernel WARNING in the boot, and SPMI now enumerates cleanly as
0-00 0-01 0-04 0-05(pm8150 + pm8150l only).So Route A in the description stands as the only route: port the SM5705 fuel gauge as a
power_supplyprovider oni2c11. Nothing to salvage from pm8150b.Useful for verification
Once the gauge lands, the numbers can be sanity-checked against TWRP — boot to recovery and read
/proc/last_kmsgfor thesm5705_fuel_gauge_read_*lines, which give a known-good reading from Samsung's own driver on the same hardware minutes earlier.