| Message ID | 20191203134816.5319-2-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBM6PTHXQKGQETF6E33Q@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DD4433F0CC for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 3 Dec 2019 14:48:36 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id u11sf1700573pgm.20 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 03 Dec 2019 05:48:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1575380915; cv=pass; d=google.com; s=arc-20160816; b=LS2n32eiR25+8TH8BTG5zW0YqAvn6SPKTPwpXjTqwsGbkDbu3bZg4amgjc74JmmjIs uddgkWtU6XFIYY464S7jd7jlyQdnnn+IcG4Mw7PyZ6rD9ZXlNbHwceWjgcyUF0FWZPFX PgnVnx2qwyqWHjgKbcX10xZhl8AbOEUrrsbA4xJd3Jr5eqNaCoq72P6JI5rkczjJ9YGH AhvR0zowyFwuDVnp8s4Se8f55S+inJLuqoP+jRAe42uzJEvEW7+ofIy1kG2G7w/k2In5 vRV7TndJ6W7PqzfVFhTvwtxItAHi+sqkP+ucpcnXaUHJN9ZHLu8nz0pXYBy4/tHStN8f giRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pCIKUXUUmROK/OIGpZU8Hx00T9jNcSaavqJlK9Dxctc=; b=TzOc+RER50EHjTDAwwziOS3/07ikprCXHcs9S8GsROREolOXZwp/nMXBncZCA46UiF zaBT9IQraj0erOWsHNdcr7GMQU3py874tZk88vnxw0W71CQtvDL5y/vmIqn0GsfnC5hN kZjTIk6xYscrkFuS5GwnmP6SPVYpmrs7mspLkm3FMi+kukI+Sz8/m7BnmXo0hDjH1Kxb DpahJDhEbREC/jDXwevQTv8OS7xPVSibGhlgAsdVmQUGBBseNhYJfl0mTUVv+WBanHas FRianbPePNwcb7d6Qgvn4Pvq2E2UGirSH3joYz2TLGDon5Lx0XnzwwyN9wMQLgQtcMKQ LzHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxVcUwh6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=pCIKUXUUmROK/OIGpZU8Hx00T9jNcSaavqJlK9Dxctc=; b=al+cpuDbsNqDQ1RkdXdKJw6X4Gr4N+ggJMeI7Kh7sKFGpkpy9XCZ4kWOhqV2HnEu9t nA/Qehe8wpFvi3CmOjP93XdkbKOHnrfjgd+SbaIoLKFK/UBC5lUwKaoLowW+aVuIvHo3 c/qFqS2u2BBiF1Cj81Zv3NP74p+wLvsLhrl7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=pCIKUXUUmROK/OIGpZU8Hx00T9jNcSaavqJlK9Dxctc=; b=jujLM11XqEszN6U2/ZYEXcvmWpOzQdUVItfxs8jbeVuaw5CxppWuZ28KP+sdjBW1T8 aCS8rBOKZRPPxpQjQRR2AWOT+abZxHxWpa7jnT2KG3TL6edqft6TD4n6/GR32JdlTfP1 fyS5+P1MnsmfWC9bdmNrzkDmqiUmWOopRmgRfNYz7WZzwkp4a0WNLA5yH6jodXNYnhMd RJvV7b748mL7ITDbbSrz7u0bDHpRqFvmqQp2tL7b75mKD3PMIB7nxa3P+u/N8MfYerdZ dnx+a0+gFNBHOCRqRi+GXJMww2iC+s20fcKezBKQgekkM4x02TkcvN/w4BgCYcr65sXo +tww== X-Gm-Message-State: APjAAAVjm3vf5DcdEM5C+rIqX+bhbaOlUyjdaJNUGSQ3hiN3yGG9tKYo 5FLDnOgB8vK1PrZicH8lFI3aPb/p X-Google-Smtp-Source: APXvYqx1zKVxx55IHggr9L0hHAvSShzYEYMziTGeiwX/u/XNjAhjDWYyJDHgnn4yNEmTEXvgPJzwIA== X-Received: by 2002:a62:d415:: with SMTP id a21mr4779443pfh.242.1575380915472; Tue, 03 Dec 2019 05:48:35 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:ad46:: with SMTP id w6ls808668pjv.4.gmail; Tue, 03 Dec 2019 05:48:35 -0800 (PST) X-Received: by 2002:a17:902:7087:: with SMTP id z7mr4882563plk.65.1575380914919; Tue, 03 Dec 2019 05:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575380914; cv=none; d=google.com; s=arc-20160816; b=V0sHxpj2FHQOMcIQeDpA+wqTEd3t4lu6NSmN1In2sG6dL1ez1lGgWqoOtqq/QEjNWy zp1T0d3sum202v34jOC8Ra3lqHEqJnvXiQGB/WhaiUXnFTwTzFKhnxtO0Ym38ezRI2UL CemVX66Gd7RhzvtiXJsRyzk4a4bapFmP1kmIK8a0EbJzfFT/uQIFFSUTTSWa8TcAaAcR yCOsdFMTY3KZkoj+oIsxuMv4256AiDzToZhnBcm5y2IRxlT8jhCMBUB35NeoHf/y+A5R YW6hpc89OZFzaQ4B/2TCfiRF3rYQ2LqkdQNa18SkMOhnOHlVxfzWTPA43CVutvFCSocs 7Tnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=UUlsRRK2pgCm9l96Sadau8/Jinv10/1VueVd+pNemqM=; b=TKM3C5AYxMxxr2pomAeAqJxVzRlJgdMsG8cQyRW0cTBvpW0GcxqsxTQ2TrFB5UIJuW bcn1XSdeeJ6OFKXiD9/XOYypp5zgHUPR877GQrHT2SO/jTckWo2X0L2LTIpWbxFf/0hU 21KTDaQhUzwH/8EXPJWqaIoswSj0GkedNh+iUx5So8SdJWQp3FPL5gpv8/VFgJszNVz+ 1BtNljvlUgASkyuGBi39wgcOoiLMStP77TdjW4BEwNL+7ruXkx5vHb84dXSF2GMCLzhr KMfGZoWwbVmZ+p7dgUEgWh2RBl+cwY51Gj8vmckA86hFMDUCdZtZHf07TwdHwq1KFJW/ gTeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxVcUwh6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d34sor2660661pgb.20.2019.12.03.05.48.34 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 03 Dec 2019 05:48:34 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:e94d:: with SMTP id q13mr5361869pgj.209.1575380914518; Tue, 03 Dec 2019 05:48:34 -0800 (PST) Received: from localhost.localdomain ([115.97.190.29]) by smtp.gmail.com with ESMTPSA id y144sm4397892pfb.188.2019.12.03.05.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 05:48:34 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com> Cc: michael@amarulasolutions.com, Icenowy Zheng <icenowy@aosc.io>, linux-sunxi <linux-sunxi@googlegroups.com>, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v12 1/7] dt-bindings: sun6i-dsi: Document A64 MIPI-DSI controller Date: Tue, 3 Dec 2019 19:18:10 +0530 Message-Id: <20191203134816.5319-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191203134816.5319-1-jagan@amarulasolutions.com> References: <20191203134816.5319-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kxVcUwh6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm/sun4i: Allwinner A64 MIPI-DSI support
|
|
Commit Message
Jagan Teki
Dec. 3, 2019, 1:48 p.m. UTC
The MIPI DSI controller in Allwinner A64 is similar to A33. But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid to have separate compatible for A64 on the same driver. DSI_SCLK uses mod clock-names on dt-bindings, so the same is not required for A64. On that note - A64 require minimum of 1 clock like the bus clock - A33 require minimum of 2 clocks like both bus, mod clocks So, update dt-bindings so-that it can document both A33, A64 bindings requirements. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- Changes for v12: - Use 'enum' instead of oneOf+const .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
Comments
On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > The MIPI DSI controller in Allwinner A64 is similar to A33. > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > to have separate compatible for A64 on the same driver. > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > is not required for A64. > > On that note > - A64 require minimum of 1 clock like the bus clock > - A33 require minimum of 2 clocks like both bus, mod clocks > > So, update dt-bindings so-that it can document both A33, > A64 bindings requirements. > > Reviewed-by: Rob Herring <robh@kernel.org> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > Changes for v12: > - Use 'enum' instead of oneOf+const > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > index dafc0980c4fa..b91446475f35 100644 > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > @@ -15,7 +15,9 @@ properties: > "#size-cells": true > > compatible: > - const: allwinner,sun6i-a31-mipi-dsi > + enum: > + - allwinner,sun6i-a31-mipi-dsi > + - allwinner,sun50i-a64-mipi-dsi > > reg: > maxItems: 1 > @@ -24,6 +26,8 @@ properties: > maxItems: 1 > > clocks: > + minItems: 1 > + maxItems: 2 > items: > - description: Bus Clock > - description: Module Clock > @@ -63,13 +67,25 @@ required: > - reg > - interrupts > - clocks > - - clock-names > - phys > - phy-names > - resets > - vcc-dsi-supply > - port > > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: allwinner,sun6i-a31-mipi-dsi > + then: > + properties: > + clocks: > + minItems: 2 > + required: > + - clock-names > + Your else condition should check that the number of clocks items is 1 on the A64 Maxime
On Wed, Dec 4, 2019 at 7:06 PM Maxime Ripard <mripard@kernel.org> wrote: > > On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > > The MIPI DSI controller in Allwinner A64 is similar to A33. > > > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > > to have separate compatible for A64 on the same driver. > > > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > > is not required for A64. > > > > On that note > > - A64 require minimum of 1 clock like the bus clock > > - A33 require minimum of 2 clocks like both bus, mod clocks > > > > So, update dt-bindings so-that it can document both A33, > > A64 bindings requirements. > > > > Reviewed-by: Rob Herring <robh@kernel.org> > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > --- > > Changes for v12: > > - Use 'enum' instead of oneOf+const > > > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > index dafc0980c4fa..b91446475f35 100644 > > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > @@ -15,7 +15,9 @@ properties: > > "#size-cells": true > > > > compatible: > > - const: allwinner,sun6i-a31-mipi-dsi > > + enum: > > + - allwinner,sun6i-a31-mipi-dsi > > + - allwinner,sun50i-a64-mipi-dsi > > > > reg: > > maxItems: 1 > > @@ -24,6 +26,8 @@ properties: > > maxItems: 1 > > > > clocks: > > + minItems: 1 > > + maxItems: 2 > > items: > > - description: Bus Clock > > - description: Module Clock > > @@ -63,13 +67,25 @@ required: > > - reg > > - interrupts > > - clocks > > - - clock-names > > - phys > > - phy-names > > - resets > > - vcc-dsi-supply > > - port > > > > +allOf: > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: allwinner,sun6i-a31-mipi-dsi > > + then: > > + properties: > > + clocks: > > + minItems: 2 > > + required: > > + - clock-names > > + > > Your else condition should check that the number of clocks items is 1 > on the A64 But the minItems mentioned as 1 in clocks, which is unchanged number by default. doesn't it sufficient?
On Mon, Dec 16, 2019 at 04:37:20PM +0530, Jagan Teki wrote: > On Wed, Dec 4, 2019 at 7:06 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > > > The MIPI DSI controller in Allwinner A64 is similar to A33. > > > > > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > > > to have separate compatible for A64 on the same driver. > > > > > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > > > is not required for A64. > > > > > > On that note > > > - A64 require minimum of 1 clock like the bus clock > > > - A33 require minimum of 2 clocks like both bus, mod clocks > > > > > > So, update dt-bindings so-that it can document both A33, > > > A64 bindings requirements. > > > > > > Reviewed-by: Rob Herring <robh@kernel.org> > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > --- > > > Changes for v12: > > > - Use 'enum' instead of oneOf+const > > > > > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > index dafc0980c4fa..b91446475f35 100644 > > > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > @@ -15,7 +15,9 @@ properties: > > > "#size-cells": true > > > > > > compatible: > > > - const: allwinner,sun6i-a31-mipi-dsi > > > + enum: > > > + - allwinner,sun6i-a31-mipi-dsi > > > + - allwinner,sun50i-a64-mipi-dsi > > > > > > reg: > > > maxItems: 1 > > > @@ -24,6 +26,8 @@ properties: > > > maxItems: 1 > > > > > > clocks: > > > + minItems: 1 > > > + maxItems: 2 > > > items: > > > - description: Bus Clock > > > - description: Module Clock > > > @@ -63,13 +67,25 @@ required: > > > - reg > > > - interrupts > > > - clocks > > > - - clock-names > > > - phys > > > - phy-names > > > - resets > > > - vcc-dsi-supply > > > - port > > > > > > +allOf: > > > + - if: > > > + properties: > > > + compatible: > > > + contains: > > > + const: allwinner,sun6i-a31-mipi-dsi > > > + then: > > > + properties: > > > + clocks: > > > + minItems: 2 > > > + required: > > > + - clock-names > > > + > > > > Your else condition should check that the number of clocks items is 1 > > on the A64 > > But the minItems mentioned as 1 in clocks, which is unchanged number > by default. doesn't it sufficient? In the main schema, it's said that the clocks property can have one or two elements (to cover the A31 case that has one, and the A64 case that has 2). This is fine. Later on, you enforce that the A64 has two elements, and this is fine too. However, you never check that on the A31 you only have one clock, and you could very well have two and no one would notice. Maxime
On Mon, Dec 16, 2019 at 4:50 PM Maxime Ripard <mripard@kernel.org> wrote: > > On Mon, Dec 16, 2019 at 04:37:20PM +0530, Jagan Teki wrote: > > On Wed, Dec 4, 2019 at 7:06 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > > > On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > > > > The MIPI DSI controller in Allwinner A64 is similar to A33. > > > > > > > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > > > > to have separate compatible for A64 on the same driver. > > > > > > > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > > > > is not required for A64. > > > > > > > > On that note > > > > - A64 require minimum of 1 clock like the bus clock > > > > - A33 require minimum of 2 clocks like both bus, mod clocks > > > > > > > > So, update dt-bindings so-that it can document both A33, > > > > A64 bindings requirements. > > > > > > > > Reviewed-by: Rob Herring <robh@kernel.org> > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > --- > > > > Changes for v12: > > > > - Use 'enum' instead of oneOf+const > > > > > > > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > > > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > index dafc0980c4fa..b91446475f35 100644 > > > > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > @@ -15,7 +15,9 @@ properties: > > > > "#size-cells": true > > > > > > > > compatible: > > > > - const: allwinner,sun6i-a31-mipi-dsi > > > > + enum: > > > > + - allwinner,sun6i-a31-mipi-dsi > > > > + - allwinner,sun50i-a64-mipi-dsi > > > > > > > > reg: > > > > maxItems: 1 > > > > @@ -24,6 +26,8 @@ properties: > > > > maxItems: 1 > > > > > > > > clocks: > > > > + minItems: 1 > > > > + maxItems: 2 > > > > items: > > > > - description: Bus Clock > > > > - description: Module Clock > > > > @@ -63,13 +67,25 @@ required: > > > > - reg > > > > - interrupts > > > > - clocks > > > > - - clock-names > > > > - phys > > > > - phy-names > > > > - resets > > > > - vcc-dsi-supply > > > > - port > > > > > > > > +allOf: > > > > + - if: > > > > + properties: > > > > + compatible: > > > > + contains: > > > > + const: allwinner,sun6i-a31-mipi-dsi > > > > + then: > > > > + properties: > > > > + clocks: > > > > + minItems: 2 > > > > + required: > > > > + - clock-names > > > > + > > > > > > Your else condition should check that the number of clocks items is 1 > > > on the A64 > > > > But the minItems mentioned as 1 in clocks, which is unchanged number > > by default. doesn't it sufficient? > > In the main schema, it's said that the clocks property can have one or > two elements (to cover the A31 case that has one, and the A64 case > that has 2). > > This is fine. > > Later on, you enforce that the A64 has two elements, and this is fine > too. Actually A31 case has 2 and A64 case has 1. > > However, you never check that on the A31 you only have one clock, and > you could very well have two and no one would notice. I did check A31 case for 2 but not in A64. this is what you mean? so adding A64 check like below would fine? allOf: - if: properties: compatible: contains: const: allwinner,sun6i-a31-mipi-dsi then: properties: clocks: minItems: 2 required: - clock-names - if: properties: compatible: contains: const: allwinner,sun50i-a64-mipi-dsi then: properties: clocks: minItems: 1
On Mon, Dec 16, 2019 at 10:29:08PM +0530, Jagan Teki wrote: > On Mon, Dec 16, 2019 at 4:50 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > On Mon, Dec 16, 2019 at 04:37:20PM +0530, Jagan Teki wrote: > > > On Wed, Dec 4, 2019 at 7:06 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > > > > > On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > > > > > The MIPI DSI controller in Allwinner A64 is similar to A33. > > > > > > > > > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > > > > > to have separate compatible for A64 on the same driver. > > > > > > > > > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > > > > > is not required for A64. > > > > > > > > > > On that note > > > > > - A64 require minimum of 1 clock like the bus clock > > > > > - A33 require minimum of 2 clocks like both bus, mod clocks > > > > > > > > > > So, update dt-bindings so-that it can document both A33, > > > > > A64 bindings requirements. > > > > > > > > > > Reviewed-by: Rob Herring <robh@kernel.org> > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > --- > > > > > Changes for v12: > > > > > - Use 'enum' instead of oneOf+const > > > > > > > > > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > > > > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > index dafc0980c4fa..b91446475f35 100644 > > > > > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > @@ -15,7 +15,9 @@ properties: > > > > > "#size-cells": true > > > > > > > > > > compatible: > > > > > - const: allwinner,sun6i-a31-mipi-dsi > > > > > + enum: > > > > > + - allwinner,sun6i-a31-mipi-dsi > > > > > + - allwinner,sun50i-a64-mipi-dsi > > > > > > > > > > reg: > > > > > maxItems: 1 > > > > > @@ -24,6 +26,8 @@ properties: > > > > > maxItems: 1 > > > > > > > > > > clocks: > > > > > + minItems: 1 > > > > > + maxItems: 2 > > > > > items: > > > > > - description: Bus Clock > > > > > - description: Module Clock > > > > > @@ -63,13 +67,25 @@ required: > > > > > - reg > > > > > - interrupts > > > > > - clocks > > > > > - - clock-names > > > > > - phys > > > > > - phy-names > > > > > - resets > > > > > - vcc-dsi-supply > > > > > - port > > > > > > > > > > +allOf: > > > > > + - if: > > > > > + properties: > > > > > + compatible: > > > > > + contains: > > > > > + const: allwinner,sun6i-a31-mipi-dsi > > > > > + then: > > > > > + properties: > > > > > + clocks: > > > > > + minItems: 2 > > > > > + required: > > > > > + - clock-names > > > > > + > > > > > > > > Your else condition should check that the number of clocks items is 1 > > > > on the A64 > > > > > > But the minItems mentioned as 1 in clocks, which is unchanged number > > > by default. doesn't it sufficient? > > > > In the main schema, it's said that the clocks property can have one or > > two elements (to cover the A31 case that has one, and the A64 case > > that has 2). > > > > This is fine. > > > > Later on, you enforce that the A64 has two elements, and this is fine > > too. > > Actually A31 case has 2 and A64 case has 1. > > > > > However, you never check that on the A31 you only have one clock, and > > you could very well have two and no one would notice. > > I did check A31 case for 2 but not in A64. this is what you mean? so > adding A64 check like below would fine? > > allOf: > - if: > properties: > compatible: > contains: > const: allwinner,sun6i-a31-mipi-dsi You need a new line here > then: This is the wrong level of indentation, it needs to be at the same level than if > properties: > clocks: > minItems: 2 Newline > required: > - clock-names Newline > - if: > properties: > compatible: > contains: > const: allwinner,sun50i-a64-mipi-dsi > then: > properties: > clocks: > minItems: 1 (and same thing here). But yeah, otherwise that's what I meant Maxime
On Tue, Dec 17, 2019 at 12:04 AM Maxime Ripard <mripard@kernel.org> wrote: > > On Mon, Dec 16, 2019 at 10:29:08PM +0530, Jagan Teki wrote: > > On Mon, Dec 16, 2019 at 4:50 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > > > On Mon, Dec 16, 2019 at 04:37:20PM +0530, Jagan Teki wrote: > > > > On Wed, Dec 4, 2019 at 7:06 PM Maxime Ripard <mripard@kernel.org> wrote: > > > > > > > > > > On Tue, Dec 03, 2019 at 07:18:10PM +0530, Jagan Teki wrote: > > > > > > The MIPI DSI controller in Allwinner A64 is similar to A33. > > > > > > > > > > > > But unlike A33, A64 doesn't have DSI_SCLK gating so it is valid > > > > > > to have separate compatible for A64 on the same driver. > > > > > > > > > > > > DSI_SCLK uses mod clock-names on dt-bindings, so the same > > > > > > is not required for A64. > > > > > > > > > > > > On that note > > > > > > - A64 require minimum of 1 clock like the bus clock > > > > > > - A33 require minimum of 2 clocks like both bus, mod clocks > > > > > > > > > > > > So, update dt-bindings so-that it can document both A33, > > > > > > A64 bindings requirements. > > > > > > > > > > > > Reviewed-by: Rob Herring <robh@kernel.org> > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > --- > > > > > > Changes for v12: > > > > > > - Use 'enum' instead of oneOf+const > > > > > > > > > > > > .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 20 +++++++++++++++++-- > > > > > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > > index dafc0980c4fa..b91446475f35 100644 > > > > > > --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > > +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml > > > > > > @@ -15,7 +15,9 @@ properties: > > > > > > "#size-cells": true > > > > > > > > > > > > compatible: > > > > > > - const: allwinner,sun6i-a31-mipi-dsi > > > > > > + enum: > > > > > > + - allwinner,sun6i-a31-mipi-dsi > > > > > > + - allwinner,sun50i-a64-mipi-dsi > > > > > > > > > > > > reg: > > > > > > maxItems: 1 > > > > > > @@ -24,6 +26,8 @@ properties: > > > > > > maxItems: 1 > > > > > > > > > > > > clocks: > > > > > > + minItems: 1 > > > > > > + maxItems: 2 > > > > > > items: > > > > > > - description: Bus Clock > > > > > > - description: Module Clock > > > > > > @@ -63,13 +67,25 @@ required: > > > > > > - reg > > > > > > - interrupts > > > > > > - clocks > > > > > > - - clock-names > > > > > > - phys > > > > > > - phy-names > > > > > > - resets > > > > > > - vcc-dsi-supply > > > > > > - port > > > > > > > > > > > > +allOf: > > > > > > + - if: > > > > > > + properties: > > > > > > + compatible: > > > > > > + contains: > > > > > > + const: allwinner,sun6i-a31-mipi-dsi > > > > > > + then: > > > > > > + properties: > > > > > > + clocks: > > > > > > + minItems: 2 > > > > > > + required: > > > > > > + - clock-names > > > > > > + > > > > > > > > > > Your else condition should check that the number of clocks items is 1 > > > > > on the A64 > > > > > > > > But the minItems mentioned as 1 in clocks, which is unchanged number > > > > by default. doesn't it sufficient? > > > > > > In the main schema, it's said that the clocks property can have one or > > > two elements (to cover the A31 case that has one, and the A64 case > > > that has 2). > > > > > > This is fine. > > > > > > Later on, you enforce that the A64 has two elements, and this is fine > > > too. > > > > Actually A31 case has 2 and A64 case has 1. > > > > > > > > However, you never check that on the A31 you only have one clock, and > > > you could very well have two and no one would notice. > > > > I did check A31 case for 2 but not in A64. this is what you mean? so > > adding A64 check like below would fine? > > > > allOf: > > - if: > > properties: > > compatible: > > contains: > > const: allwinner,sun6i-a31-mipi-dsi > > You need a new line here I couldn't see new line before then: in example schema - https://elixir.bootlin.com/linux/v5.5-rc2/source/Documentation/devicetree/bindings/example-schema.yaml#L208 May be a new changes for this ML or so? > > > then: > > This is the wrong level of indentation, it needs to be at the same level than if True, I have seen it in example schema. > > > properties: > > clocks: > > minItems: 2 > > Newline > > > required: > > - clock-names > > Newline > > > - if: > > properties: > > compatible: > > contains: > > const: allwinner,sun50i-a64-mipi-dsi > > then: > > properties: > > clocks: > > minItems: 1 > > (and same thing here). > > But yeah, otherwise that's what I meant Thanks for the detailed review.
diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml index dafc0980c4fa..b91446475f35 100644 --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml @@ -15,7 +15,9 @@ properties: "#size-cells": true compatible: - const: allwinner,sun6i-a31-mipi-dsi + enum: + - allwinner,sun6i-a31-mipi-dsi + - allwinner,sun50i-a64-mipi-dsi reg: maxItems: 1 @@ -24,6 +26,8 @@ properties: maxItems: 1 clocks: + minItems: 1 + maxItems: 2 items: - description: Bus Clock - description: Module Clock @@ -63,13 +67,25 @@ required: - reg - interrupts - clocks - - clock-names - phys - phy-names - resets - vcc-dsi-supply - port +allOf: + - if: + properties: + compatible: + contains: + const: allwinner,sun6i-a31-mipi-dsi + then: + properties: + clocks: + minItems: 2 + required: + - clock-names + additionalProperties: false examples: