Message ID | 20231009183522.543918-9-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2055232vqo; Mon, 9 Oct 2023 11:38:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQQch9RUVaxAcYS5YOQKkci3zQ0vtvHZEJ59LvXIqrhEbeefNBMFSR29JzJfOEiJgpkd+t X-Received: by 2002:a17:90a:b114:b0:25b:c454:a366 with SMTP id z20-20020a17090ab11400b0025bc454a366mr15857366pjq.5.1696876736793; Mon, 09 Oct 2023 11:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696876736; cv=none; d=google.com; s=arc-20160816; b=Io8oriTHiwGvWQ/4V7GP9jOel3U9bstcR8ryBfjuvsLbTLjqv0rEJpnNJWQ+3QUDB6 ZN7lF5VhpqRLkV3xqUY+pe+yBnroz1GcR7M88REfxuz+gUG+NHMxk5rALWAup7Rkv/Ar O2AKFSvLAGui6hKfInNyiG1KAdEY26uTgSwUNF88nI2MXP18MM0aKD2drwkdmaDhoZf+ 7SM6oy/1LlAcgpqkY9BcmOjfkK9oTMmhaHEE/wchwDCqgy9+BOVYQwfg3XPxT+avKwLy FtK3iYNVW5qmr6GWUH3Om+Bizuf/YVrvZNGA9CxZSpYOIIb1CgyyJdHcj9qHGwQzZgUD YiyQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QVKQrPdUbZGc1wU+oO+Twkh3N/BNeBlGHNRWMhTu31k=; fh=Qe1jJ3QoeEu44AKXGK0e4h3a8gwrRnsPqG0tZqqpWYY=; b=OPymXgF7TY1ustLo0Ua4SMKsvAzltFLU2RgOeUco0ZrLOTfqKAL8dPSy8kuEENnxRr nHDXVM7mgJksK1fCgKoEChYeMS3Fiuhg6NZsbNgyb7tNx8Ub9qppsKuhsb4aABo/snYe ZcJA79F6zzm5PlsSNity9bPLxDTPmrOlU4Ly61d/Igtcafz/af49gUPMuYHQjRJ96qhC P16sR0s0KPELcTdFE3v086m5BgiZGwo/gtZq5X1yuFWeNPvAqcKdptH+2bOUzW7nAeE4 x+ocst2oVvLRT+Gm4RUeWAphXEACAdG6RS85wYvyuBjIF8Rl87B6i0DDRslGmwnq5c2W 58lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZGdS2dKM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a4-20020a17090aa50400b0026ceee6848asi12118883pjq.180.2023.10.09.11.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZGdS2dKM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 654E780B83B2; Mon, 9 Oct 2023 11:38:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378218AbjJIShc (ORCPT <rfc822;ezelljr.billy@gmail.com> + 18 others); Mon, 9 Oct 2023 14:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378209AbjJIShP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Oct 2023 14:37:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04151C6 for <linux-kernel@vger.kernel.org>; Mon, 9 Oct 2023 11:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696876582; 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=QVKQrPdUbZGc1wU+oO+Twkh3N/BNeBlGHNRWMhTu31k=; b=ZGdS2dKM/FSbizUYKYF0FsM70M33pd1lao1z+X1Qo88xNlV2WQ8MVdDS3q7t6ad0eAxZAv OrzI+Beqm7fSgw0DXPWpxREAQdr/1haUzAuT8iLAv5MKAfy72ucC8HMDSTcvmt5u8cEqPA rQoMUburAmDrSu+fEU5fygojyiYhTXU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252--Jhv4srvMLWE1aNEW_63eA-1; Mon, 09 Oct 2023 14:36:11 -0400 X-MC-Unique: -Jhv4srvMLWE1aNEW_63eA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-327ab41de6cso3517806f8f.2 for <linux-kernel@vger.kernel.org>; Mon, 09 Oct 2023 11:36:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696876569; x=1697481369; 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=QVKQrPdUbZGc1wU+oO+Twkh3N/BNeBlGHNRWMhTu31k=; b=YxR1QwYwzU+CexLQT0z0UGL+6Wahyyot1gJoZu/rRHbbuZvNYjvWefMnaTpIk3ktIz QWzFr1cS1REgwKjp1GLIdCE36y/s3yW62zcQZU085dVyPZHG+SNApGY65Tn5yzhwsE4B A0XsjcoWJVaUcb60/HKvJSd4LNqE0UqSNEM1eCVsiQMsVyAezIhJYbRNMxAvKGgpQd0E xyx4kpy6GfYo1voiItAofYOz/pIoyiCgzzX3IRKN+UcFpPF8NP5bpNt2W4shavePiq7Z tg1b1msvzew2atgMYGJalIvmCZxlJW2Nf4YNwVwEqaqFzWkpDGTeJJ9YTFEznBKOymzx OK2w== X-Gm-Message-State: AOJu0Yz7cjS62vLbVlZ6cTGo6xjkwefLoCqGNe9Mvp20rUmw9JcTI4bQ Ya7hCDO92y/j29ES2akmECTGq39YDRBswpnuLn1U2+wcZkq9POBJEaSt2LBp+UI2HlhvgbeqYxc CxusL5FxsvTnbPcy35BQXWjgOqE4N/4P53UjnObciQfJ+qgGzrdyVLMc/IF/htvYIRkaEr/JJNR y62eVgIiY= X-Received: by 2002:a05:6000:1008:b0:31a:ed75:75df with SMTP id a8-20020a056000100800b0031aed7575dfmr14391824wrx.15.1696876569561; Mon, 09 Oct 2023 11:36:09 -0700 (PDT) X-Received: by 2002:a05:6000:1008:b0:31a:ed75:75df with SMTP id a8-20020a056000100800b0031aed7575dfmr14391797wrx.15.1696876569304; Mon, 09 Oct 2023 11:36:09 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id b16-20020adfe650000000b003266ece0fe2sm10221874wrn.98.2023.10.09.11.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:36:09 -0700 (PDT) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, Geert Uytterhoeven <geert@linux-m68k.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 8/8] dt-bindings: display: Add SSD132x OLED controllers Date: Mon, 9 Oct 2023 20:34:22 +0200 Message-ID: <20231009183522.543918-9-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231009183522.543918-1-javierm@redhat.com> References: <20231009183522.543918-1-javierm@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:38:54 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779304221020125667 X-GMAIL-MSGID: 1779304221020125667 |
Series |
drm/solomon: Add support for the SSD132x controller family
|
|
Commit Message
Javier Martinez Canillas
Oct. 9, 2023, 6:34 p.m. UTC
Add a Device Tree binding schema for the OLED panels based on the Solomon
SSD132x family of controllers.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
.../bindings/display/solomon,ssd132x.yaml | 116 ++++++++++++++++++
1 file changed, 116 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd132x.yaml
Comments
Hey, On Mon, Oct 09, 2023 at 08:34:22PM +0200, Javier Martinez Canillas wrote: > Add a Device Tree binding schema for the OLED panels based on the Solomon > SSD132x family of controllers. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > --- > > .../bindings/display/solomon,ssd132x.yaml | 116 ++++++++++++++++++ > 1 file changed, 116 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > new file mode 100644 > index 000000000000..b64904703a3a > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > @@ -0,0 +1,116 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/display/solomon,ssd132x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Solomon SSD132x OLED Controllers > + > +maintainers: > + - Javier Martinez Canillas <javierm@redhat.com> > + > +properties: > + compatible: > + oneOf: > + - enum: > + - solomon,ssd1322 > + - solomon,ssd1325 > + - solomon,ssd1327 You don't need the oneOf here here as there is only the enum as a possible item. I didn't get anything else in the series, I have to ask - are these controllers not compatible with eachother? > + > + reg: > + maxItems: 1 > + > + reset-gpios: > + maxItems: 1 > + > + # Only required for SPI > + dc-gpios: > + description: > + GPIO connected to the controller's D/C# (Data/Command) pin, > + that is needed for 4-wire SPI to tell the controller if the > + data sent is for a command register or the display data RAM > + maxItems: 1 > + > + 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. You probably know better than me, operating in drm stuff, but are there really no generic properties for the weidth/height of a display? > + > + 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. > + > +required: > + - compatible > + - reg > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + > + - if: > + properties: > + compatible: > + contains: > + const: solomon,ssd1322 > + then: > + properties: > + width: > + default: 480 > + height: > + default: 128 > + > + - if: > + properties: > + compatible: > + contains: > + const: solomon,ssd1325 > + then: > + properties: > + width: > + default: 128 > + height: > + default: 80 > + > + - if: > + properties: > + compatible: > + contains: > + const: solomon,ssd1327 > + then: > + properties: > + width: > + default: 128 > + height: > + default: 128 Unless you did it like this for clarity, 2 of these have the same default width and 2 have the same default height. You could cut this down to a pair of if/then/else on that basis AFAICT. :wq > + > +unevaluatedProperties: false > + > +examples: > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + ssd1327_i2c: oled@3c { This label is unused as far as I can tell. Ditto below. Cheers, Conor. > + compatible = "solomon,ssd1327"; > + reg = <0x3c>; > + reset-gpios = <&gpio2 7>; > + }; > + > + }; > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + ssd1327_spi: oled@0 { > + compatible = "solomon,ssd1327"; > + reg = <0x0>; > + reset-gpios = <&gpio2 7>; > + dc-gpios = <&gpio2 8>; > + spi-max-frequency = <10000000>; > + }; > + }; > -- > 2.41.0 > >
On Mon, Oct 09, 2023 at 08:34:22PM +0200, Javier Martinez Canillas wrote: > Add a Device Tree binding schema for the OLED panels based on the Solomon > SSD132x family of controllers. Looks like the same binding as solomon,ssd1307fb.yaml. Why a different binding? Why does that binding need a slew of custom properties and here you don't? > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > --- > > .../bindings/display/solomon,ssd132x.yaml | 116 ++++++++++++++++++ > 1 file changed, 116 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > new file mode 100644 > index 000000000000..b64904703a3a > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml > @@ -0,0 +1,116 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/display/solomon,ssd132x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Solomon SSD132x OLED Controllers > + > +maintainers: > + - Javier Martinez Canillas <javierm@redhat.com> > + > +properties: > + compatible: > + oneOf: > + - enum: > + - solomon,ssd1322 > + - solomon,ssd1325 > + - solomon,ssd1327 > + > + reg: > + maxItems: 1 > + > + reset-gpios: > + maxItems: 1 > + > + # Only required for SPI > + dc-gpios: > + description: > + GPIO connected to the controller's D/C# (Data/Command) pin, > + that is needed for 4-wire SPI to tell the controller if the > + data sent is for a command register or the display data RAM > + maxItems: 1 > + > + 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. > + > + 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. Don't define the same properties twice. Either share the binding or split out the common properties into their own schema file. Rob
Conor Dooley <conor@kernel.org> writes: Hello Conor, Thanks a lot for your feedback. > Hey, > > On Mon, Oct 09, 2023 at 08:34:22PM +0200, Javier Martinez Canillas wrote: [...] >> +properties: >> + compatible: >> + oneOf: >> + - enum: >> + - solomon,ssd1322 >> + - solomon,ssd1325 >> + - solomon,ssd1327 > > You don't need the oneOf here here as there is only the enum as a > possible item. Indeed. I'll fix that in v2. > I didn't get anything else in the series, I have to ask - are these > controllers not compatible with eachother? > They are not, basically the difference is in the default width and height for each controller. That's why the width and height fields are optional. But other than the default resolution, yes the controllers are very much the same. >> + >> + reg: >> + maxItems: 1 >> + >> + reset-gpios: >> + maxItems: 1 >> + >> + # Only required for SPI >> + dc-gpios: >> + description: >> + GPIO connected to the controller's D/C# (Data/Command) pin, >> + that is needed for 4-wire SPI to tell the controller if the >> + data sent is for a command register or the display data RAM >> + maxItems: 1 >> + >> + 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. > > You probably know better than me, operating in drm stuff, but are there > really no generic properties for the weidth/height of a display? > There are some common properties, such as the width-mm and height-mm for the panel-common: Documentation/devicetree/bindings/display/panel/panel-common.yaml But those are to describe the physical area expressed in millimeters and the Solomon drivers (the old ssd1307fb fbdev driver and the new ssd130x DRM driver for backward compatibility with existing DTB) express the width and height in pixels. That's why are Solomon controller specific properties "solomon,width" and "solomon,height". [...] >> + then: >> + properties: >> + width: >> + default: 128 >> + height: >> + default: 128 > > Unless you did it like this for clarity, 2 of these have the same > default width and 2 have the same default height. You could cut this > down to a pair of if/then/else on that basis AFAICT. > :wq > Yes, this was done like that for clarity. Because is easier for someone reading the DT binding schema to reason about resolution (width,height) for a given SSD132x controller, rather than following the if/else logic. >> + >> +unevaluatedProperties: false >> + >> +examples: >> + - | >> + i2c { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + ssd1327_i2c: oled@3c { > > This label is unused as far as I can tell. Ditto below. > Right, I'll drop those too. > Cheers, > Conor. >
Rob Herring <robh@kernel.org> writes: Hello Rob, Thanks a lot for your feedback. > On Mon, Oct 09, 2023 at 08:34:22PM +0200, Javier Martinez Canillas wrote: >> Add a Device Tree binding schema for the OLED panels based on the Solomon >> SSD132x family of controllers. > > Looks like the same binding as solomon,ssd1307fb.yaml. Why a different > binding? Why does that binding need a slew of custom properties and here > you don't? > It's a sub-set of it. Because only the minimum required properties are defined. But also, is a clean slate schema because the old ssd1307fb fbdev driver only supports the Solomon SSD130x family, so there is no need to follow the existing solomon,ssd1307fb.yaml nor the need for backward compat. [...] >> + 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. >> + >> + 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. > > Don't define the same properties twice. Either share the binding or > split out the common properties into their own schema file. > Agreed. I'll do that in v2. > Rob >
Javier Martinez Canillas <javierm@redhat.com> writes: > Rob Herring <robh@kernel.org> writes: > > Hello Rob, > > Thanks a lot for your feedback. > >> On Mon, Oct 09, 2023 at 08:34:22PM +0200, Javier Martinez Canillas wrote: >>> Add a Device Tree binding schema for the OLED panels based on the Solomon >>> SSD132x family of controllers. >> >> Looks like the same binding as solomon,ssd1307fb.yaml. Why a different >> binding? Why does that binding need a slew of custom properties and here >> you don't? >> > > It's a sub-set of it. Because only the minimum required properties are > defined. But also, is a clean slate schema because the old ssd1307fb fbdev > driver only supports the Solomon SSD130x family, so there is no need to > follow the existing solomon,ssd1307fb.yaml nor the need for backward compat. > I think this answer was a little sparse, let me elaborate a bit. The Solomon display controllers are quite flexible, so that could be used with different OLED panels. And the ssd1307fb binding schema defines a set of properties that are almost a 1:1 mapping from properties to the configuration registers. This makes the driver to support most SSD130x controller + panel configurations but at the expense of making the binding more complicated (a slew of custom propertie as you pointed out). Now, as mentioned this is support for greyscale Solomon controllers (the old fbdev driver only supports monochrome controllers) so we don't care about DT backward compatibility. I decided for now to keep the binding at a minimum and be more opinionated in the driver with having what I think are sane defaults for most of the config registers. If there is a need to expose any of this configuration as DT properties, then we can later added it share some of the existing solomon,ssd1307fb.yaml custom properties and move them to a common schema. We can always change the driver in the future anyways, but we can't do the same with the DT binding schema since that is considered an ABI.
On Wed, Oct 11, 2023 at 08:34:29AM +0200, Javier Martinez Canillas wrote: > Conor Dooley <conor@kernel.org> writes: > >> + # Only required for SPI > >> + dc-gpios: > >> + description: > >> + GPIO connected to the controller's D/C# (Data/Command) pin, > >> + that is needed for 4-wire SPI to tell the controller if the > >> + data sent is for a command register or the display data RAM > >> + maxItems: 1 > >> + > >> + 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. > > > > You probably know better than me, operating in drm stuff, but are there > > really no generic properties for the weidth/height of a display? > > > > There are some common properties, such as the width-mm and height-mm for > the panel-common: > > Documentation/devicetree/bindings/display/panel/panel-common.yaml > > But those are to describe the physical area expressed in millimeters and > the Solomon drivers (the old ssd1307fb fbdev driver and the new ssd130x > DRM driver for backward compatibility with existing DTB) express the width > and height in pixels. > > That's why are Solomon controller specific properties "solomon,width" and > "solomon,height". Okay. Thanks for the explanation.
diff --git a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml new file mode 100644 index 000000000000..b64904703a3a --- /dev/null +++ b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml @@ -0,0 +1,116 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/solomon,ssd132x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Solomon SSD132x OLED Controllers + +maintainers: + - Javier Martinez Canillas <javierm@redhat.com> + +properties: + compatible: + oneOf: + - enum: + - solomon,ssd1322 + - solomon,ssd1325 + - solomon,ssd1327 + + reg: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + # Only required for SPI + dc-gpios: + description: + GPIO connected to the controller's D/C# (Data/Command) pin, + that is needed for 4-wire SPI to tell the controller if the + data sent is for a command register or the display data RAM + maxItems: 1 + + 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. + + 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. + +required: + - compatible + - reg + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + + - if: + properties: + compatible: + contains: + const: solomon,ssd1322 + then: + properties: + width: + default: 480 + height: + default: 128 + + - if: + properties: + compatible: + contains: + const: solomon,ssd1325 + then: + properties: + width: + default: 128 + height: + default: 80 + + - if: + properties: + compatible: + contains: + const: solomon,ssd1327 + then: + properties: + width: + default: 128 + height: + default: 128 + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + ssd1327_i2c: oled@3c { + compatible = "solomon,ssd1327"; + reg = <0x3c>; + reset-gpios = <&gpio2 7>; + }; + + }; + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + ssd1327_spi: oled@0 { + compatible = "solomon,ssd1327"; + reg = <0x0>; + reset-gpios = <&gpio2 7>; + dc-gpios = <&gpio2 8>; + spi-max-frequency = <10000000>; + }; + };