Skip to content

Wcd9378 sdca codec support - #1857

Open
Mohis-12 wants to merge 8 commits into
qualcomm-linux:tech/mm/audio/allfrom
Mohis-12:WCD9378_sdca_codec_support
Open

Mohis-12 wants to merge 8 commits into
qualcomm-linux:tech/mm/audio/allfrom
Mohis-12:WCD9378_sdca_codec_support

Conversation

@Mohis-12

Copy link
Copy Markdown

This series extends the ASoC SDCA framework to support Device Tree (non-ACPI) platforms by adding reusable infrastructure such as ACPI-independent build support, common PM helpers, SoundWire probe/remove helpers, topology population hooks, DAI entity translation, and default control classifier handling. These changes are intended to enable SDCA codec drivers to provide static topology information without relying on ACPI or DisCo discovery.

In addition, the series introduces support for the Qualcomm WCD9378 (Tambora) SDCA codec operating in SoundWire compute mode. It includes the required Device Tree bindings, SoundWire integration, SDCA topology definitions, and codec driver implementation. The solution has been validated on the Snapdragon X2 Elite Glymur CRD with successful headphone playback and headset microphone capture, while jack detection support is planned for future work.
CRs-Fixed: 4680771

Srinivas Kandagatla added 8 commits September 16, 2026 19:33
The SDCA class driver is useful on non-ACPI platforms where the
topology is supplied statically via sdca_class_ops.populate_function.

Drop 'depends on ACPI' from SND_SOC_SDCA and guard the
ACPI-parsing implementations in sdca_device.c and sdca_functions.c
with IS_ENABLED(CONFIG_ACPI), providing empty stubs when ACPI is off.

Link: https://lore.kernel.org/all/20260915165652.914893-2-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
The class PM callbacks pull sdca_class_drv out of drvdata, so the
built-in class_sdw_driver owns the drvdata slot. That works for the
generic case but blocks codec drivers that want to embed
sdca_class_drv in their own private struct, they need drvdata for
their codec priv.

Split the four callbacks into exported helpers that take a
struct sdca_class_drv * directly:

  sdca_class_system_suspend()
  sdca_class_system_resume()
  sdca_class_runtime_suspend()
  sdca_class_runtime_resume()

Codec drivers can now compose these into their own dev_pm_ops without
going through drvdata.

For the built-in class_sdw_driver, add small dev_pm_ops wrappers that
fetch drv from drvdata and wire them into sdca_class_pm_ops (kept
static; the built-in slave is the only user).

No functional change: the built-in class_sdw_driver keeps the same PM
semantics; only the internal plumbing shifts to operate on
sdca_class_drv instead of struct device *dev.

Link: https://lore.kernel.org/all/20260915165652.914893-3-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Split the internal class_sdw_probe/class_sdw_remove functions into
caller-friendly library helpers:

  sdca_class_probe(sdw, drv)
  sdca_class_remove(drv)

The class_sdw_probe/class_sdw_remove callbacks of the built-in
class_sdw_driver are now thin wrappers that allocate a bare
sdca_class_drv, stash it in drvdata, and defer to the exported
helpers.

The exported sdca_class_probe() takes a caller-owned struct
sdca_class_drv * so codec-specific SoundWire drivers can embed the
class state in their own priv struct, own dev_set_drvdata() themselves,
and avoid a second allocation. No functional change for the built-in
driver.

This lays the groundwork for codec-specific SDCA SoundWire drivers
that want to compose the class-side probe with their own quirks; the
next patches add the class_ops mechanism on top.

Link: https://lore.kernel.org/all/20260915165652.914893-4-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Add struct sdca_class_ops with a populate_function callback that lets
codec drivers supply the SDCA topology (entities, clusters,
init_table, ...) from static tables in place of sdca_parse_function()
on DT/non-DisCo platforms. The callback is a pure data source and
performs no bus I/O.

Codec drivers embed sdca_class_drv in their own priv and register
their populate_function through class_ops passed to
sdca_class_probe().

Link: https://lore.kernel.org/all/20260915165652.914893-5-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
…index

