Skip to content

Pixel 8a (akita): the battery's fuel gauge and PMIC, the pack's EEPROM, and the PMIC's interrupt - #246

Merged
derekross merged 3 commits into
derekross:omamobilefrom
aninmucek:omamobile-zuma-akita-battery
Nov 15, 2026
Merged

derekross merged 3 commits into
derekross:omamobilefrom
aninmucek:omamobile-zuma-akita-battery

Conversation

@aninmucek

Copy link
Copy Markdown
Contributor

The Pixel 8a's battery chips, the battery pack's EEPROM, and the main PMIC's interrupt. These are the board-file parts of akita's M4 (battery and charging) in omarchy-mobile. The 8a's battery hardware is the 8 Pro's: the same chips, at the same addresses, on the same bus, with the same interrupt lines. So all three commits follow zuma-husky.

  • zuma-akita: Add the battery's fuel gauge and PMIC.
    • The chips: CMU_PERIC1, its sysreg, USI11 and hsi2c_11 at 400 kHz, with the MAX77759 fuel gauge at 0x36 (interrupt gpa7-7) and the PMIC at 0x66 (gpa8-0), as Google's zuma-akita-battery.dtsi has them.
    • The sense resistor: 5 mΩ. That's stock's maxim,rsense-default = <500>, in Google's 10 µΩ units.
    • The bus pull: Google's file leaves the pins without a pull, but the stock phone's live tree has them pulled up, as zuma-pinctrl.dtsi does. So there's no override.
    • The battery node: 4486 mAh, the design capacity the stock gauge reports, and 4.48 V design maximum (google,fv-max-uv). The charge limits are 4.2 V and 1.32 A (about 0.3 C), below stock's, as on the 8 Pro.
    • The Type-C controller (0x25) isn't described yet.
  • zuma-akita: Describe the battery pack's EEPROM. A read-only atmel,24c08 at 0x50 on hsi2c_9. The bus stays disabled in the board file, as on husky. omarchy-mobile enables it with an overlay when it needs the pack's ID.
  • zuma-akita: Give the main PMIC its interrupt. arm64: dts: exynos: google: zuma-husky: the main PMIC's interrupt, so the Pixel 8 Pro has an RTC alarm #243's three lines as they are: GIC SPI 74, the VGPIO2AP sysreg and wakeup-source. The stock phone's s2mpg14mfd node has the same interrupt (<0 0x4a 4 0>, s2mpg14,wakeup enabled), and its /proc/interrupts shows rtc-alarm0 on it. arm64: dts: exynos: google: zuma-husky: the main PMIC's interrupt, so the Pixel 8 Pro has an RTC alarm #243's author suggested akita take the same lines.

Tested on a Pixel 8a from slot B (7.3.0-rc6, these three commits on 2db2bc35b), one change per boot, with every battery driver held back by a modprobe blacklist until its step:

  1. The bus: exynos5-hsi2c binds 10cb0000.i2c, and clients 0x36 and 0x66 appear, unbound, with no I2C errors.

  2. The gauge, loaded by hand: max170xx_battery reads level, voltage, current and temperature, and UPower shows it.

    • The pack: its EEPROM's ID byte (0x17) reads 1, so it's the ATL pack (atl-a1-1k).
    • The model: with that pack's model from Google's zuma-akita-battery-data.dtsi (an omarchy-mobile overlay), the driver logs "battery model loaded (DesignCap 0x8c3)", and the temperature reads a real, moving 34–36 C instead of the stuck 22.0 C you get without a model.
  3. The PMIC, loaded by hand:

    • PMIC_ID 0x3b, rev 0x02, OTP 0x31, as on the 8 Pro;
    • its interrupt lines stay flat;
    • the bootloader leaves the charger exactly as on the 8 Pro: charging, a 4.35 V float, about 1.93 A fast charge and a 500 mA input limit.
  4. The charger driver, under omarchy-mobile's dead-man tool, with a person at the phone:

    • it applied this battery node's limits (float 4200 mV, charge 1320000 uA, a 20–42 C band);
    • it charged the battery from 65 % to 72 % over 25 minutes, on a laptop port and then a wall charger, at 34–35 C and at most 4.165 V, and the guard never tripped;
    • the dead-man tool's undo leaves charging off; the next reboot, through the bootloader, comes back with the bootloader's charger settings.
  5. The PMIC interrupt:

    • no "no RTC alarm" line, and rtc0 has wakealarm;
    • s2mpg14-pmic (GIC 106) and rtc-alarm0 stay at 0 at rest;
    • an alarm armed with rtcwake -m no -s 60 fires on time (rtc-alarm0 0 to 1).

    No failed units, and the boot log has only the two error lines we already know about.

