Skip to content

Add surface-pro-11-support: Wi-Fi, audio, Bluetooth, charge window, keyboard pairing and pen resume - #825

Merged
ryanrhughes merged 12 commits into
omacom:masterfrom
turbineBMW:upstream/surface-pro-11-hardware
Oct 21, 2026
Merged

ryanrhughes merged 12 commits into
omacom:masterfrom
turbineBMW:upstream/surface-pro-11-hardware

Conversation

@turbineBMW

@turbineBMW turbineBMW commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hardware support for the Microsoft Surface Pro 11 (Snapdragon X Elite, microsoft,denali-oled) that does not belong in the kernel. One commit per concern:

  • Wi-Fi board data and audio. The WCN7850 reports generic identifiers with no linux-firmware board record, so ath12k cannot load board data. Qualcomm's reference-design record is extracted from linux-firmware-atheros at build time, unmodified and checked by size and SHA-256, and shipped as board.bin until the Surface's own record reaches linux-firmware. The AudioReach topology is built from pinned upstream source. UCM routing for speakers and microphones derives from alsa-ucm-conf's Surface Pro 12in profile, with its BSD-3-Clause attribution kept. A WirePlumber rule hides the IR sensor from camera pickers. It also ships the front camera's (IMX681) measured black level as libcamera tuning, so stock libcamera drives it.
  • Charge window after resume. The battery firmware can forget its charge window across suspend. A sleep hook writes the current thresholds back. It never picks a limit itself; that stays with UPower and Omarchy's power settings (#11792 / #13205 work the same way).
  • Flex Keyboard pairing. Attaching the keyboard pairs it over Bluetooth, as Windows does: the tablet hands the keyboard its address and a fresh key over the connector (KIP's Bluetooth OOB coupling collection, 0C8F) and it pairs with LE legacy out-of-band pairing. A working bond is left alone; a bond another host re-keyed is replaced on the next attach. Detaching connects it over Bluetooth. Pairing turns the adapter pairable for the pair only (Omarchy leaves it off, and the kernel only stores keys while bondable) and stores a 7.5-11.25 ms connection interval, without which the touchpad is jerky over Bluetooth. surface-pro-11-flex-pair pairs by hand. Needs the KIP pairing node and LE legacy OOB pairing, which landed in linux-omarchy with linux-omarchy-aarch64: let the Snapdragon X1 laptops reach DDR sleep and CX collapse in suspend #1315.
  • iptsd across suspend. The digitizer resets its firmware on resume and a running iptsd never recovers. A sleep hook stops and restarts it.
  • Lid wake only with the lid closed. Since linux-omarchy-aarch64: let the Snapdragon X1 laptops reach DDR sleep and CX collapse in suspend #1315 the SoC collapses CX in suspend, and with the cover open the lid line shows a false edge about 0.3 s later, which wakes the machine at once. A sleep hook arms lid wake only when logind reports the lid closed (unknown counts as open). The power button wakes the machine either way.
  • Wi-Fi and Bluetooth addresses. Set by surface-snapdragon-addresses (Add surface-snapdragon-addresses for Snapdragon Surface Wi-Fi and Bluetooth addresses #972, published), which the Surface Laptop 8 shares; this package depends on it.

CPU caps per power profile were here at first; they moved to omarchy-power-profiles-daemon (#1029), which covers every Snapdragon X laptop, and the last commit removes them.

aarch64 only, groups=('omarchy-platform-qualcomm') (#636), published to edge. iptsd is an optdepend.

Dependencies

None to build. Needs surface-snapdragon-addresses (#972, published) to install, plus bluez, bluez-utils and python for the keyboard pairing. On a device it is used with linux-omarchy 7.2.8-19 or later (#1315) and iptsd (#826, published), installed by the Surface Pro 11 board script (omacom/omarchy#14390).

Test plan

  • test.sh passes
  • Package build: board data and topology byte-identical to a working Surface Pro 11 install
  • Surface Pro 11, Dragon install: Wi-Fi associates; speakers and microphones work; PipeWire offers only the front and back cameras
  • A 75–80% window is written back unchanged after suspend; reboot keeps it (UPower)
  • Pen and touch work after suspend and resume (kernel 7.3-rc6)
  • Flex Keyboard (linux-omarchy-n1x 7.2.8-7 with linux-omarchy: add the Surface Pro 11 patches #975): attaching paired a keyboard bonded to another host, it typed over Bluetooth when detached with a smooth touchpad, reattaching left the bond alone, and it was taken back automatically after a Surface Pro 12 had re-keyed it
  • test.sh covers the keyboard's attach and detach decisions
  • With surface-snapdragon-addresses from Add surface-snapdragon-addresses for Snapdragon Surface Wi-Fi and Bluetooth addresses #972 installed, Wi-Fi and Bluetooth come up with their Windows addresses after a reboot (tested in Add surface-snapdragon-addresses for Snapdragon Surface Wi-Fi and Bluetooth addresses #972)
  • test.sh covers the lid hook: open and unknown lid turn lid wake off, closed lid arms it, nothing after resume or on other hardware
  • Lid hook, linux-omarchy 7.2.8: suspended with the cover open, the machine slept 5 h with CX collapsed 99.9 % and woke on the power button
  • Lid hook, linux-omarchy 7.2.8-23: closing the cover suspended the machine with lid wake armed, CX collapsed for 92 of 96 s, and opening the cover woke it (lid IRQ)

The Surface Pro 11's WCN7850 reports generic identifiers that match no
linux-firmware board record, so Wi-Fi cannot load board data. Extract
Qualcomm's reference-design record from linux-firmware-atheros at build
time, unmodified and checked by size and SHA-256, and ship it as
board.bin until the Surface's own board data reaches linux-firmware.
Stripping is disabled because the record is an ELF image.

Build the AudioReach topology from pinned upstream source, checked
against the binary validated on the device, and ship ALSA UCM routing
for the speakers and microphones, derived from alsa-ucm-conf's Surface
Pro 12in profile with its attribution and BSD-3-Clause licence kept.
Hide the monochrome infrared sensor from camera pickers in WirePlumber,
so apps see the front and back cameras only.

The package is aarch64-only, tagged for the Qualcomm platform guard and
published to edge.

Validated with test.sh and a package build whose board data and
topology are byte-identical to a working Surface Pro 11 installation,
where Wi-Fi, speakers and microphones work and PipeWire offers exactly
the front and back cameras.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turbineBMW

Copy link
Copy Markdown
Contributor Author

The Wi-Fi and Bluetooth address handling moved out of this PR into its own package, surface-snapdragon-addresses (#972), so the Surface Laptop 8 can use it too. It matches on the Microsoft DMI vendor and the MacAddressEmulationAddress variable instead of the Denali device tree. surface-pro-11-support now depends on it, so #972 needs to land first or in the same publish. Tested together on the Surface Pro 11: same addresses as before.

turbineBMW and others added 5 commits October 12, 2026 20:00
The battery firmware can lose its charge window across suspend while
the kernel driver still reports the thresholds that were set. A sleep
hook now writes those same thresholds back after resume. It never
chooses a limit, leaving that to UPower or Omarchy's power settings,
and does nothing when no limit is set. The kernel driver already
restores the window when the battery-manager service restarts.

Validated with test.sh and on a Surface Pro 11: a 75-80% window is
written back unchanged after suspend and resume.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Surface's firmware power profile does not limit short CPU loads. A
service now follows power-profiles-daemon and caps every cpufreq policy
at 1.92 GHz in power-saver and 2.52 GHz in balanced, restoring the full
range in performance.

Validated with test.sh and on a Surface Pro 11: each profile sets its
ceiling on all policies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The touch controller resets its firmware during resume ("Spontaneous FW
reset!") and a running iptsd never recovers, leaving pen and touch dead
until it is restarted. A sleep hook now stops the active iptsd
instances before sleep and starts them again one second after resume.

Validated with test.sh and on a Surface Pro 11: the pen works after
suspend and resume.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…snapdragon-addresses

The WCN7850's Wi-Fi interface gets a per-boot placeholder address and
its Bluetooth controller stays unconfigured until it is given a public
address. surface-snapdragon-addresses sets both from the
MacAddressEmulationAddress UEFI variable, the way Windows does, and the
Surface Laptop 8 shares it, so this package depends on it instead of
carrying its own copy.

Validated with the package's test.sh and a makepkg build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ship the IMX681 simple-IPA tuning file where libcamera looks for
per-sensor tuning, in place of the copy built into the patched
libcamera-surface-pro-11. With the linear gain control now in
linux-omarchy-n1x's IMX681 driver, stock libcamera drives the front
camera and the libcamera fork is no longer needed.

Validated on a Surface Pro 11 with Arch's libcamera 0.7.2-4, which loaded
this file and gave the same front camera picture as the patched
libcamera, before and after suspend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turbineBMW
turbineBMW force-pushed the upstream/surface-pro-11-hardware branch from 6707e53 to 2890ce7 Compare October 13, 2026 00:16
omarchy-power-profiles-daemon caps the CPU clusters on every Snapdragon X
laptop now (omacom#1029), so the SP11's own service would only fight it over
scaling_max_freq. The python, python-dbus, python-gobject and
power-profiles-daemon dependencies were only there for it.

Validated with test.sh and a clean makepkg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turbineBMW turbineBMW changed the title Add surface-pro-11-support: Wi-Fi, audio, Bluetooth, charge window, CPU caps and pen resume Add surface-pro-11-support: Wi-Fi, audio, Bluetooth, charge window and pen resume Oct 13, 2026
Attaching the keyboard runs surface-pro-11-flex-autopair: with no bond, or a
bond that stopped working because another host re-keyed it, it hands the
keyboard the tablet's address and a fresh key over the connector and pairs
with LE legacy out-of-band pairing, as Windows does. A working bond is left
alone. Detaching runs surface-pro-11-flex-reconnect, which connects the
keyboard over Bluetooth and marks the bond for re-pairing if it never
connects. surface-pro-11-flex-pair pairs by hand.

Pairing turns the adapter pairable for the pair only, since the kernel stores
the keys only while it is bondable and Omarchy leaves Pairable off. It also
stores a 7.5-11.25 ms connection interval for the keyboard, which never asks
for one; at Linux's default its touchpad reports arrive in bursts.

Validated on a Surface Pro 11 with linux-omarchy-n1x 7.2.8-7 (omacom#975's KIP
pairing node and LE legacy OOB pairing): attaching paired a keyboard bonded
to another host, it typed over Bluetooth when detached, reattaching left the
working bond alone, attaching it after a Surface Pro 12 had re-keyed it took
it back in about 25 s, and the touchpad moved smoothly over Bluetooth with
the stored interval. test.sh covers the attach and detach decisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turbineBMW turbineBMW changed the title Add surface-pro-11-support: Wi-Fi, audio, Bluetooth, charge window and pen resume Add surface-pro-11-support: Wi-Fi, audio, Bluetooth, charge window, keyboard pairing and pen resume Oct 13, 2026
@ryanrhughes
ryanrhughes enabled auto-merge October 20, 2026 01:29
@ryanrhughes ryanrhughes added the build-approved Maintainer approved this PR to build on the self-hosted pool label Oct 20, 2026
@ryanrhughes

Copy link
Copy Markdown
Collaborator

@turbineBMW looks like we have a build failure here.

turbineBMW and others added 2 commits October 21, 2026 06:29
Now that linux-omarchy lets the SoC collapse CX in suspend, the lid line
(gpio2) shows a false edge about 0.3 s after the collapse when the cover
is open. Lid wake is on by default, so every suspend with the cover open
wakes the machine at once.

A sleep hook now arms lid wake before suspend only when logind reports
the lid closed, and turns it off otherwise; an unknown lid state counts
as open. Suspending with the cover closed keeps the default, so opening
the cover still wakes the machine, and the power button wakes it either
way.

Validated with test.sh and on a Surface Pro 11 on linux-omarchy 7.2.8:
with the cover open the machine stays asleep (5 h overnight, CX
collapsed 99.9 %) and wakes on the power button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Surface Pro 11 patches, the KIP pairing node and the IMX681 gain
control among them, landed in linux-omarchy with omacom#1315, and
linux-omarchy-n1x is gone. Point the README and the pairing tool at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auto-merge was automatically disabled October 21, 2026 10:33

Head branch was pushed to by a user without write access

@ryanrhughes
ryanrhughes enabled auto-merge (squash) October 21, 2026 10:34
The release ring replaced channels on master (61ff008) and metadata
validation now refuses the key. The package publishes to edge on merge
like every other package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auto-merge was automatically disabled October 21, 2026 11:05

Head branch was pushed to by a user without write access

@ryanrhughes
ryanrhughes enabled auto-merge (squash) October 21, 2026 11:05
The lid wake commit picked up makepkg's audioreach-topology clone by
mistake. In CI it lands in the build directory, and makepkg refuses it
because it is not a clone of the source URL, so the build fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
auto-merge was automatically disabled October 21, 2026 14:43

Head branch was pushed to by a user without write access

@ryanrhughes
ryanrhughes enabled auto-merge (squash) October 21, 2026 14:43
@ryanrhughes
ryanrhughes merged commit 12c9210 into omacom:master Oct 21, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: surface-pro-11-support (aarch64, PR artifact)

  • edge/aarch64: surface-pro-11-support-1-1-aarch64

Commit 12c9210 · run

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.

2 participants