Skip to content

Pixel 8 Pro battery: CMU_PERIC1, USI11 and the MAX77759 bus - #163

Merged
derekross merged 6 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-battery-i2c
Nov 1, 2026
Merged

derekross merged 6 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-battery-i2c

Conversation

@Somnius

@Somnius Somnius commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

First step of the battery work on the 8 Pro, the one Brett and I agreed on in omarchy-mobile#1. This gets the I2C bus the MAX77759 chips sit on, nothing more.

Four commits: the CMU_PERIC1 bindings, the clk-zuma path to USI11 (the gates and layout follow the 9a's PERIC1 code and Google's cal-if/zuma tables), the zuma.dtsi nodes for cmu_peric1, usi11 and hsi2c_11, and the husky side with the battery and the gauge, PMIC and Type-C nodes. Everything new is disabled in the board DTS, so the default DTB behaves like before.

I tested it on my Kioxia husky with a device tree overlay that enables the nodes (the overlay is not in this PR). CMU_PERIC1 probes, the clocks show up in clk_summary with sane rates, and the bus registers with clients at 0x36 and 0x66. Loading max17042_battery gives a battery that reads about 86% at 4.2 V, 32 C, discharging. Loading the max77759 MFD binds, its PMIC_ID check passes, the interrupt lines stay quiet and there are no I2C errors. I did not load the charger or the Type-C driver, and I did not test charging at all.

Checks: kernel-pr-check --build --merge is clean (in the build container), dt-doc-validate passes on the three bindings, and dtbs_check on zuma-husky only shows the two eusb2-phy supply warnings that are already there.

Things I would like a second pair of eyes on:

  • The charge limits in zuma-husky.dts (4.2 V and 0.3 C, 1.485 A) are deliberately conservative until stock's step charging is described. Stock goes up to 4.48 V in steps.
  • The gauge reports 5022 mAh design capacity, the DT says 4950. I left the DT value.
  • The USI11 gates keep the mode firmware set and work like that. I have not tried the MANUAL bit.
  • No fuel gauge model is described yet, because I do not know which pack this phone has.

It is on top of the current omamobile. Brett's husky-test-20261031-c6 tag has the same four commits on an older base, and the only conflict was a duplicated comment in zuma.dtsi.

Update after Derek's review: the branch has 6 commits now (the bindings are split into three, one per file), the comment above &hsi2c_11 is corrected, hsi2c11's pins use the pull-up that stock ends up with, and the PMIC_ID is in the husky commit message. The tree I booted is Brett's c6 plus the first version of these commits applied before the build (hence the -dirty release), and those commits as booted are on https://github.com/Somnius/linux-omarchy-mobile/tree/husky-battery-i2c-booted. Details and the smoke report are in the comment below.

@derekross

Copy link
Copy Markdown
Owner

Thanks Lef, this is careful work. I checked every offset, field width and parent in the clock driver against Google's zuma CMUCAL tables, and the DT against stock (USI11's sysreg offset, SPI 659, the interrupt pins, the 5 mΩ shunt, and your fix for stock's gpp22-1 typo), and it all matches. The husky DTB validates with nothing new. A few things before I merge:

  1. The PR says the c6 tag carries these four commits, but the c6 tag on Brett's fork is the touch stack only. Could you push the tree you actually booted (a branch or tag), and add uname -r and a tools/phone-smoke report from that boot?
  2. The comment above &hsi2c_11 says the rootfs blacklists the drivers, but nothing in the husky package does that yet. Binding the max77759 MFD also creates its charger cell, and the charger driver would program charge limits from the battery node. Please reword that comment, and confirm with lsmod that max77759_charger didn't load during your test. Before an overlay that enables this bus goes into omarchy-mobile, the husky device package needs the same blacklist cheetah has (omamobile-max77759.conf), and the overlay and your results belong in device/husky/ with a runbook.
  3. Please split the first commit: the i2c-exynos5 and exynos-sysreg compatibles each go in their own dt-bindings: commit with that file's prefix.

Smaller things: stock's final hsi2c11 pins are pull-up (zuma-typec.dtsi is included after the battery file), so either match that or say why not; and please quote the PMIC_ID probe line in the commit message, since Google's own comment names a MAX77729 on that interrupt. Heads-up: Brett's GPU PR (#157) also numbers new CMU_TOP clocks from 16 in google,zuma.h. Git merges the two without a conflict and leaves duplicate ids, so whichever lands second renumbers; I plan to merge this one first.

