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 /** 15 * struct linedisp - character line display private data structure 16 * @dev: the line display device 17 * @timer: timer used to implement scrolling 18 * @update: function called to update the display 19 * @buf: pointer to the buffer for the string currently displayed 20 * @message: the full message to display or scroll on the display 21 * @num_chars: the number of characters that can be displayed 22 * @message_len: the length of the @message string 23 * @scroll_pos: index of the first character of @message currently displayed 24 * @scroll_rate: scroll interval in jiffies 25 */ 26 struct linedisp { 27 struct device dev; 28 struct timer_list timer; 29 void (*update)(struct linedisp *linedisp); 30 char *buf; 31 char *message; 32 unsigned int num_chars; 33 unsigned int message_len; 34 unsigned int scroll_pos; 35 unsigned int scroll_rate; 36 }; 37 38 int linedisp_register(struct linedisp *linedisp, struct device *parent, 39 unsigned int num_chars, char *buf, 40 void (*update)(struct linedisp *linedisp)); 41 void linedisp_unregister(struct linedisp *linedisp); 42 43 #endif /* LINEDISP_H */ 44