Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp94281pxb; Thu, 20 Jan 2022 09:31:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2fnyo3b4LBpZDCUw8nLF7gYor7ZiSqHwP14HdoaXjH3fczCpzW5q6N/xL7wUHZGYY4uB/ X-Received: by 2002:a17:902:b40c:b0:14a:792:741f with SMTP id x12-20020a170902b40c00b0014a0792741fmr39325495plr.113.1642699874383; Thu, 20 Jan 2022 09:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642699874; cv=none; d=google.com; s=arc-20160816; b=RVAlHUpBEZ+kQTHvbfWY5KZgtdfE49TU1ybfr4IlhNnPBLYiHZKSf24ddhRZAsga89 BxC3xJtKTGlysXmZJPCrna08ubegkvf9dym5FuShP6S/ok2nofFHDQ7JCAPfRu2swhA9 JlX5dXm64SfV7Aa/doHkqsKiFTXtMbYt1V5QN8S3udZ8tXNZNb62GyoIIEoTb2NaE5Pe GVYeKQsZ9r+LPH84FWnZVYwgCXFFrQpZY+sdQPC9Lkn5Ab+Euw5GWnqdCq2WELQqvDxq lDxhtB8PsvdUiquQNjgeqqfs0z26daqyEri5h6Oe17RABeAkO5n9f6VnG37XRwZmtP5g Namg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ceXfyYTQzZtkDYYvHrKFKTFUbUEhkyAb/D9EKxUZSZI=; b=ddrP1b2GwOUI14cxdN4wSlOdj4TIaznIrqA+Wwg/jqUssriwmxjscKPwsplzbP6SNn iyJu6j9hNBC5W7pQlL+MCSyfO8WbNu/Ay6IF/IGEaUg5T7CPwFMdOwdtTwGOPBL8VtoP KwR1fRMsJEjLZCBjQw/xU89Cb0oI/QVOAJGgPR/dktSU6F8mgbYgHzOMM1wnWHnnxcwI 0uRCNy0F9VeFEOYB72TuayVnZzZ3ugen5qNw2J5ELTDg3zx1ZaQ+Dn430lhnDttL9NOq 4YzOutIS//+k+fULFQwfocw7JMMkjOALUAymcxwGCpEynTDLsZE5g9Wf0InHm9l7qKTe vsfQ== 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 e12si4179055pgg.778.2022.01.20.09.31.00; Thu, 20 Jan 2022 09:31:14 -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 S236425AbiARQV0 (ORCPT + 99 others); Tue, 18 Jan 2022 11:21:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235038AbiARQVZ (ORCPT ); Tue, 18 Jan 2022 11:21:25 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64179C061574; Tue, 18 Jan 2022 08:21:24 -0800 (PST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 8D7021BF206; Tue, 18 Jan 2022 16:21:19 +0000 (UTC) Date: Tue, 18 Jan 2022 17:22:21 +0100 From: Jacopo Mondi To: Niklas =?utf-8?Q?S=C3=B6derlund?= Cc: Lad Prabhakar , Mauro Carvalho Chehab , Rob Herring , Geert Uytterhoeven , Prabhakar , Biju Das , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: dt-bindings: media: renesas,csi2: Update data-lanes property Message-ID: <20220118162221.yfwen6ppx7gcjzvw@uno.localdomain> References: <20220113103215.27080-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220117081110.bkwr3ttoexgr2wjt@uno.localdomain> <20220117100040.wa3ple6meahebtni@uno.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Niklas, On Tue, Jan 18, 2022 at 11:33:08AM +0100, Niklas Söderlund wrote: > Hi Jacopo, > > Thanks for your feedback. > > On 2022-01-17 11:00:40 +0100, Jacopo Mondi wrote: > > Hi Niklas, > > > > On Mon, Jan 17, 2022 at 10:23:28AM +0100, Niklas Söderlund wrote: > > > Hello Jacopo, > > > > > > On 2022-01-17 09:11:10 +0100, 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. > > > > > > > > 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 don't think this is correct, what if data lanes 2 and 3 are used? > > > > > > > These were examples that allow you to accept <1 2> and <1 2 3 4> as > > valid properties. If other combinations are accepted they can be > > specified there, in your example, <2 3> with > > > > - items: > > - const: 2 > > - const: 3 > > > > As lane re-reordering is quite unusual as a feature (afaik) there are > > usually just an handful of supported combinations for 1, 2 and 4 data > > lanes setups. > > R-Car CSI-2 hardware and driver supports full lane swapping, see the > LSWAP register and usage of struct rcar_csi2.lane_swap. Uh, I missed that. So indeed restricting the possible combinations in the .dts file is a no-go :0 > > I think it's a good idea to extend the binding description to limit the > data-lanes property to an array of max 4 items where each value use is > ether a 1, 2, 3 or 4. But it must allow for any combination of the > values. > Agreed then. Looking at the definition in video-interfaces.txt data-lanes: $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 8 items: # Assume up to 9 physical lane indices maximum: 8 Should the R-Car CSI-2 bindings report (validated with dt_binding_check) data-lanes: maxItems: 4 items: maximum: 4 Thanks j > > > > If full lane re-ordering is supported then it's enough to set > > data-lanes: true and accepts all combinations. > > > > Also, the reason why imho the property should go in the board DTS and > > not in the SoC .dtsi is that not all the available data lanes of the > > IP-core might be routed out on a specific board. > > > > That's at least my understanding which I would be glad to be disproved > > as specifying the valid combinations in each board dts is rather > > un-convenient. > > > > Thanks > > j > > > > > > > > > > Thanks > > > > j > > > > > > > > > > > > > > required: > > > > > - clock-lanes > > > > > -- > > > > > 2.17.1 > > > > > > > > > > > -- > > > Kind Regards, > > > Niklas Söderlund > > -- > Kind Regards, > Niklas Söderlund