WSA881X also supports analog mode when device is configured via i2c
only. Document it, add properties, new compatibles and example.
While at this, also adjust quotes.
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
.../bindings/sound/qcom,wsa881x.yaml | 75 +++++++++++++++++--
1 file changed, 67 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
index ac03672ebf6d..e482d9dc0de2 100644
--- a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
@@ -12,15 +12,17 @@ maintainers:
description: |
WSA8810 is a class-D smart speaker amplifier and WSA8815
is a high-output power class-D smart speaker amplifier.
- Their primary operating mode uses a SoundWire digital audio
- interface. This binding is for SoundWire interface.
-
-allOf:
- - $ref: dai-common.yaml#
+ This family of amplifiers support two operating modes:
+ SoundWire digital audio interface which is a primary mode
+ and analog mode when device is configured via i2c only.
+ This binding describes both modes.
properties:
compatible:
- const: sdw10217201000
+ enum:
+ - qcom,wsa8810
+ - qcom,wsa8815
+ - sdw10217201000
reg:
maxItems: 1
@@ -35,17 +37,60 @@ properties:
'#sound-dai-cells':
const: 0
+ clocks:
+ maxItems: 1
+
+ mclk-gpios:
+ description: GPIO spec for mclk
+ maxItems: 1
+
required:
- compatible
- reg
- powerdown-gpios
- - "#thermal-sensor-cells"
- - "#sound-dai-cells"
+ - '#thermal-sensor-cells'
+ - '#sound-dai-cells'
+
+allOf:
+ - $ref: dai-common.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,wsa8810
+ const: qcom,wsa8815
+ then:
+ properties:
+ reg:
+ description:
+ In case of analog mode this should be I2C address of the digital
+ part of the device. The I2C address of analog part of an amplifier
+ is expected to be located at the fixed offset.
+ maxItems: 1
+ items:
+ minimum: 0x0e
+ maximum: 0x0f
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,wsa8810
+ const: qcom,wsa8815
+ then:
+ required:
+ - clocks
+ - mclk-gpios
unevaluatedProperties: false
examples:
- |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/sound/qcom,q6afe.h>
+
soundwire@c2d0000 {
#address-cells = <2>;
#size-cells = <0>;
@@ -68,4 +113,18 @@ examples:
};
};
+ i2c0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ amplifier@e {
+ compatible = "qcom,wsa8810";
+ reg = <0x0e>;
+ clocks = <&q6afecc LPASS_CLK_ID_MCLK_3 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+ powerdown-gpios = <&lpass_tlmm 16 GPIO_ACTIVE_LOW>;
+ mclk-gpios = <&lpass_tlmm 18 GPIO_ACTIVE_HIGH>;
+ #sound-dai-cells = <0>;
+ #thermal-sensor-cells = <0>;
+ };
+ };
...
--
2.45.2
On 12.12.2024 1:47 AM, Alexey Klimov wrote: > WSA881X also supports analog mode when device is configured via i2c > only. Document it, add properties, new compatibles and example. IIUC, this can work both with i2c only and soundwire only. That's not fun to describe in bindings.. I was thinking, maybe something like [1] referencing and i2c host would be fitting, but now I doubt that given we don't even need a swr device node.. Konrad [1] https://lore.kernel.org/linux-arm-msm/20241112-qps615_pwr-v3-1-29a1e98aa2b0@quicinc.com/
On Thu, Dec 12, 2024 at 12:47:22AM +0000, Alexey Klimov wrote:
> WSA881X also supports analog mode when device is configured via i2c
> only. Document it, add properties, new compatibles and example.
>
> While at this, also adjust quotes.
>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> ---
> .../bindings/sound/qcom,wsa881x.yaml | 75 +++++++++++++++++--
> 1 file changed, 67 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
> index ac03672ebf6d..e482d9dc0de2 100644
> --- a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
> +++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml
> @@ -12,15 +12,17 @@ maintainers:
> description: |
> WSA8810 is a class-D smart speaker amplifier and WSA8815
> is a high-output power class-D smart speaker amplifier.
> - Their primary operating mode uses a SoundWire digital audio
> - interface. This binding is for SoundWire interface.
> -
> -allOf:
> - - $ref: dai-common.yaml#
> + This family of amplifiers support two operating modes:
> + SoundWire digital audio interface which is a primary mode
> + and analog mode when device is configured via i2c only.
> + This binding describes both modes.
>
> properties:
> compatible:
> - const: sdw10217201000
> + enum:
> + - qcom,wsa8810
> + - qcom,wsa8815
You implement only one compatible, so does it mean they are compatible?
If so, make them compatible.
> + - sdw10217201000
>
> reg:
> maxItems: 1
> @@ -35,17 +37,60 @@ properties:
> '#sound-dai-cells':
> const: 0
>
> + clocks:
> + maxItems: 1
> +
> + mclk-gpios:
> + description: GPIO spec for mclk
Do not repeat property name as description. Say something useful. "GPIO
spec for" is redundant, it cannot be anything else, so basically your
description saod "mclk" which is the same as in property name.
Usually clocks are not GPIOs, so description could explain that.
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> - powerdown-gpios
> - - "#thermal-sensor-cells"
> - - "#sound-dai-cells"
> + - '#thermal-sensor-cells'
> + - '#sound-dai-cells'
> +
> +allOf:
> + - $ref: dai-common.yaml#
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,wsa8810
> + const: qcom,wsa8815
That's not a valid syntax. Either enum or const.
This was never tested.
> + then:
> + properties:
> + reg:
> + description:
> + In case of analog mode this should be I2C address of the digital
> + part of the device. The I2C address of analog part of an amplifier
> + is expected to be located at the fixed offset.
> + maxItems: 1
> + items:
> + minimum: 0x0e
> + maximum: 0x0f
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - qcom,wsa8810
> + const: qcom,wsa8815
Why are you repeating the if?
> + then:
> + required:
> + - clocks
> + - mclk-gpios
>
> unevaluatedProperties: false
>
> examples:
> - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/sound/qcom,q6afe.h>
> +
> soundwire@c2d0000 {
> #address-cells = <2>;
> #size-cells = <0>;
> @@ -68,4 +113,18 @@ examples:
> };
> };
>
> + i2c0 {
i2c
Best regards,
Krzysztof
On Thu, 12 Dec 2024 00:47:22 +0000, Alexey Klimov wrote: > WSA881X also supports analog mode when device is configured via i2c > only. Document it, add properties, new compatibles and example. > > While at this, also adjust quotes. > > Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> > --- > .../bindings/sound/qcom,wsa881x.yaml | 75 +++++++++++++++++-- > 1 file changed, 67 insertions(+), 8 deletions(-) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/qcom,wsa881x.example.dtb: amplifier@e: compatible: 'oneOf' conditional failed, one must be fixed: 'qcom,wsa8810' does not match '^qcom,(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1e)[0-9]+(pro)?-.*$' 'qcom,wsa8810' does not match '^qcom,(sa|sc)8[0-9]+[a-z][a-z]?-.*$' 'qcom,wsa8810' does not match '^qcom,[ak]pss-wdt-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$' 'qcom,wsa8810' does not match '^qcom,gcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$' 'qcom,wsa8810' does not match '^qcom,mmcc-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$' 'qcom,wsa8810' does not match '^qcom,pcie-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1e)[0-9]+.*$' 'qcom,wsa8810' does not match '^qcom,rpm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm)[0-9]+.*$' 'qcom,wsa8810' does not match '^qcom,scm-(apq|ipq|mdm|msm|qcm|qcs|q[dr]u|sa|sc|sd[amx]|sm|x1e)[0-9]+.*$' 'qcom,wsa8810' is not one of ['qcom,dsi-ctrl-6g-qcm2290', 'qcom,gpucc-sdm630', 'qcom,gpucc-sdm660', 'qcom,lcc-apq8064', 'qcom,lcc-ipq8064', 'qcom,lcc-mdm9615', 'qcom,lcc-msm8960', 'qcom,lpass-cpu-apq8016', 'qcom,usb-ss-ipq4019-phy', 'qcom,usb-hs-ipq4019-phy', 'qcom,vqmmc-ipq4019-regulator'] 'qcom,wsa8810' is not one of ['qcom,ipq806x-gmac', 'qcom,ipq806x-nand', 'qcom,ipq806x-sata-phy', 'qcom,ipq806x-usb-phy-ss', 'qcom,ipq806x-usb-phy-hs'] from schema $id: http://devicetree.org/schemas/arm/qcom-soc.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241212004727.2903846-10-alexey.klimov@linaro.org The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
© 2016 - 2025 Red Hat, Inc.