ASoC: qcom: add Surface Pro 11 Golden v33 protected playback - #89
Draft
ooaklee wants to merge 20 commits into
Draft
ASoC: qcom: add Surface Pro 11 Golden v33 protected playback#89ooaklee wants to merge 20 commits into
ooaklee wants to merge 20 commits into
Conversation
Describe the optional WSA8845 VISENSE and CPS feedback paths, including their DAI selectors and slave-only SoundWire transport properties. Add a board-specific Denali sound-card compatible with the generic X1E80100 fallback. [Leon: Split the source binding changes into a reviewable commit, rebased them onto the current schemas, added the Denali sound-card compatible with its generic fallback, and kept the new properties optional.] Link: geocausa/SP11X1e-audio@31466d6 Link: 4bcfa10 Signed-off-by: Leon Silcott <leon@boasi.io>
Let a slave describe optional banked registers implemented by a SIMPLE data port, and let a stream provide slave-only transport overrides. The new fields default to zero so existing SoundWire devices are unchanged. [Leon: Split the zero-default slave transport metadata from the source overlay and rebased it onto the current SoundWire types.] Link: geocausa/SP11X1e-audio@31466d6 Link: 4bcfa10 Signed-off-by: Leon Silcott <leon@boasi.io>
Give the Denali sound-card compatible a private configuration and use it to constrain the WSA VI and CPS rate, format, and channel-map setup. Other X1E80100 sound cards keep their existing backend behavior and speaker volume limits. Do not carry the source branch's global AudioReach readiness variables. Readiness must instead be represented by the relevant card and graph instances in the runtime part of the series. [Leon: Replaced the source global readiness and volume changes with a Denali-private card configuration while retaining non-Denali behavior.] Link: geocausa/SP11X1e-audio@31466d6 Link: 4f9ac01 Signed-off-by: Leon Silcott <leon@boasi.io>
Let a slave describe optional banked registers implemented by a SIMPLE data port, and let a stream provide slave-only transport overrides. The new fields default to zero, so existing SoundWire devices keep the current programming path. This is the generic core portion required by the Denali WSA8845 feedback ports; controller and codec use is added separately. [Leon: Split the generic SIMPLE transport/register override support from its Qualcomm controller and codec consumers and retained the current stream API.] Link: geocausa/SP11X1e-audio@31466d6 Link: 5cf86f7 Signed-off-by: Leon Silcott <leon@boasi.io>
Expose companion playback streams for the two Denali WSA input DAIs so DPCM can start VI and CPS with speaker render while SoundWire keeps their physical direction toward the master. Merge the two amplifier channels only for Denali's shared CPS master port. Gate both changes on the Denali machine compatible, the WSA controller, and DAI IDs 9 and 10. Other Qualcomm SoundWire controllers retain their existing DAI capabilities, rates, formats, direction, and port allocation. The source branch's global diagnostic module parameters are intentionally not carried. [Leon: Scoped the feedback direction, shared-port merge, and companion DAIs to Denali WSA controller IDs 9 and 10. Omitted the source diagnostic module parameters.] Link: geocausa/SP11X1e-audio@31466d6 Link: 5cf86f7 Signed-off-by: Leon Silcott <leon@boasi.io>
Register separate VI and CPS feedback DAIs when a WSA884x instance has the qcom,enable-cps property. Split its SoundWire sink and source ports, apply the DT-selected VISENSE mask and CPS Offset1, and keep playback and feedback stream state separate. Devices without the property still register only the existing speaker DAI and retain the existing port description and stream setup. This commit does not include the Denali PA register profile or lifecycle changes. [Leon: Split the WSA884x feedback DAI/port subset, made it an explicit per-node opt-in with private stream state, and omitted the broad PA lifecycle changes.] Link: geocausa/SP11X1e-audio@31466d6 Link: e72bffc Signed-off-by: Leon Silcott <leon@boasi.io>
On Denali, add playback-side VI and CPS endpoints so the protected render graph can start both feedback paths atomically. Add the associated DAPM widgets and keep the existing VI capture endpoint intact. Build the extended DAI table from a private copy only on Denali. Other machines continue to register the original DAI table and DAPM graph, so the shared WSA macro driver does not redefine their TX interfaces. [Leon: Split the WSA macro feedback endpoints, built them from a Denali-private DAI/DAPM copy, and preserved the existing VI capture path.] Link: geocausa/SP11X1e-audio@31466d6 Link: e72bffc Signed-off-by: Leon Silcott <leon@boasi.io>
Add playback capabilities for the WSA TX0 and TX1 backend DAIs used by Denali's VI and CPS protection links. Build the modified table as a device-managed copy only for the Denali AudioReach backend provider. Other machines and the legacy Q6AFE provider keep the existing capture- only definitions. Propagate allocation failure from the AudioReach DAI probe. Link: geocausa/SP11X1e-audio@31466d6 Link: 22bdec2 Signed-off-by: Leon Silcott <leon@boasi.io>
APR receive processing can hold a service pointer after dropping svcs_lock, while dynamic port removal used to remove and immediately free that service. A concurrent callback could therefore use freed memory. Give every service a registrar reference and take callback references while holding svcs_lock. Remove the service from the IDR first, then wait for admitted callbacks to drain before freeing it. Apply the same unwind discipline to static service registration failures. gpr_free_port() may sleep and must run in process context outside the port's own callback. This avoids self-deadlock while preserving a simple removal contract. Signed-off-by: Leon Silcott <leon@boasi.io>
Global AudioReach commands reused token zero and shared one result slot. Late responses after a timeout could complete a later command or mutate the wrong mapping handle. Dynamic graph clients could also disappear while callbacks or command users still held them. Assign unique tokens to synchronous global and per-client commands while preserving the graph and position-buffer token fields. Claim replies only when token and opcode match the active command, and update mapping handles inside the same critical section. Publish graph clients under a lifecycle lock, reject new users once teardown begins, abort pending waits, and drain admitted users and callbacks before releasing ports. This also corrects the position-buffer unmap token. Link: geocausa/SP11X1e-audio@33d5145 Link: geocausa/SP11X1e-audio@39499f0 Link: 22bdec2 Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO v19c topologies add raw module stage classes and data, graph control links, extended container placement, and integrated-backend metadata. The 7.2 parser did not retain or emit those fields. Parse the extended tokens and build matching graph-open payloads without hard-coded diagnostic or volume instance IDs. Use one checked iterator for vendor arrays and known raw records, reject truncated, reordered, duplicate, oversized, or overflowing input before packet allocation, and preserve the historical no-op for unsupported legacy module extensions. [Leon: ported the format to 7.2, preserved legacy-topology no-op behavior, and hardened raw-block bounds, ordering, duplicates, ownership, and aggregate allocation arithmetic.] Link: geocausa/SP11X1e-audio@31466d6 Link: geocausa/SP11X1e-audio@7af8f21 Link: 4bcfa10 Link: 22bdec2 Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO protection calibration can exceed the in-band SET_CFG limit, and its storage belongs to the DSP graph rather than global card state. Size each graph payload from topology, allocate coherent memory through the APM DMA device, translate the address for the DSP SID, and map it with a graph-scoped token. Serialize buffer writes and correlate MAP, SET_CFG, and UNMAP replies to the exact command before changing mapping state. Close the DSP graph before unmapping its OOB buffer. If a reply leaves ownership ambiguous, retain the coherent memory and device reference until reboot or a future proven reset hook rather than allowing the DMA range to be reused. [Leon: made OOB ownership graph-scoped, keyed reply mutation to the current command, and retained ambiguous mappings instead of reusing DMA.] Link: geocausa/SP11X1e-audio@9de3dc9 Link: geocausa/SP11X1e-audio@af28565 Link: geocausa/SP11X1e-audio@1ca3820 Link: geocausa/SP11X1e-audio@31466d6 Link: 22bdec2 Signed-off-by: Leon Silcott <leon@boasi.io>
FullIO v19c describes protected-speaker calibration and runtime stages in topology. Execute graph calibration and ordered protection or bypass SET_CFG payloads on the owning graph instead of using global card state or hard-coded module instance IDs. Keep configuration, bypass proof, backend readiness, start references, and faults per graph. Enable this path only for Denali PCM clients and a topology-declared protected graph; reject partial profiles and mixed ordinary or protected clients. Start only after protected configuration or both SP and SPVI bypass commands are confirmed. Correlate every state transition and make final close consume-on-success. If execution, close, OOB, or mapping ownership is unconfirmed, block reuse and retain the complete client, callback context, and DMA ownership until reboot or a future proven reset hook. [Leon: limited the runtime to Denali plus a topology-declared protected graph, made malformed or unconfirmed setup fail closed, serialized backend/readiness and start references, enforced immutable shared runtime modes, and quarantined callbacks, clients, and DMA after unconfirmed teardown.] Link: geocausa/SP11X1e-audio@db2af54 Link: geocausa/SP11X1e-audio@1ca3820 Link: geocausa/SP11X1e-audio@33d5145 Link: geocausa/SP11X1e-audio@31466d6 Link: geocausa/SP11X1e-audio@7af8f21 Link: 22bdec2 Signed-off-by: Leon Silcott <leon@boasi.io>
Denali speaker protection needs both VI feedback and CPS telemetry before the protected path can be enabled. Map those backend DAIs to the graph that owns their topology-declared integrated backend, and publish readiness as the SoundWire links prepare or tear down. Keep the mapping and lifecycle limited to microsoft,denali-sndcard. Require a valid, prepared SoundWire runtime before publishing readiness, reject readiness transitions while the graph is started, and drain the matching FE and BE start references symmetrically. Refuse SoundWire teardown until the graph is known stopped. Other machines and ordinary graphs keep their existing DAI behavior. Link: geocausa/SP11X1e-audio@31466d6 Link: geocausa/SP11X1e-audio@7af8f21 Link: 22bdec2 Link: 4f9ac01 Signed-off-by: Leon Silcott <leon@boasi.io>
Describe the optional nominal speaker load used to select board-specific PA gain and PBR thresholds. An absent property retains the existing 8-ohm defaults. Link: geocausa/SP11X1e-audio@967b539 Link: 40932bb Signed-off-by: Leon Silcott <leon@boasi.io>
Read the nominal speaker load from firmware and apply the 2S 4-ohm PA gain, PBR, class-H, VCM, and UVLO values only when the amplifier also reports a 2S VPHX supply. Devices without the property retain the current defaults. [Leon: Re-lifted the profile onto the current driver, gated it by qcom,speaker-load-ohms and a fresh hardware-confirmed 2S status, and added explicit default restoration after failed re-attach reads.] Link: geocausa/SP11X1e-audio@967b539 Link: 40932bb Signed-off-by: Leon Silcott <leon@boasi.io>
Have each opted-in WSA884x report a successful, error-free PA enable to the WSA macro. Enable both protection paths after the second confirmed PA and disable them before the first PA teardown. Require protected feedback DAIs to have a live 2S/4-ohm classification so VI/CPS readiness cannot outrun the PA profile. Roll back PA and DRE state when an enable write, PA status check, or macro lookup fails. Keep the counters, lock, and enabled state in each WSA macro instance so non-protected cards remain unchanged. [Leon: Replaced the source globals with per-macro state, scoped lookup to the source card, balanced duplicate/remove events per amp, made the helper Kconfig-safe, required a confirmed 2S/4-ohm feedback profile, and withheld the PA event after write or FSM errors.] Link: geocausa/SP11X1e-audio@31466d6 Link: e72bffc Signed-off-by: Leon Silcott <leon@boasi.io>
Describe the WSA8845 VISENSE and CPS feedback links used by the protected speaker graph. Select them only from the Denali sound card and give that card a board-specific compatible ahead of the generic X1E80100 fallback. [Leon: Re-lifted only the common Denali VI/CPS graph and transport data, added the board-specific compatible, and omitted the experimental board target.] Link: geocausa/SP11X1e-audio@31466d6 Link: 6035b3e Signed-off-by: Leon Silcott <leon@boasi.io>
Describe both integrated WSA8845 speaker loads as 4 ohms so the codec can select the matching PA profile after confirming the hardware 2S supply. Link: geocausa/SP11X1e-audio@967b539 Link: 6035b3e Signed-off-by: Leon Silcott <leon@boasi.io>
ooaklee
added a commit
to ooaklee/linux_ms_dev_kit-sp11
that referenced
this pull request
Sep 1, 2026
Integrate jglathe#89 for combined SP11 testing.
The SP11 FullIO topology SAL module declares ten input ports. AR_MAX_MOD_LINKS bounds the stored output connection arrays, but it does not bound this module metadata. Rejecting the input count prevents the sound card from probing with -EINVAL. Keep the output-port array bound while accepting the valid SAL declaration. Signed-off-by: Leon Silcott <leon@boasi.io>
ooaklee
added a commit
to ooaklee/linux_ms_dev_kit-sp11
that referenced
this pull request
Sep 2, 2026
Author
|
Follow-up validation for the SP11 7.2.2 retrospective:
The microphone did not need a separate route patch: the reported failure occurs because the whole card aborts topology loading at |
This was referenced Sep 2, 2026
Closed
jglathe
force-pushed
the
jg/ubuntu-qcom-x1e-7.2.y
branch
from
September 3, 2026 10:32
87bcf07 to
4943ee7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Series, base, and dependencies
This PR targets
jg/ubuntu-qcom-x1e-7.2.ydirectly and follows the ordered SP11 release-line topics:#88 is the immediate prerequisite. This branch is based directly on the release branch; it does not merge any prerequisite head, the broad
-sp11staging branch, or the staging correction merged through #81.032e174490d2ede881771cb368e86540b3a8818b766f34d63900cf897ed9902005c5a5bac1b1ec5bb2c7e8c5f1c5be3b9cd5b72db3622fd305c0ec75The bindings and providers precede their consumers, and the two Denali DTS activation commits are last. Reordering changed commit hashes only: the final tree is byte-identical to the reviewed pre-reorder combined head
d803e8c2c9173d494420fd5773858f513bf67843.This PR is intentionally a draft. It must not be marked ready until its dependencies, personal author attestation, exact package build, paired userspace policy, and SP11/non-SP11 hardware gates below are complete.
FullIO v19c userspace pairing and volume safety
Protected playback must be tested with the immutable FullIO v19c UCM source and the sp11-audio-v19c release, whose target commit is
2f97c3d672c7c28acfe39173679a9924489b3c69.X1E80100-Microsoft-Surface-Pro-11-tplg.bine7bb06a03e7bd9b869825a51775355a6743477d1579d78eb09fad5881cfb20f0MICROSOFT-Surface-Pro-11in.conf225976f925624f156d9fab84e15a5126a60a236783cfcb82d43d2a2aec028d7bSP11-HiFi.conf9d36df8570b85f1dcecc385a8f85fa2d1e1058ef8efedee6ae2ce49dc259a06aThe topology contains protected/vendor-derived data and remains an external userspace artifact; it is not copied into this kernel PR.
There is one deliberate safety difference that must remain visible during review. The v19c UCM requests PA volume 24, while this focused kernel retains the release-line limit of 6 (0 dB). With alsa-lib 1.2.14, UCM
csetis passed throughsnd_ctl_ascii_value_parse(), whose integer parser clamps values to the control's advertised range; the request should therefore resolve to 6 rather than program 24. Hardware testing must verify that behavior instead of assuming it.For the first hardware pass, use a separately pinned test copy of
SP11-HiFi.confthat changes only its four PA-volume requests from 24 to 6, record its digest, and confirm withamixer cgetthat both controls advertise a maximum of 6 and hold an effective value of 6. This validates protected playback at the retained cap; it does not establish acoustic or production-volume parity with v19c. Any proposal to expose 24 belongs in a later Denali-only safety change, must retain the limit of 6 for other devices, and needs its own acoustic, thermal, fault, and bypass review.Containment and failure behavior
microsoft,denali-sndcard; only the common Denali description adds WSA VI/CPS linksqcom,speaker-load-ohms = <4>-EBUSYSET_CFG, unmap, stop, or close ownership quarantines the affected callback/client/DMA state rather than allowing reuse before reboot or a future proven reset hookThe extraction deliberately omits global readiness statics, diagnostic module parameters, hard-coded diagnostic or volume module-instance IDs, soft-pause support, and wholesale driver-file replay.
PA completion hardening
For an opted-in protected amplifier, feedback startup now requires a freshly confirmed 2S/4-ohm profile. PA unmute checks both register writes, waits 1–1.1 ms, reads
PA_FSM_STA1, and publishes the macro PA event only when the status read succeeds without an error bit. A failure rolls back DRE and global PA enable and does not advance paired-PA clock state.The ASoC core may ignore a codec
mute_streamreturn value, so an ALSA start call can still appear successful while this path has correctly left the hardware disabled. The hardware gate must therefore inspect playback, mixer state, and kernel logs rather than treating the start syscall alone as proof of PA readiness.Provenance and DCO
The focused history preserves authorship according to the substantive source:
geoca <272055834+geocausa@users.noreply.github.com>and their verified source author datesLeon Silcott <leon@boasi.io>[Leon: ...]note where the extraction changed structure or containmentThe reordered history preserves every author identity, author date, commit body, stable patch ID, and all 48 immutable
Link:trailers from the reviewed pre-reorder series.Every rewritten commit carries exactly one authorized
Signed-off-by: Leon Silcott <leon@boasi.io>from the submitter. No personal geoca sign-off exists in the immutable source commits, so none has been invented. Raw strict checkpatch consequently reportsNO_AUTHOR_SIGN_OFFfor the 13 geoca-authored commits. I will ask @geocausa to attest to the rewritten commits personally before this draft is marked ready.Validation completed at the exact head
git diff --check 032e174490d2ede881771cb368e86540b3a8818b..766f34d63900cf897ed9902005c5a5bac1b1ec5b: passNO_AUTHOR_SIGN_OFFexcluded: 0 errors, 0 warnings, 0 checks; raw strict output contains only the 13 documented nominal-author findingsubuntu_x1e_defconfigW=1builds of APR, SoundWire bus/controller/stream, WSA macro, WSA8845, AudioReach, Q6APM, LPASS port, topology, and X1E80100 machine-driver objects: passy,m, and disabled combinations: passqcom,sm8250.yamlandqcom,wsa8840.yamlbinding/schema checks: pass, apart from unrelated pre-existing warningsx1e80100-microsoft-denali-oled.dtb,x1p64100-microsoft-denali.dtb, and non-SP11x1e80100-dell-xps13-9345.dtb: passA focused partial-module build cannot provide meaningful final modpost coverage without the complete kernel's
vmlinuxandModule.symvers; no full exact-head package or full modpost result is claimed here.Remaining draft gates
SP11 hardware gates
766f34d63900cf897ed9902005c5a5bac1b1ec5bwith the pinned FullIO topology and PA-volume-6 test UCM-ENODEVerrorNon-SP11 hardware gates