sdca_asoc_populate_dais() sets each DAI id from the SDCA Function's
entity array index. ASoC's default of_xlate_dai_name treats the
phandle cell as a positional index into the DAI list, so on a Function
with non-DAI entries between dataport entities a sound-dai phandle
resolves to the wrong DAI.

Register a custom of_xlate_dai_name that walks the entity array and
returns the dataport entity whose array index matches the cell value.

Link: https://lore.kernel.org/all/20260915165652.914893-6-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
…lper

sdca_parse_function() derives is_volatile (see c7b6c6b) and the
spec-defined reset value (see 02d851b) from each Control's
(entity type, selector, access mode). Codecs that ship static SDCA
tables via populate_function skip that path, so RW1S action Controls
end up with is_volatile=0 and get replayed on every regcache_sync.

Add sdca_apply_default_control_classifiers() to re-run those two
classifiers over a Function.

Link: https://lore.kernel.org/all/20260915165652.914893-7-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Describe the WCD9378 SoundWire peripheral which is SDCA compatible
soundwire device. It provides SDCA SimpleJack for headphone playback
headset mic capture and MBHC jack detection.

The same silicon is integrated in two ways and enumerates with the
same SoundWire class ID:

  mobile mode: two slaves (tx, rx) on separate SoundWire masters.

  SDCA / compute mode: one aggregated slave on a multi-lane
  master.

Note: both of them have different bus toplogies 1 device vs 2 devices.

Currently only compute mode is supported by this bindings, mobile mode
will extend this binding as required.

Link: https://lore.kernel.org/all/20260915165652.914893-8-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Add support for the Qualcomm Tambora (WCD9378) headset codec in SDCA
mode over SoundWire. On ARM/DT platforms without ACPI/DisCo firmware
the SDCA topology and SoundWire port properties are supplied as static
data through the codec driver.

The codec exposes a single SimpleJack SDCA Function providing:
  - Headphone playback via FU 6 (mute + Q7.8 volume) and OT 43/45.
  - Headset mic capture via IT 33 with MICB2 fixed at 2.75 V (SDCA
    MIC_BIAS index 0x5) via the static init_table.
  - MBHC-based headset jack detection (not wired up in this series).

Implements:
  - sdw_slave_ops.read_prop: SoundWire slave properties and dpn caps
    for the compute-mode dataports. Supplies, reset GPIO, and the
    vendor TX PDM clock are set up directly in the SoundWire probe.
  - sdca_class_ops.populate_function: fills the SDCA Function data
    (entities, clusters, init_table) from static tables.

Binds SoundWire slave id 0x0217:0x0110 when the qcom,wcd9378c
variant compatible is set on the DT node.

Link: https://lore.kernel.org/all/20260915165652.914893-9-srinivas.kandagatla@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
@qcomlnxci
qcomlnxci requested review from a team, PrasadKumpatla and mohsRafi and removed request for a team September 18, 2026 06:36
@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #1857

PR: #1857
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/35315604876

# Error File:Line PR-introduced? Root Cause
1 Merge conflict during automerge Documentation/devicetree/bindings/arm/qcom,coresight-ctcu.yaml No Pre-existing merge conflict between topic branches during integration; PR does not touch this file

Verdict

This is NOT a build failure caused by the PR. The failure occurred during the automerge/integration step when merging multiple topic branches together, encountering a pre-existing merge conflict in a devicetree binding file that this PR does not modify.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #1857

PR: #1857
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/35315604876

# Error File:Line PR-introduced? Root Cause
1 Merge conflict during automerge Documentation/devicetree/bindings/arm/qcom,coresight-ctcu.yaml No Pre-existing conflict between baseline qcom-next and PR branch tech/mm/audio/all in a file not touched by this PR

Verdict

This is not a compilation failure. The build failed during the automerge phase when attempting to merge the PR branch with the baseline. The conflict is in a file (qcom,coresight-ctcu.yaml) that is not modified by any of the 8 patches in this PR, indicating a pre-existing conflict in the integration branch that needs to be resolved independently.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

PR #1857 — validate-patch

PR: #1857

Verdict Issues Detailed Report
⚠️ 0 Full report

