162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci#define DEFAULT_LCD_BWIDTH      40
462306a36Sopenharmony_ci#define DEFAULT_LCD_HWIDTH      64
562306a36Sopenharmony_ci
662306a36Sopenharmony_cistruct hd44780_common {
762306a36Sopenharmony_ci	int ifwidth;			/* 4-bit or 8-bit (default) */
862306a36Sopenharmony_ci	int bwidth;			/* Default set by hd44780_alloc() */
962306a36Sopenharmony_ci	int hwidth;			/* Default set by hd44780_alloc() */
1062306a36Sopenharmony_ci	unsigned long hd44780_common_flags;
1162306a36Sopenharmony_ci	void (*write_data)(struct hd44780_common *hdc, int data);
1262306a36Sopenharmony_ci	void (*write_cmd)(struct hd44780_common *hdc, int cmd);
1362306a36Sopenharmony_ci	/* write_cmd_raw4 is for 4-bit connected displays only */
1462306a36Sopenharmony_ci	void (*write_cmd_raw4)(struct hd44780_common *hdc, int cmd);
1562306a36Sopenharmony_ci	void *hd44780;
1662306a36Sopenharmony_ci};
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciint hd44780_common_print(struct charlcd *lcd, int c);
1962306a36Sopenharmony_ciint hd44780_common_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y);
2062306a36Sopenharmony_ciint hd44780_common_home(struct charlcd *lcd);
2162306a36Sopenharmony_ciint hd44780_common_clear_display(struct charlcd *lcd);
2262306a36Sopenharmony_ciint hd44780_common_init_display(struct charlcd *lcd);
2362306a36Sopenharmony_ciint hd44780_common_shift_cursor(struct charlcd *lcd,
2462306a36Sopenharmony_ci		enum charlcd_shift_dir dir);
2562306a36Sopenharmony_ciint hd44780_common_shift_display(struct charlcd *lcd,
2662306a36Sopenharmony_ci		enum charlcd_shift_dir dir);
2762306a36Sopenharmony_ciint hd44780_common_display(struct charlcd *lcd, enum charlcd_onoff on);
2862306a36Sopenharmony_ciint hd44780_common_cursor(struct charlcd *lcd, enum charlcd_onoff on);
2962306a36Sopenharmony_ciint hd44780_common_blink(struct charlcd *lcd, enum charlcd_onoff on);
3062306a36Sopenharmony_ciint hd44780_common_fontsize(struct charlcd *lcd, enum charlcd_fontsize size);
3162306a36Sopenharmony_ciint hd44780_common_lines(struct charlcd *lcd, enum charlcd_lines lines);
3262306a36Sopenharmony_ciint hd44780_common_redefine_char(struct charlcd *lcd, char *esc);
3362306a36Sopenharmony_cistruct hd44780_common *hd44780_common_alloc(void);
34