diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-02-12 19:01:42 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-02-15 14:30:15 +0200 |
commit | 34ddc83dc72030ded90b5ff038cca67354ea8d34 (patch) | |
tree | d70b20af4118c3770800acfdfe480cb9fcedbfe5 /drivers/auxdisplay/line-display.h | |
parent | 70fb97c0611ed76be5b44cbd3593d1c0b731321e (diff) | |
download | linux-stable-34ddc83dc72030ded90b5ff038cca67354ea8d34.tar.gz linux-stable-34ddc83dc72030ded90b5ff038cca67354ea8d34.tar.bz2 linux-stable-34ddc83dc72030ded90b5ff038cca67354ea8d34.zip |
auxdisplay: linedisp: Add support for overriding character mapping
There is already the driver using character mapping table for
7 or 14 segment display. It is possible to override it. Make
the similar in the line display library to allow other drivers
to utilise the same functionality.
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/auxdisplay/line-display.h')
-rw-r--r-- | drivers/auxdisplay/line-display.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/auxdisplay/line-display.h b/drivers/auxdisplay/line-display.h index 88d051445599..4e310b0e611e 100644 --- a/drivers/auxdisplay/line-display.h +++ b/drivers/auxdisplay/line-display.h @@ -14,13 +14,43 @@ #include <linux/device.h> #include <linux/timer_types.h> +#include <linux/map_to_7segment.h> +#include <linux/map_to_14segment.h> + struct linedisp; /** + * enum linedisp_map_type - type of the character mapping + * @LINEDISP_MAP_SEG7: Map characters to 7 segment display + * @LINEDISP_MAP_SEG14: Map characters to 14 segment display + */ +enum linedisp_map_type { + LINEDISP_MAP_SEG7, + LINEDISP_MAP_SEG14, +}; + +/** + * struct linedisp_map - character mapping + * @type: type of the character mapping + * @map: conversion character mapping + * @size: size of the @map + */ +struct linedisp_map { + enum linedisp_map_type type; + union { + struct seg7_conversion_map seg7; + struct seg14_conversion_map seg14; + } map; + unsigned int size; +}; + +/** * struct linedisp_ops - character line display operations + * @get_map_type: Function called to get the character mapping, if required * @update: Function called to update the display. This must not sleep! */ struct linedisp_ops { + int (*get_map_type)(struct linedisp *linedisp); void (*update)(struct linedisp *linedisp); }; @@ -41,6 +71,7 @@ struct linedisp { struct device dev; struct timer_list timer; const struct linedisp_ops *ops; + struct linedisp_map *map; char *buf; char *message; unsigned int num_chars; |