Message ID | 20231218132045.2066576-2-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1253443dyi; Mon, 18 Dec 2023 05:53:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEq6+ZOWNa1sdEoZ6aItbbgf6harHS+wpmk1kvyKf5HXSVAR6VvmlsOhjnLyCHWePWsjVa5 X-Received: by 2002:a17:902:bc84:b0:1cf:da41:7292 with SMTP id bb4-20020a170902bc8400b001cfda417292mr14723439plb.45.1702907637600; Mon, 18 Dec 2023 05:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702907637; cv=none; d=google.com; s=arc-20160816; b=jPonETML9nLd0MqGE0AXJbby7GDyO6MeKA2GlBNZfq+wXdswQ1MqizuO0otM8QiyGI fJk5dWoel5kb+t4hYQq6aQi4d8hwIkLItEIntR7Sxl8FZNtvwJyKCpm7Br5Bhb6FNFDO PHXTyKnKNBEXhUSJfh9KvyqeLszcjAqbtvLGAwE1pPJWQDwfsZNs74sXfZMpgRTz0R6a F2n219cxnyoXRQIkQlZvjZdpn8dyD01lH0HGqhosCt4Agh/tXPn3iF+5A45CBil9jl0q 05uiSsygwdn90RFxXaao7he3aUpEAVjqyNPhpeelyfhVuBisfsyEalY78vgST8GGV4vd FNJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xcLxXFd71FqRSBT1EG5Vxt0tr8/Qm7u7kD7fkPmPXog=; fh=Ty68pxBBriQNqMpR91HQMaZ9KkK5r/kLdLBgpV5fHJo=; b=tKpLswqG97yYWn2DtxH618T3oLAYywsLPnKeN3oqLYptK10BiDzQz7npS9oY3SyhEP trKIPsRUmms2TpLRu66ayFX8mnJ1HXqzKuJ5w5Wk/nIwZOcvuFcnZ9Gmjg96Xq5F9bn4 ZQ8oMIEyFtXnj8V8GmyluurIQfXVfTxsZv6bD/r4fbRXZuyq2CK8XKY2KGayaMkBc/of r8k/HYoWns63pLJMs2vXo1RkJtGWoIojhGlWZOACyNpzd0+Mq6My+96059ojecyN94ny fsjdd9XP6YEy4TdtBN5JzCk/Vy1ofNy3A2CICvZg+MM2Gc0THTdhK8r6dunYD6yzgnpx t8pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J3daaCiL; spf=pass (google.com: domain of linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p7-20020a1709028a8700b001d39f6f1b17si3779050plo.51.2023.12.18.05.53.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J3daaCiL; spf=pass (google.com: domain of linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3779-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5B5EC283BCA for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 13:53:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC8C1129EFB; Mon, 18 Dec 2023 13:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J3daaCiL" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABF9415AC0 for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 13:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702907620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xcLxXFd71FqRSBT1EG5Vxt0tr8/Qm7u7kD7fkPmPXog=; b=J3daaCiLLpHCeA5flahgWqM+5cHBiGs4uumjcr17ZWgsnEXWtpboUrYRKQLvbmgEBR17Il 1JwnvEnJGzUPh5kTo1pgx1UGa8CEDltB5hMNtejwgua+EeLOUoAqdKhqL6qTurHiMcXCzI DwOXeabAArh//qiSx8ZUo3PV9KzH/fo= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-665-yHjWfYp-MZu9huJpMVe_rg-1; Mon, 18 Dec 2023 08:53:39 -0500 X-MC-Unique: yHjWfYp-MZu9huJpMVe_rg-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-50e30e33677so1034592e87.2 for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 05:53:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702907617; x=1703512417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xcLxXFd71FqRSBT1EG5Vxt0tr8/Qm7u7kD7fkPmPXog=; b=eKK/BKXe5STJtp8fI1KGeobsiDoi8JFa8LzIviPsFokTNYNIlBflvZPE+IuO2wcjTq XJQROlDzGBDmBZavVxAKF/jy8CRznwBeIdl5aDckMiDsDUQFQsHnZ28Vn2oh5Nfb51vB ozeZGOk2c5qlkQLPoxmx00nZRF2I1O6qK3KhWE4jHJ0txyM1B6Bbr/fabrJPOYG/NQea fhZCmjfIPlhUhcVkXuY1zETPn/Up3eAnjjaouoIEvhJKMsnpy4J/d8WZ2KST2aC6/yVW RZgR8jDBnBOD7YrkY8xHfSS8YLgibAfNQAiymgcLTzut/5M38FoK6cyC3agI04tzBXkb HUTg== X-Gm-Message-State: AOJu0YzLVi8ZfuuawYAajQPjDvccTchJ5seYkyOFFigmG3DCxaUHIIJN SK9S+CwxVpRN76NxmandzHyInWN6THvtxvUk8A6T+kQl9fGvWsAehrX//L2q+NIrpUgZBGFK+Qo 45dek806HL6A9AwwpXF4wCEcLCbuyHR1B6+rVIitppy8t9yeD6ULrAzdvhRCCDIMloVYrXG4WMb oTisCum4E= X-Received: by 2002:a19:2d02:0:b0:50e:3121:1a12 with SMTP id k2-20020a192d02000000b0050e31211a12mr1252032lfj.110.1702907617013; Mon, 18 Dec 2023 05:53:37 -0800 (PST) X-Received: by 2002:adf:cf0e:0:b0:336:445a:ec51 with SMTP id o14-20020adfcf0e000000b00336445aec51mr4106218wrj.143.1702905686791; Mon, 18 Dec 2023 05:21:26 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id g17-20020a5d5551000000b003333521a1cesm2115952wrw.57.2023.12.18.05.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:21:25 -0800 (PST) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Maxime Ripard <mripard@kernel.org>, Jocelyn Falempe <jfalempe@redhat.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Conor Dooley <conor@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Thomas Zimmermann <tzimmermann@suse.de>, Peter Robinson <pbrobinson@gmail.com>, Rob Herring <robh@kernel.org>, Javier Martinez Canillas <javierm@redhat.com>, Conor Dooley <conor+dt@kernel.org>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Rob Herring <robh+dt@kernel.org>, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/2] dt-bindings: display: Add SSD133x OLED controllers Date: Mon, 18 Dec 2023 14:20:35 +0100 Message-ID: <20231218132045.2066576-2-javierm@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218132045.2066576-1-javierm@redhat.com> References: <20231218132045.2066576-1-javierm@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785628078823651711 X-GMAIL-MSGID: 1785628078823651711 |
Series |
drm/solomon: Add support for the SSD133x controller family
|
|
Commit Message
Javier Martinez Canillas
Dec. 18, 2023, 1:20 p.m. UTC
Add a Device Tree binding schema for the OLED panels based on the
Solomon SSD133x family of controllers.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
Changes in v2:
- Unconditionally set the width and height constraints (Conor Dooley).
- Fix indentation in the DTS examples (Krzysztof Kozlowski).
.../bindings/display/solomon,ssd133x.yaml | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd133x.yaml
Comments
On Mon, Dec 18, 2023 at 02:20:35PM +0100, Javier Martinez Canillas wrote: > Add a Device Tree binding schema for the OLED panels based on the > Solomon SSD133x family of controllers. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > --- > > Changes in v2: > - Unconditionally set the width and height constraints (Conor Dooley). > - Fix indentation in the DTS examples (Krzysztof Kozlowski). > > .../bindings/display/solomon,ssd133x.yaml | 57 +++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > new file mode 100644 > index 000000000000..8feee9eef0fd > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > @@ -0,0 +1,57 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/display/solomon,ssd133x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Solomon SSD133x OLED Display Controllers > + > +maintainers: > + - Javier Martinez Canillas <javierm@redhat.com> > + > +properties: > + compatible: > + enum: > + - solomon,ssd1331 > + > +required: > + - compatible > + - reg > + > +allOf: > + - $ref: solomon,ssd-common.yaml# > + > + - properties: > + width: > + default: 96 > + height: > + default: 64 diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml index 8feee9eef0fd..ffc939c782eb 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml @@ -9,24 +9,24 @@ title: Solomon SSD133x OLED Display Controllers maintainers: - Javier Martinez Canillas <javierm@redhat.com> +allOf: + - $ref: solomon,ssd-common.yaml# + properties: compatible: enum: - solomon,ssd1331 + width: + default: 96 + + height: + default: 64 + required: - compatible - reg -allOf: - - $ref: solomon,ssd-common.yaml# - - - properties: - width: - default: 96 - height: - default: 64 - unevaluatedProperties: false examples: The properties stuff doesn't need to be in the allOf. Although, I took the opportunity to look at ssd-common.yaml. How do the height/width here differ from the vendor prefixed versions in that file?
Conor Dooley <conor@kernel.org> writes: Hello Conor, Thanks a lot for your feedback. > On Mon, Dec 18, 2023 at 02:20:35PM +0100, Javier Martinez Canillas wrote: [...] >> + >> + - properties: >> + width: >> + default: 96 >> + height: >> + default: 64 > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > index 8feee9eef0fd..ffc939c782eb 100644 > --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > @@ -9,24 +9,24 @@ title: Solomon SSD133x OLED Display Controllers > maintainers: > - Javier Martinez Canillas <javierm@redhat.com> > > +allOf: > + - $ref: solomon,ssd-common.yaml# > + > properties: > compatible: > enum: > - solomon,ssd1331 > > + width: > + default: 96 > + > + height: > + default: 64 > + > required: > - compatible > - reg > > -allOf: > - - $ref: solomon,ssd-common.yaml# > - > - - properties: > - width: > - default: 96 > - height: > - default: 64 > - > unevaluatedProperties: false > > examples: > > The properties stuff doesn't need to be in the allOf. Although, I took Ok. > the opportunity to look at ssd-common.yaml. How do the height/width here > differ from the vendor prefixed versions in that file? Oh! That is an error in the schema that I introduced when adding the binding for the SSD132x family in commit 2d23e7d6bacb ("dt-bindings: display: Add SSD132x OLED controllers"), and I just copied it to this binding as well making the same mistake... I'll fix that with a preparatory patch to use "solomon,{width,height}" everywhere in v3 and also include your suggested changes for this patch.
Conor Dooley <conor@kernel.org> writes: Hello Conor, > On Mon, Dec 18, 2023 at 02:20:35PM +0100, Javier Martinez Canillas wrote: [...] >> +allOf: >> + - $ref: solomon,ssd-common.yaml# >> + >> + - properties: >> + width: >> + default: 96 >> + height: >> + default: 64 > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > index 8feee9eef0fd..ffc939c782eb 100644 > --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > @@ -9,24 +9,24 @@ title: Solomon SSD133x OLED Display Controllers > maintainers: > - Javier Martinez Canillas <javierm@redhat.com> > > +allOf: > + - $ref: solomon,ssd-common.yaml# > + This part worked correctly... > properties: > compatible: > enum: > - solomon,ssd1331 > > + width: > + default: 96 > + > + height: > + default: 64 > + ...but when trying move the default for the "solomon,width" and "solomon,height" to the properties section, make dt_binding_check complains as follows: LINT Documentation/devicetree/bindings CHKDT Documentation/devicetree/bindings/processed-schema.json /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,height: 'oneOf' conditional failed, one must be fixed: 'type' is a required property hint: A vendor boolean property can use "type: boolean" 'description' is a required property hint: A vendor boolean property can use "type: boolean" Additional properties are not allowed ('default' was unexpected) hint: A vendor boolean property can use "type: boolean" /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,height: 'oneOf' conditional failed, one must be fixed: 'enum' is a required property 'const' is a required property hint: A vendor string property with exact values has an implicit type from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,height: 'oneOf' conditional failed, one must be fixed: '$ref' is a required property 'allOf' is a required property hint: A vendor property needs a $ref to types.yaml from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# hint: Vendor specific properties must have a type and description unless they have a defined, common suffix. from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,width: 'oneOf' conditional failed, one must be fixed: 'type' is a required property hint: A vendor boolean property can use "type: boolean" 'description' is a required property hint: A vendor boolean property can use "type: boolean" Additional properties are not allowed ('default' was unexpected) hint: A vendor boolean property can use "type: boolean" /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,width: 'oneOf' conditional failed, one must be fixed: 'enum' is a required property 'const' is a required property hint: A vendor string property with exact values has an implicit type from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# /home/javier/devel/linux/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml: properties:solomon,width: 'oneOf' conditional failed, one must be fixed: '$ref' is a required property 'allOf' is a required property hint: A vendor property needs a $ref to types.yaml from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# hint: Vendor specific properties must have a type and description unless they have a defined, common suffix. from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# SCHEMA Documentation/devicetree/bindings/processed-schema.json DTEX Documentation/devicetree/bindings/display/solomon,ssd133x.example.dts /home/javier/.local/bin/dt-extract-example:75: SyntaxWarning: invalid escape sequence '\s' root_node = re.search('/\s*{', ex) /home/javier/.local/bin/dt-extract-example:79: SyntaxWarning: invalid escape sequence '\s' int_val = re.search('\sinterrupts\s*=\s*<([0-9a-zA-Z |()_]+)>', ex).group(1) DTC_CHK Documentation/devicetree/bindings/display/solomon,ssd133x.example.dtb The warning goes away if I follow the hints and add a type and description to the properties, i.e: diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml index 880c71fdec68..0f4d9ca7456b 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml @@ -17,6 +17,20 @@ properties: enum: - solomon,ssd1331 + solomon,width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Width in pixel of the screen driven by the controller. + The default value is controller-dependent. + default: 96 + + solomon,height: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Height in pixel of the screen driven by the controller. + The default value is controller-dependent. + default: 64 + required: - compatible - reg But that would duplicate information that is already present in the included solomon,ssd-common.yaml schema. Do you know what is the proper way to do this? Or maybe should I just drop the default values for the width and height properties? I just think that is good information to have in the schema.
On 19/12/2023 12:20, Javier Martinez Canillas wrote: > Conor Dooley <conor@kernel.org> writes: > > Hello Conor, > >> On Mon, Dec 18, 2023 at 02:20:35PM +0100, Javier Martinez Canillas wrote: > > [...] > >>> +allOf: >>> + - $ref: solomon,ssd-common.yaml# >>> + >>> + - properties: >>> + width: >>> + default: 96 >>> + height: >>> + default: 64 >> >> diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml >> index 8feee9eef0fd..ffc939c782eb 100644 >> --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml >> +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml >> @@ -9,24 +9,24 @@ title: Solomon SSD133x OLED Display Controllers >> maintainers: >> - Javier Martinez Canillas <javierm@redhat.com> >> >> +allOf: >> + - $ref: solomon,ssd-common.yaml# >> + > > This part worked correctly... > >> properties: >> compatible: >> enum: >> - solomon,ssd1331 >> >> + width: >> + default: 96 >> + >> + height: >> + default: 64 Which also looks wrong on its own. Where is the definition of these properties? IOW, where do they come from? >> + > > ...but when trying move the default for the "solomon,width" and > "solomon,height" to the properties section, make dt_binding_check > complains as follows: Worked for me. ... > DTC_CHK Documentation/devicetree/bindings/display/solomon,ssd133x.example.dtb > > The warning goes away if I follow the hints and add a type and description > to the properties, i.e: Hm, I wonder what's different in your case. I assume you run the latest dtschema. > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > index 880c71fdec68..0f4d9ca7456b 100644 > --- a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml > @@ -17,6 +17,20 @@ properties: > enum: > - solomon,ssd1331 > > + solomon,width: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: > + Width in pixel of the screen driven by the controller. > + The default value is controller-dependent. > + default: 96 > + > + solomon,height: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: > + Height in pixel of the screen driven by the controller. > + The default value is controller-dependent. > + default: 64 > + > required: > - compatible > - reg > > But that would duplicate information that is already present in the > included solomon,ssd-common.yaml schema. Do you know what is the proper > way to do this? Works for me, so please paste somewhere proper diff so we can compare. Best regards, Krzysztof
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> writes: Hello Krzysztof, > On 19/12/2023 12:20, Javier Martinez Canillas wrote: [...] >>>> +allOf: >>>> + - $ref: solomon,ssd-common.yaml# >>>> + [...] >>> >>> + width: >>> + default: 96 >>> + >>> + height: >>> + default: 64 > > Which also looks wrong on its own. Where is the definition of these Yes, I already discussed this with Conor and mentioned to him that is a typo but already fixed it locally and I'm testing with the correct ones. > properties? IOW, where do they come from? > The "solomon,width" and "solomon,height" properties are defined in the solomon,ssd-common.yaml binding schema file that is referenced. >>> + >> >> ...but when trying move the default for the "solomon,width" and >> "solomon,height" to the properties section, make dt_binding_check >> complains as follows: > > Worked for me. > Oh, that's good to know. I wonder what's the difference... > ... > >> DTC_CHK Documentation/devicetree/bindings/display/solomon,ssd133x.example.dtb >> >> The warning goes away if I follow the hints and add a type and description >> to the properties, i.e: > > Hm, I wonder what's different in your case. I assume you run the latest > dtschema. > Not the latest but had a recent one. I've updated it, so I do now :) $ pip list | grep dtschema dtschema 2023.9 $ pip install --upgrade dtschema $ pip list | grep dtschema dtschema 2023.11 [...] >> But that would duplicate information that is already present in the >> included solomon,ssd-common.yaml schema. Do you know what is the proper >> way to do this? > > Works for me, so please paste somewhere proper diff so we can compare. > With the latest dtschema version it works indeed. Thanks for the pointer! $ make W=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/solomon,ssd133x.yaml LINT Documentation/devicetree/bindings CHKDT Documentation/devicetree/bindings/processed-schema.json SCHEMA Documentation/devicetree/bindings/processed-schema.json DTEX Documentation/devicetree/bindings/display/solomon,ssd133x.example.dts DTC_CHK Documentation/devicetree/bindings/display/solomon,ssd133x.example.dtb > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file mode 100644 index 000000000000..8feee9eef0fd --- /dev/null +++ b/Documentation/devicetree/bindings/display/solomon,ssd133x.yaml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/solomon,ssd133x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Solomon SSD133x OLED Display Controllers + +maintainers: + - Javier Martinez Canillas <javierm@redhat.com> + +properties: + compatible: + enum: + - solomon,ssd1331 + +required: + - compatible + - reg + +allOf: + - $ref: solomon,ssd-common.yaml# + + - properties: + width: + default: 96 + height: + default: 64 + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + oled@3c { + compatible = "solomon,ssd1331"; + reg = <0x3c>; + reset-gpios = <&gpio2 7>; + }; + + }; + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + oled@0 { + compatible = "solomon,ssd1331"; + reg = <0x0>; + reset-gpios = <&gpio2 7>; + dc-gpios = <&gpio2 8>; + spi-max-frequency = <10000000>; + }; + };