Skip to contentSkip to conversation

drm/solomon: Add support for the SSD133x controller family

PATCH Superseded Javier Martinez Canillas 3 participants 11 messages Dec 17, 2023 – Dec 18, 2023

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Javier Martinez Canillas

author maintainer
#0 lore raw

cover drm/solomon: Add support for the SSD133x controller family

Hello,

This patch-set adds support for the family of SSD133x Solomon controllers, such as the SSD1331. These are used for RGB Dot Matrix OLED/PLED panels.

The patches were tested on a Waveshare SSD1331 display using glmark2-drm, fbcon, fbtests and the retroarch emulator.

Patch #1 adds a DT binding schema for the SSD133x controllers and patch #2 extends the ssd130x DRM driver to support the SSD133x controller family.

Best regards,
Javier

Javier Martinez Canillas (2):
dt-bindings: display: Add SSD133x OLED controllers drm/ssd130x: Add support for the SSD133x OLED controller family

 .../bindings/display/solomon,ssd133x.yaml     |  63 +++
 drivers/gpu/drm/solomon/ssd130x-i2c.c         |   5 +
 drivers/gpu/drm/solomon/ssd130x-spi.c         |   7 +
 drivers/gpu/drm/solomon/ssd130x.c             | 370 ++++++++++++++++++
 drivers/gpu/drm/solomon/ssd130x.h             |   5 +-
 5 files changed, 449 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd133x.yaml
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/2 dt-bindings: display: Add SSD133x OLED controllers

Add a Device Tree binding schema for the OLED panels based on the Solomon SSD133x family of controllers.

---

 .../bindings/display/solomon,ssd133x.yaml     | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd133x.yaml
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +63 -0
new file mode 100644
index 000000000000..eee8d8c9ca35
@@ -0,0 +1,63 @@
+# 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 <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - solomon,ssd1331
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: solomon,ssd-common.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
+      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>;
+            };
+    };
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Quoted 40 lines · Javier Martinez Canillas

Add a Device Tree binding schema for the OLED panels based on the Solomon SSD133x family of controllers.

---

 .../bindings/display/solomon,ssd133x.yaml     | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/solomon,ssd133x.yaml
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +24 -0
new file mode 100644
index 000000000000..eee8d8c9ca35
@@ -0,0 +1,63 @@
+# 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 <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - solomon,ssd1331
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: solomon,ssd-common.yaml#
+
+  - if:

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 10 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +10 -0
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Cheers,
Conor.

author maintainer
#3 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Conor Dooley <[email protected]> writes:

Hello Connor,

Quoted 1 line · Javier Martinez Canillas

[...]

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +18 -0
+properties:
+  compatible:
+    enum:
+      - solomon,ssd1331
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: solomon,ssd-common.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
Quoted 9 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 5 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +5 -0
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Because these are only for the default width and height, there can be panels using the same controller but that have a different resolution.

For example, there are panels using the SSD1306 controller that have 128x32 [0], 64x32 [1] or 128x64 [2] resolutions.

But answering your question, yes I think that more devices for this SSD133x family are going to be added later. Looking at [3], there is at least SSD1333 that has a different default resolutions (176x176).

I think that even the SSD135x family could be supported by the same modsetting pipeline, but I need to get one to figure it out.

[0]: https://es.aliexpress.com/item/1005003648174074.html
[1]: https://www.buydisplay.com/white-0-49-inch-oled-display-64x32-iic-i2c-ssd1306-connector-fpc
[2]: https://es.aliexpress.com/item/1005001582340858.html?gatewayAdapt=glo2esp
[3]: https://www.solomon-systech.com/product-search/?technology=oled-display

Quoted 2 lines

Cheers,
Conor.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#4 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Quoted 36 lines · Javier Martinez Canillas

Conor Dooley <[email protected]> writes:

Hello Connor,

Quoted 1 line · Javier Martinez Canillas

