From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D970C10F13 for ; Tue, 16 Apr 2019 07:20:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 17B252086A for ; Tue, 16 Apr 2019 07:20:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VLwN6p/D"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="glCQImmA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17B252086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lhoD2BUVHH9K7N+dEng35b78gb/EcqZHXNkNmNTrrUo=; b=VLwN6p/D1CjZIYFJPpDU4Hhwr 2xNtrzyCPX9G5ZjBmPMsbzvTDGdyNBDWV/Y3vbN5GpZ+Hgvdh15q9fdW8R8ULZ2pKpNu3U8e/IuZM Oxbr5aMWnZHpOH5vcumcvFej75PkjFemADHXwJk0IPjliQ9swCbrL/s5qXtLvuxa2/QqrupY8WqMb EwLxWVARR8YBMVM5wk3GIiR5Begy9xXzVIgR2P0XgqVE6o/REp1dPyHlaYAIEyBCwKYvvnoTE/TyK EL0wHWGe1Gzh8ArKj9bq4cpynGttccb02wxvKJ1Pm/yCTkClKbMDdt2dicxoFjeVqc8f2kQt+8bp4 r3wJ30JwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGINs-0005Dw-Vm; Tue, 16 Apr 2019 07:20:00 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGINr-0005DS-5H for linux-arm-kernel@bombadil.infradead.org; Tue, 16 Apr 2019 07:19:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=O5ZLX/zPk7PQcKwentTFBhBv9YCwUF+V8dT6qv960nM=; b=glCQImmA+vGYk++z7Nsa7QIa7 HyvKqMNEjTuwSCALb2woanujk7Dy+ItiJZ4i0CU2vRUoRsIqqqF407eWDrUa4Aw+SBSor7z4nGnID q7462lQcNQ5FRbM2MNkwkBVJuJQ1RnjfzM0qhE7s/FUdLVwAabcsLifyXU4Y95sv1O8tNRR4Uky/2 7b0oPRctW/F/ZmytbXeYwMJ1FP0I+4vMn5wtFvuFuawYKiXQ/1UBSBWAuxraWCWXaQbBFrX83a6PW nfR21nI2OCIvi3Uj27aSWiu0F7qgw0FzMORpdRgiNiGJp1gFe9K6DLOjk9gb7kKlV2r1A26jhTMFe N+9KMHpyA==; Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGINm-0000XJ-LK for linux-arm-kernel@lists.infradead.org; Tue, 16 Apr 2019 07:19:56 +0000 X-Originating-IP: 90.88.18.121 Received: from localhost (aaubervilliers-681-1-63-121.w90-88.abo.wanadoo.fr [90.88.18.121]) (Authenticated sender: maxime.ripard@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id BAC891C0003; Tue, 16 Apr 2019 07:19:16 +0000 (UTC) Date: Tue, 16 Apr 2019 09:19:16 +0200 From: Maxime Ripard To: Rob Herring Subject: Re: [PATCH 2/2] dt-bindings: sound: sun6i-spdif: Document that the RX channel can be missing Message-ID: <20190416071916.y5cdqhdlljcasbsn@flea> References: <4060ec46117ccf3cd643b8f1b9759ed44d38c5e7.1555330005.git-series.maxime.ripard@bootlin.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_031954_942808_A8B02196 X-CRM114-Status: GOOD ( 26.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Linux-ALSA , Liam Girdwood , Chen-Yu Tsai , Mark Brown , Frank Rowand , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: multipart/mixed; boundary="===============1877212161623617478==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1877212161623617478== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="66vwobinpu2khg3v" Content-Disposition: inline --66vwobinpu2khg3v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Rob, On Mon, Apr 15, 2019 at 08:36:28PM -0500, Rob Herring wrote: > On Mon, Apr 15, 2019 at 7:07 AM Maxime Ripard wrote: > > > > Not all controllers using the A31 SPDIF binding actually have some RX > > capabilities, and therefore on some controllers we don't have the option to > > set an RX DMA channel. > > > > This was already done in the DTSI, but the binding itself was never > > updated. > > > > Signed-off-by: Maxime Ripard > > --- > > Documentation/devicetree/bindings/sound/allwinner,sun6i-a31-spdif.yaml | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun6i-a31-spdif.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun6i-a31-spdif.yaml > > index 7329d9fcf34c..800f794fafe0 100644 > > --- a/Documentation/devicetree/bindings/sound/allwinner,sun6i-a31-spdif.yaml > > +++ b/Documentation/devicetree/bindings/sound/allwinner,sun6i-a31-spdif.yaml > > @@ -44,14 +44,24 @@ properties: > > - const: spdif > > > > dmas: > > + minItems: 1 > > + maxItems: 2 > > items: > > - description: RX DMA Channel > > - description: TX DMA Channel > > + description: > > + Some controllers cannot receive but can only transmit data. In > > + such a case, the RX DMA channel is to be omitted. > > Really, the schema is saying rx is optional, but it doesn't really > matter here as the schema for each item is just 'description'. What should I do here then? Remove the global description and leave only the one under items? Also, it won't necessarily match the dma-names (since rx might be there or not), does it matter or is it obvious enough that we don't care? > > dma-names: > > - items: > > - - const: rx > > - - const: tx > > + minItems: 1 > > + maxItems: 2 > > + enum: > > + - rx > > + - tx > > + description: > > + Some controllers cannot receive but can only transmit data. In > > + such a case, the RX name is to be omitted. > > Here it matters though. This would allow just 'tx', '"tx", "tx"', or > either order. > > You need something like this: > > oneOf: > - items: > - const: rx > - const: tx > - const: tx Ok. > Ideally, we'd always put the required entry first and avoid this > problem. Not always possible if the first entry gets removed in later > h/w. One of the question I was wondering myself when I wrote those schemas is how are we supposed to deal with lists that need to have a particular set of values, but without any particular order? rx and tx here is a good example of that. We need both (let's leave the "missing RX" case aside for a minute), but since we reference them by name, '"rx", "tx"' is strictly equivalent to '"tx", "rx"'. Yet, items cares about the order, so the latter would fail to validate with that schemas. Should we do something like: oneOf: - items: - const: rx - const: tx - items: - const: tx - const: rx or is there a smarter way? Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --66vwobinpu2khg3v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLWB9AAKCRDj7w1vZxhR xffyAP9UZfK9BvgAeeXbHg8xnYpoPU/Ngje1hn9CDL7Qnt9mHAD5Ae9wb0NzuR+p +IR8YcXo4JXNTn6ySKzuAJ4IB+IyfAo= =kFjx -----END PGP SIGNATURE----- --66vwobinpu2khg3v-- --===============1877212161623617478== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1877212161623617478==--