Community meeting on 22nd May 2025

The sysfs file just dumps the current state of the driver. The actual one-time calibration data is part of the device tree, which is stored somewhere in the vendor_boot and dtbo partitions. A typical battery definition looks like this: ums9230-reeder-s19mps.dts line 64

The upstream Linux Kernel driver is a bit simpler than Unisoc’s version used in the C2 (probably kernel-sprd/drivers/power/supply/sc27xx_fuel_gauge.c at android-14-release-ula34 · MotorolaMobilityLLC/kernel-sprd · GitHub), but they both seem to start recalculating the charge based on the voltage only after the charge drops below a certain threshold. This should explain why the curve suddenly drops and suggests that it can be fixed by correcting the ocv-capacity-table in the device tree.

3 Likes