Final Summary

  1. Lore link present: Yes — all 8 commits have correct Link: tags pointing to https://lore.kernel.org/all/20260915165652.914893-{2..9}-srinivas.kandagatla@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes — subjects match (with FROMLIST prefix), authors match, commit message bodies identical, diff content verified identical for commit 1/8, diffstats match for all 8 commits
  3. Upstream patch status: ⏳ Decision Pending — v3 series posted Sep 15, 2026; no maintainer acceptance or rejection signals yet; patches under review
  4. PR present in qcom-next/topics: Fail - 3/8 commit(s) are missing from both qcom-next and topics
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1857 - ASoC: SDCA: Qualcomm Tambora (WCD9378) SDCA codec support (8 commits)
Upstream commit: v3 series posted to linux-sound@vger.kernel.org
Verdict: ⚠️ PARTIAL — patches faithful to lore, but 3/8 commits missing from qcom-next/topics

Commit Message

Check Status Note
Subject matches upstream All 8 subjects match lore v3 series (FROMLIST prefix correctly added)
Body preserves rationale Commit message bodies identical to lore patches
Fixes tag present/correct N/A No Fixes tags in this series (new feature addition)
Authorship preserved All commits: From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> matches lore author
Backport note (if applicable) N/A FROMLIST prefix used correctly (patches posted but not yet merged upstream)
Lore author SOB present All 8 commits have Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

Diff

File Status Notes
Commit 1/8: include/sound/sdca.h + 3 more Diffstat matches: 4 files, +28/-7 lines; diff content identical
Commit 2/8: sound/soc/sdca/sdca_class.c + 3 more Subject and diffstat match lore
Commit 3/8: include/sound/sdca_class.h + 1 more Subject and diffstat match lore
Commit 4/8: include/sound/sdca_class.h + 2 more Subject and diffstat match lore
Commit 5/8: sound/soc/sdca/sdca_class_function.c Subject and diffstat match lore
Commit 6/8: include/sound/sdca_function.h + 1 more Subject and diffstat match lore
Commit 7/8: Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml Subject and diffstat match lore
Commit 8/8: sound/soc/codecs/wcd9378-* (5 files) Subject and diffstat match lore

Upstream Patch Status

Commit Community Verdict
All 8 commits Decision Pending — v3 series posted Sep 15, 2026 to linux-sound@vger.kernel.org; no maintainer replies yet in fetched threads

Evidence: Lore mbox files contain only the original v3 patch series with no applied/queued/Reviewed-by/Acked-by or NAK signals from maintainers. This is a recent posting (Sep 15, 2026) and the series is under review.

Integration Presence (qcom-next/topics)

Per integration_presence_report.md:

Commit qcom-next topics Final Status
1/8 partial missing ⚠️ partial
2/8 missing missing missing
3/8 partial missing ⚠️ partial
4/8 missing missing missing
5/8 partial missing ⚠️ partial
6/8 partial partial ⚠️ partial
7/8 missing missing missing
8/8 partial missing ⚠️ partial

Overall:FAIL — 3/8 commits (2/8, 4/8, 7/8) are completely missing from both qcom-next and topics; 5/8 commits show only partial evidence (subject or partial tree match, but full change not verified).

Issues

  1. Integration presence failure: Commits 2/8, 4/8, and 7/8 are not present in qcom-next or any kernel topic branch. The remaining 5 commits show only partial matches (subject found but full diff not verified in the integration tree).

  2. Upstream status: All patches are from a v3 series posted Sep 15, 2026. No maintainer acceptance signals yet. Using FROMLIST: prefix is correct for patches posted to the mailing list but not yet merged.

Verdict

Do not merge until integration presence is resolved. The patches are faithful to the lore v3 series (subjects, authorship, commit messages, and diff content all match correctly), but the integration presence check shows that most commits are either missing or only partially present in qcom-next/topics. This indicates the patches may not have been properly integrated into the Qualcomm kernel tree yet.

Recommended action:

  1. Verify why commits 2/8, 4/8, and 7/8 are completely missing from qcom-next/topics
  2. Investigate the "partial" status for the other 5 commits — determine if they need to be re-integrated or if the presence check needs refinement
  3. Once integration presence is confirmed, the PR can be merged (the lore validation itself is clean)