Not covered here, and tracked in omarchy-mobile:

  • The charge current is higher than I'd expect. During the charging test the gauge read about +1.0 A into the battery on a 500 mA input limit. At 4.1 V that's more power than 5 V × 0.5 A can supply. The gauge's sense resistor matches stock's (above), and the level rose about as fast as that current says. So I suspect the input limit's readback, or the port giving more than the limit, but I haven't settled it.
  • The charger driver's units: constant_charge_voltage_max reads 4200, which looks like millivolts where sysfs uses microvolts. That's in max77759_charger, not this board file.
  • Suspend isn't tried, as before.

tools/kernel-pr-check --build OUT --merge origin/omamobile, with the dtschema validator, passes everything:

  • a clean merge onto 2db2bc35b;
  • the sign-offs: 3 commits, each signed off by its author, none by an AI;
  • checkpatch --strict with no errors and no warnings;
  • the policy checks;
  • the 10 Google device trees build with W=1 and pass dtbs_check, with no new warnings.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a tidy piece of work, and the way you ran it is how I'd want every charger bring-up done: the bus first with the clients unbound, each driver held back and loaded by hand, the charger only under the dead-man tool with someone at the phone, and the open points (the charge current, the driver's units) said plainly instead of smoothed over.

I checked the values against Google's zuma-akita-battery.dtsi: the gauge at 0x36 on gpa7-7, the PMIC at 0x66 on gpa8-0, the 5 mΩ sense resistor (maxim,rsense-default = <500>), the EEPROM at 0x50 on hsi2c_9, and the 4404 mAh next to the gauge's 4486 are all as you say, and taking the bus pull from the stock phone's live tree is right. Our gate passes on the merge with today's omamobile, CI is green with dtbs_check, and each of the three commits builds on its own.

Two small things before it goes in, and one about the order:

  1. Say in the board file that the device package must come with this DTB. Once pmic@66 is enabled, binding it creates the charger cell, and max77759_charger is a module in the shared config, so on an 8a whose device package has no blacklist it loads at boot and programs the limits by itself, with no dead-man. The 8 Pro's &hsi2c_11 comment has a sentence for this (the cell drivers have to be kept from loading, the device package blocks them in omamobile-max77759.conf, "so install it with this DTB"); the 8a's comment leaves that part out. Could you add it, naming omarchy-mobile#718's file?
  2. The tested tree. The plan in omarchy-mobile#718 names the tested builds …g2a02a03a60cf, …g27a64aba0dc3 and …g8136602c700c; this head's commits were made after those. Could you confirm that git hash-object arch/arm64/boot/dts/exynos/google/zuma-akita.dts in the tree that ran the last step prints 61308cae02aa, this head's file? If it differs, tell me by what.

The order: the 8a's device package on main has no MAX77759 blacklist today, so I'll merge omarchy-mobile#718 first and this one after it, so that no 8a boots this device tree without it.

On the charge current you flagged: 65 % to 72 % in 25 minutes is about 0.75 A on average for this pack, so the gauge's current looks real and it's the 500 mA that needs explaining. I'll ask about that on #718, where the charger results live; it doesn't hold this up. The constant_charge_voltage_max units are the charger driver's and deserve their own issue.

…and PMIC

