Message ID | 20241212004727.2903846-1-alexey.klimov@linaro.org |
---|---|
Headers | show |
Series | qrb4210-rb2: add wsa audio playback and capture support | expand |
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.
On Thu, Dec 12, 2024 at 12:47:14AM +0000, Alexey Klimov wrote: > Document compatibles for Qualcomm SM6115 SoC macro digital codecs > (RX and VA). > > Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> > --- Changelog does not mention anything about this file (or I missed it), b4 diff fails, so what happened here? > .../bindings/sound/qcom,lpass-rx-macro.yaml | 19 +++++++++++++++++++ > .../bindings/sound/qcom,lpass-va-macro.yaml | 17 +++++++++++++++++ > 2 files changed, 36 insertions(+) > > diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml > index 92f95eb74b19..697c5591ae7c 100644 > --- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml > +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml > @@ -14,6 +14,7 @@ properties: > oneOf: > - enum: > - qcom,sc7280-lpass-rx-macro > + - qcom,sm6115-lpass-rx-macro > - qcom,sm8250-lpass-rx-macro > - qcom,sm8450-lpass-rx-macro > - qcom,sm8550-lpass-rx-macro > @@ -80,6 +81,24 @@ allOf: > - const: npl > - const: fsgen > > + - if: > + properties: > + compatible: > + contains: > + enum: > + - qcom,sm6115-lpass-rx-macro > + then: > + properties: > + clocks: > + minItems: 4 > + maxItems: 4 > + clock-names: > + items: > + - const: mclk > + - const: npl > + - const: dcodec > + - const: fsgen > + > - if: > properties: > compatible: > diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml > index f41deaa6f4df..30a44b444f39 100644 > --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml > +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml > @@ -14,6 +14,7 @@ properties: > oneOf: > - enum: > - qcom,sc7280-lpass-va-macro > + - qcom,sm6115-lpass-va-macro > - qcom,sm8250-lpass-va-macro > - qcom,sm8450-lpass-va-macro > - qcom,sm8550-lpass-va-macro > @@ -83,6 +84,22 @@ allOf: > items: > - const: mclk > > + - if: > + properties: > + compatible: > + contains: > + const: qcom,sm8250-lpass-va-macro Wrong comaptible. Best regards, Krzysztof
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 12/12/2024 08:46, Krzysztof Kozlowski wrote: > On Thu, Dec 12, 2024 at 12:47:21AM +0000, Alexey Klimov wrote: >> Add support for qcom,wsa8815 and qcom,wsa8810 names to be recognised > > What is WSA8815 that? I guess I had some longer thought: "What is WSA8815 that it should be here?" > >> as a valid compatibles. Best regards, Krzysztof
On 12.12.2024 1:47 AM, Alexey Klimov wrote: > Add support for audio playback via WCD937X/WSA881X. From DSP > and rxmacro the sound stream goes into AUX port of wcd codec. > wcd codec decodes digital audio into analog and outputs it to > single wsa amplifier hence only the mono configuration. > > The audio playback is verified using the following commands: > > amixer -c0 cset iface=MIXER,name='AUX_RDAC Switch' 1 > amixer -c0 cset iface=MIXER,name='RX_RX2 Digital Volume' 80 > amixer -c0 cset iface=MIXER,name='RX INT2_1 MIX1 INP0' 'RX2' > amixer -c0 cset iface=MIXER,name='RX_CODEC_DMA_RX_1 Audio Mixer MultiMedia1' 1 > amixer -c0 cset iface=MIXER,name='RX_MACRO RX2 MUX' 'AIF2_PB' > amixer -c0 cset iface=MIXER,name='SpkrMono WSA_RDAC' 1 > amixer -c0 cset iface=MIXER,name='LO Switch' 1 > amixer -c0 cset iface=MIXER,name='RX HPH Mode' 4 > > aplay -D hw:0,0 /usr/share/sounds/alsa/Front_Center.wav > > Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> > --- > arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts > index 827ce5f7adfb..34ba563d0d07 100644 > --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts > +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts > @@ -111,7 +111,9 @@ sound { > pinctrl-0 = <&lpi_i2s2_active>; > pinctrl-names = "default"; > model = "Qualcomm-RB2-WSA8815-Speakers-DMIC0"; > - audio-routing = "MM_DL1", "MultiMedia1 Playback", > + audio-routing = "IN3_AUX", "AUX_OUT", > + "SpkrMono WSA_IN", "AUX", > + "MM_DL1", "MultiMedia1 Playback", > "MM_DL2", "MultiMedia2 Playback"; > > mm1-dai-link { > @@ -145,6 +147,22 @@ codec { > sound-dai = <<9611_codec 0>; > }; > }; > + > + wsa-dai-link { > + link-name = "WSA Playback"; > + > + cpu { > + sound-dai = <&q6afedai RX_CODEC_DMA_RX_1>; > + }; > + > + platform { > + sound-dai = <&q6routing>; > + }; > + > + codec { > + sound-dai = <&wsa881x>, <&wcd937x 0>, <&swr1 3>, <&rxmacro 1>; > + }; Please sort these subnodes alphabetically - and yes I realize we managed to overlook that for 10 years lgtm otherwise Konrad