xref: /openbmc/linux/drivers/auxdisplay/charlcd.h (revision 11588b59)
175354284SMasahiro Yamada /* SPDX-License-Identifier: GPL-2.0-or-later */
275354284SMasahiro Yamada /*
375354284SMasahiro Yamada  * Character LCD driver for Linux
475354284SMasahiro Yamada  *
575354284SMasahiro Yamada  * Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu>
675354284SMasahiro Yamada  * Copyright (C) 2016-2017 Glider bvba
775354284SMasahiro Yamada  */
875354284SMasahiro Yamada 
9390235c3SMasahiro Yamada #ifndef _CHARLCD_H
10390235c3SMasahiro Yamada #define _CHARLCD_H
11390235c3SMasahiro Yamada 
1266ce7d5cSLars Poeschel enum charlcd_onoff {
1366ce7d5cSLars Poeschel 	CHARLCD_OFF = 0,
1466ce7d5cSLars Poeschel 	CHARLCD_ON,
1566ce7d5cSLars Poeschel };
1666ce7d5cSLars Poeschel 
1775354284SMasahiro Yamada struct charlcd {
1875354284SMasahiro Yamada 	const struct charlcd_ops *ops;
1975354284SMasahiro Yamada 	const unsigned char *char_conv;	/* Optional */
2075354284SMasahiro Yamada 
2175354284SMasahiro Yamada 	int height;
2275354284SMasahiro Yamada 	int width;
2375354284SMasahiro Yamada 
24*11588b59SLars Poeschel 	/* Contains the LCD X and Y offset */
25*11588b59SLars Poeschel 	struct {
26*11588b59SLars Poeschel 		unsigned long x;
27*11588b59SLars Poeschel 		unsigned long y;
28*11588b59SLars Poeschel 	} addr;
29*11588b59SLars Poeschel 
302545c1c9SLars Poeschel 	void *drvdata;
3175354284SMasahiro Yamada };
3275354284SMasahiro Yamada 
3375354284SMasahiro Yamada struct charlcd_ops {
3475354284SMasahiro Yamada 	void (*clear_fast)(struct charlcd *lcd);
3566ce7d5cSLars Poeschel 	void (*backlight)(struct charlcd *lcd, enum charlcd_onoff on);
3675354284SMasahiro Yamada };
3775354284SMasahiro Yamada 
382545c1c9SLars Poeschel struct charlcd *charlcd_alloc(void);
3975354284SMasahiro Yamada void charlcd_free(struct charlcd *lcd);
4075354284SMasahiro Yamada 
4175354284SMasahiro Yamada int charlcd_register(struct charlcd *lcd);
4275354284SMasahiro Yamada int charlcd_unregister(struct charlcd *lcd);
4375354284SMasahiro Yamada 
4475354284SMasahiro Yamada void charlcd_poke(struct charlcd *lcd);
45390235c3SMasahiro Yamada 
46390235c3SMasahiro Yamada #endif /* CHARLCD_H */
47