[PATCH v2 00/11] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec

Srinivas Kandagatla posted 11 patches 2 weeks, 4 days ago
.../bindings/sound/qcom,wcd9378-sdw.yaml      |   91 ++
include/sound/sdca.h                          |   23 +-
include/sound/sdca_class.h                    |   80 ++
include/sound/sdca_function.h                 |    2 +
sound/soc/codecs/Kconfig                      |   11 +
sound/soc/codecs/Makefile                     |    2 +
sound/soc/codecs/wcd9378-sdca.c               | 1010 +++++++++++++++++
sound/soc/codecs/wcd9378-sdca.h               |   20 +
sound/soc/codecs/wcd9378-sdw.c                |   52 +
sound/soc/sdca/Kconfig                        |    6 +-
sound/soc/sdca/sdca_class.c                   |  166 ++-
sound/soc/sdca/sdca_class.h                   |   35 -
sound/soc/sdca/sdca_class_function.c          |   50 +-
sound/soc/sdca/sdca_device.c                  |    4 +
sound/soc/sdca/sdca_functions.c               |   43 +-
15 files changed, 1516 insertions(+), 79 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml
create mode 100644 include/sound/sdca_class.h
create mode 100644 sound/soc/codecs/wcd9378-sdca.c
create mode 100644 sound/soc/codecs/wcd9378-sdca.h
create mode 100644 sound/soc/codecs/wcd9378-sdw.c
delete mode 100644 sound/soc/sdca/sdca_class.h
[PATCH v2 00/11] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec
Posted by Srinivas Kandagatla 2 weeks, 4 days ago
This series extends the SDCA class driver to work on DT / non-ACPI
platforms via a codec-provided static topology, and adds the Qualcomm
WCD9378 (Tambora) codec as the first user driven in SDCA / compute
mode.  Tested on the Snapdragon X2 Elite Glymur CRD.

Patches 1-9 extend the SDCA class helpers:

  - Kconfig gate to build the class without ACPI enabled.
  - PM helpers keyed on a codec-embedded struct sdca_class_drv, so
    codec drivers can build their own dev_pm_ops.
  - Class SoundWire probe/remove/read_prop exposed as library
    functions callable from codec-specific SDW slave drivers.
  - hw_ops with hw_init (supplies/reset/SCP init) and
    populate_function (DT-supplied SDCA function data) hooks.
  - Class function driver registers SDCA_FUNCTION_TYPE_SIMPLE_JACK,
    and resolves sound-dai cells by entity index.
  - sdca_apply_default_control_classifiers() applies the same
    is_volatile / has_reset flags that the DisCo/ACPI parser would.

Note:
None of these are functional changes in sdca core, all of these are
helper functions to allow non-ACPI users to use sdca core.

Patches 10-11 add the WCD9378 SDCA / compute-mode codec:

  - dt-bindings for the SoundWire slave in compute mode, using the
    qcom,wcd9378c variant compatible alongside the SoundWire
    class-ID compatible sdw20217011000.
  - Codec driver split across wcd9378-sdw.c (SoundWire slave driver
    plumbing) and wcd9378-sdca.c (SDCA topology + hw_ops) with a
    shared wcd9378-sdca.h header.  A future mobile-mode driver can
    plug into the same module (single MODULE_DEVICE_TABLE, single
    modalias) by adding its own files and hooking into
    wcd9378-sdw.c.

Testing: HPH playback and headset-mic capture confirmed on the
Snapdragon X2 Elite Glymur CRD.

Jack detection is not wired up in this series.  GE 35 / MBHC stays
armed by the transcribed init table but is not consumed; the mode
0/1 aliasing in range_ge35_mode_data is a defensive fallback and
has not been tested.

Changes since RFC v1 [1]:

  - Compute-mode identified by qcom,wcd9378c variant compatible
    instead of the qcom,compute-mode boolean property.
  - qcom,micbias2-microvolt dropped; MICB2 fixed at 2.75 V by the
    SimpleJack topology.
  - Codec split into wcd9378-sdw.c (SDW plumbing) and
    wcd9378-sdca.c (SDCA topology); module renamed to
    snd-soc-wcd9378 as preparatory for mobile driver.
  - Binding is compute-only; qcom,wcd9378 mobile-mode variant will
    land with the mobile-mode driver.
  - MODULE_IMPORT_NS("SND_SOC_SDCA") added.
  - sdca_class.h moved from sound/soc/sdca/ to include/sound/.
  - qcom,port-mapping missing now returns -EINVAL via
    dev_err_probe().
  - init_table sync up with CRD asl and the T14s DSDT; 8 stray writes dropped.
  - Six fake IRQ-anchor Controls on PDE 47 dropped; HPH
    OCP/CNP/SURGE stay codec-local until an SDCA framework
    interface for standalone status-bit IRQs lands.
  - .is_volatile dropped from FU 6 CHANNEL_VOLUME (matches MUTE).
  - dropped pre post pde callbacks, and all of the mixers and mute are
    exposed as mixer controls.
  - added sdca_apply_default_control_classifiers, inline with acpi
    iparsing.

[1] https://lore.kernel.org/all/amHqO5pMFmKRNYTT@opensource.cirrus.com/

Srinivas Kandagatla (11):
  ASoC: SDCA: allow building without ACPI
  ASoC: SDCA: export PM helpers keyed on sdca_class_drv
  ASoC: SDCA: expose class SoundWire probe/remove/read_prop as library
  ASoC: SDCA: add hw_ops with hw_init hook
  ASoC: SDCA: add populate_function hw_op for DT function data
  ASoC: SDCA: class_function: xlate sound-dai cell by entity index
  ASoC: SDCA: register SDCA_FUNCTION_TYPE_SIMPLE_JACK in class function
    driver
  ASoC: SDCA: make find_sdca_control_reset() return void
  ASoC: SDCA: add sdca_apply_default_control_classifiers() helper
  dt-bindings: sound: qcom: add Tambora WCD9378 SDCA codec
  ASoC: codecs: add Qualcomm Tambora (WCD9378) SDCA codec

 .../bindings/sound/qcom,wcd9378-sdw.yaml      |   91 ++
 include/sound/sdca.h                          |   23 +-
 include/sound/sdca_class.h                    |   80 ++
 include/sound/sdca_function.h                 |    2 +
 sound/soc/codecs/Kconfig                      |   11 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/wcd9378-sdca.c               | 1010 +++++++++++++++++
 sound/soc/codecs/wcd9378-sdca.h               |   20 +
 sound/soc/codecs/wcd9378-sdw.c                |   52 +
 sound/soc/sdca/Kconfig                        |    6 +-
 sound/soc/sdca/sdca_class.c                   |  166 ++-
 sound/soc/sdca/sdca_class.h                   |   35 -
 sound/soc/sdca/sdca_class_function.c          |   50 +-
 sound/soc/sdca/sdca_device.c                  |    4 +
 sound/soc/sdca/sdca_functions.c               |   43 +-
 15 files changed, 1516 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml
 create mode 100644 include/sound/sdca_class.h
 create mode 100644 sound/soc/codecs/wcd9378-sdca.c
 create mode 100644 sound/soc/codecs/wcd9378-sdca.h
 create mode 100644 sound/soc/codecs/wcd9378-sdw.c
 delete mode 100644 sound/soc/sdca/sdca_class.h

-- 
2.53.0