Unverified Commit cecf8179 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: dt-bindings: Rework Qualcomm APR/GPR Sound nodes for SM8450

Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>:

Adding sound support for Qualcomm SM8450 SoC (and later for SC8280XP) brought
some changes to APR/GPR services bindings.  These bindings are part of
qcom,apr.yaml:

  apr-or-gpr-device-node <- qcom,apr.yaml
    apr-gpr-service@[0-9] <- qcom,apr.yaml
      service-specific-components <- /schemas/sound/qcom,q6*.yaml

The schema for services (apr-gpr-service@[0-9]) was not complete and is still
quite not specific.  It allows several incorrect combinations, like adding a
clock-controller to a APM device.  Restricting it would complicate the schema
even more.  Bringing new support for sound on Qualcomm SM8450 and SC8280XP SoC
would grow it as well.

Refactor the bindings before extending them for Qualcomm SM8450 SoC.
parents 2d68148f b386acc0
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/soc/qcom/qcom,apr-services.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm APR/GPR services shared parts

maintainers:
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

description:
  Common parts of a static service in Qualcomm APR/GPR (Asynchronous/Generic
  Packet Router).

properties:
  reg:
    minimum: 1
    maximum: 13
    description: |
      APR Service ID
        3 = DSP Core Service
        4 = Audio  Front End Service.
        5 = Voice Stream Manager Service.
        6 = Voice processing manager.
        7 = Audio Stream Manager Service.
        8 = Audio Device Manager Service.
        9 = Multimode voice manager.
        10 = Core voice stream.
        11 = Core voice processor.
        12 = Ultrasound stream manager.
        13 = Listen stream manager.
      GPR Service ID
        1 = Audio Process Manager Service
        2 = Proxy Resource Manager Service.
        3 = AMDB Service.
        4 = Voice processing manager.

  qcom,protection-domain:
    $ref: /schemas/types.yaml#/definitions/string-array
    description: |
      Protection domain service name and path for APR service
      possible values are::
      "avs/audio", "msm/adsp/audio_pd".
      "kernel/elf_loader", "msm/modem/wlan_pd".
      "tms/servreg", "msm/adsp/audio_pd".
      "tms/servreg", "msm/modem/wlan_pd".
      "tms/servreg", "msm/slpi/sensor_pd".

required:
  - reg
  - qcom,protection-domain

additionalProperties: true
+51 −119
Original line number Diff line number Diff line
@@ -58,8 +58,7 @@ properties:
  qcom,glink-channels:
    $ref: /schemas/types.yaml#/definitions/string-array
    description: Channel name used for the communication
    items:
      - const: apr_audio_svc
    maxItems: 1

  qcom,intents:
    $ref: /schemas/types.yaml#/definitions/uint32-array
@@ -81,12 +80,13 @@ properties:
  '#size-cells':
    const: 0

#APR/GPR Services
patternProperties:
  "^service@[1-9a-d]$":
    type: object
    $ref: /schemas/soc/qcom/qcom,apr-services.yaml
    additionalProperties: true
    description:
      APR/GPR node's client devices use subnodes for desired static port services.
      APR/GPR static port services.

    properties:
      compatible:
@@ -98,99 +98,6 @@ patternProperties:
          - qcom,q6apm
          - qcom,q6prm

      reg:
        minimum: 1
        maximum: 13
        description:
          APR Service ID
            3 = DSP Core Service
            4 = Audio  Front End Service.
            5 = Voice Stream Manager Service.
            6 = Voice processing manager.
            7 = Audio Stream Manager Service.
            8 = Audio Device Manager Service.
            9 = Multimode voice manager.
            10 = Core voice stream.
            11 = Core voice processor.
            12 = Ultrasound stream manager.
            13 = Listen stream manager.
          GPR Service ID
            1 = Audio Process Manager Service
            2 = Proxy Resource Manager Service.
            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-dais.yaml#
        unevaluatedProperties: false
        description: Qualcomm DSP audio ports

      routing:
        type: object
        $ref: /schemas/sound/qcom,q6adm-routing.yaml#
        unevaluatedProperties: false
        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
          possible values are
          "avs/audio", "msm/adsp/audio_pd".
          "kernel/elf_loader", "msm/modem/wlan_pd".
          "tms/servreg", "msm/adsp/audio_pd".
          "tms/servreg", "msm/modem/wlan_pd".
          "tms/servreg", "msm/slpi/sensor_pd".

    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

