Skip to content

omamobile-device-panther: off-mode charging instead of starting the phone on its cable - #788

Open
nesmeck wants to merge 1 commit into
derekross:mainfrom
nesmeck:panther-charger-mode
Open

nesmeck wants to merge 1 commit into
derekross:mainfrom
nesmeck:panther-charger-mode

Conversation

@nesmeck

@nesmeck nesmeck commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

The Pixel 7 Pro's off-mode charging (#554, which landed in #730), on the Pixel 7. A Pixel 7 powered off on its cable is started by its bootloader with androidboot.mode = "charger", where stock runs only a charging screen, and we started the whole phone. Now that boot charges with the panel dark.

What it adds (no version bump; the number is yours at the merge):

  • The cheetah package's four files, byte for byte: omamobile-charger-mode, omamobile-charger-mode-generator, omamobile-charger.service and omamobile-charger.target. install stages them, with the generator executable, and enables nothing: only the generator uses the target, on a charger boot.
  • python added to depends.
  • The test checks the four files against the cheetah package, as it does for Wi-Fi and sleep, and fails if one drifts. It also runs the generator on a charger boot, a normal boot and with charger-mode-disable. Then it checks that the target keeps SSH over USB and starts nothing of the phone. The script's own behavior stays tested in the cheetah package.
  • The README has a row for it.

The charger's policy came first as #827, merged as device-panther 0.1.17: the Pixel 7 Pro's two modprobe files, so the charger loads with default_ilim_ua and temp_guard, and the BATTERY-PLAN commit with gates B3 to D1 and their results. This pull request is the off-mode commit alone, rebased onto it. install's header and the test's last line now say that the charger driver loads under that policy and that the charger target comes only from its generator.

The power off once the cable is out reads max77759-charger/online, which needs the MAX77759's PMIC in the device tree: linux-omarchy-mobile#259. Without that node the phone stays in the dark charging boot until Power is held. Next is linux-omarchy-mobile#259, then this one, with a run on a published kernel that has the node.

Tested on a Pixel 7 from slot B, on a 7.3.0-rc6 kernel built from omamobile 82f31d3a7 with my local panther changes, including linux-omarchy-mobile#259's node, and with the two modprobe files. The four files on the phone had the same hashes as this branch's.

  • A power off on the cable: the bootloader's charging icon showed for under a second, then our kernel came up in omamobile-charger.target. The service logged "panel off: 1c2c0000.dsi.0" and then "charging; hold Power to start the phone, battery 98% Charging".
    • The panel was dark.
    • multi-user, graphical, Wi-Fi, Bluetooth and Plymouth stayed inactive.
    • sshd, usb-rescue and ufw were active, so SSH over USB worked, and no unit failed.
  • Power held: "Power held: reboot", then a normal boot to graphical.target with the screen right.
  • A second power off on the cable, then the cable out: "charger unplugged: poweroff", and the phone stayed off.
  • Slot B's tries: neither charger boot spent one (2 → 2, then 1 → 1). The restart from Power held spent one, as a normal boot does.

The second charger boot's battery line read "99% Discharging" on the cable, near full, like the first "Discharging" line seen on the 7 Pro. The unplug check uses the charger's online, which read 1.

Checks: packages/omamobile-device-panther/test/all, tests/grep-q-pipes and tools/pr-check pass.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a clean port: the 7 Pro's four files exactly (I checked the blobs), a test that fails if they drift, the generator run for a charger boot, a normal boot and the opt-out, and a phone run that covers the dark panel, Power held and the slot counts. The package test passes on today's main with this merged, and nothing on the 7 Pro changes.

The part I need to decide before merging is the one you flagged yourself. On the published kernel panther has no max77759-charger supply, so the script's "cable out, power off" can never fire: a Pixel 7 powered off on its cable, then unplugged, stays on with its screen dark until someone holds Power or the battery runs flat, and it looks off the whole time. Today that boot at least starts the phone where you can see it. Your run of the power-off path was on a kernel with your local charger node, which isn't in any tree yet.

