From patchwork Tue Nov 17 01:33:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 324550 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp3792036ils; Mon, 16 Nov 2020 17:35:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz7+PNRP5jcg6g8PrC01txsvahmUwGduW8yRwXG7hikibN7J2VwzLoBPyw96DGnFzrQD63 X-Received: by 2002:a17:906:7698:: with SMTP id o24mr16564180ejm.447.1605576925072; Mon, 16 Nov 2020 17:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605576925; cv=none; d=google.com; s=arc-20160816; b=FF5GEKXVLVT7KMy5/+6EQIO+TjdgMoudt/ChLhpumiqfvLfc5Sb7iz6ptP5okiB3qb WhfVTqpOSutwqGIdNiFOACUuYr8Ck31iB94oc5c3RRCiQjKvbNxJ6E4kGyxS+PksYaLN 24ZwQjYOHrwNuzS1I9KCQCdjHjMuAWJaZwc/T8Dre/D38rFxIwoHwopswF0nY8wFgm07 ReIabUKxcRe6q+q3P8Wcwrpq3apDbvBoFgqvYh6UYKEoXBywHCQa+Yv0Q4BPvAtnBH2e l62pIl6/xoNXmB5CSu5HYmTYIwmhQ60dRnwk8FZhTLoiO0/UONIkbQBgHEeLWtodbgps hNDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qK36A5rVThIRP81jEbeCpq/j9+HO/HBCjgD8p63pIAY=; b=N3zN7lA7HRWrCJIZnXVLNINYvPzkv0fdHN+r6PY6D6LEW4nySRrA1L6uW38tlsogHX M51046Qsm1tBKfJKlmyoLcbl5mWuXxiUYeiQPXNfXva67yBtbkLaOUxjwazTq1AiwQFi 18T7TOqSr81llzA1SMbEzsx3bi43eXezkxGmg9yWfNJKkMHp9Ux6GTjyWE6TLkdYcYH4 ci0M/J1LugPrWijAEaHRLu7ZUlzvFOAzwlKRAt8EsOEVrfvPxE/xGQiKat+9dQqqgRX9 h/ii9c12oo5FHS7DiEOkaS3FKNxSgtWb/prr6J997gSsk9GChiCWyWOwjVXwtVPgAuvM bp3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si13139170ejq.401.2020.11.16.17.35.24; Mon, 16 Nov 2020 17:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbgKQBdz (ORCPT + 6 others); Mon, 16 Nov 2020 20:33:55 -0500 Received: from mail-oo1-f54.google.com ([209.85.161.54]:34192 "EHLO mail-oo1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgKQBdy (ORCPT ); Mon, 16 Nov 2020 20:33:54 -0500 Received: by mail-oo1-f54.google.com with SMTP id q28so4384249oof.1 for ; Mon, 16 Nov 2020 17:33:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qK36A5rVThIRP81jEbeCpq/j9+HO/HBCjgD8p63pIAY=; b=aVDiJRoHDjcVNWqkzZaMosqQNpokVA3MvyozHJLhIjOTk9vU3PiUtbK2dvPNdmbrZ1 exFxQLlSfYITAcbge8Hzy3yJuRQoIAGzu10wl2I8hADd6PzqdPfb66TvJyA3zPNWAlzz RwR8toJ6fOlUMnXuBf7oBDpSBzd98ROdREn0tZsetok6k2fpUElQRpH6n0Z+PiIa2NQX sVlSLhzpfJf94g4GwqWkBDNjmOZrm58/ZrLk61zsbZi0F4qnlIAVwS90THky2R7qN13n hbBLk9dQvXtdtNfa161DiRVg6Tin56rk3HHFVrtaXjczckmx+ykBod8G/uGiLCgheagi eWJA== X-Gm-Message-State: AOAM533RkgLR9kK+dY1mBSU3xYUKIYLPrIaly3KigkzzQdjbstQR/930 hlX10T8CrrxX0DxsBR6NgfStTG3iqg== X-Received: by 2002:a4a:e09a:: with SMTP id w26mr1528078oos.18.1605576831640; Mon, 16 Nov 2020 17:33:51 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j9sm3861325oij.44.2020.11.16.17.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 17:33:51 -0800 (PST) From: Rob Herring To: Mark Brown Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Liam Girdwood , Kuninori Morimoto , Lubomir Rintel , Sameer Pujar Subject: [PATCH 1/4] ASoC: audio-graph-card: Refactor schema Date: Mon, 16 Nov 2020 19:33:46 -0600 Message-Id: <20201117013349.2458416-2-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201117013349.2458416-1-robh@kernel.org> References: <20201117013349.2458416-1-robh@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Sameer Pujar There can be customized sound cards which are based on generic audio graph. In such cases most of the stuff is reused from generic audio graph. To facilitate this, refactor audio graph schema into multiple files and the base schema can be reused for specific sound cards. The graph card nodes and port nodes are separate entities, so they should be separate schemas. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto [robh: Split out port schema. Add graph.yaml in subsequent commit] Signed-off-by: Rob Herring --- .../bindings/sound/audio-graph-card.yaml | 106 +----------------- .../bindings/sound/audio-graph-port.yaml | 86 ++++++++++++++ .../bindings/sound/audio-graph.yaml | 45 ++++++++ .../bindings/sound/renesas,rsnd.yaml | 12 +- 4 files changed, 141 insertions(+), 108 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-port.yaml create mode 100644 Documentation/devicetree/bindings/sound/audio-graph.yaml -- 2.25.1 Acked-by: Sameer Pujar diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml index 2329aeb91db7..109e55f9e597 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-card.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-card.yaml @@ -4,120 +4,24 @@ $id: http://devicetree.org/schemas/sound/audio-graph-card.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Audio Graph Card Driver Device Tree Bindings +title: Audio Graph Card Device Tree Bindings maintainers: - Kuninori Morimoto +allOf: + - $ref: /schemas/sound/audio-graph.yaml# + properties: compatible: enum: - audio-graph-card - audio-graph-scu-card - dais: - $ref: /schemas/types.yaml#/definitions/phandle-array - label: - maxItems: 1 - prefix: - description: "device name prefix" - $ref: /schemas/types.yaml#/definitions/string - routing: - description: | - A list of the connections between audio components. - Each entry is a pair of strings, the first being the - connection's sink, the second being the connection's source. - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - widgets: - description: User specified audio sound widgets. - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 - convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 - pa-gpios: - maxItems: 1 - hp-det-gpio: - maxItems: 1 - mic-det-gpio: - maxItems: 1 - - port: - description: single OF-Graph subnode - type: object - properties: - reg: - maxItems: 1 - prefix: - description: "device name prefix" - $ref: /schemas/types.yaml#/definitions/string - convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 - convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 - patternProperties: - "^endpoint(@[0-9a-f]+)?": - type: object - properties: - remote-endpoint: - maxItems: 1 - mclk-fs: - description: | - Multiplication factor between stream rate and codec mclk. - When defined, mclk-fs property defined in dai-link sub nodes are ignored. - $ref: /schemas/types.yaml#/definitions/uint32 - frame-inversion: - description: dai-link uses frame clock inversion - $ref: /schemas/types.yaml#/definitions/flag - bitclock-inversion: - description: dai-link uses bit clock inversion - $ref: /schemas/types.yaml#/definitions/flag - frame-master: - description: Indicates dai-link frame master. - $ref: /schemas/types.yaml#/definitions/phandle-array - maxItems: 1 - bitclock-master: - description: Indicates dai-link bit clock master - $ref: /schemas/types.yaml#/definitions/phandle-array - maxItems: 1 - dai-format: - description: audio format. - items: - enum: - - i2s - - right_j - - left_j - - dsp_a - - dsp_b - - ac97 - - pdm - - msb - - lsb - convert-rate: - description: CPU to Codec rate convert. - $ref: /schemas/types.yaml#/definitions/uint32 - convert-channels: - description: CPU to Codec rate channels. - $ref: /schemas/types.yaml#/definitions/uint32 - required: - - remote-endpoint - - ports: - description: multi OF-Graph subnode - type: object - patternProperties: - "^port(@[0-9a-f]+)?": - $ref: "#/properties/port" - required: - compatible - - dais -additionalProperties: false +unevaluatedProperties: false examples: - | diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml new file mode 100644 index 000000000000..9db19d4edc6a --- /dev/null +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/audio-graph-port.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Audio Graph Card 'port' Node Bindings + +maintainers: + - Kuninori Morimoto + +select: false + +properties: + port: + description: single OF-Graph subnode + type: object + properties: + reg: + maxItems: 1 + prefix: + description: "device name prefix" + $ref: /schemas/types.yaml#/definitions/string + convert-rate: + description: CPU to Codec rate convert. + $ref: /schemas/types.yaml#/definitions/uint32 + convert-channels: + description: CPU to Codec rate channels. + $ref: /schemas/types.yaml#/definitions/uint32 + patternProperties: + "^endpoint(@[0-9a-f]+)?": + type: object + properties: + remote-endpoint: + maxItems: 1 + mclk-fs: + description: | + Multiplication factor between stream rate and codec mclk. + When defined, mclk-fs property defined in dai-link sub nodes are + ignored. + $ref: /schemas/types.yaml#/definitions/uint32 + frame-inversion: + description: dai-link uses frame clock inversion + $ref: /schemas/types.yaml#/definitions/flag + bitclock-inversion: + description: dai-link uses bit clock inversion + $ref: /schemas/types.yaml#/definitions/flag + frame-master: + description: Indicates dai-link frame master. + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + bitclock-master: + description: Indicates dai-link bit clock master + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + dai-format: + description: audio format. + items: + enum: + - i2s + - right_j + - left_j + - dsp_a + - dsp_b + - ac97 + - pdm + - msb + - lsb + convert-rate: + description: CPU to Codec rate convert. + $ref: /schemas/types.yaml#/definitions/uint32 + convert-channels: + description: CPU to Codec rate channels. + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - remote-endpoint + + ports: + description: multi OF-Graph subnode + type: object + patternProperties: + "^port(@[0-9a-f]+)?": + $ref: "#/properties/port" + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml new file mode 100644 index 000000000000..4b46794e5153 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/audio-graph.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Audio Graph Device Tree Bindings + +maintainers: + - Kuninori Morimoto + +properties: + dais: + $ref: /schemas/types.yaml#/definitions/phandle-array + label: + maxItems: 1 + prefix: + description: "device name prefix" + $ref: /schemas/types.yaml#/definitions/string + routing: + description: | + A list of the connections between audio components. + Each entry is a pair of strings, the first being the + connection's sink, the second being the connection's source. + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + widgets: + description: User specified audio sound widgets. + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + convert-rate: + description: CPU to Codec rate convert. + $ref: /schemas/types.yaml#/definitions/uint32 + convert-channels: + description: CPU to Codec rate channels. + $ref: /schemas/types.yaml#/definitions/uint32 + pa-gpios: + maxItems: 1 + hp-det-gpio: + maxItems: 1 + mic-det-gpio: + maxItems: 1 + +required: + - dais + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index 51f4dcaa970d..cbfd5914b432 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -9,6 +9,10 @@ title: Renesas R-Car Sound Driver Device Tree Bindings maintainers: - Kuninori Morimoto +allOf: + - $ref: audio-graph.yaml# + - $ref: audio-graph-port.yaml# + properties: compatible: @@ -111,13 +115,7 @@ properties: - pattern: '^dvc\.[0-1]$' - pattern: '^clk_(a|b|c|i)$' - port: - description: OF-Graph subnode - $ref: "audio-graph-card.yaml#/properties/port" - - ports: - description: multi OF-Graph subnode - $ref: "audio-graph-card.yaml#/properties/ports" + port: true # use patternProperties to avoid naming "xxx,yyy" issue patternProperties: