Character LCD driver for the Hitachi HD44780 with I2C connection:
There already is a driver for displays with parallel gpio connections.
Re-uses the high-level API.
Concerning the compatible-string: I'm currently using
"hit,hd44780+nxp,pcf8575"
- "hit,hd44780" is used for the parallel-connected version of the display
- nxp,pcf8575 already exists in drivers/gpio/gpio-pcf857x.c which uses
the same chip for gpio expansion.
Let me know if this choice of names is fine or should be changed.
For the other device-tree names I'm reusing (some of) the names from the
parallel connected display.
.../auxdisplay/hit,hd44780+nxp,pcf8575.yaml (new) | 65 +++++++
drivers/auxdisplay/Kconfig | 14 +-
drivers/auxdisplay/Makefile | 1 +
drivers/auxdisplay/hd44780-pcf8574.c (new) | 207 +++++++++++++++++++++
4 files changed, 286 insertions(+), 1 deletion(-)
--
Ralf Schlatterbeck Tel: +43/2243/26465-16
Open Source Consulting www: http://www.runtux.com
Reichergasse 131, A-3411 Weidling email: [email protected]
Add devicetree documentation with example.
Signed-off-by: Ralf Schlatterbeck <[email protected]>
---
.../auxdisplay/hit,hd44780+nxp,pcf8575.yaml | 65 +++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 Documentation/devicetree/bindings/auxdisplay/hit,hd44780+nxp,pcf8575.yaml
diff --git a/Documentation/devicetree/bindings/auxdisplay/hit,hd44780+nxp,pcf8575.yaml b/Documentation/devicetree/bindings/auxdisplay/hit,hd44780+nxp,pcf8575.yaml
new file mode 100644
index 000000000000..c8e822c43b10
--- /dev/null
+++ b/Documentation/devicetree/bindings/auxdisplay/hit,hd44780+nxp,pcf8575.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/auxdisplay/hit,hd44780+nxp,pcf8575.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hitachi HD44780 Character LCD Controller attached to I2C via PCF8575
+
+maintainers:
+ - Ralf Schlatterbeck <[email protected]>
+
+description:
+ The Hitachi HD44780 Character LCD Controller is commonly used on character
+ LCDs that can display one or more lines of text. The display itself
+ exposes a parallel connection but they're often used with a PCF8575
+ I/O expander to connect them to an I2C bus.
+
+properties:
+ compatible:
+ const: hit,hd44780+nxp,pcf8575
+
+ reg:
+ description: I2C-bus address
+ maxItems: 1
+
+ display-height-chars:
+ description: Height of the display, in character cells,
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 1
+ maximum: 4
+
+ display-width-chars:
+ description: Width of the display, in character cells.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 1
+ maximum: 64
+
+ internal-buffer-width:
+ description:
+ Internal buffer width (default is 40 for displays with 1 or 2 lines, and
+ display-width-chars for displays with more than 2 lines).
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 1
+ maximum: 64
+
+required:
+ - compatible
+ - display-height-chars
+ - display-width-chars
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c@2000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ auxdisplay: hd44780@27 {
+ compatible = "hit,hd44780+nxp,pcf8575";
+ reg = <0x27>;
+ display-height-chars = <2>;
+ display-width-chars = <16>;
+ };
+ };
--
2.20.1
Hi Ralf,
Something quick I noticed...
On Tue, Jan 5, 2021 at 4:05 PM Ralf Schlatterbeck <[email protected]> wrote:
>
> + display-height-chars:
> + description: Height of the display, in character cells,
Spurious comma instead of period.
Cheers,
Miguel