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,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 B5503C282DA for ; Wed, 17 Apr 2019 18:24:57 +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 83E5020675 for ; Wed, 17 Apr 2019 18:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HpbCfGYQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83E5020675 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=urWbvnnbxImoyAUvTgtUCfimEgwF+Sr/1YQ3KjLMOuY=; b=HpbCfGYQYbB2UM7FbVWtvqbuf uvJ/NPbk8IfLHzwXPxHE9qYf7/i5k0X1gJs2iicEmD/nemS6RUpH/5aleIUakxCVPk8MzF6QIxkKn T7D1iIc4acmdYwsZr3EbU7jLyeyqr7PNcIuLal+r93smRWp4lfW62+ZZ6fc0DlQwjvIiYFnv/n00T ETvAKlBGWEdIKF8oNK6LDKf4IvVi1DknAop7VsTSY+wLLeu7RLvQpXqBY54cJDdBWQZWReMy64sU3 M626XQG0ZFcBGHSpMJ5KgW6CRiQy5FBSxBGObOgTsjx2q+UGkCtbZPyzROcChPrbO7ZBhIhclppz1 gxc2fY6yg==; 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 1hGpEs-0001Tg-4L; Wed, 17 Apr 2019 18:24:54 +0000 Received: from relay12.mail.gandi.net ([217.70.178.232]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGpEo-0001TK-GC for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 18:24:52 +0000 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id CC566200009; Wed, 17 Apr 2019 18:24:42 +0000 (UTC) Date: Wed, 17 Apr 2019 20:24:41 +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: <20190417182441.gluqwwoziybabmz5@flea> References: <4060ec46117ccf3cd643b8f1b9759ed44d38c5e7.1555330005.git-series.maxime.ripard@bootlin.com> <20190416071916.y5cdqhdlljcasbsn@flea> 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-20190417_112450_843117_D1B8E92B X-CRM114-Status: GOOD ( 29.38 ) 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="===============0824315503129564653==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0824315503129564653== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sxwgxl2i3bech6el" Content-Disposition: inline --sxwgxl2i3bech6el Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 16, 2019 at 04:50:35PM -0500, Rob Herring wrote: > On Tue, Apr 16, 2019 at 2:19 AM Maxime Ripard wrote: > > > > 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? > > I think the opposite. Just drop 'items' and leave 'description'. > > > 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? > > 'items' can be a list or dictionary. When it's a dictionary, the > schema for 'items' is applied to each item. For example: > > items: > enum: [ rx, tx ] > uniqueItems: true > > 'uniqueItems' prevents the case of 'rx, rx' or 'tx, tx'. Oh, so that's how you use uniqueItems. I've been struggling with it to cover the ALSA routing options that will have non-unique strings, but string-array didn't let me. I'll test that. > > 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. > > Even when we reference things by name, the order should be defined > still. Using names allows for skipping entries. > > If you have a mixture, I'd prefer to see dts files cleaned-up. That works for me, thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --sxwgxl2i3bech6el Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLdvaQAKCRDj7w1vZxhR xUVaAP9XMxL6SQXibEOcVv6XQ+IhCns/yrvqojpTxrNq91j1aQD8C/Vt6NaZ96rN s5jZ8AqnLHxf6a3Iu4d87LvMkAq27wg= =Gt+T -----END PGP SIGNATURE----- --sxwgxl2i3bech6el-- --===============0824315503129564653== 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 --===============0824315503129564653==--