Commit 39f8ea46 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Greg Kroah-Hartman

auxdisplay: charlcd: Extract character LCD core from misc/panel

Extract the character LCD core from the Parallel port LCD/Keypad Panel
driver in the misc subsystem, and convert it into a subdriver in the
auxdisplay subsystem.  This allows the character LCD core to be used by
other drivers later.

Compilation is controlled by its own Kconfig symbol CHARLCD, which is to
be selected by its users, but can be enabled manually for
compile-testing.

All functions changed their prefix from "lcd_" to "charlcd_", and gained
a "struct charlcd *" parameter to operate on a specific instance.
While the driver API thus is ready to support multiple instances, the
current limitation of a single display (/dev/lcd has a single misc minor
assigned) is retained.

No functional changes intended.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2eec1080
...@@ -13,6 +13,9 @@ menuconfig AUXDISPLAY ...@@ -13,6 +13,9 @@ menuconfig AUXDISPLAY
If you say N, all options in this submenu will be skipped and disabled. If you say N, all options in this submenu will be skipped and disabled.
config CHARLCD
tristate "Character LCD core support" if COMPILE_TEST
if AUXDISPLAY if AUXDISPLAY
config KS0108 config KS0108
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Makefile for the kernel auxiliary displays device drivers. # Makefile for the kernel auxiliary displays device drivers.
# #
obj-$(CONFIG_CHARLCD) += charlcd.o
obj-$(CONFIG_KS0108) += ks0108.o obj-$(CONFIG_KS0108) += ks0108.o
obj-$(CONFIG_CFAG12864B) += cfag12864b.o cfag12864bfb.o obj-$(CONFIG_CFAG12864B) += cfag12864b.o cfag12864bfb.o
obj-$(CONFIG_IMG_ASCII_LCD) += img-ascii-lcd.o obj-$(CONFIG_IMG_ASCII_LCD) += img-ascii-lcd.o
......
This diff is collapsed.
...@@ -495,6 +495,7 @@ config VEXPRESS_SYSCFG ...@@ -495,6 +495,7 @@ config VEXPRESS_SYSCFG
config PANEL config PANEL
tristate "Parallel port LCD/Keypad Panel support" tristate "Parallel port LCD/Keypad Panel support"
depends on PARPORT depends on PARPORT
select CHARLCD
---help--- ---help---
Say Y here if you have an HD44780 or KS-0074 LCD connected to your Say Y here if you have an HD44780 or KS-0074 LCD connected to your
parallel port. This driver also features 4 and 6-key keypads. The LCD parallel port. This driver also features 4 and 6-key keypads. The LCD
......
This diff is collapsed.
/*
* Character LCD driver for Linux
*
* Copyright (C) 2000-2008, Willy Tarreau <w@1wt.eu>
* Copyright (C) 2016-2017 Glider bvba
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
struct charlcd {
const struct charlcd_ops *ops;
const unsigned char *char_conv; /* Optional */
int height;
int width;
int bwidth; /* Default set by charlcd_alloc() */
int hwidth; /* Default set by charlcd_alloc() */
void *drvdata; /* Set by charlcd_alloc() */
};
struct charlcd_ops {
/* Required */
void (*write_cmd)(struct charlcd *lcd, int cmd);
void (*write_data)(struct charlcd *lcd, int data);
/* Optional */
void (*clear_fast)(struct charlcd *lcd);
void (*backlight)(struct charlcd *lcd, int on);
};
struct charlcd *charlcd_alloc(unsigned int drvdata_size);
int charlcd_register(struct charlcd *lcd);
int charlcd_unregister(struct charlcd *lcd);
void charlcd_poke(struct charlcd *lcd);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment