[v4,6/6] dt-bindings: display: Add SSD132x OLED controllers

Message ID 20231014071520.1342189-7-javierm@redhat.com
State New
Headers
Series drm/solomon: Add support for the SSD132x controller family |

Commit Message

Javier Martinez Canillas Oct. 14, 2023, 7:15 a.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>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
---

(no changes since v3)

Changes in v3:
- Add Rob Herring's Reviewed-by tag to patch #6.

Changes in v2:
- Remove unnecessary 'oneOf' in the SSD132x DT binding schema (Conor Dooley).
- Remove unused DT nodes labels in the binding schema examples (Conor Dooley).
- Split out common Solomon properties into a separate schema (Rob Herring).

 .../bindings/display/solomon,ssd132x.yaml     | 89 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 2 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd132x.yaml
  

Comments

Rob Herring Oct. 20, 2023, 3:34 p.m. UTC | #1
On Sat, Oct 14, 2023 at 2:15 AM Javier Martinez Canillas
<javierm@redhat.com> 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>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>
> (no changes since v3)
>
> Changes in v3:
> - Add Rob Herring's Reviewed-by tag to patch #6.
>
> Changes in v2:
> - Remove unnecessary 'oneOf' in the SSD132x DT binding schema (Conor Dooley).
> - Remove unused DT nodes labels in the binding schema examples (Conor Dooley).
> - Split out common Solomon properties into a separate schema (Rob Herring).
>
>  .../bindings/display/solomon,ssd132x.yaml     | 89 +++++++++++++++++++
>  MAINTAINERS                                   |  2 +-
>  2 files changed, 90 insertions(+), 1 deletion(-)
>  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..0aa41bd9ddca
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml
> @@ -0,0 +1,89 @@
> +# 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 Display Controllers
> +
> +maintainers:
> +  - Javier Martinez Canillas <javierm@redhat.com>
> +
> +properties:
> +  compatible:
> +    - enum:

Now this is a warning in linux-next. The '-' should not be there.
Please send a fix.

Not sure why there wasn't a report, but most likely it didn't apply to v6.6-rc1.

Rob

> +        - solomon,ssd1322
> +        - solomon,ssd1325
> +        - solomon,ssd1327
  
Javier Martinez Canillas Oct. 20, 2023, 10:28 p.m. UTC | #2
Rob Herring <robh@kernel.org> writes:

Hello Rob,

> On Sat, Oct 14, 2023 at 2:15 AM Javier Martinez Canillas
> <javierm@redhat.com> wrote:

[...]

>> +maintainers:
>> +  - Javier Martinez Canillas <javierm@redhat.com>
>> +
>> +properties:
>> +  compatible:
>> +    - enum:
>
> Now this is a warning in linux-next. The '-' should not be there.
> Please send a fix.
>

Sure, I'll post a fix. Thanks for reporting the issue.

This is a leftover from when the compatible string enum was a 'oneOf'
child and the 'oneOf' got removed during the binding schema review.

> Not sure why there wasn't a report, but most likely it didn't apply to v6.6-rc1.
>

Yes, I'm not sure either. I didn't notice it when testing with:

make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/solomon,ssd132x.yaml

> Rob
>
  

Patch

diff --git a/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml
new file mode 100644
index 000000000000..0aa41bd9ddca
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/solomon,ssd132x.yaml
@@ -0,0 +1,89 @@ 
+# 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 Display Controllers
+
+maintainers:
+  - Javier Martinez Canillas <javierm@redhat.com>
+
+properties:
+  compatible:
+    - enum:
+        - solomon,ssd1322
+        - solomon,ssd1325
+        - solomon,ssd1327
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: solomon,ssd-common.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>;
+
+            oled@3c {
+                    compatible = "solomon,ssd1327";
+                    reg = <0x3c>;
+                    reset-gpios = <&gpio2 7>;
+            };
+
+    };
+  - |
+    spi {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            oled@0 {
+                    compatible = "solomon,ssd1327";
+                    reg = <0x0>;
+                    reset-gpios = <&gpio2 7>;
+                    dc-gpios = <&gpio2 8>;
+                    spi-max-frequency = <10000000>;
+            };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index c63649e9ba58..4b518429458b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6766,7 +6766,7 @@  M:	Javier Martinez Canillas <javierm@redhat.com>
 S:	Maintained
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 F:	Documentation/devicetree/bindings/display/solomon,ssd-common.yaml
-F:	Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
+F:	Documentation/devicetree/bindings/display/solomon,ssd13*.yaml
 F:	drivers/gpu/drm/solomon/ssd130x*
 
 DRM DRIVER FOR ST-ERICSSON MCDE