Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4548920pxu; Tue, 20 Oct 2020 22:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF6A1E+92vJNHYNqfC37iXKvkaAF0OcHEJAHbgQvTar/mHuH50aR0KitBkQ+LcUK10vazm X-Received: by 2002:aa7:c491:: with SMTP id m17mr1217271edq.299.1603256845982; Tue, 20 Oct 2020 22:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603256845; cv=none; d=google.com; s=arc-20160816; b=YY8L80j+XW2zPcKuzc6lqxznskRPyYadDcFbRc8WqrvkYELrrgX1Ua/wl/+UQ6a2Bv ws1pVKGUqw5hEHSMoumKWH5ZKIIo6LfdjH85loDaTubK2gN+T8RnUtoGwGiaK4+7vrxR 5AcGA7herUIokfCGVkonNGxXaObq5aeA0vBvM9PrJp9aWdm5rCgze2L1SGTkEQcSKivi 6jlMk+GfUl+G/XfmXmPlpbnmc/CoJZ6lsTFQpnLG8qWcH7edskeuvDSM4Yl0pAMigySN sT3yjhgN+vMi/Ge/QiwnlEIAePV4VPYkGVghZQu3BpcO4FnyPTDSGbHVkclteg6dfuXi Kvsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H6+tI37I/sJKbl0n1QmA4zMB0kpO8bDSBP+OEXRlei0=; b=Qv8qLi9ksg5csOU9TqN3Uk4ApgUPW+06QlzAMoCkp3Mx7pgoNpErpLM/Slp0vusae0 yMNo8sbtStuTx2AhuDK955Bu4lLq1ofDXcFHGHSSqQfpZb1ETXjiQm0F06CmUCil3I+D fp20flZE774wnRoSkwCh7vL35zDFNMDK0P3uE2gj4AH5+KGkA/WujZG1fyhJhC6z8KrC x4c01R6AbbSV5lZ1xLP492o6fmeYrun5MsUUKtN3XPSgwpMJ3Wf8S2a3LixBFtNnnc6f QcGz52tqEMn8LmNKv1Y05z1RsWMMNNdasPipuTkUEU/0YsnoskbLt98Lg2HQHbdrq77e wz2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oMLMoBv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 r6si568094eji.73.2020.10.20.22.06.59; Tue, 20 Oct 2020 22:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oMLMoBv8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S2407415AbgJTNYy (ORCPT + 99 others); Tue, 20 Oct 2020 09:24:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406741AbgJTNYx (ORCPT ); Tue, 20 Oct 2020 09:24:53 -0400 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A137920BED; Tue, 20 Oct 2020 13:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603200292; bh=ZaKgderQG4KKZH6fH+HyuZTcQv1aic4HE94Cqcbe1RY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oMLMoBv80hIxboOAiLeXVWq+xzfjYExK0+aAYH/Glp3Pe78NPfGerVw9m4mjjYFrO M90N8EAaloVWWbe8yl6W/TqmoF1pgWGDlbLJgLWBW5P9lALjjJCnv/wjH64R8OG/aR A5AfKmrc+BaDOCNR8+8jSrmF0NgQBfbGZwiG/Z0o= Received: by mail-ot1-f46.google.com with SMTP id e20so1654908otj.11; Tue, 20 Oct 2020 06:24:52 -0700 (PDT) X-Gm-Message-State: AOAM533NUApPLFWs9U1he4YaaCutDk0dqBtomQ3vCF7Lh9GQuJy8W3gp tsYmn4ER/wa8RN+g4w/khRI3gPBwO9nhRW1aIw== X-Received: by 2002:a9d:5e14:: with SMTP id d20mr1611217oti.107.1603200291871; Tue, 20 Oct 2020 06:24:51 -0700 (PDT) MIME-Version: 1.0 References: <1602859382-19505-1-git-send-email-spujar@nvidia.com> <1602859382-19505-12-git-send-email-spujar@nvidia.com> <20201019221612.GA3690258@bogus> In-Reply-To: From: Rob Herring Date: Tue, 20 Oct 2020 08:24:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 11/15] ASoC: dt-bindings: tegra: Add json-schema for Tegra audio graph card To: Sameer Pujar Cc: Mark Brown , Liam Girdwood , Kuninori Morimoto , Pierre-Louis Bossart , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Thierry Reding , Jon Hunter , Linux-ALSA , devicetree@vger.kernel.org, linux-tegra , "linux-kernel@vger.kernel.org" , sharadg@nvidia.com, mkumard@nvidia.com, viswanathl@nvidia.com, rlokhande@nvidia.com, dramesh@nvidia.com, atalambedu@nvidia.com, nwartikar@nvidia.com, Stephen Warren , Nicolin Chen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 1:16 AM Sameer Pujar wrote: > > > >> Add YAML schema for Tegra audio graph sound card DT bindings. It uses the > >> same DT bindings provided by generic audio graph driver. Along with this > >> few standard clock DT bindings are added which are specifically required > >> for Tegra audio. > >> > >> Signed-off-by: Sameer Pujar > >> --- > >> .../sound/nvidia,tegra-audio-graph-card.yaml | 158 +++++++++++++++++++++ > >> 1 file changed, 158 insertions(+) > >> create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml > >> > >> diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml > >> new file mode 100644 > >> index 0000000..284d185 > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml > >> @@ -0,0 +1,158 @@ > >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > >> +%YAML 1.2 > >> +--- > >> +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml# > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> + > >> +title: Audio Graph based Tegra sound card driver > >> + > >> +description: | > >> + This is based on generic audio graph card driver along with additional > >> + customizations for Tegra platforms. It uses the same bindings with > >> + additional standard clock DT bindings required for Tegra. > >> + > >> + See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.yaml > > You should be able to just $ref this at the top level. > > I am seeing one problem while using $ref like below. > allOf: > - $ref: /schemas/sound/audio-graph-card.yaml > > I see below while running doc validator. > "Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.example.dt.yaml: > tegra_sound: compatible:0: 'audio-graph-card' was expected" > > Is there a way to avoid this? Adjust the schemas so the constraints match. You can't say it must be one thing in one place and something else here. Your choices are: - Drop compatible from audio-graph-card.yaml. You can define a 2nd schema that references audio-graph-card.yaml and defines the compatible. - Use 'contains' in audio-graph-card.yaml and then make 'audio-graph-card' a fallback here. The best option depends on what existing users have. > >> +maintainers: > >> + - Jon Hunter > >> + - Sameer Pujar > >> + > >> +properties: > >> + compatible: > >> + items: > >> + - enum: > >> + - nvidia,tegra210-audio-graph-card > >> + - nvidia,tegra186-audio-graph-card > >> + > > >> + dais: > >> + $ref: /schemas/sound/audio-graph-card.yaml#/properties/dais > >> + > >> + label: > >> + $ref: /schemas/sound/simple-card.yaml#/properties/label > >> + > >> + pa-gpios: > >> + $ref: /schemas/sound/audio-graph-card.yaml#/properties/pa-gpios > >> + > >> + widgets: > >> + $ref: /schemas/sound/simple-card.yaml#/definitions/widgets > >> + > >> + routing: > >> + $ref: /schemas/sound/simple-card.yaml#/definitions/routing > >> + > >> + mclk-fs: > >> + $ref: /schemas/sound/simple-card.yaml#/definitions/mclk-fs > >> + > >> + prefix: > >> + $ref: /schemas/sound/simple-card.yaml#/definitions/prefix > > And drop all of these. > > Could not re-use because of above compatible problem. Also require some > additional properties for Tegra. > > >> + > >> + clocks: > >> + minItems: 2 > >> + > >> + clock-names: > >> + minItems: 2 > > Don't need this. > > This is required for Tegra audio graph card to update clock rates at > runtime. I mean you can drop 'minItems: 2' as it is redundant. The 'items' list size implies the size. > >> + items: > >> + - const: pll_a > >> + - const: plla_out0 > >> + > >> + assigned-clocks: > >> + minItems: 1 > >> + maxItems: 3 > >> + > >> + assigned-clock-parents: > >> + minItems: 1 > >> + maxItems: 3 > >> + > >> + assigned-clock-rates: > >> + minItems: 1 > >> + maxItems: 3 > >> + > > It is required for initialisation of above clocks with specific rates. > > >> + ports: > >> + $ref: /schemas/sound/audio-graph-card.yaml#/properties/ports > >> + > >> +patternProperties: > >> + "^port(@[0-9a-f]+)?$": > >> + $ref: /schemas/sound/audio-graph-card.yaml#/definitions/port > > And these can be dropped. Unless what each port is is Tegra specific. > > May be I can drop this if I could just directly include > audio-graph-card.yaml and extend required properties for Tegra. There are numerous examples of doing that. Rob