Skip to contentSkip to conversation

drivers: add LCD support

PATCH Superseded Miguel Ojeda Sandonis 3 participants 4 messages Oct 4, 2006

Subsystems (5)

v8 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 drivers: add LCD support

miguelojeda-2.6.18-add-lcd-display-support.patch.v8

Andrew, I think this can be the final review.
Nomenclature changed as requested. Please apply.

Brief
-----

- Adds a "auxdisplay/" folder in "drivers/" for auxiliary display drivers.
- Adds a LCD class for registering LCD devices.
- Adds support for the ks0108 LCD Controller as a device driver.
(uses lcddisplay class and parport interface)
- Adds support for the cfag12864b LCD as a device driver.
(uses ks0108 LCD Controller driver)
- Adds a new ioctl() magic number/range (0xFF) in the list for the cfag12864b device.
- Adds the usual Documentation, ABI, includes, Makefiles, Kconfigs, MAINTAINERS, CREDITS...

Changelog (newer first)
-----------------------

V8 - Nomenclature changed as discussed (mainly by Randy Dunlop and Stefan Richter;
also Alan Cox, Alexander van Heukelum, Andrew James, Andreas Schwab...)
- Changed tree to a neutral "drivers/auxdisplay/"
- Changed references from "LCD Display" to "LCD"
- Other minor reviews

V7 - Fixed mistakes found by Randy Dunlap
- removed kmalloc/kfree calls, do it at init/exit
- added Documentation/ABI/testing/cfag12864b
- changed %i to %Zd at printk calls to avoid gcc warnings
- removed image startup
- coding style
- improved MODULE_DESCRIPTIONs
- added parens to some macros
- changed KERN_DEBUG to KERN_INFO for "inited" and "exited" messages
- added single spaces around arithmetic operators
- added several spacebars
- fixed several spelling issues

V6 - Fixed mistakes found by Andrew Morton
- added locking
- removed "add const to class_create" part, as it is already accepted in 2.6.18-git10
- removed PRINT_PREFIX macro, use KERN_... instead
- reverted bitops to standard |= and &=
- added const to fop's static struct
- added error code checking for class_device_create()
- removed "if(foo > maxfoo) foo=maxfoo;", use min(foo,maxfoo) instead
- coding style:
- used #defined constants directly, not static constants = DEFINED_CONSTANT
- removed blank lines
- changed pointers declarations to "T *name"
- changed for's coding style
- added single spaces around arithmetic operators
- changed counter's nomencalture to i,j,k
- shorter function definitions
- removed newlines at some function calls
- udelay(2)

V5 - Fixed mistakes found by Joe Perches
- coding style
- const, spelling mistake

V4 - Fixed mistakes found by Pavel Machek
- no zero initialization
- GPL version
- use bitop generic functions