The Pixel 8 Pro's USI11 bus (hsi2c_11, at 0x10cb0000, as in Google's
devicetree) is the same Samsung HSI2C controller as the other Google SoCs
in this list. Add the zuma compatible, which the zuma devicetree uses for
it.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
USI11 is at 0x10cb00c0 and its SW_CONF is at offset 0xc of the PERIC1
sysreg (0x10c21000), as in Google's devicetree. Add the zuma compatible to
the list of sysregs and to the condition that groups the PERIC sysregs of
the other Google SoCs.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
CMU_PERIC1 supplies USI11, the I2C bus of the Pixel 8 Pro's MAX77759
fuel gauge, charger, Type-C controller and PMIC. Its NoC and USI input
clocks come from CMU_TOP.

Register layout and parents are from Google's GPL cal-if/zuma tables
(android-gs-shusky-6.1-android16).

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
Add the CMU_TOP PERIC1 NoC and IP clocks (firmware-owned, read-only) and
CMU_PERIC1 with USI11's user mux, divider and gates, for the I2C bus of
the battery, charger and Type-C chips. The layout follows the Pixel 9a's
PERIC1 code, which comes from the same cal-if/zuma tables; USI11 is the
next slot after USI10 there (mux 0x640, divider 0x1810, gates
0x2048/0x204c/0x2094). The USI11 gates keep the mode firmware set.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
All disabled. USI11 is at 0x10cb00c0 with its SW_CONF at offset 0xc of
the PERIC1 sysreg, and the bus is hsi2c_11 at 0x10cb0000 on GIC SPI 659,
as in Google's device tree. Add its pins (gpp21-0/1, the board's pair)
and the MAX77759 interrupt pins on the ALIVE banks gpa7 and gpa8.

The bus pins get a pull-up. Stock's board file sets no pull (pud 0) on
hsi2c11_bus, but its Type-C file, applied after it, sets pud 3, which is
the final value.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
…c_11

Add the battery, and the fuel gauge (0x36), PMIC (0x66) and Type-C
controller (0x25) on hsi2c_11, as on the Pixel 7 Pro. The bus stays
disabled here and bring-up overlays enable it. No gauge model yet: the
pack is not known and a wrong model would be written on power-on reset.
The Type-C controller stays disabled. The charge limits are
conservative (4.2 V, 0.3 C) until stock's step charging is described.

The MFD driver binds only if PMIC_ID reads 59 (0x3b), and it does on
the Pixel 8 Pro: PMIC_ID 0x3b, PMIC_REVISION 0x02, OTP_REVISION 0x31
(i2cget on 0x66). So the chip at 0x66 is a MAX77759, and not the
MAX77729 that Google's devicetree names on the same interrupt.

Binding the PMIC creates its charger cell, which programs charge limits
from the battery node, so in the boots for this series a modprobe.d file
on the phone kept max77759_charger, gpio_max77759, nvmem_max77759 and
tcpci_maxim from loading, and lsmod shows the charger was not loaded.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
@Somnius

Somnius commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Derek, that was a careful review and every point was fair. I pushed all of it (the branch now has 6 commits, new tip 7b80e83). Going through them in your order, including what I did not test.

  1. The tree I booted. You're right that the c6 tag is only Brett's touch stack. The kernel I booted is Brett's c6 (c7a0b2e, the touchscreen commit) with my four changes applied on top, and I built it before I committed them, which is why the release says -dirty: 7.3.0-rc6-omamobile-push1-gc7a0b2ef2f66-dirty, slot B. The same four commits as I booted them are on this branch of my fork: https://github.com/Somnius/linux-omarchy-mobile/tree/husky-battery-i2c-booted (tip 9de84ee). I rebuilt nothing since then. The tools/phone-smoke report from that boot is at the bottom (0 WARN and 0 error lines in dmesg, no failed units, battery 75% at 33 C). One caveat on "same as booted": the branch of this PR is not identical, it has the changes below, the pull-up one is the only functional difference and I booted it separately (see the pins paragraph).

  2. The comment above &hsi2c_11 was wrong, nothing in the husky package blocks the drivers, I had done it by hand with a modprobe.d file on the phone. It now says that binding the PMIC creates the charger cell, which then programs charge limits from the battery node, names the four modules (max77759_charger, gpio_max77759, nvmem_max77759, tcpci_maxim) and says the husky package does not block them yet while cheetah's omamobile-max77759.conf does, and has to before an overlay that enables this bus ships. And you asked me to confirm with lsmod that the charger did not load during the test: in the boots for this series lsmod showed max17042_battery and max77759 (the gauge and the MFD core) and nothing else of the family, max77759_charger, gpio_max77759, nvmem_max77759 and tcpci_maxim were all kept out by that modprobe.d file the whole time. I did load the charger later, on purpose and under a dead-man tool, in separate steps, which are written up separately (links below), but none of that is part of this PR's test. The husky commit message now says all this too. The package PR with the blacklist, as you asked: omamobile-device-husky 0.1.4: the USB replug rescue and the MAX77759 blocklist omarchy-mobile#250.

  3. The first commit is split into three, each with its own file's prefix: dt-bindings: i2c: exynos5 (google,zuma-hsi2c), dt-bindings: soc: samsung: exynos-sysreg (google,zuma-peric1-sysreg, in both lists) and dt-bindings: clock: google,zuma-clock (CMU_PERIC1). The content is the same as before, I checked there is no diff against the old commit.

