xref: /linux/drivers/auxdisplay/hd44780_common.h (revision d2f2187e8f27cd884150acdce7ec96135260413b)
1718e05edSLars Poeschel /* SPDX-License-Identifier: GPL-2.0-or-later */
2718e05edSLars Poeschel 
32545c1c9SLars Poeschel #define DEFAULT_LCD_BWIDTH      40
42545c1c9SLars Poeschel #define DEFAULT_LCD_HWIDTH      64
52545c1c9SLars Poeschel 
6718e05edSLars Poeschel struct hd44780_common {
73fc04dd7SLars Poeschel 	int ifwidth;			/* 4-bit or 8-bit (default) */
82545c1c9SLars Poeschel 	int bwidth;			/* Default set by hd44780_alloc() */
92545c1c9SLars Poeschel 	int hwidth;			/* Default set by hd44780_alloc() */
1001ec46dfSLars Poeschel 	unsigned long hd44780_common_flags;
1171ff701bSLars Poeschel 	void (*write_data)(struct hd44780_common *hdc, int data);
122c6a82f2SLars Poeschel 	void (*write_cmd)(struct hd44780_common *hdc, int cmd);
132c6a82f2SLars Poeschel 	/* write_cmd_raw4 is for 4-bit connected displays only */
142c6a82f2SLars Poeschel 	void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
15718e05edSLars Poeschel 	void *hd44780;
16718e05edSLars Poeschel };
17718e05edSLars Poeschel 
18b26deabbSLars Poeschel int hd44780_common_print(struct charlcd *lcd, int c);
19d3a2fb81SLars Poeschel int hd44780_common_gotoxy(struct charlcd *lcd);
2088645a86SLars Poeschel int hd44780_common_home(struct charlcd *lcd);
2145421ffeSLars Poeschel int hd44780_common_clear_display(struct charlcd *lcd);
2201ec46dfSLars Poeschel int hd44780_common_init_display(struct charlcd *lcd);
23*d2f2187eSLars Poeschel int hd44780_common_shift_cursor(struct charlcd *lcd,
24*d2f2187eSLars Poeschel 		enum charlcd_shift_dir dir);
25*d2f2187eSLars Poeschel int hd44780_common_shift_display(struct charlcd *lcd,
26*d2f2187eSLars Poeschel 		enum charlcd_shift_dir dir);
27*d2f2187eSLars Poeschel int hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on);
28*d2f2187eSLars Poeschel int hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on);
29*d2f2187eSLars Poeschel int hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on);
30*d2f2187eSLars Poeschel int hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size);
31*d2f2187eSLars Poeschel int hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines);
32718e05edSLars Poeschel struct hd44780_common *hd44780_common_alloc(void);
33