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 15c784e46cSRalf Schlatterbeck interface, which can be used in either 4-bit or 8-bit mode. By using a 16c784e46cSRalf Schlatterbeck GPIO expander it is possible to use the driver with one of the popular I2C 17c784e46cSRalf Schlatterbeck expander boards based on the PCF8574 available for these displays. For 18c784e46cSRalf 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> 8796145459SKrzysztof Kozlowski display-controller { 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 }; 10096145459SKrzysztof Kozlowski 101c784e46cSRalf Schlatterbeck - | 102c784e46cSRalf Schlatterbeck #include <dt-bindings/gpio/gpio.h> 103c784e46cSRalf Schlatterbeck i2c { 104c784e46cSRalf Schlatterbeck #address-cells = <1>; 105c784e46cSRalf Schlatterbeck #size-cells = <0>; 106c784e46cSRalf Schlatterbeck 10796145459SKrzysztof Kozlowski pcf8574: gpio-expander@27 { 108c784e46cSRalf Schlatterbeck compatible = "nxp,pcf8574"; 109c784e46cSRalf Schlatterbeck reg = <0x27>; 110c784e46cSRalf Schlatterbeck gpio-controller; 111c784e46cSRalf Schlatterbeck #gpio-cells = <2>; 112c784e46cSRalf Schlatterbeck }; 113c784e46cSRalf Schlatterbeck }; 11496145459SKrzysztof Kozlowski 11596145459SKrzysztof Kozlowski display-controller { 116c784e46cSRalf Schlatterbeck compatible = "hit,hd44780"; 117c784e46cSRalf Schlatterbeck display-height-chars = <2>; 118c784e46cSRalf Schlatterbeck display-width-chars = <16>; 119*4fdcbb88SKrzysztof Kozlowski data-gpios = <&pcf8574 4 GPIO_ACTIVE_HIGH>, 120*4fdcbb88SKrzysztof Kozlowski <&pcf8574 5 GPIO_ACTIVE_HIGH>, 121*4fdcbb88SKrzysztof Kozlowski <&pcf8574 6 GPIO_ACTIVE_HIGH>, 122*4fdcbb88SKrzysztof Kozlowski <&pcf8574 7 GPIO_ACTIVE_HIGH>; 123*4fdcbb88SKrzysztof Kozlowski enable-gpios = <&pcf8574 2 GPIO_ACTIVE_HIGH>; 124*4fdcbb88SKrzysztof Kozlowski rs-gpios = <&pcf8574 0 GPIO_ACTIVE_HIGH>; 125*4fdcbb88SKrzysztof Kozlowski rw-gpios = <&pcf8574 1 GPIO_ACTIVE_HIGH>; 126*4fdcbb88SKrzysztof Kozlowski backlight-gpios = <&pcf8574 3 GPIO_ACTIVE_HIGH>; 127c784e46cSRalf Schlatterbeck }; 128