The pins. You're right, I had missed that zuma-typec.dtsi is applied after the battery file. Stock's board file sets hsi2c11_bus to no pull (pud 0), its Type-C file sets pud 3 later, so the pins end up with the pull-up. I matched that (GS101_PIN_PULL_UP) and put the two stock entries in the comment and the commit message. The tree I booted all day still had the old no-pull, so I booted the pull-up separately with a one-line overlay (samsung,pin-pud = <3> on hsi2c11-bus-pins): the running device tree shows pin-pud 3 on gpp21-0/1, the gauge (max17042), the PMIC (max77759) and the dummy client at 0x69 all bind, the Type-C chip answers on the bus (its USB switch register reads 0x09), dmesg has no i2c errors and the battery reads normally. I did not test the pull-up under any other conditions than that boot.

PMIC_ID. Your catch about Google's comment naming a MAX77729 on that interrupt was right to question, so I checked: the MFD driver only binds if PMIC_ID reads 59 (0x3b) and it does, and reading it back on the phone gives PMIC_ID 0x3b, PMIC_REVISION 0x02, OTP_REVISION 0x31. So the chip at 0x66 is a MAX77759. That is in the husky commit message now (the driver prints nothing on success, so there is no probe line to quote, the check is in the code and the read is from i2cget).

On the CMU_TOP numbering with Brett's #157: understood, merge this one first and I'll renumber if it comes to that, tell me.

Checks on the new branch: kernel-pr-check --build --merge is clean in the container (clean merge onto b0d62d9, sign-offs, subject prefixes, checkpatch --strict, W=1 build of the touched C file, 8 device trees W=1), dt-doc-validate is clean on the three bindings, dt_binding_check is clean for them, and dtbs_check on zuma-husky.dtb only shows the same two eusb2-phy supply warnings as before, nothing about hsi2c, peric1, sysreg, max77759 or the pinctrl. The commits also carry the trailer the kernel process doc asks for, so the commit hashes changed once more after those runs; the tree did not. Since a force push needs your approval for CI again, could you approve the run?

What this PR does not claim: nothing about the charger, the Type-C chip or charging, those need their own steps. For anyone who wants the whole story of what I ran on top of it (the gauge model, three guarded charger runs, the USB replug problem, the numbers): derekross/omarchy-mobile#249 has device/husky/BATTERY-NOTES.md, and the overview is in issue #1: derekross/omarchy-mobile#1 (comment).

tools/phone-smoke from the booted kernel

phone-smoke: husky

Kernel 7.3.0-rc6-omamobile-push1-gc7a0b2ef2f66-dirty, tools at bb11919, 2026-11-01T11:15Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gc7a0b2ef2f66-dirty, slot b, up 3292s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 215G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card0-Unknown-1 connected, 1344x2992
GPU not ok no render node
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok SALIXP Touchscreen
buttons ok gpio-keys
Wi-Fi skip no wireless interface
Bluetooth skip no controller
battery ok 75% Discharging, 33 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 33 °C

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-device-husky 0.1.1-1, omamobile-firstboot 0.1.2-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.20-1, omamobile-owl-widgets 0.1.1-1, omamobile-shell 0.2.45-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1

@derekross

Copy link
Copy Markdown
Owner

Thanks Lef, that's a thorough answer, and every point is in. What I checked:

  1. The booted tree. I fetched husky-battery-i2c-booted (9de84ee). It sits on Brett's c6 commit c7a0b2ef2, which matches the -gc7a0b2ef2f66-dirty release, and its four commits make the same changes as this PR in clk-zuma.c, google,zuma.h, zuma.dtsi and zuma-husky.dts. The only difference in zuma-pinctrl.dtsi is the pull-up and its comment, which you booted separately. That's good evidence, thank you.
  2. The comment and the charger. The new comment is accurate, the commit message records the lsmod result, and I've seen omarchy-mobile#250 for the blocklist.
  3. The split. Three dt-bindings: commits, one per file, and the gate is happy with every prefix.

The pins: you're right. In Google's zuma-shusky-board.dtsi, zuma-shusky-battery.dtsi (no pull) is included before zuma-shusky-typec.dtsi, which pulls in zuma/zuma-typec.dtsi (pull-up), so pull-up is the final value. The PMIC_ID read settles the chip question too.

On my side: kernel-pr-check --build --merge is clean on today's base. Every commit's husky DTB builds. dtbs_check on the husky DTB gives only the two eUSB2 supply warnings that are already there, and stays clean with cmu_peric1, the sysreg, USI11 and hsi2c_11 switched on. Nothing here touches the Pixel 7 Pro. I've approved the CI run and will merge this once it's green, ahead of Brett's GPU and CPU stack, as planned.

