aboutsummaryrefslogtreecommitdiff
path: root/drivers/auxdisplay/charlcd.h
diff options
context:
space:
mode:
authorLars Poeschel2020-11-03 10:58:11 +0100
committerMiguel Ojeda2020-11-04 11:04:03 +0100
commitb26deabb1d915fe87d395081bbd3058b938dee89 (patch)
treeea623cab5ff65fe59f1e514c85ea41692e0bb5e6 /drivers/auxdisplay/charlcd.h
parent11588b59cf620305e78523f57918b986b5e32214 (diff)
auxdisplay: hd44780_common_print
We create a hd44780_common_print function. It is derived from the original charlcd_print. charlcd_print becomes a device independent print function, that then only calls via its ops function pointers, into the print function offered by drivers. Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'drivers/auxdisplay/charlcd.h')
-rw-r--r--drivers/auxdisplay/charlcd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/auxdisplay/charlcd.h b/drivers/auxdisplay/charlcd.h
index ff4896af2189..94922e3c1c4c 100644
--- a/drivers/auxdisplay/charlcd.h
+++ b/drivers/auxdisplay/charlcd.h
@@ -30,9 +30,21 @@ struct charlcd {
void *drvdata;
};
+/**
+ * struct charlcd_ops - Functions used by charlcd. Drivers have to implement
+ * these.
+ * @clear_fast: Clear the whole display and set cursor to position 0, 0.
+ * Optional.
+ * @backlight: Turn backlight on or off. Optional.
+ * @print: Print one character to the display at current cursor position.
+ * The cursor is advanced by charlcd.
+ * The buffered cursor position is advanced by charlcd. The cursor should not
+ * wrap to the next line at the end of a line.
+ */
struct charlcd_ops {
void (*clear_fast)(struct charlcd *lcd);
void (*backlight)(struct charlcd *lcd, enum charlcd_onoff on);
+ int (*print)(struct charlcd *lcd, int c);
};
struct charlcd *charlcd_alloc(void);