From f4d736112b64933c1849d16072575f665ca9f4c1 Mon Sep 17 00:00:00 2001
From: Christian Poessinger <christian@poessinger.com>
Date: Sun, 10 Oct 2021 18:53:02 +0200
Subject: lcd: T2564: add support for hd44780 displays

(cherry picked from commit 4218a5bcb1093108e25d4e07fa07050b4f79d3d5)
---
 data/templates/lcd/LCDd.conf.tmpl       | 7 +++++++
 debian/control                          | 1 +
 interface-definitions/system-lcd.xml.in | 8 ++++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/data/templates/lcd/LCDd.conf.tmpl b/data/templates/lcd/LCDd.conf.tmpl
index 6cf6a440f..2c7ad920f 100644
--- a/data/templates/lcd/LCDd.conf.tmpl
+++ b/data/templates/lcd/LCDd.conf.tmpl
@@ -53,6 +53,8 @@ DriverPath=/usr/lib/x86_64-linux-gnu/lcdproc/
 Driver=CFontzPacket
 {%   elif model == 'sdec' %}
 Driver=sdeclcd
+{%   elif model == 'hd44780' %}
+Driver=hd44780
 {%   endif %}
 {% endif %}
 
@@ -128,5 +130,10 @@ USB=yes
 ## SDEC driver for Lanner, Watchguard, Sophos sppliances ##
 [sdeclcd]
 # No options
+{%   elif model == 'hd44780' %}
+[hd44780]
+ConnectionType=ezio
+Device={{ device }}
+Size=16x2
 {%   endif %}
 {% endif %}
diff --git a/debian/control b/debian/control
index 2a107c954..87a0258d2 100644
--- a/debian/control
+++ b/debian/control
@@ -65,6 +65,7 @@ Depends:
   iw,
   keepalived (>=2.0.5),
   lcdproc,
+  lcdproc-extra-drivers,
   libatomic1,
   libndp-tools,
   libpam-radius-auth (>= 1.5.0),
diff --git a/interface-definitions/system-lcd.xml.in b/interface-definitions/system-lcd.xml.in
index 36116ae1b..4c9d5c92e 100644
--- a/interface-definitions/system-lcd.xml.in
+++ b/interface-definitions/system-lcd.xml.in
@@ -12,7 +12,7 @@
             <properties>
               <help>Model of the display attached to this system [REQUIRED]</help>
               <completionHelp>
-                <list>cfa-533 cfa-631 cfa-633 cfa-635 sdec</list>
+                <list>cfa-533 cfa-631 cfa-633 cfa-635 hd44780 sdec</list>
               </completionHelp>
               <valueHelp>
                 <format>cfa-533</format>
@@ -30,12 +30,16 @@
                 <format>cfa-635</format>
                 <description>Crystalfontz CFA-635</description>
               </valueHelp>
+              <valueHelp>
+                <format>hd44780</format>
+                <description>Hitachi HD44780, Caswell Appliances</description>
+              </valueHelp>
               <valueHelp>
                 <format>sdec</format>
                 <description>Lanner, Watchguard, Nexcom NSA, Sophos UTM appliances</description>
               </valueHelp>
               <constraint>
-                <regex>^(cfa-533|cfa-631|cfa-633|cfa-635|sdec)$</regex>
+                <regex>^(cfa-533|cfa-631|cfa-633|cfa-635|hd44780|sdec)$</regex>
               </constraint>
             </properties>
           </leafNode>
-- 
cgit v1.2.3