Final Summary

  1. Lore link present: Yes — all 8 commits have correct Link: tags pointing to https://lore.kernel.org/all/20260915165652.914893-{2..9}-srinivas.kandagatla@oss.qualcomm.com/
  2. Lore link matches PR commits: Yes — subjects match (with FROMLIST prefix), authors match, commit message bodies identical, diff content verified identical for commit 1/8, diffstats match for all 8 commits
  3. Upstream patch status: ⏳ Decision Pending — v3 series posted Sep 15, 2026; no maintainer acceptance or rejection signals yet; patches under review
  4. PR present in qcom-next/topics: ❌ Fail — 3/8 commits missing from both qcom-next and topics; 5/8 commits show only partial presence (per integration_presence_report.md)

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: d49c33864d06e9672dce57738be8851384578fcf
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/8 [PATCH 1/8] FROMLIST: ASoC: SDCA: allow building without ACPI partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial
2/8 [PATCH 2/8] FROMLIST: ASoC: SDCA: export PM helpers keyed on missing - no subject, patch-id, or full tree-content match found missing - no subject, patch-id, or full tree-content match found missing
3/8 [PATCH 3/8] FROMLIST: ASoC: SDCA: expose class SoundWire probe/remove partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial
4/8 [PATCH 4/8] FROMLIST: ASoC: SDCA: add class_ops with missing - no subject, patch-id, or full tree-content match found missing - no subject, patch-id, or full tree-content match found missing
5/8 [PATCH 5/8] FROMLIST: ASoC: SDCA: class_function: xlate sound-dai partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial
6/8 [PATCH 6/8] FROMLIST: ASoC: SDCA: add partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial
7/8 [PATCH 7/8] FROMLIST: dt-bindings: sound: qcom: add Tambora WCD9378 missing - no subject, patch-id, or full tree-content match found missing - no subject, patch-id, or full tree-content match found missing
8/8 [PATCH 8/8] FROMLIST: ASoC: codecs: add Qualcomm Tambora (WCD9378) partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: FAIL
present_commits: 0/8
partial_commits: 5/8
missing_commits: 3/8
topics_checked_for_commits: 8/8
final_summary: PR present in qcom-next/topics: Fail - 3/8 commit(s) are missing from both qcom-next and topics

@qlijarvis

Copy link
Copy Markdown

PR #1857 — checker-log-analyzer

PR: #1857
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/35315605136

Checker Result Summary
Checker Result Summary
checkpatch ⏭️ Skipped - merge conflict prevented execution
dt-binding-check ⏭️ Skipped - merge conflict prevented execution
dtb-check ⏭️ Skipped - merge conflict prevented execution
sparse-check ⏭️ Skipped - merge conflict prevented execution
check-uapi-headers ⏭️ Skipped - merge conflict prevented execution
check-patch-compliance ⏭️ Skipped - merge conflict prevented execution
tag-check N/A Cannot determine target branch (network restricted)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1857 - ASoC: SDCA and Tambora WCD9378 codec support
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/35315605136

Checker Result Summary
checkpatch ⏭️ Skipped - merge conflict prevented execution
dt-binding-check ⏭️ Skipped - merge conflict prevented execution
dtb-check ⏭️ Skipped - merge conflict prevented execution
sparse-check ⏭️ Skipped - merge conflict prevented execution
check-uapi-headers ⏭️ Skipped - merge conflict prevented execution
check-patch-compliance ⏭️ Skipped - merge conflict prevented execution
tag-check N/A Cannot determine target branch (network restricted)

❌ CI Infrastructure — Merge Conflict Blocker

Root cause: The CI workflow failed during the integration merge phase when attempting to merge topic/tech/mm/audio/all into the integration branch based on v7.3-rc1. Multiple merge conflicts prevented any checkers from running.

Failure details:

Merging topic branches...
------------------------------------------
 ** Merging topic branch: topic/tech/mm/audio/all
Auto-merging Documentation/devicetree/bindings/arm/qcom,coresight-ctcu.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/arm/qcom,coresight-ctcu.yaml
Auto-merging Documentation/devicetree/bindings/arm/qcom,coresight-tnoc.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/arm/qcom,coresight-tnoc.yaml
Auto-merging Documentation/devicetree/bindings/arm/qcom.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/arm/qcom.yaml
Auto-merging Documentation/devicetree/bindings/clock/qcom,glymur-evacc.yaml
CONFLICT (add/add): Merge conflict in Documentation/devicetree/bindings/clock/qcom,glymur-evacc.yaml
Auto-merging Documentation/devicetree/bindings/clock/qcom,qcm2290-dispcc.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/clock/qcom,qcm2290-dispcc.yaml
Auto-merging Documentation/devicetree/bindings/clock/qcom,shikra-audiocorecc.yaml
CONFLICT (add/add): Merge conflict in Documentation/devicetree/bindings/clock/qcom,shikra-audiocorecc.yaml
Auto-merging Documentation/devicetree/bindings/clock/qcom,sm8550-tcsr.yaml
CONFLICT (content): Merge conflict in Documentation/devicetree/bindings/clock/qcom,sm8550-tcsr.yaml
[... and many more conflicts in sound/soc/qcom/qdsp6/ files ...]
Automatic merge failed; fix conflicts and then commit the result.
##[error]Process completed with exit code 1.

Analysis:

The conflicts are occurring in two main areas:

  1. Device tree bindings (Documentation/devicetree/bindings/) — Multiple YAML files have conflicting changes, including both content conflicts and add/add conflicts where the same file was added in both branches.

  2. Sound subsystem (sound/soc/qcom/qdsp6/) — Multiple files in the AudioReach/Q6APM subsystem have conflicting changes:

    • audioreach.c, audioreach.h
    • q6apm-lpass-dais.c
    • q6dsp-lpass-clocks.c
    • q6prm-clocks.c, q6prm.h
    • topology.c
    • sc8280xp.c

Root cause assessment:

This PR introduces 8 FROMLIST commits for ASoC SDCA support and the Tambora WCD9378 codec. The integration presence report shows that 5/8 commits have "partial" evidence in qcom-next (subject or partial tree evidence found), suggesting that similar or overlapping changes may have already been merged into the integration baseline (v7.3-rc1), causing conflicts when the topic branch attempts to merge.

The conflicts are not caused by defects in this PR's patches — they are caused by the state of the integration branch at the time of CI execution. The PR patches themselves may be clean, but they conflict with other changes already present in the baseline or in other topic branches being merged.

Fix:

This is a topic branch integration issue, not a patch quality issue. The PR author cannot fix this directly. The resolution requires one of the following actions:

  1. Rebase the topic branch (topic/tech/mm/audio/all) onto the current integration baseline (v7.3-rc1 or later) to resolve conflicts.

  2. Coordinate with maintainers to determine if the conflicting changes in qcom-next should take precedence, or if this PR's changes should override them.

  3. Re-trigger CI after the topic branch has been rebased or after conflicting topic branches have been resolved.

Reproduce locally:

To reproduce the merge conflict locally:

# Clone the kernel and set up remotes
git clone https://github.com/qualcomm-linux/kernel.git
cd kernel
git remote add topics https://github.com/qualcomm-linux/kernel-topics.git
git fetch topics

# Create integration branch based on v7.3-rc1
git checkout -b integ d49c33864d06e9672dce57738be8851384578fcf

# Attempt to merge the topic branch
git merge topics/topic/tech/mm/audio/all

# Conflicts will appear in the files listed above

Note on checker execution:

Because the merge failed, none of the kernel checkers (checkpatch, dt-binding-check, dtb-check, sparse-check, check-uapi-headers, check-patch-compliance) were able to execute. All checker jobs exited with code 1 at the merge stage before any actual checking could occur.

To get meaningful checker results, the merge conflicts must be resolved first, then CI should be re-triggered.

Verdict

Cannot assess patch quality — all checkers were blocked by merge conflicts during topic branch integration. The PR patches themselves may be clean, but they cannot be validated until the topic branch is rebased onto the current integration baseline and conflicts are resolved. This is a CI infrastructure / topic branch management issue, not a patch defect.

Recommended action: Rebase topic/tech/mm/audio/all onto v7.3-rc1 (or the current qcom-next tip), resolve conflicts, and re-trigger CI.

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