I see two ways, and I'd like your view:

  1. Send the charger node as a linux-omarchy-mobile pull request first. Then the shared script works on panther as it does on the 7 Pro, and your runs here become evidence on a public kernel. If the charger driver shouldn't load on the Pixel 7 yet, the package would need to blacklist it before that node lands, as the 8a's package now does.
  2. Merge this now with the gap in the README: on the published kernel, a phone powered off on its cable stays on, dark, after it's unplugged; hold Power to start it, then power it off from the menu.

I lean towards the first, since a phone that looks off but isn't is the kind of surprise I'd rather not ship. Either way, a tools/phone-smoke report from a normal boot of 0.1.16 would round off the evidence.

@nesmeck
nesmeck force-pushed the panther-charger-mode branch from 9c1c0bf to 092a3a7 Compare November 15, 2026 05:59
@nesmeck

nesmeck commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Thank you. I agree with the first way: a phone that looks off but isn't shouldn't ship.

The charger should load on the Pixel 7. It has charged through the upstream driver on my phone since 2026-11-01, with the Pixel 7 Pro's options. So rather than a blacklist, I've added that setup to this pull request, as two commits on top of the charger-mode one:

  • device-panther 0.1.16: the charger's policy and the MAX77759 blacklist. The phone's two modprobe files:

    • default_ilim_ua=500000 temp_guard=1 after the gauge, as on the 7 Pro;
    • tcpci_maxim, gpio_max77759 and nvmem_max77759 blacklisted.

    Without the PMIC node nothing binds, so on today's kernel they change nothing. With it, the driver doesn't turn charging off at probe. The test checks both options together and the blacklist.

  • BATTERY-PLAN (panther): the charger, gates B3 to D1 and their results. The plan and the results of B3.1-B3.3, B3g and D1 from 2026-11-01, which until now were only in my tree.

The kernel side is linux-omarchy-mobile#259: pmic@66 with its GPIO cell, the battery's 4.45 V and 0.3 C limits, and the Type-C port controller still undescribed. It passes tools/kernel-pr-check on today's omamobile and merges cleanly onto linux-omarchy-mobile#181. Since the driver turns charging off at probe without default_ilim_ua, it should merge after this one.

The tools/phone-smoke report from a normal boot of 0.1.16 will follow.

🤖 Generated with Claude Code

@nesmeck

nesmeck commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

The tools/phone-smoke report from a normal boot of this pull request's package, as promised. The phone ran a local build, device-panther 0.1.17.1, built from this branch's three commits plus:

  • the Wi-Fi check, the pull request that will follow this one;
  • three local files: the Bluetooth address, screen_off=2 for gs-decon, and the Wi-Fi wake turned off around sleep.

Nothing in the build changes this pull request's files. The kernel is my test kernel with linux-omarchy-mobile#259's node, #181 and its 90 Hz commits.

On that boot the charger loaded with default_ilim_ua=500000 and read online. The charger-mode generator left the normal boot alone: the default target stayed graphical.target, and no charger-mode unit ran.

### phone-smoke: panther

Kernel `7.3.0-rc6-omamobile-push1-g78a54921b02a`, tools at `9d1fd45f`, 2026-11-15T06:46Z.

| Check | Result | Detail |
| --- | --- | --- |
| boot (required) | ok | kernel 7.3.0-rc6-omamobile-push1-g78a54921b02a, slot b, up 65s |
| storage guard (required) | ok | 55 partitions; only userdata and slot B's boot images writable |
| root (required) | ok | ext4 on userdata, 98G free |
| kernel health (required) | ok | no oops or BUG; 0 WARN, 38 error lines in dmesg (37 known, 1 new) |
| new dmesg errors | not ok | cma: Failed to reserve N MiB x1 |
| systemd units | ok | none failed |
| USB gadget (required) | ok | bound to 11210000.usb |
| display | ok | card2-DSI-1 connected, 1080x2400 |
| GPU | ok | render node on panthor |
| session (required) | ok | Hyprland and the Omarchy shell running |
| lock | ok | PAM file present, the shell can lock (passwordPam true, locked true) |
| touch | ok | FocalTech FT3658 |
| buttons | ok | gpio-keys |
| Wi-Fi | ok | wlp1s0 on brcmfmac, link up |
| Bluetooth | ok | hci0, powered true |
| battery | ok | 99% Charging, 28 °C |
| sound cards | skip | none |
| sensors | skip | no sensor proxy |
| cameras | skip | no libcamera tools |
| thermal | ok | hottest zone 43 °C |