V3 - Apply for 2.6.18
- added const to class_create (2.6.18 hasn't add-const-to-class_create.patch)

V2 - Fixed mistakes found by Greg KH
- lots about coding style

V1 - Fixed mistakes found by Alexey Dobriyan
- coding style
- init() and exit() error management

V0 - Original patch

Patched files Index
-------------------

 CREDITS                              |    8
 Documentation/ABI/testing/cfag12864b |   50 ++
 Documentation/auxdisplay/auxdisplay  |   37 +
 Documentation/auxdisplay/cfag12864b  |  404 ++++++++++++++++
 Documentation/auxdisplay/ks0108      |   59 ++
 Documentation/ioctl-number.txt       |    2
 MAINTAINERS                          |    6
 drivers/Kconfig                      |    2
 drivers/Makefile                     |    1
 drivers/auxdisplay/Kconfig           |  103 ++++
 drivers/auxdisplay/Makefile          |    7
 drivers/auxdisplay/cfag12864b.c      |  600 +++++++++++++++++++++++++
 drivers/auxdisplay/ks0108.c          |  171 +++++++
 drivers/auxdisplay/lcdclass.c        |   79 +++
 include/linux/cfag12864b.h           |   58 ++
 include/linux/ks0108.h               |   36 +
 include/linux/lcdclass.h             |   33 +
 17 files changed, 1656 insertions(+)

miguelojeda-2.6.18-add-lcd-display-support.patch.v8

---

CREDITS +8 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/CREDITS linux-2.6.18/CREDITS
@@ -2535,6 +2535,14 @@ S: Subiaco, 6008
 S: Perth, Western Australia
 S: Australia
 
+N: Miguel Ojeda Sandonis
+E: [email protected]
+D: Author: LCD and LCD Controller drivers (ks0108, cfag12864b)
+D: Maintainer: Auxiliary display drivers tree (drivers/auxdisplay/*)
+S: C/ Mieses 20, 9-B
+S: Valladolid 47009
+S: Spain
+
 N: Greg Page
 E: [email protected]
 D: IPX development and support
Documentation/ABI/testing/cfag12864b +50 -0

50 lines not on this page · raw message

Documentation/auxdisplay/auxdisplay +37 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/Documentation/auxdisplay/auxdisplay linux-2.6.18/Documentation/auxdisplay/auxdisplay
@@ -0,0 +1,37 @@
+	=======================================
+	Auxiliary Display Drivers Documentation
+	=======================================
+
+License:		GPLv2
+Author & Maintainer:	Miguel Ojeda Sandonis <[email protected]>
+Date:			2006-10-04
+
+--------
+0. INDEX
+--------
+
+	1. NEW DISPLAY DRIVERS
+	2. GENERAL TIPS
+
+
+
+----------------------
+1. NEW DISPLAY DRIVERS
+----------------------
+
+Feel free to send me new display drivers. I will try to do my best.
+
+If you don't get any answer, send your patch directly to the linux-kernel ml.
+
+
+
+---------------
+2. GENERAL TIPS
+---------------
+
+- Divide your driver into the controller driver, like ks0108,
+  and the specific display series driver, like cfag12864b.
+
+- Claim for your IO ports in the controller driver.
+
+EOF
Documentation/auxdisplay/cfag12864b +404 -0

404 lines not on this page · raw message

Documentation/auxdisplay/ks0108 +59 -0

59 lines not on this page · raw message

Documentation/ioctl-number.txt +2 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/Documentation/ioctl-number.txt linux-2.6.18/Documentation/ioctl-number.txt
@@ -191,3 +191,5 @@ Code	Seq#	Include File		Comments
 					<mailto:[email protected]>
 0xF3	00-3F	video/sisfb.h		sisfb (in development)
 					<mailto:[email protected]>
+0xFF	00-1F	linux/cfag12864b.h	cfag12864b LCD driver
+					<mailto:[email protected]>
drivers/auxdisplay/cfag12864b.c +600 -0

600 lines not on this page · raw message

drivers/auxdisplay/Kconfig +103 -0

103 lines not on this page · raw message

drivers/auxdisplay/ks0108.c +171 -0

171 lines not on this page · raw message

drivers/auxdisplay/lcdclass.c +79 -0

79 lines not on this page · raw message

drivers/auxdisplay/Makefile +7 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/drivers/auxdisplay/Makefile linux-2.6.18/drivers/auxdisplay/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the kernel auxiliary displays device drivers.
+#
+
+obj-$(CONFIG_LCDCLASS)		+= lcdclass.o
+obj-$(CONFIG_KS0108)		+= ks0108.o
+obj-$(CONFIG_CFAG12864B)	+= cfag12864b.o
drivers/Kconfig +2 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/drivers/Kconfig linux-2.6.18/drivers/Kconfig
@@ -74,4 +74,6 @@ source "drivers/rtc/Kconfig"
 
 source "drivers/dma/Kconfig"
 
+source "drivers/auxdisplay/Kconfig"
+
 endmenu
drivers/Makefile +1 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/drivers/Makefile linux-2.6.18/drivers/Makefile
@@ -76,3 +76,4 @@ obj-$(CONFIG_CRYPTO)		+= crypto/
 obj-$(CONFIG_SUPERH)		+= sh/
 obj-$(CONFIG_GENERIC_TIME)	+= clocksource/
 obj-$(CONFIG_DMA_ENGINE)	+= dma/
+obj-y				+= auxdisplay/
include/linux/cfag12864b.h +58 -0

58 lines not on this page · raw message

include/linux/ks0108.h +36 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/include/linux/ks0108.h linux-2.6.18/include/linux/ks0108.h
@@ -0,0 +1,36 @@
+/*
+ *    Filename: ks0108.h
+ *     Version: 0.1.0
+ * Description: ks0108 LCD Controller driver header
+ *     License: GPLv2
+ *
+ *      Author: Copyright (C) Miguel Ojeda Sandonis <[email protected]>
+ *        Date: 2006-10-04
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef _KS0108_H_
+#define _KS0108_H_
+
+extern void ks0108_writedata(unsigned char byte);
+extern void ks0108_writecontrol(unsigned char byte);
+extern void ks0108_displaystate(unsigned char state);
+extern void ks0108_startline(unsigned char startline);
+extern void ks0108_address(unsigned char address);
+extern void ks0108_page(unsigned char page);
+
+#endif /* _KS0108_H_ */
include/linux/lcdclass.h +33 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/include/linux/lcdclass.h linux-2.6.18/include/linux/lcdclass.h
@@ -0,0 +1,33 @@
+/*
+ *    Filename: lcdclass.h
+ *     Version: 0.1.0
+ * Description: LCD Class Header
+ *     License: GPLv2
+ *
+ *      Author: Copyright (C) Miguel Ojeda Sandonis <[email protected]>
+ *        Date: 2006-10-04
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef _LCDCLASS_H_
+#define _LCDCLASS_H_
+
+#include <linux/device.h>
+
+extern struct class *lcdclass_class;
+
+#endif /* _LCDCLASS_H_ */
MAINTAINERS +6 -0
diff -uprN -X dontdiff linux-2.6.18-vanilla/MAINTAINERS linux-2.6.18/MAINTAINERS
@@ -435,6 +435,12 @@ W:	http://people.redhat.com/sgrubb/audit
 T:	git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S:	Maintained
 
+AUXILIARY DISPLAY DRIVERS
+P:	Miguel Ojeda Sandonis
+M:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 AX.25 NETWORK LAYER
 P:	Ralf Baechle
 M:	[email protected]
#1 lore raw
Quoted 6 lines · On Wed, 4 Oct 2006 18:06:15 +0000 Miguel Ojeda Sandonis wrote:

miguelojeda-2.6.18-add-lcd-display-support.patch.v8

Andrew, I think this can be the final review.
Nomenclature changed as requested. Please apply.

Quoted 7 lines

Brief
-----

- Adds a "auxdisplay/" folder in "drivers/" for auxiliary display drivers.
- Adds a LCD class for registering LCD devices.
- Adds support for the ks0108 LCD Controller as a device driver. (uses lcddisplay class and parport interface)

Couldn't you make the class be "auxdisplay" also?

Quoted 4 lines

- Adds support for the cfag12864b LCD as a device driver.
(uses ks0108 LCD Controller driver)
- Adds a new ioctl() magic number/range (0xFF) in the list for the cfag12864b device.
- Adds the usual Documentation, ABI, includes, Makefiles, Kconfigs, MAINTAINERS, CREDITS...

---
~Randy

#2 lore raw
Quoted 3 lines · Randy Dunlap

Couldn't you make the class be "auxdisplay" also?

I don't really know what would be the best. I think if anyone adds a driver for any other kind of display (example: OLED), he/she can create a oledclass, that maybe need more funcionality than just the simple lcdclass.

#3 lore raw
Quoted 9 lines · Miguel Ojeda
Quoted 3 lines · Randy Dunlap

Couldn't you make the class be "auxdisplay" also?

I don't really know what would be the best. I think if anyone adds a driver for any other kind of display (example: OLED), he/she can create a oledclass, that maybe need more funcionality than just the simple lcdclass.

There's already an lcd_class in drivers/video/backlight/lcd.c with name "lcd". Could be confusing to have an lcdclass_class with name "LCD" as well...

Haavard