Skip to content

omamobile-device-tegu 0.2.1: the charge limit works with the kernel's charger driver - #230

Closed
W4HO-ham wants to merge 1 commit into
derekross:mainfrom
W4HO-ham:device-tegu-charge-behaviour
Closed

W4HO-ham wants to merge 1 commit into
derekross:mainfrom
W4HO-ham:device-tegu-charge-behaviour

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

omamobile-tegu-charge-limit wrote charge_control_end_threshold. That attribute exists only on the bring-up charger module. The merged max77779_charger (linux-omarchy-mobile#92) offers charge_behaviour (auto/inhibit-charge) and no end threshold, so on the published driver the limit did nothing.

Now, when there's no threshold, the script holds charging off from the limit (inhibit-charge) and lets it run again 5 points below (auto), using max77779-battery's capacity. A charger with a threshold is still handed the limit directly, as before. With no file or a bad value it ends in auto, so charging is never left inhibited. The udev rule now also runs it on every max77779-battery change, which is how it follows the capacity.

Tested on the palmtop today on the published charger driver, with the charger node from linux-omarchy-mobile#161 (kernel 7.3.0-rc6-omamobile-push1-g7dbac6f4e65c):

  • At capacity 89 with /etc/omamobile/charge-limit = 80: charge limit 80 %: inhibit-charge, and the charger and the battery went to Not charging.
  • With the file removed: charge limit 100 %: auto, and Charging came back.

I ran the script by hand both times. I didn't verify the udev rule's own run on that boot: udev doesn't log the script's output, so my journal check couldn't show it either way.

test/charge-limit gains the charge_behaviour cases: at the limit, inside the 5-point band, below it, no file, and a bad file. test/all and tools/pr-check pass.

… charger driver

The merged max77779-charger driver has charge inhibit and no end threshold, so the charge limit wrote nothing. The script now switches charge_behaviour between inhibit-charge and auto by the battery's capacity, from the limit to 5 below, and udev runs it on every battery change.
@derekross

Copy link
Copy Markdown
Owner

Merged as part of #235's squash (0.2.1 through 0.2.3 together). Thanks! I checked the kernel side too: max77779_charger returns to auto at shutdown and reads back the mode at probe, so a reboot can't leave charging held off. The sleep gap I mention on #235 is worth a README line later.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…, the AoC and NFC at boot, and the 9a's own setup-system (derekross#235)

Merges the stack derekross#230, derekross#234 and derekross#235:

- 0.2.1 (derekross#230): the charge limit works with the published max77779 charger driver, which offers inhibit rather than an end threshold; the script handles both and always falls back to auto on a missing or bad file. While the phone sleeps nothing runs the script (the battery's change events come from a freezable 30 s poll), so a phone asleep on the charger below the limit charges past it until it wakes.
- 0.2.2 (derekross#234): the AoC starts at boot from the device tree, hang-safe, gated on the AoC node, under the omamobile-aoc.service alias so the sensor proxy orders after it; the amplifiers load after the AoC is online. Speaker protection stays cheetah-only.
- 0.2.3 (derekross#235): NFC at boot, gated on a node that names its clock; the existing sleep hook stops polling before s2idle. The 9a gets its own omamobile-setup-system.

Closes derekross#230, closes derekross#234.
derekross pushed a commit that referenced this pull request Nov 15, 2026
…l, regulator-wlan included (#777)

Kernel #230's PCI power-control path needs `regulator-wlan`, which the historical `wifi-controller` overlay doesn't enable. A new `wifi-reviewed-controller` overlay enables the regulator, the PHY and the controller, and leaves the endpoint off. WIFI-PLAN records the 2026-11-13 w0/w1/w2 stages on `7.3.0-rc6-omamobile-bluejay-review-20261111` as overlay combinations. The trials set the same `status` properties directly in the DT, so the overlay file itself hasn't booted. The historical overlay stays for the pinned `c934e316b` path. No descriptor applies these overlays, and their targets exist only in #230's disabled DT.

Assisted-by: OpenAI Codex
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