line-display.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <[email protected]>
  7. *
  8. * Copyright (C) 2021 Glider bv
  9. */
  10. #ifndef _LINEDISP_H
  11. #define _LINEDISP_H
  12. /**
  13. * struct linedisp - character line display private data structure
  14. * @dev: the line display device
  15. * @timer: timer used to implement scrolling
  16. * @update: function called to update the display
  17. * @buf: pointer to the buffer for the string currently displayed
  18. * @message: the full message to display or scroll on the display
  19. * @num_chars: the number of characters that can be displayed
  20. * @message_len: the length of the @message string
  21. * @scroll_pos: index of the first character of @message currently displayed
  22. * @scroll_rate: scroll interval in jiffies
  23. */
  24. struct linedisp {
  25. struct device dev;
  26. struct timer_list timer;
  27. void (*update)(struct linedisp *linedisp);
  28. char *buf;
  29. char *message;
  30. unsigned int num_chars;
  31. unsigned int message_len;
  32. unsigned int scroll_pos;
  33. unsigned int scroll_rate;
  34. };
  35. int linedisp_register(struct linedisp *linedisp, struct device *parent,
  36. unsigned int num_chars, char *buf,
  37. void (*update)(struct linedisp *linedisp));
  38. void linedisp_unregister(struct linedisp *linedisp);
  39. #endif /* LINEDISP_H */