Skip to content

Commit c784e46

Browse files
schlatterbeckojeda
authored andcommitted
auxdisplay: Add I2C gpio expander example
The hd44780 displays are often used with pcf8574 based I/O expanders. Add example to documentation. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com> [Added Suggested-by tag] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 614124b commit c784e46

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ maintainers:
1212
description:
1313
The Hitachi HD44780 Character LCD Controller is commonly used on character
1414
LCDs that can display one or more lines of text. It exposes an M6800 bus
15-
interface, which can be used in either 4-bit or 8-bit mode.
15+
interface, which can be used in either 4-bit or 8-bit mode. By using a
16+
GPIO expander it is possible to use the driver with one of the popular I2C
17+
expander boards based on the PCF8574 available for these displays. For
18+
an example see below.
1619

1720
properties:
1821
compatible:
@@ -94,3 +97,29 @@ examples:
9497
display-height-chars = <2>;
9598
display-width-chars = <16>;
9699
};
100+
- |
101+
#include <dt-bindings/gpio/gpio.h>
102+
i2c {
103+
#address-cells = <1>;
104+
#size-cells = <0>;
105+
106+
pcf8574: pcf8574@27 {
107+
compatible = "nxp,pcf8574";
108+
reg = <0x27>;
109+
gpio-controller;
110+
#gpio-cells = <2>;
111+
};
112+
};
113+
hd44780 {
114+
compatible = "hit,hd44780";
115+
display-height-chars = <2>;
116+
display-width-chars = <16>;
117+
data-gpios = <&pcf8574 4 0>,
118+
<&pcf8574 5 0>,
119+
<&pcf8574 6 0>,
120+
<&pcf8574 7 0>;
121+
enable-gpios = <&pcf8574 2 0>;
122+
rs-gpios = <&pcf8574 0 0>;
123+
rw-gpios = <&pcf8574 1 0>;
124+
backlight-gpios = <&pcf8574 3 0>;
125+
};

0 commit comments

Comments
 (0)