[PATCH v3 1/2] ASoC: dt-bindings: qcom,wcd9378-sdw: add non-SDCA (mobile) mode
From: Ravi Hothi
Date: Fri Nov 27 2026 - 08:52:31 EST
The WCD9378 silicon is fused either SDCA-compliant, which is what this
binding describes today, or not SDCA-compliant - the "mobile mode"
fusing. The two fusings put a different number of devices on the
SoundWire bus: an SDCA-compliant part is a single device aggregating the
playback and the capture path, while a part that is not SDCA-compliant
splits into an RX device for playback and a TX device for capture, one
sitting on the playback SoundWire link and one on the capture link.
Both fusings carry the same SoundWire class ID and therefore the same
compatible, so they cannot be told apart by a separate binding file.
Describe them both here instead, keyed off the existing
qcom,sdca-compliant property.
Only the capture device reaches the codec control register space, so on
the split fusing the TX device is the one that drives the codec, and it
references its playback peer through the new qcom,rx-device phandle.
Either way the device that reaches the control register space owns the
codec-wide resources - the reset GPIO, the supplies and the new mic-bias
level properties - and exposes the codec's DAIs, while its peer
describes nothing beyond its own data path.
qcom,port-mapping is shared between both fusings, so its minItems drops
from 8 to 5: the split devices map five device data ports each where an
SDCA-compliant device maps eight.
Co-developed-by: Jorijn van der Graaf <jorijnvdgraaf@xxxxxxxxxxxxx>
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@xxxxxxxxxxxxx>
Signed-off-by: Ravi Hothi <ravi.hothi@xxxxxxxxxxxxxxxx>
---
.../bindings/sound/qcom,wcd9378-sdw.yaml | 172 ++++++++++++++++++---
1 file changed, 149 insertions(+), 23 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml b/Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml
index 62d85b1dca7f..03ee4a4deea6 100644
--- a/Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,wcd9378-sdw.yaml
@@ -4,19 +4,21 @@
$id: http://devicetree.org/schemas/sound/qcom,wcd9378-sdw.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Qualcomm WCD9378 (Tambora) SoundWire codec
+title: Qualcomm WCD9378 (Tambora) SoundWire devices
maintainers:
- Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
-description:
- Qualcomm WCD9378 (Tambora) SoundWire codec. The same silicon can be
+description: |
+ Qualcomm WCD9378 (Tambora) SoundWire devices. The same silicon can be
fused for a mobile (non-SDCA) mode or an SDCA-compliant mode; the
- qcom,sdca-compliant property selects the latter and is required by
- this driver.
+ qcom,sdca-compliant property selects the latter.
-allOf:
- - $ref: dai-common.yaml#
+ An SDCA-compliant part is a single device aggregating both data paths.
+ A part that is not SDCA-compliant splits into an RX device and a TX
+ device; only the TX device reaches the codec control register space, so
+ it owns the codec-wide resources and references its peer through
+ qcom,rx-device.
properties:
compatible:
@@ -27,19 +29,28 @@ properties:
qcom,sdca-compliant:
description:
- Present when the codec is fused as SDCA-compliant. The mobile
- (non-SDCA) variant carries the same class-ID compatible and is
- handled by a different driver.
+ Present when the codec is fused as SDCA-compliant.
type: boolean
+ qcom,rx-device:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Reference to the playback (RX) SoundWire device of the same codec.
+ Present on the capture (TX) device, which reaches the control
+ register space and therefore drives the codec on its behalf.
+
qcom,port-mapping:
description:
- Each entry maps a slave data port to a master data port.
- Entries are in order starting from slave port 1; slave port 0
- is reserved and not represented. SDCA-compliant mode uses 8
- entries covering DP1..DP8.
+ Each entry maps a device data port to a master data port. Entries
+ are in order starting from device port 1; device port 0 is
+ reserved and not represented. An SDCA-compliant device uses 8
+ entries covering DP1..DP8, the split devices 5 entries covering
+ DP1..DP5.
+
+ Several device ports may map to the same master port, in which
+ case they are distinguished by their channel within that port.
$ref: /schemas/types.yaml#/definitions/uint32-array
- minItems: 8
+ minItems: 5
maxItems: 8
reset-gpios:
@@ -58,24 +69,93 @@ properties:
vdd-mic-bias-supply:
description: Mic bias supply.
+ qcom,micbias1-microvolt:
+ description: micbias1 voltage
+ minimum: 1800000
+ maximum: 2850000
+
+ qcom,micbias2-microvolt:
+ description: micbias2 voltage
+ minimum: 1800000
+ maximum: 2850000
+
+ qcom,micbias3-microvolt:
+ description: micbias3 voltage
+ minimum: 1800000
+ maximum: 2850000
+
'#sound-dai-cells':
const: 1
required:
- compatible
- reg
- - qcom,sdca-compliant
- - qcom,port-mapping
- - reset-gpios
- - vdd-buck-supply
- - vdd-rxtx-supply
- - vdd-io-supply
- - vdd-mic-bias-supply
- - '#sound-dai-cells'
+
+allOf:
+ - $ref: dai-common.yaml#
+
+ # The device reaching the control register space owns the codec-wide
+ # resources and exposes the DAIs. A data-only device describes nothing
+ # but its own data path.
+ - if:
+ anyOf:
+ - required:
+ - qcom,sdca-compliant
+ - required:
+ - qcom,rx-device
+ then:
+ required:
+ - qcom,port-mapping
+ - reset-gpios
+ - vdd-buck-supply
+ - vdd-rxtx-supply
+ - vdd-io-supply
+ - vdd-mic-bias-supply
+ - '#sound-dai-cells'
+ else:
+ properties:
+ reset-gpios: false
+ vdd-buck-supply: false
+ vdd-rxtx-supply: false
+ vdd-io-supply: false
+ vdd-mic-bias-supply: false
+ '#sound-dai-cells': false
+
+ # An SDCA-compliant part is one device carrying both data paths, so it
+ # has no peer to reference.
+ - if:
+ required:
+ - qcom,sdca-compliant
+ then:
+ properties:
+ qcom,port-mapping:
+ minItems: 8
+ qcom,rx-device: false
+ else:
+ properties:
+ qcom,port-mapping:
+ maxItems: 5
+
+ # An SDCA-compliant part takes its mic-bias levels from the function
+ # topology instead.
+ - if:
+ required:
+ - qcom,rx-device
+ then:
+ required:
+ - qcom,micbias1-microvolt
+ - qcom,micbias2-microvolt
+ - qcom,micbias3-microvolt
+ else:
+ properties:
+ qcom,micbias1-microvolt: false
+ qcom,micbias2-microvolt: false
+ qcom,micbias3-microvolt: false
unevaluatedProperties: false
examples:
+ # An SDCA-compliant part: one aggregated device.
- |
#include <dt-bindings/gpio/gpio.h>
@@ -99,6 +179,52 @@ examples:
vdd-io-supply = <&vreg_l18b_1p2>;
vdd-mic-bias-supply = <&vreg_bob1>;
+ #sound-dai-cells = <1>;
+ };
+ };
+
+ # A part that is not SDCA-compliant: an RX device and a TX device on
+ # two masters, the TX device owning the codec resources.
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ soundwire@6ad0000 {
+ reg = <0x06ad0000 0x10000>;
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+ wcd9378_rx: audio-codec@0,4 {
+ compatible = "sdw20217011000";
+ reg = <0 4>;
+
+ qcom,port-mapping = <1 2 3 4 5>;
+ };
+ };
+
+ soundwire@7630000 {
+ reg = <0x07630000 0x10000>;
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+ audio-codec@0,3 {
+ compatible = "sdw20217011000";
+ reg = <0 3>;
+
+ qcom,rx-device = <&wcd9378_rx>;
+
+ qcom,port-mapping = <2 2 2 3 4>;
+
+ reset-gpios = <&tlmm 162 GPIO_ACTIVE_LOW>;
+
+ vdd-buck-supply = <&vreg_l8b>;
+ vdd-rxtx-supply = <&vreg_l7b>;
+ vdd-io-supply = <&vreg_l7b>;
+ vdd-mic-bias-supply = <&vreg_bob>;
+
+ qcom,micbias1-microvolt = <1800000>;
+ qcom,micbias2-microvolt = <1800000>;
+ qcom,micbias3-microvolt = <1800000>;
+
#sound-dai-cells = <1>;
};
};
--
2.34.1