The one new dmesg line, "cma: Failed to reserve 384 MiB", comes at 0.000000, before any module or package file is read. The two boots before this one, with the old package, have it too. So it comes from my test kernel's memory layout, not from this package. The tool's package list is left out; it showed device-panther 0.1.17.1.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

My decision on the gap: the charger node goes into the kernel first. As it stands, a Pixel 7 that's powered off on its cable and then unplugged stays running with its panel dark until someone holds Power, because panther's published board file has no max77759-charger supply for the script to watch. Before this PR the same boot started the whole phone, which at least shows.

So please open the kernel PR with the MAX77759's charger cell for panther (as on the 7 Pro), and in this package blacklist the charger driver before that node lands, as akita's 0.1.4 does. Once the node is in a published kernel, a run of this PR on it (powered off on the cable, unplugged, the phone powering off by itself) makes this ready, and I'll merge it.

@derekross

Copy link
Copy Markdown
Owner

Thank you, Alejandro, for the kernel PR, the plan with your B3 to D1 results, and the smoke report. I owe you a correction first: my decision this afternoon asked for the charger driver to be blacklisted as on the 8a, and I hadn't taken in your reply from the morning when I posted it. You're right, and I'd rather go your way: a blacklisted charger means no max77759-charger supply, so the off-mode boot would still have nothing to watch after the node lands, and the run I asked for (powered off on the cable, unplugged, the phone powering off by itself) couldn't pass. The Pixel 7 Pro loads the charger at boot with exactly these two options, and your plan records the same gates on the Pixel 7, so please keep the policy as you have it.

Three things before this can go in:

  1. CI fails on the grep -q lint, at test/all line 181 (… | grep -qvx … under pipefail). grep -cvx '…' >/dev/null in place of grep -qvx '…' keeps the meaning and passes. With that, tests/packages will run too; I ran the package's test/all on main with your branch merged, and it passes.
  2. The order. linux-omarchy-mobile#259 can't go first: on a kernel with the node and today's device-panther, the charger loads without default_ilim_ua and turns charging off. And this PR waits for the node. Could you move the policy commit (the two modprobe files, the install lines and their test lines) into its own small pull request? It changes nothing on today's kernel, so I can merge it first; then omamobile-shell 0.2.67: omamobile-setup-user --adopt, for a user set up by hand #259; then, once the node is in a published kernel, this one with the run.
  3. The version: 0.1.16 is about to be taken by another panther pull request, so please leave the number to me at each merge; I'll tell you which one when I'm ready to merge.

For that last run, your phone has a local 0.1.17.1, which sorts above what I'll publish, so please install the package built from this branch with pacman -U and paste pacman -Q omamobile-device-panther and uname -r with the result.

@nesmeck
nesmeck force-pushed the panther-charger-mode branch from 092a3a7 to aeee023 Compare November 15, 2026 21:12
@nesmeck nesmeck changed the title omamobile-device-panther 0.1.16: off-mode charging instead of starting the phone on its cable omamobile-device-panther: off-mode charging instead of starting the phone on its cable Nov 15, 2026
@nesmeck

nesmeck commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Thank you, and no need to apologise: your first decision was right for the board file as it is.

Done:

  1. The grep -q pipe: fixed as you suggested, grep -cvx … >/dev/null. It now lives in the policy pull request, and tests/grep-q-pipes passes there.
  2. The order: the policy commit (the two modprobe files, their install lines, their test and README rows) is now omamobile-device-panther: the charger's policy and the MAX77759 blacklist #827, on today's main. This one is rebased on main without it: the charger-mode commit and BATTERY-PLAN. The plan refers to omamobile-device-panther: the charger's policy and the MAX77759 blacklist #827 for the files. The two touch the same pkgdesc and README lines, so I'll rebase this one once omamobile-device-panther: the charger's policy and the MAX77759 blacklist #827 is in.
  3. The version: neither branch bumps it now; I'll leave the number to you.

