Skip to content

linux-omarchy: let UPower see the Snapdragon laptops' charger come and go - #1030

Closed
turbineBMW wants to merge 1 commit into
omacom:masterfrom
turbineBMW:upstream/linux-omarchy-n1x-battmgr-charger
Closed

turbineBMW wants to merge 1 commit into
omacom:masterfrom
turbineBMW:upstream/linux-omarchy-n1x-battmgr-charger

Conversation

@turbineBMW

@turbineBMW turbineBMW commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Adds 2002 to linux-omarchy-aarch64, a qcom_battmgr fix that makes the X1 and X2 laptops announce their charger being plugged in or out. pkgrel 16.

Why

qcom_battmgr takes the AC, USB and wireless supplies' online state from the battery's status response. The firmware sends no notification for those supplies, and the driver only announces the battery, so userspace never hears that the charger changed. UPower keeps the state it read at startup: a laptop booted on the charger never goes on battery, and Omarchy stays on its AC power profile.

omacom/omarchy#15332 works around it with a udev rule. This fixes it in the kernel. Sebastian Reichel applied the patch to the power-supply tree on 17 October as 87fd20da8ca8: https://lore.kernel.org/all/20261013-upstream-battmgr-charger-online-v1-1-731973e133a0@gmail.com/

What changes

  • 2002-power-supply-qcom_battmgr-Notify-charger-supplies-of-online-changes.patch: calls power_supply_changed() for a charger supply whose online state changes when a status response is parsed. Glymur (X2) uses the X1E variant, so it covers both. 2001 is left to linux-omarchy-n1x: carry the I2C timing fix for the Snapdragon keyboard #990.
  • pkgrel 16, and the README's Snapdragon section and test notes.

No other patch touches qcom_battmgr. It applies with --fuzz=0 to 7.2.8 in the recipe's prepare(), and #975's 2133 still applies after it.

Tested

On a Surface Pro 11 (X1E80100), with the patched module built against 7.2.8-7 and loaded in place of the stock one, and the udev rule from #15332 turned off:

  • Plugging in and unplugging the charger now send change events for qcom-battmgr-ac.
  • After restarting UPower on the charger, unplugging sets OnBattery within seconds. Without the patch it stayed on AC.

The patch also builds with W=1 on linux-next and passes checkpatch --strict. The full package was not rebuilt.

@birkskyum birkskyum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @turbineBMW. We'll carry this in the kernel instead of the udev rule from omacom/omarchy#15332, so this is the one to land.

n1x went into master with #930 and the kernel now lives in pkgbuilds/linux-omarchy-aarch64, so this PR has to move too.

  • Retarget it to master and put the patch in linux-omarchy-aarch64.
  • Number it 2002, since #990 takes 2001 there.
  • Bump pkgrel to 12, or the change won't ship.

That's ready at birkskyum/omarchy-pkgs@22972cfe41cc, with you as the author, if you want to take it as is. Once the base is master I can also push it to your branch.

#975 needs the same move.

@birkskyum

Copy link
Copy Markdown
Contributor

#1160 took master to pkgrel 13, so this needs 14 now. birkskyum/omarchy-pkgs@2c0590142aaa has it rebased.

@turbineBMW
turbineBMW force-pushed the upstream/linux-omarchy-n1x-battmgr-charger branch from c744b5d to fabbbb0 Compare October 17, 2026 23:36
@turbineBMW turbineBMW changed the title linux-omarchy-n1x: let UPower see the Snapdragon laptops' charger come and go linux-omarchy: let UPower see the Snapdragon laptops' charger come and go Oct 17, 2026
@turbineBMW
turbineBMW changed the base branch from n1x to master October 17, 2026 23:38

@birkskyum birkskyum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turbineBMW thanks, this now has everything from my review. The build and test checks haven't run on this head, only the two bookkeeping jobs from the retarget, so build-approved has no build to start. Push once more, an empty commit is enough, or close and reopen the PR to start them.

…d go

qcom_battmgr takes the charger supplies' online state from the battery's
status response and never announces it, so UPower kept the charger state it
read at startup. Patch 2002, applied to the power-supply tree as 87fd20da8ca8,
announces the change.

Validated on a Surface Pro 11 with the patched module built against 7.2.8-7:
OnBattery follows plugging in and out with Omarchy's udev rule turned off.
@ryanrhughes
ryanrhughes force-pushed the upstream/linux-omarchy-n1x-battmgr-charger branch from c93854e to d182b9f Compare October 20, 2026 04:22
@ryanrhughes ryanrhughes added the build-approved Maintainer approved this PR to build on the self-hosted pool label Oct 20, 2026
@ryanrhughes
ryanrhughes enabled auto-merge (squash) October 20, 2026 04:24
@ryanrhughes
ryanrhughes disabled auto-merge October 20, 2026 05:17
@ryanrhughes

Copy link
Copy Markdown
Collaborator

Landed on master as part of #1315's squash merge (402c40c), which carried this commit underneath it. It ships in linux-omarchy-aarch64 7.2.8-19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-approved Maintainer approved this PR to build on the self-hosted pool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants