[PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller

Marcus Folkesson posted 3 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller
Posted by Marcus Folkesson 8 months, 1 week ago
Sitronix ST7571 is a dot matrix LCD controller supporting
both 4bit grayscale and monochrome LCDs.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 .../bindings/display/sitronix,st7571.yaml          | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/sitronix,st7571.yaml b/Documentation/devicetree/bindings/display/sitronix,st7571.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..4fea782fccd701f5095a08290c13722a12a58b52
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/sitronix,st7571.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/sitronix,st7571.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sitronix ST7571 Display Controller
+
+maintainers:
+  - Marcus Folkesson <marcus.folkesson@gmail.com>
+
+description:
+  Sitronix ST7571 is a driver and controller for 4-level gray
+  scale and monochrome dot matrix LCD panels.
+
+allOf:
+  - $ref: panel/panel-common.yaml#
+
+properties:
+  compatible:
+    const: sitronix,st7571
+
+  reg:
+    maxItems: 1
+
+  sitronix,grayscale:
+    type: boolean
+    description:
+      Display supports 4-level grayscale.
+
+  reset-gpios: true
+  width-mm: true
+  height-mm: true
+  panel-timing: true
+
+required:
+  - compatible
+  - reg
+  - reset-gpios
+  - width-mm
+  - height-mm
+  - panel-timing
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      display@3f {
+        compatible = "sitronix,st7571";
+        reg = <0x3f>;
+        reset-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+        width-mm = <37>;
+        height-mm = <27>;
+
+        panel-timing {
+          hactive = <128>;
+          vactive = <96>;
+          hback-porch = <0>;
+          vback-porch = <0>;
+          clock-frequency = <0>;
+          hfront-porch = <0>;
+          hsync-len = <0>;
+          vfront-porch = <0>;
+          vsync-len = <0>;
+        };
+      };
+    };

-- 
2.49.0
Re: [PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller
Posted by Javier Martinez Canillas 8 months ago
Marcus Folkesson <marcus.folkesson@gmail.com> writes:

> Sitronix ST7571 is a dot matrix LCD controller supporting
> both 4bit grayscale and monochrome LCDs.
>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
Re: [PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller
Posted by Krzysztof Kozlowski 8 months, 1 week ago
On 15/04/2025 07:58, Marcus Folkesson wrote:
> Sitronix ST7571 is a dot matrix LCD controller supporting
> both 4bit grayscale and monochrome LCDs.
> 
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Re: [PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller
Posted by Krzysztof Kozlowski 8 months, 1 week ago
On 15/04/2025 07:58, Marcus Folkesson wrote:
> +title: Sitronix ST7571 Display Controller
> +
> +maintainers:
> +  - Marcus Folkesson <marcus.folkesson@gmail.com>
> +
> +description:
> +  Sitronix ST7571 is a driver and controller for 4-level gray
> +  scale and monochrome dot matrix LCD panels.
> +
> +allOf:
> +  - $ref: panel/panel-common.yaml#
> +
> +properties:
> +  compatible:
> +    const: sitronix,st7571
> +
> +  reg:
> +    maxItems: 1
> +
> +  sitronix,grayscale:
> +    type: boolean
> +    description:
> +      Display supports 4-level grayscale.

That's fully deducible from compatible, no? Or does it depend on actual
panel, but then what else depends on the panel?

Best regards,
Krzysztof
Re: [PATCH v4 1/3] dt-bindings: display: Add Sitronix ST7571 LCD Controller
Posted by Marcus Folkesson 8 months, 1 week ago
Hi Krzysztof,

On Tue, Apr 15, 2025 at 09:22:30AM +0200, Krzysztof Kozlowski wrote:
> On 15/04/2025 07:58, Marcus Folkesson wrote:
> > +title: Sitronix ST7571 Display Controller
> > +
> > +maintainers:
> > +  - Marcus Folkesson <marcus.folkesson@gmail.com>
> > +
> > +description:
> > +  Sitronix ST7571 is a driver and controller for 4-level gray
> > +  scale and monochrome dot matrix LCD panels.
> > +
> > +allOf:
> > +  - $ref: panel/panel-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    const: sitronix,st7571
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  sitronix,grayscale:
> > +    type: boolean
> > +    description:
> > +      Display supports 4-level grayscale.
> 
> That's fully deducible from compatible, no? Or does it depend on actual
> panel, but then what else depends on the panel?

No it is not, the ST7571 is only the controller and some properties
depends on the connected LCD.

ST7571 supports both grayscale and monochrome LCDs but has no way to
know what is connected.

Other properties that depends on the LCD are:
panel-timing.hactive
panel-timing.vactive
panel-timing.vfront-porch

In the first revisons of the driver, I thought I could let the
grayscale and monochrome setting depends on which pixel format that
where used, but that was not the case.

> 
> Best regards,
> Krzysztof


Best regards,
Marcus Folkesson