For the last run I'll install the package built from this branch with pacman -U, once #259's node is in a published kernel, and paste pacman -Q omamobile-device-panther and uname -r with the result.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you, Alejandro. All three points are done: the lint line went with the policy into #827 and CI is green on both, the split is exactly what I asked for, and neither branch carries a version. I've asked on #827 for its version and suggested that the BATTERY-PLAN commit travel with it, so the files cite gates that are on main; if you move it, this one becomes the off-mode commit alone.

From here it's the order we agreed: #827 first, then linux-omarchy-mobile#259 once the package is published, then this one rebased onto #827, with your run on a published kernel that has the node, and I'll give you the version number then.

…hone on its cable

A Pixel 7 powered off on its cable is started by its bootloader with
androidboot.mode = "charger", where stock runs only a charging screen.
We started the whole phone.

The Pixel 7 Pro's off-mode charging (derekross#554, landed in derekross#730), copied byte
for byte: omamobile-charger-mode-generator makes omamobile-charger.target
the default of such a boot, and omamobile-charger-mode turns the panel
off, restarts into the phone on Power held for a second, and powers off
five seconds after the cable is out. The test checks the copies against
the cheetah package, runs the generator on a charger boot, a normal boot
and with charger-mode-disable, and checks that the target keeps SSH over
USB and starts nothing of the phone. python joins depends.

The power off on an unplug reads the charger's online, which needs the
MAX77759 charger in the device tree (linux-omarchy-mobile#259).
Without it the phone stays in the dark charging boot until Power is
held.

Tested on a Pixel 7 from slot B, on a kernel that describes the charger:
a power off on the cable went to the charger boot, the panel went dark
and SSH over USB came up; Power held restarted into the phone; a second
charger boot powered off once the cable was out. Neither charger boot
spent a slot B try.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nesmeck added a commit to nesmeck/omarchy-mobile that referenced this pull request Nov 18, 2026
- The Pixel 9a, not the Pixel 9 Pro, for device/tegu/SLEEP-PLAN.md.
- The status line: the kernel releases since kernel-2026.11.13 carry
  linux-omarchy-mobile#233, so the upower drop-in waits only for
  off-mode charging (derekross#788). P7's last takeaway names derekross#730, which
  carried derekross#554's commits.
- The standby numbers in the status line each with their condition:
  Wi-Fi kept at 2028 and at 1014 MHz, Wi-Fi unloaded at 1014 MHz.
- Z2k's boot: only stock recovery came up, not Android.
- DISPLAY-PLAN D5 and the NOTES entries, which come with the 90 Hz pull
  request, say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nesmeck
nesmeck force-pushed the panther-charger-mode branch from f54bb55 to 723acc2 Compare November 18, 2026 04:14
@nesmeck

nesmeck commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main with #827 in. The conflicts were the two lines both touched: pkgdesc now ends "Wi-Fi, charging and off-mode charging", and the README's first paragraph has both sentences. version is main's 0.1.17, untouched.

As you noted on #827, two lines said the package starts nothing of the charger. install's header now says the charger driver loads at boot under omamobile-charger.conf's policy and omamobile-charger.target runs only when its generator finds a charger boot. The test's last line says the package starts nothing that marks a slot, starts the modem or guards the charge, and the charger target comes only from its generator. The check itself is unchanged.

packages/omamobile-device-panther/test/all, tests/grep-q-pipes and tools/pr-check pass. The run you asked for follows once #259's node is in a published kernel.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you, Alejandro. The rebase is exactly right: one commit, the two lines both pull requests touched resolved as you describe, and install's header and the test's last line now say what the package really does with the charger. I checked the four files against the Pixel 7 Pro's by blob and they are identical, CI is green on this head, and it merges cleanly onto today's main.

Nothing more is needed from you on this one for now. Where it stands in the order: #827 is merged as device-panther 0.1.17, and I'm waiting for that package to show up in the published repository before I merge linux-omarchy-mobile#259. Then a kernel release with the node, then your run on it, installed with pacman -U from this branch, with pacman -Q omamobile-device-panther and uname -r.

On the version: this will be 0.1.18, unless another Pixel 7 pull request takes that number first. I'll tell you which when I'm ready to merge, and it goes onto the branch before the squash.

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