[...]

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +18 -0
+properties:
+  compatible:
+    enum:
+      - solomon,ssd1331
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - $ref: solomon,ssd-common.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
Quoted 9 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 5 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +5 -0
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Quoted 5 lines

Because these are only for the default width and height, there can be panels using the same controller but that have a different resolution.

For example, there are panels using the SSD1306 controller that have 128x32 [0], 64x32 [1] or 128x64 [2] resolutions.

This, as you know, does not matter here.

Quoted 3 lines

But answering your question, yes I think that more devices for this SSD133x family are going to be added later. Looking at [3], there is at least SSD1333 that has a different default resolutions (176x176).

That's fair enough though. I'd probably err on the side of introducing this complexity when the other users actually show up though.

Quoted 19 lines

I think that even the SSD135x family could be supported by the same modsetting pipeline, but I need to get one to figure it out.

[0]: https://es.aliexpress.com/item/1005003648174074.html
[1]: https://www.buydisplay.com/white-0-49-inch-oled-display-64x32-iic-i2c-ssd1306-connector-fpc
[2]: https://es.aliexpress.com/item/1005001582340858.html?gatewayAdapt=glo2esp
[3]: https://www.solomon-systech.com/product-search/?technology=oled-display

Quoted 2 lines

Cheers,
Conor.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
author maintainer
#5 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Conor Dooley <[email protected]> writes:

Hello Conor,

Quoted 1 line · Javier Martinez Canillas

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 6 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +6 -0
+    then:
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Quoted 8 lines
Quoted 5 lines

Because these are only for the default width and height, there can be panels using the same controller but that have a different resolution.

For example, there are panels using the SSD1306 controller that have 128x32 [0], 64x32 [1] or 128x64 [2] resolutions.

This, as you know, does not matter here.

Are you sure? What I tried to say is that the SSD133x are just OLED controllers and manufacturers use those chips to attach a panel that has a certain resolution.

While it makes sense to use all the supported width and height, some manufacturers chose to have a smaller panel instead (I used SSD1306 as an example because I knew about these but the same might be true for let's say SSD1331).

Or saying another way, are you sure that every manufacturer selling RGB OLED panels using the SSD1331 chip will use the default resolution and users won't have to set a custom width and height ?

I have already chosen to make the DT binding as simple as possible to prevent what happened with the SSD1306 "solomon,page-offset" property that has a broken default [0] but I think that not allowing to set the resolution is already too restrictive and would make it unusable for any panel that doesn't have the default width and height.

[0]: https://lists.freedesktop.org/archives/dri-devel/2023-November/431150.html

Quoted 7 lines
Quoted 3 lines

But answering your question, yes I think that more devices for this SSD133x family are going to be added later. Looking at [3], there is at least SSD1333 that has a different default resolutions (176x176).

That's fair enough though. I'd probably err on the side of introducing this complexity when the other users actually show up though.

Agree and the reason why I did not include entries for the SSD1332 and SSD1333. I was planning to add those only if there were users since it seems that the SSD1331 is the most popular controller from this family.

But as explained, even for the SSD1331 it may be needed to set a width and height that is different than the default of this panel controller.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#6 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Quoted 32 lines · Javier Martinez Canillas

Conor Dooley <[email protected]> writes:

Hello Conor,

Quoted 1 line · Javier Martinez Canillas

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 6 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +6 -0
+    then:
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Quoted 8 lines
Quoted 5 lines

Because these are only for the default width and height, there can be panels using the same controller but that have a different resolution.

For example, there are panels using the SSD1306 controller that have 128x32 [0], 64x32 [1] or 128x64 [2] resolutions.

This, as you know, does not matter here.

Are you sure? What I tried to say is that the SSD133x are just OLED controllers and manufacturers use those chips to attach a panel that has a certain resolution.

Quoted 8 lines

While it makes sense to use all the supported width and height, some manufacturers chose to have a smaller panel instead (I used SSD1306 as an example because I knew about these but the same might be true for let's say SSD1331).

Or saying another way, are you sure that every manufacturer selling RGB OLED panels using the SSD1331 chip will use the default resolution and users won't have to set a custom width and height ?

That's not at all what I was saying. I just meant unconditionally set the constraints on the property (in this case the default) since you only have one compatible. Not unconditionally set the height and width.

Apologies if if that was unclear.

Thanks,
Conor.

Quoted 30 lines

I have already chosen to make the DT binding as simple as possible to prevent what happened with the SSD1306 "solomon,page-offset" property that has a broken default [0] but I think that not allowing to set the resolution is already too restrictive and would make it unusable for any panel that doesn't have the default width and height.

[0]: https://lists.freedesktop.org/archives/dri-devel/2023-November/431150.html

Quoted 7 lines
Quoted 3 lines

But answering your question, yes I think that more devices for this SSD133x family are going to be added later. Looking at [3], there is at least SSD1333 that has a different default resolutions (176x176).

That's fair enough though. I'd probably err on the side of introducing this complexity when the other users actually show up though.

Agree and the reason why I did not include entries for the SSD1332 and SSD1333. I was planning to add those only if there were users since it seems that the SSD1331 is the most popular controller from this family.

But as explained, even for the SSD1331 it may be needed to set a width and height that is different than the default of this panel controller.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
author maintainer
#7 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Conor Dooley <[email protected]> writes:

Hello Connor,

Quoted 42 lines · Javier Martinez Canillas
Quoted 32 lines

Conor Dooley <[email protected]> writes:

Hello Conor,

Quoted 1 line · Javier Martinez Canillas

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 34

Quoted 6 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +6 -0
+    then:
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64

Do you envisage a rake of devices that are going to end up in this binding? Otherwise, why not unconditionally set the constraints?

Quoted 8 lines
Quoted 5 lines

Because these are only for the default width and height, there can be panels using the same controller but that have a different resolution.

For example, there are panels using the SSD1306 controller that have 128x32 [0], 64x32 [1] or 128x64 [2] resolutions.

This, as you know, does not matter here.

Are you sure? What I tried to say is that the SSD133x are just OLED controllers and manufacturers use those chips to attach a panel that has a certain resolution.

Quoted 8 lines

While it makes sense to use all the supported width and height, some manufacturers chose to have a smaller panel instead (I used SSD1306 as an example because I knew about these but the same might be true for let's say SSD1331).

Or saying another way, are you sure that every manufacturer selling RGB OLED panels using the SSD1331 chip will use the default resolution and users won't have to set a custom width and height ?

Quoted 6 lines

That's not at all what I was saying. I just meant unconditionally set the constraints on the property (in this case the default) since you only have one compatible. Not unconditionally set the height and width.

Apologies if if that was unclear.

Oh, I see that you meant now. Sorry for my confusion!

And yes, I agree with you that doesn't make sense to make it conditional if there's only a single compatible. I'll drop that if condition on v2.

Thanks a lot for your feedback.

Quoted 3 lines

Thanks,
Conor.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#8 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

In reply to Javier Martinez Canillas
Quoted 10 lines · Javier Martinez Canillas
Quoted 1 line

+ - if:

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +9 -0
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
+      properties:
+        width:
+          default: 96
+        height:

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 43

Quoted 10 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +10 -0
+          default: 64
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+            #address-cells = <1>;
+            #size-cells = <0>;
+

Use 4 spaces for example indentation.

Best regards,
Krzysztof

author maintainer
#9 lore raw

Re: [PATCH 1/2] dt-bindings: display: Add SSD133x OLED controllers

Krzysztof Kozlowski <[email protected]> writes:

Hello Krzysztof,

Quoted 15 lines · Javier Martinez Canillas
Quoted 14 lines
Quoted 1 line

+ - if:

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +13 -0
+      properties:
+        compatible:
+          contains:
+            const: solomon,ssd1331
+    then:
+      properties:
+        width:
+          default: 96
+        height:
+          default: 64
+
+unevaluatedProperties: false
+
Quoted 9 lines

Documentation/devicetree/bindings/display/solomon,ssd133x.yaml line 43

Quoted 6 lines
Documentation/devicetree/bindings/display/solomon,ssd133x.yaml new file +6 -0
+examples:
+  - |
+    i2c {
+            #address-cells = <1>;
+            #size-cells = <0>;
+

Use 4 spaces for example indentation.

Sure, I'll change it in v2.

Quoted 3 lines

Best regards,
Krzysztof

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
author maintainer
#10 lore raw

PATCH 2/2 drm/ssd130x: Add support for the SSD133x OLED controller family

In reply to Javier Martinez Canillas

The Solomon SSD133x controllers (such as the SSD1331) are used by RGB dot matrix OLED panels, add a modesetting pipeline to support the chip family.

The SSD133x controllers support 256 (8-bit) and 65k (16-bit) color depths but only the former is implemented for now. This is because the 256 color depth format matches a fourcc code already present in DRM (RGB8), but the 65k pixel format does not match the existing RG16 fourcc code format.

Instead of a R:G:B 5:6:5, the controller expects the 16-bit pixels to be R:G:B 6:5:6, and so a new fourcc needs to be added to support this format.

---

 drivers/gpu/drm/solomon/ssd130x-i2c.c |   5 +
 drivers/gpu/drm/solomon/ssd130x-spi.c |   7 +
 drivers/gpu/drm/solomon/ssd130x.c     | 370 ++++++++++++++++++++++++++
 drivers/gpu/drm/solomon/ssd130x.h     |   5 +-
 4 files changed, 386 insertions(+), 1 deletion(-)
drivers/gpu/drm/solomon/ssd130x-i2c.c +5 -0
index f2ccab9c06d9..a047dbec4e48 100644
@@ -105,6 +105,11 @@ static const struct of_device_id ssd130x_of_match[] = {
 		.compatible = "solomon,ssd1327",
 		.data = &ssd130x_variants[SSD1327_ID],
 	},
+	/* ssd133x family */
+	{
+		.compatible = "solomon,ssd1331",
+		.data = &ssd130x_variants[SSD1331_ID],
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ssd130x_of_match);
drivers/gpu/drm/solomon/ssd130x-spi.c +7 -0
index 84e035a7ab3f..84bfde31d172 100644
@@ -142,6 +142,11 @@ static const struct of_device_id ssd130x_of_match[] = {
 		.compatible = "solomon,ssd1327",
 		.data = &ssd130x_variants[SSD1327_ID],
 	},
+	/* ssd133x family */
+	{
+		.compatible = "solomon,ssd1331",
+		.data = &ssd130x_variants[SSD1331_ID],
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ssd130x_of_match);
@@ -166,6 +171,8 @@ static const struct spi_device_id ssd130x_spi_table[] = {
 	{ "ssd1322", SSD1322_ID },
 	{ "ssd1325", SSD1325_ID },
 	{ "ssd1327", SSD1327_ID },
+	/* ssd133x family */
+	{ "ssd1331", SSD1331_ID },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(spi, ssd130x_spi_table);
drivers/gpu/drm/solomon/ssd130x.c +370 -0

454 lines not on this page · raw message

drivers/gpu/drm/solomon/ssd130x.h +4 -1
index 075c5c3ee75a..a4554018bb2a 100644
@@ -25,7 +25,8 @@
 
 enum ssd130x_family_ids {
 	SSD130X_FAMILY,
-	SSD132X_FAMILY
+	SSD132X_FAMILY,
+	SSD133X_FAMILY
 };
 
 enum ssd130x_variants {
@@ -39,6 +40,8 @@ enum ssd130x_variants {
 	SSD1322_ID,
 	SSD1325_ID,
 	SSD1327_ID,
+	/* ssd133x family */
+	SSD1331_ID,
 	NR_SSD130X_VARIANTS
 };
 
Signature · 1 line
2.43.0