Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From 8bacdd79f85caec9d7d623e18ad1791615c44d80 Mon Sep 17 00:00:00 2001
From: Brandon Williams <turbine.bmw@gmail.com>
Date: Tue, 13 Oct 2026 13:14:41 -0400
Subject: [PATCH] power: supply: qcom_battmgr: Notify charger supplies of
online changes

On SC8280XP and X1E80100 the AC, USB and wireless supplies take their
online state from the charging source in the battery status response.
The firmware sends no notification for those supplies when the charging
source changes, and the driver only announces the battery, so userspace
never learns that the charger was plugged in or out. UPower keeps the
state it read at startup: a laptop booted on the charger never goes on
battery.

Call power_supply_changed() for a supply whose online state changes when
a status response is parsed. A supply that is not registered yet, when
the battery is read during probe, reports its state when it registers.

Tested on a Microsoft Surface Pro 11 (X1E80100): after restarting UPower
on the charger, unplugging now sets OnBattery, and plugging in clears it.

Fixes: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Brandon Williams <turbine.bmw@gmail.com>
---
drivers/power/supply/qcom_battmgr.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index e84633278943..2c6576b93726 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -1256,6 +1256,23 @@ static unsigned int qcom_battmgr_sc8280xp_convert_temp(unsigned int temperature)
return DIV_ROUND_CLOSEST(temperature, 10);
}

