From patchwork Thu Sep 28 19:41:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 146273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3557455vqu; Thu, 28 Sep 2023 12:47:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeIMZco1gdztmCBJ25B2/rzrfZbFNPR7yV9D8T94pFKeDnqTqA01Su7WbS4G0wweteUn8H X-Received: by 2002:a05:6a00:1acd:b0:68f:b8ca:b11 with SMTP id f13-20020a056a001acd00b0068fb8ca0b11mr2337337pfv.11.1695930438472; Thu, 28 Sep 2023 12:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695930438; cv=none; d=google.com; s=arc-20160816; b=jGolTceYDrIaTRxn4O/TF0UgucrC8/mIOVjZFhlChcqtp2neeV8m4PwA1cnOxWFWqb 5dXidgPR4kb4xup2Xcg1IYmcbZ3sEZGB3vOsqA2gX1rSqTeBMWg3wa/ongjFWfORXusT vbdb1V3bZNOUNxcBWYLP92YBjq86QrdAkC+ufD4bmnZcOZdMJ7Y2rMUXgu16hvHHZ5xo zLIvCugV7AP7vpgTl0r1HEIvIC0fTXuOCxua/1C5j8+q+aCa5F+OljKWjYkcd9IkC07l np7kBGA9YcYtQbwr+YVaMNNGfNq/xeEOGB4O5U1YvX9ONkq41lYHVfx9XjY5qGcnZWU2 RJQw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ogriG1rO96HszEHDgBIMGIcSwmq8dND8Cb80UlZScAs=; fh=Ut61+iiJ2I9AcLI9zj4Zt9c5yl86lj6y39ZEcb9GusQ=; b=jpxUUkBzmGKUJAZ0TFAYZYfmVLE8RRpiFXoHLoIr+Q7BahJhh5sG2mNYd2uacSvAsj G43jQpNvb56+zGEcZDUx3bj3hWMqVionscK7MmOhoKaihSTa60znEsCY+FKHpzHK5EQ7 b8dI4YIgx9t+jJlfJ/4SqweCIzvSWj5lwYrfI8mfuIfRKsSlhbmLMarEINSZb1C0YnyV GGPZZKVTBGe6SlwHTy4AM6tFXK8JbeB0/1MkXQD9EgQRMa/H+TTd6r48NxyWUjBcdb3P bsU6oEMMYKzvTdVrCpkCR2xRO34Vim9HWz7KkzY1roZKKvOT9hkEyUaZQPJ9d7hMTXNR 2S1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GS04NkNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id t14-20020a056a00138e00b0069025078128si21540869pfg.240.2023.09.28.12.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GS04NkNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A4ADF80E6089; Thu, 28 Sep 2023 12:42:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbjI1Tlj (ORCPT + 21 others); Thu, 28 Sep 2023 15:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjI1Tlh (ORCPT ); Thu, 28 Sep 2023 15:41:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A68761A1 for ; Thu, 28 Sep 2023 12:41:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DE9AC433C7; Thu, 28 Sep 2023 19:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695930095; bh=+f/LROZgFTPzcFy5/y8VtrXLG8LIcts2Ik8CzlQ3RsM=; h=From:To:Cc:Subject:Date:From; b=GS04NkNVwjZ5aAvctflC98Uo4+fIaRixp/S7KhAw1pj6pKgWEnR6iDPnRHcMrbxWk GDRgbrpFlHSnG52T5EMZagd0oohD+/xcuCf4IvfL4xylZ6RTNK1drD97IFlFBhvAYe rMlWf9Os5/p+g+hY6SnSR+EjfGnV8WR42DL5Bu6SarRJs1I73kT6nkyt2N6xugHotX DZjlqz/z04UMNuNoCQsaclN3jzUEiyc2uE39Ahqx7ekUBFq46WzlKbD3tNmilxO26P x6jbj8r7HxHo4ukR3juucsPsAq1CpDdnM/+vHzKqpvc1t4NAi6L8MkFv3DsG1aPtw7 SevonLnDNfLVg== Received: (nullmailer pid 1147011 invoked by uid 1000); Thu, 28 Sep 2023 19:41:33 -0000 From: Rob Herring To: Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Conor Dooley , Kuninori Morimoto Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: dt-bindings: Simplify referencing dai-params.yaml Date: Thu, 28 Sep 2023 14:41:16 -0500 Message-Id: <20230928194126.1146622-1-robh@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 12:42:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778311955198422862 X-GMAIL-MSGID: 1778311955198422862 There's generally no need to use definitions to reference from individual properties. All the property names are the same, and all the defined properties are used by all the users. Signed-off-by: Rob Herring Acked-by: Kuninori Morimoto --- .../bindings/sound/audio-graph-port.yaml | 20 ++++++------------- .../bindings/sound/audio-graph.yaml | 9 +++------ .../devicetree/bindings/sound/dai-params.yaml | 11 ++++------ 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index fa9f9a853365..60b5e3fd1115 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -13,19 +13,17 @@ select: false definitions: port-base: - $ref: /schemas/graph.yaml#/$defs/port-base + allOf: + - $ref: /schemas/graph.yaml#/$defs/port-base + - $ref: /schemas/sound/dai-params.yaml# properties: - convert-rate: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-rate - convert-channels: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-channels - convert-sample-format: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-format mclk-fs: $ref: simple-card.yaml#/definitions/mclk-fs endpoint-base: - $ref: /schemas/graph.yaml#/$defs/endpoint-base + allOf: + - $ref: /schemas/graph.yaml#/$defs/endpoint-base + - $ref: /schemas/sound/dai-params.yaml# properties: mclk-fs: $ref: simple-card.yaml#/definitions/mclk-fs @@ -68,12 +66,6 @@ definitions: - pdm - msb - lsb - convert-rate: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-rate - convert-channels: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-channels - convert-sample-format: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-format dai-tdm-slot-num: description: Number of slots in use. diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml index ed31e04ff6a6..71f52f7e55f6 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph.yaml @@ -9,6 +9,9 @@ title: Audio Graph maintainers: - Kuninori Morimoto +allOf: + - $ref: /schemas/sound/dai-params.yaml# + properties: dais: $ref: /schemas/types.yaml#/definitions/phandle-array @@ -30,12 +33,6 @@ properties: widget ("Microphone", "Line", "Headphone", "Speaker"), the second being the machine specific name for the widget. $ref: /schemas/types.yaml#/definitions/non-unique-string-array - convert-rate: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-rate - convert-channels: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-channels - convert-sample-format: - $ref: /schemas/sound/dai-params.yaml#/$defs/dai-sample-format pa-gpios: maxItems: 1 diff --git a/Documentation/devicetree/bindings/sound/dai-params.yaml b/Documentation/devicetree/bindings/sound/dai-params.yaml index f5fb71f9b603..cd8508175564 100644 --- a/Documentation/devicetree/bindings/sound/dai-params.yaml +++ b/Documentation/devicetree/bindings/sound/dai-params.yaml @@ -11,15 +11,14 @@ maintainers: select: false -$defs: - - dai-channels: +properties: + convert-channels: description: Number of audio channels used by DAI $ref: /schemas/types.yaml#/definitions/uint32 minimum: 1 maximum: 32 - dai-sample-format: + convert-sample-format: description: Audio sample format used by DAI $ref: /schemas/types.yaml#/definitions/string enum: @@ -29,12 +28,10 @@ $defs: - s24_3le - s32_le - dai-sample-rate: + convert-rate: description: Audio sample rate used by DAI $ref: /schemas/types.yaml#/definitions/uint32 minimum: 8000 maximum: 192000 -properties: {} - additionalProperties: true