130b1e7c4SGeert Uytterhoeven# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 230b1e7c4SGeert Uytterhoeven%YAML 1.2 330b1e7c4SGeert Uytterhoeven--- 430b1e7c4SGeert Uytterhoeven$id: http://devicetree.org/schemas/auxdisplay/hit,hd44780.yaml# 530b1e7c4SGeert Uytterhoeven$schema: http://devicetree.org/meta-schemas/core.yaml# 630b1e7c4SGeert Uytterhoeven 730b1e7c4SGeert Uytterhoeventitle: Hitachi HD44780 Character LCD Controller 830b1e7c4SGeert Uytterhoeven 930b1e7c4SGeert Uytterhoevenmaintainers: 1030b1e7c4SGeert Uytterhoeven - Geert Uytterhoeven <geert@linux-m68k.org> 1130b1e7c4SGeert Uytterhoeven 1230b1e7c4SGeert Uytterhoevendescription: 1330b1e7c4SGeert Uytterhoeven The Hitachi HD44780 Character LCD Controller is commonly used on character 1430b1e7c4SGeert Uytterhoeven LCDs that can display one or more lines of text. It exposes an M6800 bus 15*c784e46cSRalf Schlatterbeck interface, which can be used in either 4-bit or 8-bit mode. By using a 16*c784e46cSRalf Schlatterbeck GPIO expander it is possible to use the driver with one of the popular I2C 17*c784e46cSRalf Schlatterbeck expander boards based on the PCF8574 available for these displays. For 18*c784e46cSRalf Schlatterbeck an example see below. 1930b1e7c4SGeert Uytterhoeven 2030b1e7c4SGeert Uytterhoevenproperties: 2130b1e7c4SGeert Uytterhoeven compatible: 2230b1e7c4SGeert Uytterhoeven const: hit,hd44780 2330b1e7c4SGeert Uytterhoeven 2430b1e7c4SGeert Uytterhoeven data-gpios: 2530b1e7c4SGeert Uytterhoeven description: 2630b1e7c4SGeert Uytterhoeven GPIO pins connected to the data signal lines DB0-DB7 (8-bit mode) or 2730b1e7c4SGeert Uytterhoeven DB4-DB7 (4-bit mode) of the LCD Controller's bus interface. 2830b1e7c4SGeert Uytterhoeven oneOf: 2930b1e7c4SGeert Uytterhoeven - maxItems: 4 3030b1e7c4SGeert Uytterhoeven - maxItems: 8 3130b1e7c4SGeert Uytterhoeven 3230b1e7c4SGeert Uytterhoeven enable-gpios: 3330b1e7c4SGeert Uytterhoeven description: 3430b1e7c4SGeert Uytterhoeven GPIO pin connected to the "E" (Enable) signal line of the LCD 3530b1e7c4SGeert Uytterhoeven Controller's bus interface. 3630b1e7c4SGeert Uytterhoeven maxItems: 1 3730b1e7c4SGeert Uytterhoeven 3830b1e7c4SGeert Uytterhoeven rs-gpios: 3930b1e7c4SGeert Uytterhoeven description: 4030b1e7c4SGeert Uytterhoeven GPIO pin connected to the "RS" (Register Select) signal line of the LCD 4130b1e7c4SGeert Uytterhoeven Controller's bus interface. 4230b1e7c4SGeert Uytterhoeven maxItems: 1 4330b1e7c4SGeert Uytterhoeven 4430b1e7c4SGeert Uytterhoeven rw-gpios: 4530b1e7c4SGeert Uytterhoeven description: 4630b1e7c4SGeert Uytterhoeven GPIO pin connected to the "RW" (Read/Write) signal line of the LCD 4730b1e7c4SGeert Uytterhoeven Controller's bus interface. 4830b1e7c4SGeert Uytterhoeven maxItems: 1 4930b1e7c4SGeert Uytterhoeven 5030b1e7c4SGeert Uytterhoeven backlight-gpios: 5130b1e7c4SGeert Uytterhoeven description: GPIO pin used for enabling the LCD's backlight. 5230b1e7c4SGeert Uytterhoeven maxItems: 1 5330b1e7c4SGeert Uytterhoeven 5430b1e7c4SGeert Uytterhoeven display-height-chars: 5530b1e7c4SGeert Uytterhoeven description: Height of the display, in character cells, 5630b1e7c4SGeert Uytterhoeven $ref: /schemas/types.yaml#/definitions/uint32 5730b1e7c4SGeert Uytterhoeven minimum: 1 5830b1e7c4SGeert Uytterhoeven maximum: 4 5930b1e7c4SGeert Uytterhoeven 6030b1e7c4SGeert Uytterhoeven display-width-chars: 6130b1e7c4SGeert Uytterhoeven description: Width of the display, in character cells. 6230b1e7c4SGeert Uytterhoeven $ref: /schemas/types.yaml#/definitions/uint32 6330b1e7c4SGeert Uytterhoeven minimum: 1 6430b1e7c4SGeert Uytterhoeven maximum: 64 6530b1e7c4SGeert Uytterhoeven 6630b1e7c4SGeert Uytterhoeven internal-buffer-width: 6730b1e7c4SGeert Uytterhoeven description: 6830b1e7c4SGeert Uytterhoeven Internal buffer width (default is 40 for displays with 1 or 2 lines, and 6930b1e7c4SGeert Uytterhoeven display-width-chars for displays with more than 2 lines). 7030b1e7c4SGeert Uytterhoeven $ref: /schemas/types.yaml#/definitions/uint32 7130b1e7c4SGeert Uytterhoeven minimum: 1 7230b1e7c4SGeert Uytterhoeven maximum: 64 7330b1e7c4SGeert Uytterhoeven 7430b1e7c4SGeert Uytterhoevenrequired: 7530b1e7c4SGeert Uytterhoeven - compatible 7630b1e7c4SGeert Uytterhoeven - data-gpios 7730b1e7c4SGeert Uytterhoeven - enable-gpios 7830b1e7c4SGeert Uytterhoeven - rs-gpios 7930b1e7c4SGeert Uytterhoeven - display-height-chars 8030b1e7c4SGeert Uytterhoeven - display-width-chars 8130b1e7c4SGeert Uytterhoeven 8230b1e7c4SGeert UytterhoevenadditionalProperties: false 8330b1e7c4SGeert Uytterhoeven 8430b1e7c4SGeert Uytterhoevenexamples: 8530b1e7c4SGeert Uytterhoeven - | 8630b1e7c4SGeert Uytterhoeven #include <dt-bindings/gpio/gpio.h> 8730b1e7c4SGeert Uytterhoeven auxdisplay { 8830b1e7c4SGeert Uytterhoeven compatible = "hit,hd44780"; 8930b1e7c4SGeert Uytterhoeven 9030b1e7c4SGeert Uytterhoeven data-gpios = <&hc595 0 GPIO_ACTIVE_HIGH>, 9130b1e7c4SGeert Uytterhoeven <&hc595 1 GPIO_ACTIVE_HIGH>, 9230b1e7c4SGeert Uytterhoeven <&hc595 2 GPIO_ACTIVE_HIGH>, 9330b1e7c4SGeert Uytterhoeven <&hc595 3 GPIO_ACTIVE_HIGH>; 9430b1e7c4SGeert Uytterhoeven enable-gpios = <&hc595 4 GPIO_ACTIVE_HIGH>; 9530b1e7c4SGeert Uytterhoeven rs-gpios = <&hc595 5 GPIO_ACTIVE_HIGH>; 9630b1e7c4SGeert Uytterhoeven 9730b1e7c4SGeert Uytterhoeven display-height-chars = <2>; 9830b1e7c4SGeert Uytterhoeven display-width-chars = <16>; 9930b1e7c4SGeert Uytterhoeven }; 100*c784e46cSRalf Schlatterbeck - | 101*c784e46cSRalf Schlatterbeck #include <dt-bindings/gpio/gpio.h> 102*c784e46cSRalf Schlatterbeck i2c { 103*c784e46cSRalf Schlatterbeck #address-cells = <1>; 104*c784e46cSRalf Schlatterbeck #size-cells = <0>; 105*c784e46cSRalf Schlatterbeck 106*c784e46cSRalf Schlatterbeck pcf8574: pcf8574@27 { 107*c784e46cSRalf Schlatterbeck compatible = "nxp,pcf8574"; 108*c784e46cSRalf Schlatterbeck reg = <0x27>; 109*c784e46cSRalf Schlatterbeck gpio-controller; 110*c784e46cSRalf Schlatterbeck #gpio-cells = <2>; 111*c784e46cSRalf Schlatterbeck }; 112*c784e46cSRalf Schlatterbeck }; 113*c784e46cSRalf Schlatterbeck hd44780 { 114*c784e46cSRalf Schlatterbeck compatible = "hit,hd44780"; 115*c784e46cSRalf Schlatterbeck display-height-chars = <2>; 116*c784e46cSRalf Schlatterbeck display-width-chars = <16>; 117*c784e46cSRalf Schlatterbeck data-gpios = <&pcf8574 4 0>, 118*c784e46cSRalf Schlatterbeck <&pcf8574 5 0>, 119*c784e46cSRalf Schlatterbeck <&pcf8574 6 0>, 120*c784e46cSRalf Schlatterbeck <&pcf8574 7 0>; 121*c784e46cSRalf Schlatterbeck enable-gpios = <&pcf8574 2 0>; 122*c784e46cSRalf Schlatterbeck rs-gpios = <&pcf8574 0 0>; 123*c784e46cSRalf Schlatterbeck rw-gpios = <&pcf8574 1 0>; 124*c784e46cSRalf Schlatterbeck backlight-gpios = <&pcf8574 3 0>; 125*c784e46cSRalf Schlatterbeck }; 126