devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Schlatterbeck <rsc@runtux.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Rob Herring <robh@kernel.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Willy Tarreau <w@1wt.eu>, Lars Poeschel <poeschel@lemonage.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH 1/1] auxdisplay: Add I2C gpio expander example
Date: Wed, 19 May 2021 13:54:51 +0200	[thread overview]
Message-ID: <20210519115450.qoqpy7d5dgnjtenx@runtux.com> (raw)
In-Reply-To: <CAMuHMdV80XUo5ihXUkogCikGA4H71Ada9w=9W9d9d1zdgrw0uA@mail.gmail.com>

The hd44780 displays are often used with pcf8574 based I/O expanders.
Add example to documentation.

Signed-off-by: Ralf Schlatterbeck <rsc@runtux.com>
---
Updated Patch, thanks to Geert Uytterhoeven for his tip on how to
reproduce the warning. I've removed the address from the i2c stanza
which fixes it. Let me know if I should re-post the patch in a separate
thread.

 .../bindings/auxdisplay/hit,hd44780.yaml      | 31 ++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml b/Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml
index 9222b06e93a0..fde07e4b119d 100644
--- a/Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml
+++ b/Documentation/devicetree/bindings/auxdisplay/hit,hd44780.yaml
@@ -12,7 +12,10 @@ maintainers:
 description:
   The Hitachi HD44780 Character LCD Controller is commonly used on character
   LCDs that can display one or more lines of text. It exposes an M6800 bus
-  interface, which can be used in either 4-bit or 8-bit mode.
+  interface, which can be used in either 4-bit or 8-bit mode. By using a
+  GPIO expander it is possible to use the driver with one of the popular I2C
+  expander boards based on the PCF8574 available for these displays. For
+  an example see below.
 
 properties:
   compatible:
@@ -94,3 +97,29 @@ examples:
             display-height-chars = <2>;
             display-width-chars = <16>;
     };
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    i2c {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            pcf8574: pcf8574@27 {
+                    compatible = "nxp,pcf8574";
+                    reg = <0x27>;
+                    gpio-controller;
+                    #gpio-cells = <2>;
+            };
+    };
+    hd44780 {
+            compatible = "hit,hd44780";
+            display-height-chars = <2>;
+            display-width-chars  = <16>;
+            data-gpios = <&pcf8574 4 0>,
+                         <&pcf8574 5 0>,
+                         <&pcf8574 6 0>,
+                         <&pcf8574 7 0>;
+            enable-gpios = <&pcf8574 2 0>;
+            rs-gpios = <&pcf8574 0 0>;
+            rw-gpios = <&pcf8574 1 0>;
+            backlight-gpios = <&pcf8574 3 0>;
+    };
-- 
2.20.1

  reply	other threads:[~2021-05-19 11:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210106113730.k5qveshjgcd57kgx@runtux.com>
2021-01-06 12:12 ` [PATCH 0/1] auxdisplay: Add I2C gpio expander example Miguel Ojeda
2021-01-06 12:14   ` Miguel Ojeda
     [not found] ` <20210106113929.fizyg6fcsmsntkiy@runtux.com>
2021-01-06 12:18   ` [PATCH 1/1] " Miguel Ojeda
2021-05-12 15:32     ` Geert Uytterhoeven
2021-05-12 15:49       ` Miguel Ojeda
2021-05-17 15:20         ` Rob Herring
2021-05-19  9:00           ` Ralf Schlatterbeck
2021-05-19  9:53             ` Geert Uytterhoeven
2021-05-19 11:54               ` Ralf Schlatterbeck [this message]
2021-06-09 13:55                 ` Miguel Ojeda
2021-06-09 15:49                   ` Ralf Schlatterbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519115450.qoqpy7d5dgnjtenx@runtux.com \
    --to=rsc@runtux.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=poeschel@lemonage.de \
    --cc=robh@kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).