[PATCH v2 00/14] ASoC/qcom/arm64: Qualcomm ADSP DTS and binding fixes
Hi,
Dependencies/merging ==================== 1. The DTS patches are independent. 2. The binding patches should come together, because of context changes. Could be one of: Qualcomm SoC, ASoC or DT tree.
Changes since v1 ================ 1. Patch 9: New patch. 2. Patch 10: Correct also sound/qcom,q6apm-dai.yaml (Rob). 2. Patch 13: New patch. 3. Add Rb/Tb tags.
Best regards, Krzysztof
Krzysztof Kozlowski (14): arm64: dts: qcom: sdm630: align APR services node names with dtschema arm64: dts: qcom: sdm845: align APR services node names with dtschema arm64: dts: qcom: sm8250: align APR services node names with dtschema arm64: dts: qcom: msm8996: fix APR services nodes arm64: dts: qcom: sdm845: align dai node names with dtschema arm64: dts: qcom: msm8996: align dai node names with dtschema arm64: dts: qcom: qrb5165-rb5: align dai node names with dtschema arm64: dts: qcom: sm8250: use generic name for LPASS clock controller ASoC: dt-bindings:: qcom,q6asm: convert to dtschema dt-bindings: soc: qcom: apr: correct service children ASoC: dt-bindings: qcom,q6dsp-lpass-ports: cleanup example ASoC: dt-bindings: qcom,q6dsp-lpass-clocks: cleanup example ASoC: dt-bindings: qcom,q6apm-dai: adjust indentation in example dt-bindings: soc: qcom: apr: add missing properties
.../bindings/soc/qcom/qcom,apr.yaml | 111 +++++++++++++++-- .../bindings/sound/qcom,q6apm-dai.yaml | 21 ++-- .../devicetree/bindings/sound/qcom,q6asm.txt | 70 ----------- .../devicetree/bindings/sound/qcom,q6asm.yaml | 112 ++++++++++++++++++ .../sound/qcom,q6dsp-lpass-clocks.yaml | 36 +++--- .../sound/qcom,q6dsp-lpass-ports.yaml | 64 +++++----- arch/arm64/boot/dts/qcom/msm8996.dtsi | 10 +- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 4 +- arch/arm64/boot/dts/qcom/sdm630.dtsi | 8 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- .../boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 2 +- .../boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 10 +- 14 files changed, 293 insertions(+), 169 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.yaml
DT schema expects APR services node names to be "service":
qcom/sdm850-lenovo-yoga-c630.dtb: remoteproc-adsp: glink-edge:apr: 'apr-service@3', 'apr-service@4', 'apr-service@7', 'apr-service@8', 'qcom,glink-channels', 'qcom,intents' do not match any of the regexes: '^service@[1-9a-d]$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/sdm630.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi index 9ae6610af93a..3cd1f40b44fb 100644 --- a/arch/arm64/boot/dts/qcom/sdm630.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi @@ -2224,12 +2224,12 @@ apr { #address-cells = <1>; #size-cells = <0>;
- q6core { + service@3 { reg = <APR_SVC_ADSP_CORE>; compatible = "qcom,q6core"; };
- q6afe: apr-service@4 { + q6afe: service@4 { compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; q6afedai: dais { @@ -2240,7 +2240,7 @@ q6afedai: dais { }; };
- q6asm: apr-service@7 { + q6asm: service@7 { compatible = "qcom,q6asm"; reg = <APR_SVC_ASM>; q6asmdai: dais { @@ -2252,7 +2252,7 @@ q6asmdai: dais { }; };
- q6adm: apr-service@8 { + q6adm: service@8 { compatible = "qcom,q6adm"; reg = <APR_SVC_ADM>; q6routing: routing {
DT schema expects APR services node names to be "service":
qcom/sdm630-sony-xperia-nile-voyager.dtb: remoteproc@15700000: glink-edge:apr:service@4: 'dais' does not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org Tested-by: Steev Klimaszewski steev@kali.org --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 347c3abc117b..627e32515d29 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -767,13 +767,13 @@ apr { #size-cells = <0>; qcom,intents = <512 20>;
- apr-service@3 { + service@3 { reg = <APR_SVC_ADSP_CORE>; compatible = "qcom,q6core"; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; };
- q6afe: apr-service@4 { + q6afe: service@4 { compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; @@ -785,7 +785,7 @@ q6afedai: dais { }; };
- q6asm: apr-service@7 { + q6asm: service@7 { compatible = "qcom,q6asm"; reg = <APR_SVC_ASM>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; @@ -798,7 +798,7 @@ q6asmdai: dais { }; };
- q6adm: apr-service@8 { + q6adm: service@8 { compatible = "qcom,q6adm"; reg = <APR_SVC_ADM>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
DT schema expects APR services node names to be "service":
qcom/sm8250-sony-xperia-edo-pdx203.dtb: remoteproc@17300000: glink-edge:apr:service@7: 'dais' does not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/sm8250.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index cf5d65940174..84b4b8e40e7f 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -4782,13 +4782,13 @@ apr { #address-cells = <1>; #size-cells = <0>;
- apr-service@3 { + service@3 { reg = <APR_SVC_ADSP_CORE>; compatible = "qcom,q6core"; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; };
- q6afe: apr-service@4 { + q6afe: service@4 { compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; @@ -4805,7 +4805,7 @@ q6afecc: cc { }; };
- q6asm: apr-service@7 { + q6asm: service@7 { compatible = "qcom,q6asm"; reg = <APR_SVC_ASM>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; @@ -4818,7 +4818,7 @@ q6asmdai: dais { }; };
- q6adm: apr-service@8 { + q6adm: service@8 { compatible = "qcom,q6adm"; reg = <APR_SVC_ADM>; qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
DT schema expects APR services node names to be "service" and to have an unit address (as it has a "reg" property):
qcom/msm8996-xiaomi-gemini.dtb: apr: 'power-domains', 'q6adm', 'q6afe', 'q6asm', 'qcom,smd-channels' do not match any of the regexes: '^service@[1-9a-d]$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 1e6b70582866..abc17c905bfe 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -3389,12 +3389,12 @@ apr { #address-cells = <1>; #size-cells = <0>;
- q6core { + service@3 { reg = <APR_SVC_ADSP_CORE>; compatible = "qcom,q6core"; };
- q6afe: q6afe { + q6afe: service@4 { compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; q6afedai: dais { @@ -3408,7 +3408,7 @@ hdmi@1 { }; };
- q6asm: q6asm { + q6asm: service@7 { compatible = "qcom,q6asm"; reg = <APR_SVC_ASM>; q6asmdai: dais { @@ -3420,7 +3420,7 @@ q6asmdai: dais { }; };
- q6adm: q6adm { + q6adm: service@8 { compatible = "qcom,q6adm"; reg = <APR_SVC_ADM>; q6routing: routing {
DT schema expects DAI node names to be "dai":
qcom/sdm845-xiaomi-beryllium.dtb: dais: 'qi2s@22' does not match any of the regexes: '^dai@[0-9]+$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts | 2 +- arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts index 132417e2d11e..2110a5893149 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts @@ -651,7 +651,7 @@ led@5 {
/* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */ &q6afedai { - qi2s@22 { + dai@22 { reg = <QUATERNARY_MI2S_RX>; qcom,sd-lines = <0 1 2 3>; }; diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts index 0f470cf1ed1c..68e2a07a01dc 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts @@ -338,7 +338,7 @@ resin {
/* QUAT I2S Uses 1 I2S SD Line for audio on TAS2559/60 amplifiers */ &q6afedai { - qi2s@22 { + dai@22 { reg = <QUATERNARY_MI2S_RX>; qcom,sd-lines = <0>; }; diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts index afc17e4d403f..4f6f1ce7286c 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts @@ -544,8 +544,8 @@ resin { };
&q6afedai { - qi2s@22 { - reg = <22>; + dai@22 { + reg = <QUATERNARY_MI2S_RX>; qcom,sd-lines = <0>; }; };
DT schema expects DAI node names to be "dai":
qcom/msm8996-mtp.dtb: dais: 'hdmi@1' does not match any of the regexes: '^dai@[0-9]+$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index abc17c905bfe..b346ecccb94d 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -3402,7 +3402,7 @@ q6afedai: dais { #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <1>; - hdmi@1 { + dai@1 { reg = <1>; }; };
DT schema expects DAI node names to be "dai":
qcom/qrb5165-rb5.dtb: dais: 'qi2s@16', 'qi2s@20' do not match any of the regexes: '^dai@[0-9]+$', 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts index bf8077a1cf9a..d39ca3671477 100644 --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts @@ -867,7 +867,7 @@ &qupv3_id_2 { };
&q6afedai { - qi2s@16 { + dai@16 { reg = <PRIMARY_MI2S_RX>; qcom,sd-lines = <0 1 2 3>; }; @@ -875,7 +875,7 @@ qi2s@16 {
/* TERT I2S Uses 1 I2S SD Lines for audio on LT9611 HDMI Bridge */ &q6afedai { - qi2s@20 { + dai@20 { reg = <TERTIARY_MI2S_RX>; qcom,sd-lines = <0>; };
The node names should be generic according to Devicetree specification, so use "clock-controller" instead of "cc". The bindings so far did not define this name (as child of APR service).
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index 84b4b8e40e7f..6ee8b3b4082c 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -4799,7 +4799,7 @@ q6afedai: dais { #sound-dai-cells = <1>; };
- q6afecc: cc { + q6afecc: clock-controller { compatible = "qcom,q6afe-clocks"; #clock-cells = <2>; };
Convert Qualcomm Audio Stream Manager (Q6ASM) bindings to DT schema.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
---
Expected warning because the qcom,apr.yaml is being fixed in next commit:
Documentation/devicetree/bindings/sound/qcom,q6asm.example.dtb: apr: service@7: 'dais' does not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+' From schema: /home/krzk/dev/linux/linux/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml
Changes since v1: 1. New patch. --- .../devicetree/bindings/sound/qcom,q6asm.txt | 70 ----------- .../devicetree/bindings/sound/qcom,q6asm.yaml | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 70 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.yaml
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt b/Documentation/devicetree/bindings/sound/qcom,q6asm.txt deleted file mode 100644 index 0d0075125243..000000000000 --- a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt +++ /dev/null @@ -1,70 +0,0 @@ -Qualcomm Audio Stream Manager (Q6ASM) binding - -Q6ASM is one of the APR audio service on Q6DSP. -Please refer to qcom,apr.txt for details of the common apr service bindings -used by the apr service device. - -- but must contain the following property: - -- compatible: - Usage: required - Value type: <stringlist> - Definition: must be "qcom,q6asm-v<MAJOR-NUMBER>.<MINOR-NUMBER>". - Or "qcom,q6asm" where the version number can be queried - from DSP. - example "qcom,q6asm-v2.0" - -= ASM DAIs (Digital Audio Interface) -"dais" subnode of the ASM node represents dai specific configuration - -- compatible: - Usage: required - Value type: <stringlist> - Definition: must be "qcom,q6asm-dais". - -- #sound-dai-cells - Usage: required - Value type: <u32> - Definition: Must be 1 - -== ASM DAI is subnode of "dais" and represent a dai, it includes board specific -configuration of each dai. Must contain the following properties. - -- reg - Usage: required - Value type: <u32> - Definition: Must be dai id - -- direction: - Usage: Required for Compress offload dais - Value type: <u32> - Definition: Specifies the direction of the dai stream - Q6ASM_DAI_TX_RX (0) for both tx and rx - Q6ASM_DAI_TX (1) for only tx (Capture/Encode) - Q6ASM_DAI_RX (2) for only rx (Playback/Decode) - -- is-compress-dai: - Usage: Required for Compress offload dais - Value type: <boolean> - Definition: present for Compress offload dais - - -= EXAMPLE -#include <dt-bindings/sound/qcom,q6asm.h> - -apr-service@7 { - compatible = "qcom,q6asm"; - reg = <APR_SVC_ASM>; - q6asmdai: dais { - compatible = "qcom,q6asm-dais"; - #address-cells = <1>; - #size-cells = <0>; - #sound-dai-cells = <1>; - - dai@0 { - reg = <0>; - direction = <Q6ASM_DAI_RX>; - is-compress-dai; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml b/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml new file mode 100644 index 000000000000..505bd64a0717 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/qcom,q6asm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Audio Stream Manager (Q6ASM) + +maintainers: + - Krzysztof Kozlowski krzysztof.kozlowski@linaro.org + - Srinivas Kandagatla srinivas.kandagatla@linaro.org + +description: + Q6ASM is one of the APR audio services on Q6DSP. Each of its subnodes + represent a dai with board specific configuration. + +properties: + compatible: + enum: + - qcom,q6asm-dais + + iommus: + maxItems: 1 + + '#sound-dai-cells': + const: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +patternProperties: + '^dai@[0-9]+$': + type: object + description: + Q6ASM Digital Audio Interface + + properties: + reg: + maxItems: 1 + + direction: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2] + description: | + The direction of the dai stream:: + - Q6ASM_DAI_TX_RX (0) for both tx and rx + - Q6ASM_DAI_TX (1) for only tx (Capture/Encode) + - Q6ASM_DAI_RX (2) for only rx (Playback/Decode) + + is-compress-dai: + type: boolean + description: + Compress offload dai. + + dependencies: + is-compress-dai: ['direction'] + + required: + - reg + + additionalProperties: false + +required: + - compatible + - "#sound-dai-cells" + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/soc/qcom,apr.h> + #include <dt-bindings/sound/qcom,q6asm.h> + + apr { + compatible = "qcom,apr-v2"; + qcom,domain = <APR_DOMAIN_ADSP>; + #address-cells = <1>; + #size-cells = <0>; + + service@7 { + compatible = "qcom,q6asm"; + reg = <APR_SVC_ASM>; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd"; + + dais { + compatible = "qcom,q6asm-dais"; + iommus = <&apps_smmu 0x1821 0x0>; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + + dai@0 { + reg = <0>; + }; + + dai@1 { + reg = <1>; + }; + + dai@2 { + reg = <2>; + is-compress-dai; + direction = <1>; + }; + }; + }; + };
On Wed, Sep 07, 2022 at 12:15:51PM +0200, Krzysztof Kozlowski wrote:
Convert Qualcomm Audio Stream Manager (Q6ASM) bindings to DT schema.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Expected warning because the qcom,apr.yaml is being fixed in next commit:
Documentation/devicetree/bindings/sound/qcom,q6asm.example.dtb: apr: service@7: 'dais' does not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+' From schema: /home/krzk/dev/linux/linux/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml
Changes since v1:
- New patch.
.../devicetree/bindings/sound/qcom,q6asm.txt | 70 ----------- .../devicetree/bindings/sound/qcom,q6asm.yaml | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 70 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.yaml
Should be qcom,q6asm-dais.yaml or you need to add qcom,q6asm compatible?
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt b/Documentation/devicetree/bindings/sound/qcom,q6asm.txt deleted file mode 100644 index 0d0075125243..000000000000 --- a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt +++ /dev/null @@ -1,70 +0,0 @@ -Qualcomm Audio Stream Manager (Q6ASM) binding
-Q6ASM is one of the APR audio service on Q6DSP. -Please refer to qcom,apr.txt for details of the common apr service bindings -used by the apr service device.
-- but must contain the following property:
-- compatible:
- Usage: required
- Value type: <stringlist>
- Definition: must be "qcom,q6asm-v<MAJOR-NUMBER>.<MINOR-NUMBER>".
Or "qcom,q6asm" where the version number can be queried
from DSP.
example "qcom,q6asm-v2.0"
Where is this compatible handled now?
-= ASM DAIs (Digital Audio Interface) -"dais" subnode of the ASM node represents dai specific configuration
-- compatible:
- Usage: required
- Value type: <stringlist>
- Definition: must be "qcom,q6asm-dais".
-- #sound-dai-cells
- Usage: required
- Value type: <u32>
- Definition: Must be 1
-== ASM DAI is subnode of "dais" and represent a dai, it includes board specific -configuration of each dai. Must contain the following properties.
-- reg
- Usage: required
- Value type: <u32>
- Definition: Must be dai id
-- direction:
- Usage: Required for Compress offload dais
- Value type: <u32>
- Definition: Specifies the direction of the dai stream
Q6ASM_DAI_TX_RX (0) for both tx and rx
Q6ASM_DAI_TX (1) for only tx (Capture/Encode)
Q6ASM_DAI_RX (2) for only rx (Playback/Decode)
-- is-compress-dai:
- Usage: Required for Compress offload dais
- Value type: <boolean>
- Definition: present for Compress offload dais
-= EXAMPLE -#include <dt-bindings/sound/qcom,q6asm.h>
-apr-service@7 {
- compatible = "qcom,q6asm";
- reg = <APR_SVC_ASM>;
- q6asmdai: dais {
compatible = "qcom,q6asm-dais";
#address-cells = <1>;
#size-cells = <0>;
#sound-dai-cells = <1>;
dai@0 {
reg = <0>;
direction = <Q6ASM_DAI_RX>;
is-compress-dai;
};
- };
-}; diff --git a/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml b/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml new file mode 100644 index 000000000000..505bd64a0717 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/qcom,q6asm.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/qcom,q6asm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml#
+title: Qualcomm Audio Stream Manager (Q6ASM)
+maintainers:
- Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
- Srinivas Kandagatla srinivas.kandagatla@linaro.org
+description:
- Q6ASM is one of the APR audio services on Q6DSP. Each of its subnodes
- represent a dai with board specific configuration.
+properties:
- compatible:
- enum:
- qcom,q6asm-dais
- iommus:
- maxItems: 1
- '#sound-dai-cells':
- const: 1
- '#address-cells':
- const: 1
- '#size-cells':
- const: 0
+patternProperties:
- '^dai@[0-9]+$':
- type: object
- description:
Q6ASM Digital Audio Interface
- properties:
reg:
maxItems: 1
direction:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2]
description: |
The direction of the dai stream::
- Q6ASM_DAI_TX_RX (0) for both tx and rx
- Q6ASM_DAI_TX (1) for only tx (Capture/Encode)
- Q6ASM_DAI_RX (2) for only rx (Playback/Decode)
is-compress-dai:
type: boolean
description:
Compress offload dai.
- dependencies:
is-compress-dai: ['direction']
- required:
- reg
- additionalProperties: false
+required:
- compatible
- "#sound-dai-cells"
- "#address-cells"
- "#size-cells"
+additionalProperties: false
+examples:
- |
- #include <dt-bindings/soc/qcom,apr.h>
- #include <dt-bindings/sound/qcom,q6asm.h>
- apr {
compatible = "qcom,apr-v2";
qcom,domain = <APR_DOMAIN_ADSP>;
#address-cells = <1>;
#size-cells = <0>;
service@7 {
compatible = "qcom,q6asm";
reg = <APR_SVC_ASM>;
qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
dais {
compatible = "qcom,q6asm-dais";
iommus = <&apps_smmu 0x1821 0x0>;
#address-cells = <1>;
#size-cells = <0>;
#sound-dai-cells = <1>;
dai@0 {
reg = <0>;
};
dai@1 {
reg = <1>;
};
dai@2 {
reg = <2>;
is-compress-dai;
direction = <1>;
};
};
};
- };
-- 2.34.1
On 07/09/2022 19:57, Rob Herring wrote:
On Wed, Sep 07, 2022 at 12:15:51PM +0200, Krzysztof Kozlowski wrote:
Convert Qualcomm Audio Stream Manager (Q6ASM) bindings to DT schema.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Expected warning because the qcom,apr.yaml is being fixed in next commit:
Documentation/devicetree/bindings/sound/qcom,q6asm.example.dtb: apr: service@7: 'dais' does not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+' From schema: /home/krzk/dev/linux/linux/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml
Changes since v1:
- New patch.
.../devicetree/bindings/sound/qcom,q6asm.txt | 70 ----------- .../devicetree/bindings/sound/qcom,q6asm.yaml | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 70 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.yaml
Should be qcom,q6asm-dais.yaml or you need to add qcom,q6asm compatible?
Right, it should be -dais.
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt b/Documentation/devicetree/bindings/sound/qcom,q6asm.txt deleted file mode 100644 index 0d0075125243..000000000000 --- a/Documentation/devicetree/bindings/sound/qcom,q6asm.txt +++ /dev/null @@ -1,70 +0,0 @@ -Qualcomm Audio Stream Manager (Q6ASM) binding
-Q6ASM is one of the APR audio service on Q6DSP. -Please refer to qcom,apr.txt for details of the common apr service bindings -used by the apr service device.
-- but must contain the following property:
-- compatible:
- Usage: required
- Value type: <stringlist>
- Definition: must be "qcom,q6asm-v<MAJOR-NUMBER>.<MINOR-NUMBER>".
Or "qcom,q6asm" where the version number can be queried
from DSP.
example "qcom,q6asm-v2.0"
Where is this compatible handled now?
The "qcom,q6asm" is handled in: Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml
The "qcom,q6asm-v<MAJOR-NUMBER>.<MINOR-NUMBER>" is not handled because it seems it is not used anywhere. I did not find such usage also in downstream sources, so it seems version can be always auto-detected (I did not confirm it with datasheet, though).
I'll explain this in commit msg.
Best regards, Krzysztof
The APR bindings were not describing properly children nodes for DAIs. None of the DTSes use unit addresses for the children, so correct the nodes and reference their schema: clock-controller, dais and routing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Correct also sound/qcom,q6apm-dai.yaml (Rob) --- .../bindings/soc/qcom/qcom,apr.yaml | 68 ++++++++++++++++--- .../bindings/sound/qcom,q6apm-dai.yaml | 10 +-- .../sound/qcom,q6dsp-lpass-clocks.yaml | 16 ++--- .../sound/qcom,q6dsp-lpass-ports.yaml | 16 ++--- 4 files changed, 66 insertions(+), 44 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml index 028c5d105adb..5b9b9c86e61f 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml @@ -97,6 +97,25 @@ patternProperties: 3 = AMDB Service. 4 = Voice processing manager.
+ clock-controller: + $ref: /schemas/sound/qcom,q6dsp-lpass-clocks.yaml# + description: Qualcomm DSP LPASS clock controller + unevaluatedProperties: false + + dais: + type: object + oneOf: + - $ref: /schemas/sound/qcom,q6apm-dai.yaml# + - $ref: /schemas/sound/qcom,q6dsp-lpass-ports.yaml# + - $ref: /schemas/sound/qcom,q6asm.yaml# + unevaluatedProperties: false + description: Qualcomm DSP audio ports + + routing: + # TODO: Waiting for Documentation/devicetree/bindings/sound/qcom,q6adm.txt + type: object + description: Qualcomm DSP LPASS audio routing + qcom,protection-domain: $ref: /schemas/types.yaml#/definitions/string-array description: protection domain service name and path for apr service @@ -107,17 +126,44 @@ patternProperties: "tms/servreg", "msm/modem/wlan_pd". "tms/servreg", "msm/slpi/sensor_pd".
- '#address-cells': - const: 1 - - '#size-cells': - const: 0 - - patternProperties: - "^.*@[0-9a-f]+$": - type: object - description: - Service based devices like clock controllers or digital audio interfaces. + allOf: + - if: + properties: + compatible: + enum: + - qcom,q6afe + then: + properties: + dais: + properties: + compatible: + const: qcom,q6afe-dais + + - if: + properties: + compatible: + enum: + - qcom,q6apm + then: + properties: + dais: + properties: + compatible: + enum: + - qcom,q6apm-dais + - qcom,q6apm-lpass-dais + + - if: + properties: + compatible: + enum: + - qcom,q6asm + then: + properties: + dais: + properties: + compatible: + const: qcom,q6asm-dais
additionalProperties: false
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml index 5d972784321d..844d72b30969 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml @@ -16,16 +16,12 @@ properties: compatible: const: qcom,q6apm-dais
- reg: - maxItems: 1 - iommus: maxItems: 1
required: - compatible - iommus - - reg
additionalProperties: false
@@ -41,13 +37,9 @@ examples: compatible = "qcom,q6apm"; reg = <1>;
- #address-cells = <1>; - #size-cells = <0>; - - apm-dai@1 { + dais { compatible = "qcom,q6apm-dais"; iommus = <&apps_smmu 0x1801 0x0>; - reg = <1>; }; }; }; diff --git a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml index f83f00737a2f..604861d84ffa 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml @@ -18,9 +18,6 @@ properties: - qcom,q6afe-clocks - qcom,q6prm-lpass-clocks
- reg: - maxItems: 1 - '#clock-cells': const: 2 description: @@ -32,7 +29,6 @@ properties:
required: - compatible - - reg - "#clock-cells"
additionalProperties: false @@ -46,11 +42,9 @@ examples: #size-cells = <0>; apr-service@4 { reg = <APR_SVC_AFE>; - #address-cells = <1>; - #size-cells = <0>; - clock-controller@2 { + + clock-controller { compatible = "qcom,q6afe-clocks"; - reg = <2>; #clock-cells = <2>; }; }; @@ -66,11 +60,9 @@ examples: service@2 { reg = <GPR_PRM_MODULE_IID>; compatible = "qcom,q6prm"; - #address-cells = <1>; - #size-cells = <0>; - clock-controller@2 { + + clock-controller { compatible = "qcom,q6prm-lpass-clocks"; - reg = <2>; #clock-cells = <2>; }; }; diff --git a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml index dc7fba7b92d5..5e666d9fb388 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml @@ -18,9 +18,6 @@ properties: - qcom,q6afe-dais - qcom,q6apm-lpass-dais
- reg: - maxItems: 1 - '#sound-dai-cells': const: 1
@@ -145,7 +142,6 @@ patternProperties:
required: - compatible - - reg - "#sound-dai-cells" - "#address-cells" - "#size-cells" @@ -161,11 +157,9 @@ examples: #size-cells = <0>; apr-service@4 { reg = <APR_SVC_AFE>; - #address-cells = <1>; - #size-cells = <0>; - q6afedai@1 { + + dais { compatible = "qcom,q6afe-dais"; - reg = <1>; #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <1>; @@ -187,11 +181,9 @@ examples: service@1 { compatible = "qcom,q6apm"; reg = <GPR_APM_MODULE_IID>; - #address-cells = <1>; - #size-cells = <0>; - q6apmdai@1 { + + dais { compatible = "qcom,q6apm-lpass-dais"; - reg = <1>; #address-cells = <1>; #size-cells = <0>; #sound-dai-cells = <1>;
On Wed, 07 Sep 2022 12:15:52 +0200, Krzysztof Kozlowski wrote:
The APR bindings were not describing properly children nodes for DAIs. None of the DTSes use unit addresses for the children, so correct the nodes and reference their schema: clock-controller, dais and routing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
Changes since v1:
- Correct also sound/qcom,q6apm-dai.yaml (Rob)
.../bindings/soc/qcom/qcom,apr.yaml | 68 ++++++++++++++++--- .../bindings/sound/qcom,q6apm-dai.yaml | 10 +-- .../sound/qcom,q6dsp-lpass-clocks.yaml | 16 ++--- .../sound/qcom,q6dsp-lpass-ports.yaml | 16 ++--- 4 files changed, 66 insertions(+), 44 deletions(-)
Reviewed-by: Rob Herring robh@kernel.org
Cleanup the example DTS by adding APR and service compatibles, adding typical properties, using proper device node names for services and fixing indentation to 4-spaces.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Add few more properties. 2. Adjust indentation (better). --- .../sound/qcom,q6dsp-lpass-ports.yaml | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml index 5e666d9fb388..e53fc0960a14 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml @@ -153,24 +153,29 @@ examples: #include <dt-bindings/soc/qcom,apr.h> #include <dt-bindings/sound/qcom,q6afe.h> apr { + compatible = "qcom,apr-v2"; #address-cells = <1>; #size-cells = <0>; - apr-service@4 { + qcom,domain = <APR_DOMAIN_ADSP>; + + service@4 { + compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
dais { - compatible = "qcom,q6afe-dais"; - #address-cells = <1>; - #size-cells = <0>; - #sound-dai-cells = <1>; - - dai@22 { - reg = <QUATERNARY_MI2S_RX>; - qcom,sd-lines = <0 1 2 3>; - }; + compatible = "qcom,q6afe-dais"; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + + dai@22 { + reg = <QUATERNARY_MI2S_RX>; + qcom,sd-lines = <0 1 2 3>; + }; }; }; - }; + }; - | #include <dt-bindings/soc/qcom,gpr.h> gpr { @@ -178,20 +183,21 @@ examples: #address-cells = <1>; #size-cells = <0>; qcom,domain = <GPR_DOMAIN_ID_ADSP>; + service@1 { compatible = "qcom,q6apm"; reg = <GPR_APM_MODULE_IID>;
dais { - compatible = "qcom,q6apm-lpass-dais"; - #address-cells = <1>; - #size-cells = <0>; - #sound-dai-cells = <1>; - - dai@22 { - reg = <QUATERNARY_MI2S_RX>; - qcom,sd-lines = <0 1 2 3>; - }; + compatible = "qcom,q6apm-lpass-dais"; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + + dai@22 { + reg = <QUATERNARY_MI2S_RX>; + qcom,sd-lines = <0 1 2 3>; + }; }; }; - }; + };
Cleanup the example DTS by adding APR and service compatibles, adding typical properties, using proper device node names for services and fixing indentation to 4-spaces.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Add few more properties. 2. Adjust indentation (better). --- .../sound/qcom,q6dsp-lpass-clocks.yaml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml index 604861d84ffa..fd567d20417d 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml @@ -38,17 +38,22 @@ examples: #include <dt-bindings/soc/qcom,apr.h> #include <dt-bindings/sound/qcom,q6afe.h> apr { + compatible = "qcom,apr-v2"; + qcom,domain = <APR_DOMAIN_ADSP>; #address-cells = <1>; #size-cells = <0>; - apr-service@4 { + + service@4 { + compatible = "qcom,q6afe"; reg = <APR_SVC_AFE>; + qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
clock-controller { - compatible = "qcom,q6afe-clocks"; - #clock-cells = <2>; + compatible = "qcom,q6afe-clocks"; + #clock-cells = <2>; }; }; - }; + };
- | #include <dt-bindings/soc/qcom,gpr.h> @@ -57,13 +62,14 @@ examples: qcom,domain = <GPR_DOMAIN_ID_ADSP>; #address-cells = <1>; #size-cells = <0>; + service@2 { reg = <GPR_PRM_MODULE_IID>; compatible = "qcom,q6prm";
clock-controller { - compatible = "qcom,q6prm-lpass-clocks"; - #clock-cells = <2>; + compatible = "qcom,q6prm-lpass-clocks"; + #clock-cells = <2>; }; }; - }; + };
Cleanup the example DTS by fixing indentation to 4-spaces and adding blank lines for readability.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
---
Changes since v1: 1. New patch --- .../devicetree/bindings/sound/qcom,q6apm-dai.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml index 844d72b30969..24f7bf2bfd95 100644 --- a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml @@ -33,13 +33,14 @@ examples: #address-cells = <1>; #size-cells = <0>; qcom,domain = <GPR_DOMAIN_ID_ADSP>; + service@1 { - compatible = "qcom,q6apm"; - reg = <1>; + compatible = "qcom,q6apm"; + reg = <1>;
- dais { - compatible = "qcom,q6apm-dais"; - iommus = <&apps_smmu 0x1801 0x0>; - }; + dais { + compatible = "qcom,q6apm-dais"; + iommus = <&apps_smmu 0x1801 0x0>; + }; }; };
The APR bindings were not describing all properties already used in DTS: 1. Add qcom,glink-channels, qcom,smd-channels and qcom,intents (widely used). 2. Add power-domains for MSM8996.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org --- .../bindings/soc/qcom/qcom,apr.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+)
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml index 5b9b9c86e61f..02a261ace221 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml @@ -20,6 +20,9 @@ properties: - qcom,apr-v2 - qcom,gpr
+ power-domains: + maxItems: 1 + qcom,apr-domain: $ref: /schemas/types.yaml#/definitions/uint32 enum: [1, 2, 3, 4, 5, 6, 7] @@ -52,6 +55,26 @@ properties: 2 = Audio DSP Domain 3 = Application Processor Domain
+ qcom,glink-channels: + $ref: /schemas/types.yaml#/definitions/string-array + description: Channel name used for the communication + items: + - const: apr_audio_svc + + qcom,intents: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + List of (size, amount) pairs describing what intents should be + preallocated for this virtual channel. This can be used to tweak the + default intents available for the channel to meet expectations of the + remote. + + qcom,smd-channels: + $ref: /schemas/types.yaml#/definitions/string-array + description: Channel name used for the communication + items: + - const: apr_audio_svc + '#address-cells': const: 1
@@ -171,6 +194,30 @@ required: - compatible - qcom,domain
+allOf: + - if: + properties: + compatible: + enum: + - qcom,gpr + then: + properties: + power-domains: false + + - if: + required: + - qcom,glink-channels + then: + properties: + qcom,smd-channels: false + + - if: + required: + - qcom,smd-channels + then: + properties: + qcom,glink-channels: false + additionalProperties: false
examples:
participants (2)
-
Krzysztof Kozlowski
-
Rob Herring