+/*
+ * The charger supplies' online state comes from the battery status response,
+ * and the firmware sends no notification of its own when it changes, so
+ * announce the change here. A supply that is not registered yet announces its
+ * state when it is.
+ */
+static void qcom_battmgr_sc8280xp_set_online(struct power_supply *psy,
+ bool *online, bool value)
+{
+ if (*online == value)
+ return;
+
+ *online = value;
+ if (psy)
+ power_supply_changed(psy);
+}
+
static void qcom_battmgr_sc8280xp_callback(struct qcom_battmgr *battmgr,
const struct qcom_battmgr_message *resp,
size_t len)
@@ -1325,9 +1342,12 @@ static void qcom_battmgr_sc8280xp_callback(struct qcom_battmgr *battmgr,
battmgr->status.temperature = qcom_battmgr_sc8280xp_convert_temp(le32_to_cpu(resp->status.temperature));

source = le32_to_cpu(resp->status.charging_source);
- battmgr->ac.online = source == BATTMGR_CHARGING_SOURCE_AC;
- battmgr->usb.online = source == BATTMGR_CHARGING_SOURCE_USB;
- battmgr->wireless.online = source == BATTMGR_CHARGING_SOURCE_WIRELESS;
+ qcom_battmgr_sc8280xp_set_online(battmgr->ac_psy, &battmgr->ac.online,
+ source == BATTMGR_CHARGING_SOURCE_AC);
+ qcom_battmgr_sc8280xp_set_online(battmgr->usb_psy, &battmgr->usb.online,
+ source == BATTMGR_CHARGING_SOURCE_USB);
+ qcom_battmgr_sc8280xp_set_online(battmgr->wls_psy, &battmgr->wireless.online,
+ source == BATTMGR_CHARGING_SOURCE_WIRELESS);
if (battmgr->info.last_full_capacity != 0) {
/*
* 100 * battmgr->status.capacity can overflow a 32bit
--
2.56.0

9 changes: 6 additions & 3 deletions pkgbuilds/linux-omarchy-aarch64/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
pkgbase=linux-omarchy-aarch64
_kernel=linux-omarchy
pkgver=7.2.8
pkgrel=15
pkgrel=16
pkgdesc='Omarchy Linux for aarch64 (BORE CPU scheduler, ADIOS I/O scheduler)'
url='https://omarchy.org'
arch=(
Expand Down Expand Up @@ -258,6 +258,7 @@ source=(
1104-HID-asus-turn-the-keyboard-backlight-off-for-sleep-without-asus-wmi.patch
2000-media-iris-reset-AHB-bridge-before-enabling-HW-mode.patch
2001-ASoC-qcom-q6apm-lpass-dais-Reset-the-codec-DMA-channel-map-in-hw_params.patch
2002-power-supply-qcom_battmgr-Notify-charger-supplies-of-online-changes.patch
)
source_aarch64=(config.aarch64)
validpgpkeys=(
Expand Down Expand Up @@ -617,7 +618,8 @@ sha256sums=('12e8d5a973d1ad7c5a5c69882e4022b131ed715db7003fdcd760ddf8c3e51941'
'c7b388262ae9f8f9ec2e4f3366eb2d0cbd4d1e93f0bb563b7d3df3a17fd16e74'
'2efbd3f5d196c31c85a3733707a89cd54f8579756e30f3a16b8ac45ed76b32a6'
'61260d5828b8d5009df572d5efe50ae359879fb0fbb1bc42d9145dc1947fc8dd'
'2c2eeccb8ac53d8626494fc4a5f47ab4b7271f68c5318a67fc5f5cd130763671')
'2c2eeccb8ac53d8626494fc4a5f47ab4b7271f68c5318a67fc5f5cd130763671'
'9f08ec0bb897a496283e8f82a9478bdf42189b739094613ddc0a378b68a12dc7')
sha256sums_aarch64=('0945fa582a85896d16a0b826a05411247621885f0fb10d98369bd09b7f1599dd')
b2sums=('5326dde778eb945f282740ef0d8765b46fbd198f1209cdfd7b91e5dac1312fc01f8bf0b2bc67b16a76de736edd8ea21b38b6c91e696ec0c4b39746cd21a15214'
'SKIP'
Expand Down Expand Up @@ -971,7 +973,8 @@ b2sums=('5326dde778eb945f282740ef0d8765b46fbd198f1209cdfd7b91e5dac1312fc01f8bf0b
'fe4c9b5c3daa914887734219bf63c651e28981cbc6ea9fdb11316b40e7c6e91d2784fdcc8307e5592eeed85809fb7e0ed284bd4b1e2e0714202f014705e4247d'
'5c5a6d3a59de1be12520ec544e9f259ceef4c0981f371b363a54b4b4764ffcec198d499059e94b4ebb1bdd0293438ea6b3ea6eff6812698d9c754e98af2a946b'
'dd6c431db54ed291186cbe2ede032d8839caeaef83141d4f2fc4304c8580b426937da40aa29b66d3cbb52fedbc734c0dc6c99e5b5c266badb0d78b194f73c093'
'6c10ffec36ef7b097a4f0562cb559eaf49bbff31213181c725e6896bfb3f9112bc7a6f127a396ead99792ccd8d93019e3e4090806a417ba50d99711bb309cecb')
'6c10ffec36ef7b097a4f0562cb559eaf49bbff31213181c725e6896bfb3f9112bc7a6f127a396ead99792ccd8d93019e3e4090806a417ba50d99711bb309cecb'
'83491203f17dcf589f99b7e677e7cbeb36d5bd22e05d5bb564a254776fbcfb6020606975bd5c44cb4bc603d7a89162f7c8be2a299758b5680b73aba49f6459e0')
b2sums_aarch64=('8c93d3a66925469954c7f13f06b184cfbd16881bba91f8cfd92c2d64efb8a961e9bfa4a3bc4ed5598c49b25f074f8579048726a960bcc185ab2577ad85e4d509')

# https://www.kernel.org/pub/linux/kernel/v7.x/sha256sums.asc
Expand Down
8 changes: 6 additions & 2 deletions pkgbuilds/linux-omarchy-aarch64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `linux-omarchy` kernel for aarch64, with NVIDIA N1x (RTX Spark) and Snapdrag

It carries the same kernel.org source and signed Omarchy patch set as `linux-omarchy` 7.2.8-5, plus N1x topic patches numbered 1000 and up. `linux-omarchy` is the BORE build (it was `linux-omarchy-bore` until 7.2.8-9, which is now a transitional package), so the shared patches, their signatures and the BORE and ADIOS schedulers come from `linux-omarchy`, byte for byte, including its BORE rebases of the `0121`–`0144` scheduler patches. The intent is to fold these into `linux-omarchy` itself once it builds for aarch64; until then this is the kernel Omarchy installs on N1x machines (`install/hardware/n1x.sh` in omarchy), replacing NVIDIA's 7.0-based `linux-n1x`.

The `pkgrel` counts N1x revisions of this package and starts again at 1 when the kernel version changes. On 7.2.5 it was `6.1` to `6.9` while it tracked `linux-omarchy`'s release; the ninth revision became `9`, `10` added the Dell XPS 16 patches, `11` brought a dock's displays back after a failed DisplayPort tunnel, `12` stopped the clock during suspend-to-idle, `13` brought NVIDIA's device sleep patches from 1022.23, `14` let keyboard and touchpad interrupts wake the system from the platform's deepest sleep, and `15` brought audio and UCSI fixes from upstream and turned kexec handover off by default. `7.2.8-1` moves to 7.2.8 and `linux-omarchy` 7.2.8-5's patch set, `2` closes a SoundWire interrupt race that could hang the boot, `3` stops `cppc_cpufreq` registering its artificial energy model, so EAS no longer packs the desktop onto the A725 cores, `4` ships the Snapdragon laptops' device trees and resets the Iris AHB bridge before hardware mode, `5` builds SCMI CPU frequency scaling in, which the Snapdragon laptops need, `6` lets suspend-to-idle reach the platform's deepest idle state, which brings sleep from 6-15 W to under 1 W, `7` stops reclaiming the GPU's reserved memory, which the firmware now sizes itself, `8` takes the name `linux-omarchy`, `9` registers `cppc_cpufreq`'s artificial energy model again, so that power-profiles-daemon's RTX Spark driver can turn EAS on and off with the governor, as NVIDIA designed it, `10` keeps a dock's tunnels through suspend-to-idle, so its USB devices and displays come back on resume, `11` spaces out a dock's DisplayPort teardowns, so the GPU sees both monitors leave when a two-monitor dock is unplugged, `13` keeps USB and the SSPM-dependent ACPI drivers working on a DGX Spark whose firmware hides the SSPM mailbox, `14` lets Bolt authorize new docks on its own, as it does on Intel and AMD laptops, and `15` brings back the Snapdragon laptops' digital microphones.
The `pkgrel` counts N1x revisions of this package and starts again at 1 when the kernel version changes. On 7.2.5 it was `6.1` to `6.9` while it tracked `linux-omarchy`'s release; the ninth revision became `9`, `10` added the Dell XPS 16 patches, `11` brought a dock's displays back after a failed DisplayPort tunnel, `12` stopped the clock during suspend-to-idle, `13` brought NVIDIA's device sleep patches from 1022.23, `14` let keyboard and touchpad interrupts wake the system from the platform's deepest sleep, and `15` brought audio and UCSI fixes from upstream and turned kexec handover off by default. `7.2.8-1` moves to 7.2.8 and `linux-omarchy` 7.2.8-5's patch set, `2` closes a SoundWire interrupt race that could hang the boot, `3` stops `cppc_cpufreq` registering its artificial energy model, so EAS no longer packs the desktop onto the A725 cores, `4` ships the Snapdragon laptops' device trees and resets the Iris AHB bridge before hardware mode, `5` builds SCMI CPU frequency scaling in, which the Snapdragon laptops need, `6` lets suspend-to-idle reach the platform's deepest idle state, which brings sleep from 6-15 W to under 1 W, `7` stops reclaiming the GPU's reserved memory, which the firmware now sizes itself, `8` takes the name `linux-omarchy`, `9` registers `cppc_cpufreq`'s artificial energy model again, so that power-profiles-daemon's RTX Spark driver can turn EAS on and off with the governor, as NVIDIA designed it, `10` keeps a dock's tunnels through suspend-to-idle, so its USB devices and displays come back on resume, `11` spaces out a dock's DisplayPort teardowns, so the GPU sees both monitors leave when a two-monitor dock is unplugged, `13` keeps USB and the SSPM-dependent ACPI drivers working on a DGX Spark whose firmware hides the SSPM mailbox, `14` lets Bolt authorize new docks on its own, as it does on Intel and AMD laptops, `15` brings back the Snapdragon laptops' digital microphones, and `16` lets UPower see a Snapdragon laptop's charger being plugged in and out.

[`UPGRADING-7.3.md`](UPGRADING-7.3.md) has notes for the move to 7.3: what each N1x patch needs there, what upstream already has, and how to verify the result.

Expand Down Expand Up @@ -87,14 +87,16 @@ Patches 1100–1104 are for the ASUS ProArt P14 (H7407BA) keyboard, 0B05:4B42: t

## Snapdragon laptops

Since `7.2.8-4` this is also the kernel for the Snapdragon X laptops. Their drivers were already on in the config. Three things were missing.
Since `7.2.8-4` this is also the kernel for the Snapdragon X laptops. Their drivers were already on in the config. Four things were missing.

The laptops get no device tree from their firmware, so the package builds the Windows-on-ARM families' trees (`x1*`, `hamoa*`, `glymur*`, `sc8280xp*`) and installs them under `/boot/dtbs/linux-omarchy-n1x/qcom`. They sit under the package's name so that no file is shared with Arch Linux ARM's `linux-aarch64`, which keeps its own in `/boot/dtbs`. Omarchy's Snapdragon setup lists them for the UKI.

`2000` is "media: iris: reset AHB bridge before enabling HW mode" (cc330f558996, in the media tree for 7.4). This config builds the Iris video decoder, and without the fix its firmware can assert when a video starts after the decoder has been idle. It was reported and tested on the Yoga Slim 7x.

`2001` fixes capture from the Snapdragon laptops' digital microphones, which `0511-asoc-updates.patch` broke. It carries mainline's c663014e452d, which builds the codec DMA active channel mask from the port's channel map. `q6dma_hw_params()` never clears that map, and its default mapping covers only one, two and four channels, so a stream gets a mask that does not match its channel count, and the DSP refuses to start the port ("Failed to start APM port 110" on `VA_CODEC_DMA_TX_0`). `2001` clears the map before filling it and maps any channel the default mapping leaves out. Mainline has no fix yet. Tested on the Yoga Slim 7x, through PipeWire and with direct captures of two, four and two channels in a row.

`2002` is "power: supply: qcom_battmgr: Notify charger supplies of online changes" (87fd20da8ca8, [sent on 13 October 2026](https://lore.kernel.org/all/20261013-upstream-battmgr-charger-online-v1-1-731973e133a0@gmail.com/) and applied to the power-supply tree on 17 October). On the X1 and X2, `qcom_battmgr` takes the AC, USB and wireless supplies' online state from the battery's status response, and the firmware sends no notification for them when the charger is plugged in or out, so nothing told userspace. UPower kept the state it read at startup: a laptop booted on the charger never went on battery, and Omarchy stayed on its AC power profile. The patch announces a supply whose online state changes.

`ARM_SCMI_CPUFREQ` and `ARM_SCMI_PERF_DOMAIN` are built in since `7.2.8-5`. The X1 and X2 CPUs scale through SCMI's performance protocol, and neither module carries an alias, so as modules nothing loaded them: the laptops booted with no cpufreq policies and ran at whatever clock the firmware left. Arch Linux ARM's kernel builds both in. The N1x scales through ACPI CPPC and is unaffected.

Two differences from Arch Linux ARM's kernel matter on these laptops. Omarchy's Snapdragon setup handles both, so the config stays as the N1x needs it.
Expand Down Expand Up @@ -126,6 +128,8 @@ The build produces `Image`, modules and the Snapdragon laptops' device trees; N1

7.2.8-3 on the ProArt P14 with `nvidia-open-dkms` 615.78.08 and `omarchy-power-profiles-daemon` (2026-10-10): boot, display, speakers, Wi-Fi, keyboard and touchpad; no energy model registered and the SoundWire link enumerating with its usual handful of attach interrupts. App launches (median of 5, against 7.2.5-10 under the same conditions on AC) were 5-22% faster in the balanced profile (Nautilus 672 to 523 ms, Obsidian 1138 to 958 ms, a terminal 62 to 49 ms) and unchanged in performance. Two suspend-to-idle cycles, 25 minutes (woken by the keyboard) and 7 minutes (lid): CLOCK_MONOTONIC stayed frozen, no watchdog restarts, no SoundWire storm, and audio, Wi-Fi and the compositor back within about 5 s. The ACPI TAD (`rtc1`, the only RTC with a wake alarm) never wakes the system from suspend-to-idle, with the AC and DC timers both armed, so `rtcwake` cannot drive suspend tests on this machine.

`2002` on a Microsoft Surface Pro 11 (X1E80100, 2026-10-13), built as a module against 7.2.8-7 and loaded in place of the stock one, with Omarchy's charger udev rule turned off: plugging in and unplugging the charger now send change events for `qcom-battmgr-ac`, and after restarting UPower on the charger, unplugging sets `OnBattery` within seconds. Without the patch it stayed on AC.

7.2.8-1 with the device trees added, built in an Arch Linux ARM container, on a Lenovo Yoga Slim 7x (2026-10-11), installed beside `linux-aarch64` with the drivers above in the initramfs and `iommu.passthrough=0`. LUKS unlock at Plymouth with the built-in keyboard, the panel at 2944x1840 with the Adreno firmware, touchpad and touchscreen, Wi-Fi and Bluetooth, both DSPs, the sound card and the battery reading all work, with no failed units. That boot's UKI carried Arch Linux ARM's device trees. Without `iommu.passthrough=0` the same kernel reached the password prompt with no keyboard. An installer image on this kernel, with the package's own device trees in its live UKI, installs unattended in a VM. `2000` is build-tested on this kernel. On the ProArt P14, 7.2.8-4 (2026-10-11) boots through ACPI with no device tree in its UKI and `qcom_iris` not loaded, app launches stay within 8% of 7.2.8-3 either way, and a 68-minute lid suspend resumes as it does on 7.2.8-3.

7.2.5-6.5 on the ASUS ProArt P14 H7407BA with `nvidia-open-dkms` 615.71.09 (2026-10-02): LUKS unlock at Plymouth, internal display and brightness, CUDA, keyboard (Fn keys, backlight, Fn-lock), touchpad, speakers, headphones and microphones, battery and AC, Wi-Fi and Bluetooth, webcam, 122 GiB of RAM with `efi_reclaim_reserved=` (the reclaimed ranges kept a written pattern through display, 16 GiB of CUDA work and suspend-to-idle), suspend-to-idle.
Expand Down
Loading