[PATCH v2 1/2] dt-bindings: add bindings for pcd8544 displays

From: Viktar Simanenka
Date: Wed Jul 19 2023 - 11:45:20 EST


Signed-off-by: Viktar Simanenka <viteosen@xxxxxxxxx>

V2: deleted oneOf property from compatible
changed prefix from 'philips' to existing vendor prefix 'nxp'
placed `reg = <0>` right after `compatible`

About parameters exposed for controller:
inverted - I had an unbranded display that after reset had all pixels black,
while register was in 'normal operation'. The display I have now is opposite:
all white after reset in normal mode. This parameter should help user keep
same settings in KMS(?) for diverse displays;
voltage-op & temperature-coeff - adjusts contrast for display. voltage-op
cannot be expressed in real units, because resulting equation looks like
V = a + Vop * b, where a and b varies with ambient temperature. Vop is a
coefficient. same story for temperature-coeff - it shifts resulting voltage
curve depending on display usage invironment;
bias - relates to waveforms for LCD segments. default is 4 and should be
changed only if you use external oscillator for display.

v1 link: https://lore.kernel.org/linux-devicetree/20230719092903.316452-1-viteosen@xxxxxxxxx/

---
.../bindings/display/nxp,pcd8544.yaml | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/nxp,pcd8544.yaml

diff --git a/Documentation/devicetree/bindings/display/nxp,pcd8544.yaml b/Documentation/devicetree/bindings/display/nxp,pcd8544.yaml
new file mode 100644
index 000000000000..52e40fd0eacb
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/nxp,pcd8544.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/nxp,pcd8544.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Philips Semiconductors PCD8544 LCD Display Controller
+
+maintainers:
+ - Viktar Simanenka <viteosen@xxxxxxxxx>
+
+description: |
+ Philips Semiconductors PCD8544 LCD Display Controller with SPI control bus.
+ Designed to drive a graphic display of 48 rows and 84 columns,
+ such as Nokia 5110/3310 LCDs.
+
+allOf:
+ - $ref: panel/panel-common.yaml#
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+ compatible:
+ enum:
+ - nxp,pcd8544
+
+ dc-gpios:
+ maxItems: 1
+ description: Data/Command selection pin (D/CX)
+
+ reset-gpios:
+ maxItems: 1
+ description: Display Reset pin (RST)
+
+ nxp,inverted:
+ type: boolean
+ description: Display color inversion
+
+ nxp,voltage-op:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 127
+ description: |
+ Liquid crystall voltage operation coefficient. Determines the LCD
+ controlling voltage on the display segments. Should be adjusted
+ depending on the ambient temperature.
+
+ nxp,temperature-coeff:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 3
+ description: |
+ Display temperature compensation coefficient. Increases LCD
+ controlling voltage at lower temperatures to maintain optimum
+ contrast.
+
+ nxp,bias:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 7
+ description: Display bias system coefficient.
+
+required:
+ - compatible
+ - reg
+ - dc-gpios
+ - reset-gpios
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ display@0 {
+ compatible = "nxp,pcd8544";
+ reg = <0>;
+ spi-max-frequency = <8000000>;
+
+ dc-gpios = <&pio 0 3 GPIO_ACTIVE_HIGH>; /* DC=PA3 */
+ reset-gpios = <&pio 0 1 GPIO_ACTIVE_HIGH>; /* RESET=PA1 */
+ backlight = <&backlight>;
+
+ nxp,inverted;
+ nxp,voltage-op = <0>;
+ nxp,bias = <4>;
+ nxp,temperature-coeff = <0>;
+ };
+ };
+
+...
--
2.34.1