required:
  - compatible
  - qcom,domain
@@ -203,7 +110,15 @@ allOf:
            - qcom,gpr
    then:
      properties:
        qcom,glink-channels:
          items:
            - const: adsp_apps
        power-domains: false
    else:
      properties:
        qcom,glink-channels:
          items:
            - const: apr_audio_svc

  - if:
      required:
@@ -227,6 +142,8 @@ examples:
    apr {
        compatible = "qcom,apr-v2";
        qcom,domain = <APR_DOMAIN_ADSP>;
        qcom,glink-channels = "apr_audio_svc";
        qcom,intents = <512 20>;
        #address-cells = <1>;
        #size-cells = <0>;

@@ -236,22 +153,24 @@ examples:
            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
        };

        q6afe: service@4 {
        service@4 {
            compatible = "qcom,q6afe";
            reg = <APR_SVC_AFE>;
            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
        };

        q6asm: service@7 {
          compatible = "qcom,q6asm";
          reg = <APR_SVC_ASM>;
          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
            clock-controller {
                compatible = "qcom,q6afe-clocks";
                #clock-cells = <2>;
            };

        q6adm: service@8 {
          compatible = "qcom,q6adm";
          reg = <APR_SVC_ADM>;
          qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
            dais {
                compatible = "qcom,q6afe-dais";
                #address-cells = <1>;
                #size-cells = <0>;
                #sound-dai-cells = <1>;
                /* ... */
            };
            /* ... */
        };
    };

@@ -260,12 +179,25 @@ examples:
    gpr {
        compatible = "qcom,gpr";
        qcom,domain = <GPR_DOMAIN_ID_ADSP>;
        qcom,glink-channels = "adsp_apps";
        qcom,intents = <512 20>;
        #address-cells = <1>;
        #size-cells = <0>;

        service@1 {
            compatible = "qcom,q6apm";
            reg = <GPR_APM_MODULE_IID>;
            #sound-dai-cells = <0>;
            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";

            dais {
                compatible = "qcom,q6apm-dais";
                iommus = <&apps_smmu 0x1801 0x0>;
            };

            bedais {
                compatible = "qcom,q6apm-lpass-dais";
                #sound-dai-cells = <1>;
            };
        };
    };
+3 −19
Original line number Diff line number Diff line
@@ -30,23 +30,7 @@ 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@8 {
            compatible = "qcom,q6adm";
            reg = <APR_SVC_ADM>;
            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";

    routing {
        compatible = "qcom,q6adm-routing";
        #sound-dai-cells = <0>;
    };
        };
    };
+51 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,q6adm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Audio Device Manager (Q6ADM)

maintainers:
  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

allOf:
  - $ref: /schemas/soc/qcom/qcom,apr-services.yaml#

properties:
  compatible:
    enum:
      - qcom,q6adm

  routing:
    type: object
    $ref: /schemas/sound/qcom,q6adm-routing.yaml#
    unevaluatedProperties: false
    description: Qualcomm DSP LPASS audio routing

required:
  - compatible
  - routing

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/soc/qcom,apr.h>

    apr {
        #address-cells = <1>;
        #size-cells = <0>;

        service@8 {
            compatible = "qcom,q6adm";
            reg = <APR_SVC_ADM>;
            qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";

            routing {
                compatible = "qcom,q6adm-routing";
                #sound-dai-cells = <0>;
            };
        };
    };
+68 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,q6afe.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Audio FrontEnd (Q6AFE)

maintainers:
  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

allOf:
  - $ref: /schemas/soc/qcom/qcom,apr-services.yaml#

properties:
  compatible:
    enum:
      - qcom,q6afe

  clock-controller:
    $ref: /schemas/sound/qcom,q6dsp-lpass-clocks.yaml#
    unevaluatedProperties: false
    description: Qualcomm DSP LPASS clock controller

  dais:
    type: object
    $ref: /schemas/sound/qcom,q6dsp-lpass-ports.yaml#
    unevaluatedProperties: false
    description: Qualcomm DSP audio ports

required:
  - compatible
  - dais

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/soc/qcom,apr.h>
    #include <dt-bindings/sound/qcom,q6afe.h>
    apr {
        #address-cells = <1>;
        #size-cells = <0>;

        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>;
            };

            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>;
                };
            };
        };
    };
Loading