[PATCH v2 0/2] ASoC: codecs: add the Qualcomm WCD9378 audio codec
Jorijn van der Graaf <[email protected]>
| Newsgroups | org.kernel.vger.linux-sound,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
This series adds bindings and a codec driver for the Qualcomm WCD9378, found on SM7635 boards such as the Fairphone 6. The chip pairs a WCD937x-compatible analog core with SDCA function blocks whose built-in sequencers handle the analog power-up/down; all control registers, analog core included, sit in a 32-bit paged SDCA control address space behind the TX SoundWire slave. The driver implements the TX/capture paths (three ADCs fed from four analog microphone inputs, three mic bias supplies) and is modeled on wcd937x, reusing the wcd-common helpers. RX/playback, MBHC and the SmartAMP function are follow-up work. Register sequences come from the GPL downstream wcd9378 driver in Qualcomm's audio-kernel-ar tree; the chip has no public datasheet. The slave binding is now a single file covering both presentations of the chip: the two-slave mobile wiring this driver handles, and the aggregated single-slave SDCA mode of compute platforms, targeted by Srinivas's pending SDCA class series. Agreed with Srinivas in that series' review so it can drop its own binding file and the two drivers can share the SoundWire ID table: https://lore.kernel.org/all/[email protected]/ Two dependencies outside this series, both routed through the soundwire tree: - the paged register map needs the Qualcomm controller's SCP address paging support, already applied there as commit 999f80904763 ("soundwire: qcom: add SCP address paging support"). Any order works; capture just needs both to land. - v2 has the SoundWire core program the codec's bus-clock base/scale registers (prop.clock_reg_supported) instead of hand-rolling the writes, following Pierre-Louis's v1 review. On Qualcomm controllers the core can only do that once the bus declares its clock: https://lore.kernel.org/linux-sound/[email protected]/ Ordering matters for this one: with this series but without that patch, slave initialization on Qualcomm buses fails at enumeration ("no bus MCLK") and the codec binds with its bus-clock registers unprogrammed, i.e. dead capture; it needs to land first or together with this. Tested on the Fairphone 6 (SM7635) together with the two soundwire patches above: handset mic capture through the LPASS TX macro at 48 kHz across reboots, including UCM-driven use by PipeWire in a Plasma Mobile session. The board DTS follows once these bindings are accepted. v2: - the micbias4-requirement patch is squashed into the binding patch (Krzysztof) - one slave binding for both chip presentations (see above), with qcom,{tx,rx}-port-mapping replaced by qcom,port-mapping plus a qcom,control-device flag, the channel-mapping properties dropped, and the codec example trimmed per Rob's review - driver: single entry point declining qcom,compute-mode nodes; bus-clock and runtime-PM rework from Pierre-Louis's review; Kconfig style fixes from Julian Braha's review; sashiko-bot's tx_mode_put and mutex_destroy items - rebased; per-patch changelogs have the details v1: https://lore.kernel.org/linux-sound/[email protected]/ Jorijn van der Graaf (2): ASoC: dt-bindings: add the Qualcomm WCD9378 audio codec ASoC: codecs: wcd9378: add TX/capture codec driver .../bindings/sound/qcom,wcd9378-codec.yaml | 54 + .../bindings/sound/qcom,wcd9378-sdw.yaml | 182 +++ .../bindings/sound/qcom,wcd937x.yaml | 1 + .../bindings/sound/qcom,wcd938x.yaml | 1 + .../bindings/sound/qcom,wcd939x.yaml | 1 + .../bindings/sound/qcom,wcd93xx-common.yaml | 1 - sound/soc/codecs/Kconfig | 19 + sound/soc/codecs/Makefile | 7 + sound/soc/codecs/wcd9378-sdw.c | 441 ++++++ sound/soc/codecs/wcd9378.c | 1366 +++++++++++++++++ sound/soc/codecs/wcd9378.h | 244 +++ 11 files changed, 2316 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd9378-codec.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml create mode 100644 sound/soc/codecs/wcd9378-sdw.c create mode 100644 sound/soc/codecs/wcd9378.c create mode 100644 sound/soc/codecs/wcd9378.h base-commit: eeb306184b615ab6c6008126bc1fe0080b8e94f9 -- 2.55.0