One small thing, which doesn't need another push here: the CMU_PERIC1 comment in clk-zuma.c still calls the chip at 0x66 "the MAX77729 PMIC", while your read shows it's a MAX77759. Your USI9 commit in #175 rewrites that comment anyway, so please fix the name there.

@derekross
derekross merged commit fa55531 into derekross:omamobile Nov 1, 2026
1 check passed
@Somnius

Somnius commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Derek. Fixed the MAX77729 name in the CMU_PERIC1 comment, it says MAX77759 now. It's in the USI9 clock commit of #175 (force-pushed, the rest of the tree is the same).

Somnius added a commit to Somnius/linux-omarchy-mobile that referenced this pull request Nov 1, 2026
…si2c_9

The Pixel 8 Pro's battery pack has an EEPROM on USI9 / hsi2c_9: stock
has it as "at,24c08" at 0x50 on a 400 kHz bus. Its byte 0x17 is the
battery ID that Google's driver matches against the fuel gauge models
(0 the default model, 1 ATL, 2 COS, 3 LSN, 170 Google's dummy), and
which pack the phone has is what decides the right model. The rest of
the EEPROM holds the pack's part number, dates and history, so the node
is read-only.

Mainline's at24 driver wants "atmel,24c08", not stock's alias. The bus
and USI9 stay disabled in the board file, like hsi2c_11; a bring-up
overlay enables them. Nothing feeds the ID to the gauge yet.

Tested on a Pixel 8 Pro (slot B, release 7.3.0-rc6-omamobile-push1-
g7975b84a8017: Brett's c6 tree with derekross#163 and the four commits of this
series, as the branch husky-pack-eeprom-booted). A bring-up overlay
enabled cmu_peric1, the sysreg, USI9 and hsi2c_9. The log shows

  at24 0-0050: 1024 byte 24c08 EEPROM, read-only

and a one-byte read of offset 0x17 returned 1, the ATL pack.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
Somnius added a commit to Somnius/linux-omarchy-mobile that referenced this pull request Nov 1, 2026
…si2c_9

The Pixel 8 Pro's battery pack has an EEPROM on USI9 / hsi2c_9: stock
has it as "at,24c08" at 0x50 on a 400 kHz bus. Its byte 0x17 is the
battery ID that Google's driver matches against the fuel gauge models
(0 the default model, 1 ATL, 2 COS, 3 LSN, 170 Google's dummy), and
which pack the phone has is what decides the right model. The rest of
the EEPROM holds the pack's part number, dates and history, so the node
is read-only.

Mainline's at24 driver wants "atmel,24c08", not stock's alias. The bus
and USI9 stay disabled in the board file, like hsi2c_11; a bring-up
overlay enables them. Nothing feeds the ID to the gauge yet.

Tested on a Pixel 8 Pro (slot B, release 7.3.0-rc6-omamobile-push1-
g7975b84a8017: Brett's c6 tree with derekross#163 and the four commits of this
series, as the branch husky-pack-eeprom-booted). A bring-up overlay
enabled cmu_peric1, the sysreg, USI9 and hsi2c_9. The log shows

  at24 0-0050: 1024 byte 24c08 EEPROM, read-only

and a one-byte read of offset 0x17 returned 1, the ATL pack.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
derekross pushed a commit that referenced this pull request Nov 1, 2026
…si2c_9

The Pixel 8 Pro's battery pack has an EEPROM on USI9 / hsi2c_9: stock
has it as "at,24c08" at 0x50 on a 400 kHz bus. Its byte 0x17 is the
battery ID that Google's driver matches against the fuel gauge models
(0 the default model, 1 ATL, 2 COS, 3 LSN, 170 Google's dummy), and
which pack the phone has is what decides the right model. The rest of
the EEPROM holds the pack's part number, dates and history, so the node
is read-only.

Mainline's at24 driver wants "atmel,24c08", not stock's alias. The bus
and USI9 stay disabled in the board file, like hsi2c_11; a bring-up
overlay enables them. Nothing feeds the ID to the gauge yet.

Tested on a Pixel 8 Pro (slot B, release 7.3.0-rc6-omamobile-push1-
g7975b84a8017: Brett's c6 tree with #163 and the four commits of this
series, as the branch husky-pack-eeprom-booted). A bring-up overlay
enabled cmu_peric1, the sysreg, USI9 and hsi2c_9. The log shows

  at24 0-0050: 1024 byte 24c08 EEPROM, read-only

and a one-byte read of offset 0x17 returned 1, the ATL pack.

Signed-off-by: Lef <me@lefteros.com>
Assisted-by: LLM
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