The Pixel 8a's battery chips are the Pixel 8 Pro's: a MAX77759 fuel
gauge at 0x36 and PMIC at 0x66 (its charger at 0x69) on hsi2c_11, with
the gauge's interrupt on gpa7-7, the PMIC's on gpa8-0 and a 5 mOhm
sense resistor (Google's zuma-akita-battery.dtsi). Enable CMU_PERIC1,
its sysreg, USI11 and hsi2c_11, and describe the gauge and the PMIC as
zuma-husky does. Google's file leaves the bus pins without a pull, but
the stock phone's live device tree has them pulled up, as
zuma-pinctrl.dtsi does, so akita needs no override.

The battery node carries the 8a's pack: 4486 mAh, the design capacity
the stock gauge reports, and 4.48 V design maximum (google,fv-max-uv).
The charge limits are 4.2 V and about 0.3 C (1.32 A), below stock's,
as on the 8 Pro. The Type-C controller (0x25) isn't described yet.

Assisted-by: Claude Opus 5.5
Signed-off-by: DarekM <149845949+aninmucek@users.noreply.github.com>
…EPROM

The Pixel 8a's pack carries an at,24c08 EEPROM at 0x50 on hsi2c_9
(Google's zuma-akita-battery.dtsi, pack_bee), as the Pixel 8 Pro's
does; its byte 0x17 is the battery ID that picks the fuel gauge's
model. Describe it read-only, as zuma-husky does. The bus stays
disabled in the board file; a bring-up overlay switches USI9 and
hsi2c_9 on for the read.

Assisted-by: Claude Opus 5.5
Signed-off-by: DarekM <149845949+aninmucek@users.noreply.github.com>
Without an interrupt the S2MPG14 driver supplies its rails but none of
the PMIC's events reach the host, so rtc0 has no wake alarm on the
Pixel 8a. The stock phone's s2mpg14mfd node has the same interrupt as
the Pixel 8 Pro's (interrupts = <0 0x4a 4 0>, GIC SPI 74, with
s2mpg14,wakeup enabled), and its /proc/interrupts shows rtc-alarm0 on
it. So this takes zuma-husky's three lines as they are: the interrupt,
latched by the VGPIO2AP sysreg, and wakeup-source.

Assisted-by: Claude Opus 5.5
Signed-off-by: DarekM <149845949+aninmucek@users.noreply.github.com>
@aninmucek
aninmucek force-pushed the omamobile-zuma-akita-battery branch from 903f72c to 468cc1e Compare November 14, 2026 19:48
@aninmucek

Copy link
Copy Markdown
Contributor Author

Thank you for checking the values against Google's file.

1. The board-file comment. &hsi2c_11's comment now has husky's sentence, for akita: binding the PMIC creates the charger cell, the charger driver programs the battery node's limits, so max77759_charger, gpio_max77759, nvmem_max77759 and tcpci_maxim have to be kept from loading. The akita device package blocks them (omamobile-max77759.conf, omarchy-mobile#718), "so install it with this DTB".

I folded it into the first commit and rebased: the head is now 468cc1eb1, still signed off by me.

2. The tested tree. In the tree that ran the last step (8136602c7, release …g8136602c700c), git hash-object arch/arm64/boot/dts/exynos/google/zuma-akita.dts printed 61308cae02aa, the same as the previous head 903f72c4a. The first two test builds were earlier stages of the same file.

After the comment above, this head's file is 039eadf76c8c. The only difference from the tested file is those comment lines (git diff 903f72c4a 468cc1eb1). So the compiled device tree is the one that was tested.

Since then, omarchy-mobile#718's package has also had its own boot on this tree:

  • the MFD core and the gauge autoload under its blacklist;
  • the charger and Type-C drivers don't;
  • its USB rescue brought the link back after an unplug.

The order: #718 first is right. I'll open an issue for the constant_charge_voltage_max units, and follow up the charge current on #718.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you. Both points are done. The new &hsi2c_11 comment says what the 8 Pro's does, and the file it names is in omarchy-mobile#718. I checked that the only change from the head you tested is those comment lines, so the device tree that ran is this one. Our gate passes on today's omamobile (da171ea), and CI is green with dtbs_check.

As agreed, I'll merge omarchy-mobile#718 first and this one right after it, so that no 8a gets this device tree without the blacklist. Thanks for opening the issue for the charger's units.

@derekross
derekross merged commit 2eda146 into derekross:omamobile Nov 15, 2026
1 check passed
@aninmucek
aninmucek deleted the omamobile-zuma-akita-battery branch November 15, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants