Message ID | 20230416153929.356330-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1627488vqo; Sun, 16 Apr 2023 09:00:56 -0700 (PDT) X-Google-Smtp-Source: AKy350buuI96pN5qOJFmKCxlFuSewD5etm4Iu33tVXHMWDHHMtQvwEGO/afW/3fa61bhB5oT3+6Y X-Received: by 2002:aca:131a:0:b0:386:a653:2340 with SMTP id e26-20020aca131a000000b00386a6532340mr6225398oii.42.1681660856678; Sun, 16 Apr 2023 09:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681660856; cv=none; d=google.com; s=arc-20160816; b=iDwNHF1kMaRKuDZ6vDy3JFq/f5P6V/G4pul0GxszL+DUyFKk3+Zs0ncSLk1cQ0cwbL toI6QnRJcJuxsWMzaK1CcR67WBIM9TxxJ155/xgjtS6WnGZyAzfUa4kbzooxTWth4NWK JPIQ8kQEPwqEjEbJ1XN2/oc65XNPt1CcKMt+YvrzbQQl3L0DFQ2V2LLqMYdqW4Eu+AjF D05VRfY805TX0Iytvzc3XegWsf6jApo6NPbBLm9XIxvTvIxEi4Ljtc5JJPmRpErP0+Zw YUJ+bURhSOOie/g8XICBIdf7XkrGzkcDsqpVInFbFV63Aqo3D/IB51dLOO7ml5gOfaiP 7chg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E17WEg49le+klxTuomeJeEdwGWIDnQJMq0IOIIIQHco=; b=nLY8Ytj7TrmdCyR8lJ457hQ4KrUtkLOyvG3Zlaoa0HItPYqGTFjOhUBdV0j/PbyHM2 lc+GpkFc5Sf2kZzU3SOrL0GCVI6wBOYBGNIJgfrRWu+JXnBPanHy6faT5Gv+RizpfCie U5pbEfoJ3wmxWZKEX7odh4U1+yp291qFvljWBJ81toG8crVQ5R04l1NmG9gsVw2Q4eS4 bKWxRwmnZ94rnRsYgAm9n2p0bQX7vvI0W6eaNRzT0FX8MNYu6VquaO4PKERtbkRBDHi1 yHjDLdb8yOnXDDFXyeMRMnRhpGlff0tx6863CqjexkwEsmMj7eOCURjm6DZAeEM9qUQI cVNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cbOSxVQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a056830161400b0068bb9c7813dsi8138379otr.119.2023.04.16.09.00.42; Sun, 16 Apr 2023 09:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cbOSxVQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbjDPPjh (ORCPT <rfc822;yuanzuo1009@gmail.com> + 99 others); Sun, 16 Apr 2023 11:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjDPPje (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 16 Apr 2023 11:39:34 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B236B2D40 for <linux-kernel@vger.kernel.org>; Sun, 16 Apr 2023 08:39:33 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-50506111a6eso3761627a12.1 for <linux-kernel@vger.kernel.org>; Sun, 16 Apr 2023 08:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681659572; x=1684251572; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=E17WEg49le+klxTuomeJeEdwGWIDnQJMq0IOIIIQHco=; b=cbOSxVQUuH0TmnR/wMG+aV/jT6kR96WA9eXEZYRhn2HhZyOSjc6k3/sqt1vQSEloZC 7FOZ9LQ2duwBDfuxwKi04MFdcN1s/MvtWfR3caktknX3Dq6oZixGL0uj7bsCSLNsemtd 1ZyfF1I0Sl2N+Ha1jwr8kgA1Kvuyl3fJMOL3dgmMXcQ3QUk6s092DruBX5VdeMva/DAE iH80fhj7RSgmijPC+N7V8dVqbeVgZ+MLHMlBq/YwL5wRlalG5QQtdYvmpEAFdH2BV/t7 sTEmugUwUomTp8fgB3MWK5LnKcnaeFXBQK+18pfeWo+xgSehkdJinVX2UxX4tBFnQDoM Pedw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681659572; x=1684251572; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E17WEg49le+klxTuomeJeEdwGWIDnQJMq0IOIIIQHco=; b=J3PZPIasUwmTuoIUcLhm7dXagGljWNUQRz9wBaB6y/RozLwqbq5y1D1sOmpYwn9JB+ zmldVPortlZu1/V5YCUHA9etMdKXrY/uwEcPU8UoO/2te+2exNrCHu14BgdAT6p5yCJp ZmWsJfeMHux/sliWka7xOnwh+2hL8nEbCdO61CPEhXApvJ1ObKrkhxFzC9JgPFWe0HVP HcULrDKDfJuVj2rTjRD1ep/ATK2Wq4Rw8ricXK93ggCQ3P1blWMp5n/184t/h14fuTrD Ttq/COErcFELXt4FjLRAH3AD4ydNelc64ZmgFY0kVLFlUqimYzCzO9NeegIYNt+76EY4 X62Q== X-Gm-Message-State: AAQBX9dTVb6m9191a7o1JXHfb4UjiOSTFYZqkT+PM2Kyfy32CNsfb3e5 h6xTFitIH9vR2AjVc+BveyVPBA== X-Received: by 2002:aa7:cd4f:0:b0:506:9ece:60cb with SMTP id v15-20020aa7cd4f000000b005069ece60cbmr2188353edw.38.1681659572188; Sun, 16 Apr 2023 08:39:32 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:ba4d:301c:484d:5c9]) by smtp.gmail.com with ESMTPSA id h3-20020a170906530300b0093a0e5977e2sm5217259ejo.225.2023.04.16.08.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 08:39:31 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Neil Armstrong <neil.armstrong@linaro.org>, Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Thierry Reding <thierry.reding@gmail.com>, Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Konrad Dybcio <konrad.dybcio@linaro.org> Subject: [PATCH] dt-bindings: display: panel: add common definition of ports Date: Sun, 16 Apr 2023 17:39:29 +0200 Message-Id: <20230416153929.356330-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763349214172580476?= X-GMAIL-MSGID: =?utf-8?q?1763349214172580476?= |
Series |
dt-bindings: display: panel: add common definition of ports
|
|
Commit Message
Krzysztof Kozlowski
April 16, 2023, 3:39 p.m. UTC
Few panel bindings for dual-link connections just type "ports: true",
which does not enforce any type. Add common definition of ports, so the
type will be fixed.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
---
.../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
Comments
On 16.04.2023 17:39, Krzysztof Kozlowski wrote: > Few panel bindings for dual-link connections just type "ports: true", > which does not enforce any type. Add common definition of ports, so the > type will be fixed. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad > > Cc: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > .../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > index 5b38dc89cb21..ad62d34e6fa3 100644 > --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml > +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > @@ -70,6 +70,16 @@ properties: > port: > $ref: /schemas/graph.yaml#/properties/port > > + # For dual-link connections > + ports: > + $ref: /schemas/graph.yaml#/properties/ports > + patternProperties: > + "^port@[0-9a-f]+$": > + $ref: /schemas/graph.yaml#/$defs/port-base > + > + required: > + - port@0 > + > ddc-i2c-bus: > $ref: /schemas/types.yaml#/definitions/phandle > description: > @@ -154,6 +164,12 @@ dependencies: > width-mm: [ height-mm ] > height-mm: [ width-mm ] > > +allOf: > + - not: > + required: > + - port > + - ports > + > additionalProperties: true > > ...
On 16/04/2023 17:39, Krzysztof Kozlowski wrote: > Few panel bindings for dual-link connections just type "ports: true", > which does not enforce any type. Add common definition of ports, so the > type will be fixed. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > Cc: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > .../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > index 5b38dc89cb21..ad62d34e6fa3 100644 > --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml > +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > @@ -70,6 +70,16 @@ properties: > port: > $ref: /schemas/graph.yaml#/properties/port > > + # For dual-link connections > + ports: > + $ref: /schemas/graph.yaml#/properties/ports > + patternProperties: > + "^port@[0-9a-f]+$": > + $ref: /schemas/graph.yaml#/$defs/port-base > + > + required: > + - port@0 > + > ddc-i2c-bus: > $ref: /schemas/types.yaml#/definitions/phandle > description: > @@ -154,6 +164,12 @@ dependencies: > width-mm: [ height-mm ] > height-mm: [ width-mm ] > > +allOf: > + - not: > + required: > + - port > + - ports > + > additionalProperties: true > > ... Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
On Sun, Apr 16, 2023 at 05:39:29PM +0200, Krzysztof Kozlowski wrote: > Few panel bindings for dual-link connections just type "ports: true", > which does not enforce any type. Add common definition of ports, so the > type will be fixed. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > Cc: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > .../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > index 5b38dc89cb21..ad62d34e6fa3 100644 > --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml > +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > @@ -70,6 +70,16 @@ properties: > port: > $ref: /schemas/graph.yaml#/properties/port > > + # For dual-link connections > + ports: > + $ref: /schemas/graph.yaml#/properties/ports > + patternProperties: > + "^port@[0-9a-f]+$": > + $ref: /schemas/graph.yaml#/$defs/port-base This allows any undocumented property. > + > + required: > + - port@0 > + I don't think this should be added here because users must define what each port is. With it here, we're going to validate the nodes twice as well. Same can be said for 'port' though. It can't be extended though. I originally wanted to a do a meta-schema to enforce some of this, but there's just too many exceptions. Rob
On 19/04/2023 00:26, Rob Herring wrote: > On Sun, Apr 16, 2023 at 05:39:29PM +0200, Krzysztof Kozlowski wrote: >> Few panel bindings for dual-link connections just type "ports: true", >> which does not enforce any type. Add common definition of ports, so the >> type will be fixed. >> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> >> --- >> >> Cc: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- >> .../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml >> index 5b38dc89cb21..ad62d34e6fa3 100644 >> --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml >> +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml >> @@ -70,6 +70,16 @@ properties: >> port: >> $ref: /schemas/graph.yaml#/properties/port >> >> + # For dual-link connections >> + ports: >> + $ref: /schemas/graph.yaml#/properties/ports >> + patternProperties: >> + "^port@[0-9a-f]+$": >> + $ref: /schemas/graph.yaml#/$defs/port-base > > This allows any undocumented property. Yes, which I hope the device schema (using this panel-common) will narrow with additionalProperties: false. I can make it explicit: additionalProperties: true. Otherwise, how do I allow custom properties like: Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml > >> + >> + required: >> + - port@0 >> + > > I don't think this should be added here because users must define what > each port is. With it here, we're going to validate the nodes twice as > well. Same can be said for 'port' though. It can't be extended though. So you propose to drop entire "ports" here and expect every panel schema to define it instead? Best regards, Krzysztof
On Wed, Apr 19, 2023 at 10:56:55AM +0200, Krzysztof Kozlowski wrote: > On 19/04/2023 00:26, Rob Herring wrote: > > On Sun, Apr 16, 2023 at 05:39:29PM +0200, Krzysztof Kozlowski wrote: > >> Few panel bindings for dual-link connections just type "ports: true", > >> which does not enforce any type. Add common definition of ports, so the > >> type will be fixed. > >> > >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > >> > >> --- > >> > >> Cc: Konrad Dybcio <konrad.dybcio@linaro.org> > >> --- > >> .../bindings/display/panel/panel-common.yaml | 16 ++++++++++++++++ > >> 1 file changed, 16 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > >> index 5b38dc89cb21..ad62d34e6fa3 100644 > >> --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml > >> +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml > >> @@ -70,6 +70,16 @@ properties: > >> port: > >> $ref: /schemas/graph.yaml#/properties/port > >> > >> + # For dual-link connections > >> + ports: > >> + $ref: /schemas/graph.yaml#/properties/ports > >> + patternProperties: > >> + "^port@[0-9a-f]+$": > >> + $ref: /schemas/graph.yaml#/$defs/port-base > > > > This allows any undocumented property. > > Yes, which I hope the device schema (using this panel-common) will > narrow with additionalProperties: false. > > I can make it explicit: additionalProperties: true. > > Otherwise, how do I allow custom properties like: > Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml > > > > >> + > >> + required: > >> + - port@0 > >> + > > > > I don't think this should be added here because users must define what > > each port is. With it here, we're going to validate the nodes twice as > > well. Same can be said for 'port' though. It can't be extended though. > > So you propose to drop entire "ports" here and expect every panel schema > to define it instead? Only those with more than 1 port or extra port/endpoint properties. If neither of those are true, then they can use just 'port'. Otherwise, all those panel bindings already have to define the port nodes already. Rob
diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml index 5b38dc89cb21..ad62d34e6fa3 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml @@ -70,6 +70,16 @@ properties: port: $ref: /schemas/graph.yaml#/properties/port + # For dual-link connections + ports: + $ref: /schemas/graph.yaml#/properties/ports + patternProperties: + "^port@[0-9a-f]+$": + $ref: /schemas/graph.yaml#/$defs/port-base + + required: + - port@0 + ddc-i2c-bus: $ref: /schemas/types.yaml#/definitions/phandle description: @@ -154,6 +164,12 @@ dependencies: width-mm: [ height-mm ] height-mm: [ width-mm ] +allOf: + - not: + required: + - port + - ports + additionalProperties: true ...