Skip to content

Wcd9378 sdca codec support - #1844

Closed
Mohis-12 wants to merge 8 commits into
qualcomm-linux:mainfrom
Mohis-12:WCD9378_SDCA_CODEC_SUPPORT
Closed

Mohis-12 wants to merge 8 commits into
qualcomm-linux:mainfrom
Mohis-12:WCD9378_SDCA_CODEC_SUPPORT

Conversation

@Mohis-12

@Mohis-12 Mohis-12 commented Sep 16, 2026

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>
@qswat-orbit-external

Copy link
Copy Markdown

Dev Completion validation failed

CR: 4680771
Change Task: kernel.qli.0.0
Error: GenAI Assisted field must be set before moving change tasks to Development Complete. Please provide GenAI information.

The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check.

@qswat-orbit-external

Copy link
Copy Markdown

Dev Completion validation failed

CR: 4680771
Change Task: kernel.qli.0.0
Error: For CR '4680771' Change Task cannot be Development Complete until the Release Notes Status has transitioned beyond Update at least once.

The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check.

@Mohis-12 Mohis-12 closed this Sep 18, 2026
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.

1 participant