Repository navigation
arm64: dts: exynos: google: gs201-panther: the fuel gauge and its battery model - #171
Merged
derekross merged 2 commits intoNov 1, 2026
Merged
Conversation
… battery Describe the MAX77759's fuel gauge at 0x36 on USI13, as on the Pixel 7 Pro: interrupt on gpa9-3, low, with a pull-up, and the 5 mOhm sense resistor, all as in the Pixel 7's live device tree. The battery takes the live tree's values: 4277 mAh (google,chg-battery-capacity), 4.45 V maximum (google,fv-max-uv) and 3.3 V empty (VEmpty of its gauge models). There is no battery model yet, so the gauge reports from its default one: voltage and current are measured, while the capacity, the percentage and the temperature are approximate. Without a model the driver writes only the gauge's alert settings. Tested on a Pixel 7 from slot B (7.3.0-rc6), with the touchscreen, GPU, haptics and USB rescue: max17042_battery binds to 1-0036 and registers max170xx_battery, reading 4.33 V, 99 % and Charging on the cable, with no I2C errors and no interrupts on gpa9-3. upower and the shell show the battery. With the cable out for a minute, btop showed a discharge of about 1.3 W from it; after the replug it read Charging again. As expected with no model, the temperature stays at 22.0 C and charge_full is the default model's. Assisted-by: Claude Opus 5.5 Signed-off-by: Alejandro Garcia <skipper.pelygro@gmail.com>
…ttery model Give the gauge the ModelGauge m5 model that the stock kernel loads for the pack with a 1 kOhm ID resistor (Coslight, cos-a1-1k in Google's gs201-panther-battery-data.dtsi), as the Pixel 7 Pro does with its own. The phone's pack is that one: under stock's driver the gauge's TempCo read 0x1a02, this model's, where the 0 and 3 kOhm models have 0x223e and 0x1802. RelaxCfg takes the value stock writes over the model at boot (r_regval_1720x in the live device tree); the rest, FilterCfg included, is Google's, and the same as the live tree's. On a POR, the driver writes the model into the gauge's RAM and clears POR. With it, the gauge measures the battery thermistor, and one capacity LSB becomes 2 mAh (TaskPeriod 0x2d00). Tested on a Pixel 7 from slot B (7.3.0-rc6), on top of the previous patch, with the gauge in POR: the driver logs "battery model loaded (DesignCap 0x873, TaskPeriod 0x2d00)". On the cable it then read 92 % (99 % with the default model), 4.33 V, 33.1 C (22.0 C before), charge_full 4324 mAh of 4326 mAh design, and Charging. upower and the shell show 92 %. With the cable out for a minute, btop showed a discharge of 1.38-1.67 W from it. No I2C errors. The gauge's interrupt fired in bursts, about 1300 times while the model loaded and about 400 during the unplug, and was quiet otherwise. Assisted-by: Claude Opus 5.5 Signed-off-by: Alejandro Garcia <skipper.pelygro@gmail.com>
9 tasks done
Owner
|
Thank you, @nesmeck. Two commits, one per test boot, with the table for each and the smoke report: that's exactly how I like a board change to arrive, and the TempCo read to tell the three packs apart is a neat trick. What I checked:
Our gate on today's This doesn't depend on #170: without it the gauge's interrupt still bursts at each 1 % step, as it does on the Pixel 7 Pro today, but nothing breaks. I'll merge this one as it is. Thanks! |
This was referenced Nov 1, 2026
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Pixel 7's battery through the MAX77759's fuel gauge, as on the Pixel 7 Pro, on the I2C bus that #167 enabled. Two commits, one per test boot:
The fuel gauge and the battery.
fuel-gauge@36onhsi2c_13,maxim,max77759-fg, with:if_pmic_fg_intpin group (EINT, pull-up, 2.5 mA);shunt-resistor-micro-ohms, which also keeps the driver out of its voltage-only mode);simple-battery: 4277 mAh, 4.45 V maximum, 3.3 V empty.Every value is from the Pixel 7's live device tree (
max77759fg@36,if-pmic-fg-irq,google,chg-battery-capacity,google,fv-max-uv, and VEmpty of its gauge models). The PMIC at 0x66 stays undescribed, so the charger, GPIO and NVMEM cells don't bind and charging stays as ABL leaves it.The battery model. Stock's ModelGauge m5 model for the pack with a 1 kOhm ID resistor (Coslight,
cos-a1-1k), from Google's GPLgs201-panther-battery-data.dtsi. All three of Google's models (0, 1 and 3 kOhm) match the live tree's word for word.cos-a1-1k's value; the 0 and 3 kOhm models have 0x223e and 0x1802.maxim,r_regval_1720x = <0x2a143b>), as the Pixel 7 Pro's node does too.Tested on a Pixel 7 (slot B, 7.3.0-rc6), with the touchscreen, GPU and haptics:
…-g549fddfe41cc)…-ge654d41e556f)dmesg1-0036, no errorsbattery model loaded (DesignCap 0x873, TaskPeriod 0x2d00)The report's battery line reads Discharging on the cable: ABL's input current limit is below what the phone drew with the screen on. That belongs to the charger, a later step.
phone-smoke (`…-g51074200c999`: this PR, #167, #133, #166 and the driver fix)
phone-smoke: panther
Kernel
7.3.0-rc6-omamobile-push1-g51074200c999, tools at84d3edf, 2026-11-01T03:29Z.Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.21, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamobile-apps 0.2.0-1, omamobile-device-panther 0.1.3-1, omamobile-firstboot 0.1.2-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.12-1, omamobile-owl-widgets 0.1.1-1, omamobile-shell 0.2.28-1, omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1
Checks:
tools/kernel-pr-check --build OUT --merge origin/omamobilepasses everything:🤖 Generated with Claude Code