Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp99453pxb; Thu, 20 Jan 2022 09:36:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZP75TQ5An11vjLUoahP7STDUigM3cKWSZrS4Yb+z/7BZ8raj4YuH9KCRkC2K5W5S4iRxF X-Received: by 2002:a17:902:ea0b:b0:14a:98a3:42dd with SMTP id s11-20020a170902ea0b00b0014a98a342ddmr29521044plg.135.1642700205768; Thu, 20 Jan 2022 09:36:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642700205; cv=none; d=google.com; s=arc-20160816; b=iaZTkffiSue8RFLG8j/jd82knjgk+KVev+IIas3oSAcOmRJuDZF+Z1fRluIk+tu9dU MOvJZgk2SFkcLrJlAhf8QjZLB23kpjex0hiZq1H0q24IjUGu7w1iMDuglJmwNILaXwpK gKm4TbRwppT3IPhFAQrUldBFKYIF4MV4nppozEdcQoeNQapHtPwNLdCgrFIwPiNbSwDJ nS7chFiHqpSGEzWSIUmC+psxlYBz+x/SGUXbWccJ3NC1tHj0Tv1Wrc9MUJmH/gYDDedY bsSfYlgX4AQ1qy8GKsp73y/1IMF2sYApKl6mzCGPZtugUcrgPyFWFfxPFY6NYAINbUmK VnqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pSDNWZ3H/nWhxz2054vpkeqs9TdzbMPMu7q/+Z6+kMo=; b=Rol13tnu3J4zhvj/uNi87I5CxDPWwFw24LKpPNUux9TTZrRyunAxBdcWydDeLeOva7 k9JYIx/gPQ9hG3L+JwA6ZBj5R2t/EicRfvHYvdWmJZO1a+IId2k/NYlV/i6kx91bDNPq nAAK1JuN20NRHORhs7x0km3uoqJ8CFX89J2fa46yZtXKZMqHbJFyBdrtRoU6vO6sm3yI OQbQOjGW8b/AQsONCh0qAH7QUOg47OhtUiUqcG1Gxyx4Ch192ZBkO2zp3teas0TrP/FL unT9GkJmsvGZsJzWA0n0zNqi9g+Bwg7JOSyj2OIGI5r7CH5sWoAW0o1NyNvoZYW27LHh FEPQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si4525708pfd.229.2022.01.20.09.36.33; Thu, 20 Jan 2022 09:36:45 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244337AbiARQdc (ORCPT + 99 others); Tue, 18 Jan 2022 11:33:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244047AbiARQdQ (ORCPT ); Tue, 18 Jan 2022 11:33:16 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBDEBC06173F; Tue, 18 Jan 2022 08:33:14 -0800 (PST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id D1D162000A; Tue, 18 Jan 2022 16:33:10 +0000 (UTC) Date: Tue, 18 Jan 2022 17:34:13 +0100 From: Jacopo Mondi To: "Lad, Prabhakar" Cc: Lad Prabhakar , Niklas =?utf-8?Q?S=C3=B6derlund?= , Mauro Carvalho Chehab , Rob Herring , Geert Uytterhoeven , Biju Das , linux-media , Linux-Renesas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML Subject: Re: [PATCH] media: dt-bindings: media: renesas,csi2: Update data-lanes property Message-ID: <20220118163413.ge2b4g75yhfqvq3x@uno.localdomain> References: <20220113103215.27080-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220117081110.bkwr3ttoexgr2wjt@uno.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar On Tue, Jan 18, 2022 at 09:11:42AM +0000, Lad, Prabhakar wrote: > Hi Jacopo, > > Thank you for the review. > > On Mon, Jan 17, 2022 at 8:11 AM Jacopo Mondi wrote: > > > > Hello Prabhakar, > > > > On Thu, Jan 13, 2022 at 10:32:14AM +0000, Lad Prabhakar wrote: > > > CSI-2 (CSI4LNK0) on R-Car and RZ/G2 supports 4-lane mode which is already > > > handled by rcar-csi2.c driver. This patch updates the data-lanes property > > > to describe the same. > > > > > > Signed-off-by: Lad Prabhakar > > > --- > > > .../devicetree/bindings/media/renesas,csi2.yaml | 9 ++++++++- > > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/media/renesas,csi2.yaml b/Documentation/devicetree/bindings/media/renesas,csi2.yaml > > > index e6a036721082..064a0a4c5737 100644 > > > --- a/Documentation/devicetree/bindings/media/renesas,csi2.yaml > > > +++ b/Documentation/devicetree/bindings/media/renesas,csi2.yaml > > > @@ -67,7 +67,14 @@ properties: > > > maxItems: 1 > > > > > > data-lanes: > > > - maxItems: 1 > > > + items: > > > + minItems: 1 > > > + maxItems: 4 > > > + items: > > > + - const: 1 > > > + - const: 2 > > > + - const: 3 > > > + - const: 4 > > > > Seeing "maxItems: 1" there confuses me too, as the property is an > > array of data-lanes, but I'm afraid your change does not what you > > intend as it would allow you to specify the number of data lanes as an > > integer rather than as an array. > > > Agreed, what do you think of the below instead? > > properties: > data-lanes: > minItems: 1 > maxItems: 4 > items: > maximum: 4 > Sorry, I should have read your reply first :) even better with your suggested uniqueItems > The above should handle all the possible mix and match of the lanes. > > > I think it would probably be correct to set > > > > data-lanes: true > > > > (maybe maxItems: 1 is correct already) > > > > And restrict the number of valid combinations in the board DTS file > > with a construct like: > > > > data-lanes: > > oneOf: > > - items: > > - const: 1 > > - const: 2 > > - const: 3 > > - const: 4 > > - items: > > - const: 1 > > - const: 2 > > > I haven't come across dts files having such constraints is it allowed, > could you point me to a example. I see some Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- properties: Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml: data-lanes: Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- oneOf: Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - items: Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 3 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 4 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - items: Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/hynix,hi846.yaml- Documentation/devicetree/bindings/media/i2c/imx258.yaml- properties: Documentation/devicetree/bindings/media/i2c/imx258.yaml: data-lanes: Documentation/devicetree/bindings/media/i2c/imx258.yaml- oneOf: Documentation/devicetree/bindings/media/i2c/imx258.yaml- - items: Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 3 Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 4 Documentation/devicetree/bindings/media/i2c/imx258.yaml- - items: Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/imx258.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- properties: Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml: data-lanes: Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- anyOf: Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - items: Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - items: Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 1 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 2 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 3 Documentation/devicetree/bindings/media/i2c/sony,imx214.yaml- - const: 4 But yes, most bindings simply report data-lanes: minItems: 1 maxItems: 4 Which allows all combinations, including repetitions, so they're probably wrong. Thanks j > > Cheers, > Prabhakar