a6efda4ac11d92fa18fcc30e1202aa366733925d
[linux-2.6-microblaze.git] / drivers / auxdisplay / line-display.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Character line display core support
4  *
5  * Copyright (C) 2016 Imagination Technologies
6  * Author: Paul Burton <paul.burton@mips.com>
7  *
8  * Copyright (C) 2021 Glider bv
9  */
10
11 #ifndef _LINEDISP_H
12 #define _LINEDISP_H
13
14 #include <linux/device.h>
15 #include <linux/timer_types.h>
16
17 /**
18  * struct linedisp - character line display private data structure
19  * @dev: the line display device
20  * @timer: timer used to implement scrolling
21  * @update: function called to update the display
22  * @buf: pointer to the buffer for the string currently displayed
23  * @message: the full message to display or scroll on the display
24  * @num_chars: the number of characters that can be displayed
25  * @message_len: the length of the @message string
26  * @scroll_pos: index of the first character of @message currently displayed
27  * @scroll_rate: scroll interval in jiffies
28  * @id: instance id of this display
29  */
30 struct linedisp {
31         struct device dev;
32         struct timer_list timer;
33         void (*update)(struct linedisp *linedisp);
34         char *buf;
35         char *message;
36         unsigned int num_chars;
37         unsigned int message_len;
38         unsigned int scroll_pos;
39         unsigned int scroll_rate;
40         unsigned int id;
41 };
42
43 int linedisp_register(struct linedisp *linedisp, struct device *parent,
44                       unsigned int num_chars, char *buf,
45                       void (*update)(struct linedisp *linedisp));
46 void linedisp_unregister(struct linedisp *linedisp);
47
48 #endif /* LINEDISP_H */