Battery
The MT6358 fuel gauge: what is read, and what is not driven.
Hardware
The battery’s level is read from the PMIC’s fuel gauge (FGADC, with a latch and a charge counter) and its battery-voltage ADC (BATADC); the charger’s presence is a PMIC status bit
(CHR_CON0), and Android leaves its own percentage in the RTC’s RTC_AL_MTH register. On spaced the battery is 4950 mAh (the project profile’s capacity) and the
charger is a separate chip that Android’s driver sets up.
Driver
mt6358_gauge.c counts charge from Android’s last percentage with the gauge’s counter (a count is 106295 pAh on this chip), cross-checks it against the voltage, and publishes
the percentage, voltage, current and charger state to MapplePowerSource.cpp, the IOKit power source iOS reads. If the two disagree it believes the voltage. The charger is
not driven: it runs on whatever LK left.
Device tree
None: the gauge is read through the PMIC wrapper.
Boot-arguments
mp_gauge in the catalogue: 1 the gauge, 2 also every reading in the log, 3 the percentage from the voltage alone. The spaced line has mp_gauge=1.
The charger, charge-limit and Low Power Mode arguments (mp_battery, mp_charge*, mp_lpm_*) belong to the TI gauge and Silergy charger driver for the viva phone, which needs a battery
node that spaced’s tree does not have.
User space
None.
Status
device.conf: partial: the fuel gauge’s charge and voltage are read; the charger is not driven.
Seen: Android’s 100 % picked up, the charge counted down and the voltage read (smoke run 4); about 98.8 % by the charge against 95.0 % by the voltage at the end of a boot, Android reading 99 % right after.
Known issues
- Charging is not managed under iOS: it uses what LK left, and no charge limit is possible.
- The battery’s temperature is a fixed 25 C.
- The percentage is rebuilt from Android’s last value at every boot (it is not written back between XNU boots).
Source files
bsd/dev/mt6358_gauge.c and iokit/Kernel/arm/MapplePowerSource.cpp of the kernel at 76b737c.
Applies to realme 8i (spaced), release 1 · Updated 15 November 2026