From ac201479cc695cb0140e425b9ca8ab2ecdcd2f0d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 10 Mar 2017 15:15:18 +0100 Subject: auxdisplay: charlcd: Add support for 4-bit interfaces In 4-bit mode, 8-bit commands and data are written using two raw writes to the data interface: high nibble first, low nibble last. This must be handled by the low-level driver. However, as we don't know in which mode (4-bit or 8-bit) nor 4-bit phase the LCD was left, initialization must always be handled using raw writes, and needs to configure the LCD for 8-bit mode first. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- include/misc/charlcd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/misc/charlcd.h') diff --git a/include/misc/charlcd.h b/include/misc/charlcd.h index c40047b673c9..23f61850f363 100644 --- a/include/misc/charlcd.h +++ b/include/misc/charlcd.h @@ -14,6 +14,7 @@ struct charlcd { const struct charlcd_ops *ops; const unsigned char *char_conv; /* Optional */ + int ifwidth; /* 4-bit or 8-bit (default) */ int height; int width; int bwidth; /* Default set by charlcd_alloc() */ @@ -28,6 +29,7 @@ struct charlcd_ops { void (*write_data)(struct charlcd *lcd, int data); /* Optional */ + void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */ void (*clear_fast)(struct charlcd *lcd); void (*backlight)(struct charlcd *lcd, int on); }; -- cgit v1.2.3-59-g8ed1b