[RESEND v5 0/7] ASoC: codecs: wcd937x: add wcd937x audio codec support

From: Mohammad Rafi Shaik
Date: Mon May 27 2024 - 07:21:06 EST


This patchset adds support for Qualcomm WCD9370/WCD9375 codec.

Qualcomm WCD9370/WCD9375 Codec is a standalone Hi-Fi audio codec IC
connected over SoundWire. This device has two SoundWire devices, RX and
TX respectively supporting 3 x ADCs, ClassH, Ear, Aux PA, 2xHPH,
6 DMICs and MBHC.

For codec driver to be functional it would need both tx and rx Soundwire devices
to be up and this is taken care by using device component framework and device-links
are used to ensure proper pm dependencies. Ex tx does not enter suspend
before rx or codec is suspended.

This patchset along with other SoundWire patches on the list
have been tested on QCM6490 IDP device.

Changes since v4:
- Removed volatile/read-only registers from defaults list
- Added wcd939x_volatile_register() with only volatile registers
- Added a wcd939x_readable_register() with read-only and read-write registers, so cache does it's job
- Fixed Spurious events for mixer controls and validated with mixer selftest tool
- Used TLV instead of enum for ear_pa_gain mixer control
- Used enum constraints instead of OneOf in dt-binding patch
- Added vdd-px supply property as non optional in dt-binding patch
- Reworked and done driver cleanup

Changes since v3:
- Fixed dt binding check errors.
- Added constraints on values in v4-0001 binding patch as suggested by Krzysztof
- Change the patch sequence soundwire driver first then codec driver
- Added missing .remove soundwire driver function
- Reworked and done driver cleanup

Changes since v2:
- Used common qcom,wcd93xx-common.yaml. removed duplicate properties.
- Merged bindings patches "v2-0001" and "v2-0003" in single patch for easy review.
- Fixed dt binding check errors.
- Added missing "qcom,wcd9375-codec" in v3-0001 dt binding patch.
- Added constraints on values in v3-0001 binding patch as suggested by Krzysztof
- Fix the typo mistake in v2 cover letter

Changes since v1:
- Split the patch per driver for easier review as suggested by Krzysztof
- Used devm_gpiod_get api to get reset gpio as suggested by Krzysztof

Prasad Kumpatla (7):
ASoC: dt-bindings: document wcd937x Audio Codec
ASoC: codecs: wcd937x-sdw: add SoundWire driver
ASoC: codecs: wcd937x: add wcd937x codec driver
ASoC: codecs: wcd937x: add basic controls
ASoC: codecs: wcd937x: add playback dapm widgets
ASoC: codecs: wcd937x: add capture dapm widgets
ASoC: codecs: wcd937x: add audio routing and Kconfig

.../bindings/sound/qcom,wcd937x-sdw.yaml | 91 +
.../bindings/sound/qcom,wcd937x.yaml | 82 +
sound/soc/codecs/Kconfig | 20 +
sound/soc/codecs/Makefile | 7 +
sound/soc/codecs/wcd937x-sdw.c | 1139 +++++++
sound/soc/codecs/wcd937x.c | 3029 +++++++++++++++++
sound/soc/codecs/wcd937x.h | 653 ++++
7 files changed, 5021 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd937x-sdw.yaml
create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd937x.yaml
create mode 100644 sound/soc/codecs/wcd937x-sdw.c
create mode 100644 sound/soc/codecs/wcd937x.c
create mode 100644 sound/soc/codecs/wcd937x.h


base-commit: 3689b0ef08b70e4e03b82ebd37730a03a672853a
--
2.25.1