Skip to contentSkip to conversation

drivers: add LCD support

PATCH Superseded Miguel Ojeda Sandonis 1 participant 1 message Oct 5, 2006

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v9 1/1 drivers: add LCD support

Andrew, I think this can be the final review.
Updated to 2.6.19-rc1. Please apply.

It just inserts, anything is deleted and it doesn't get affected by the huge "IRQ: Maintain regs pointer globally ..." soon applied patch so it is safe to apply it now.
---
miguelojeda-2.6.19-rc1-add-LCD-support.patch.v9

Adds support for auxiliary displays, the ks0108 LCD controller and the cfag12864b LCD.

Brief
-----

- Adds a "auxdisplay/" folder in "drivers/" for auxiliary display drivers.
- Adds a class for registering Auxiliary LCD devices, named "auxlcd"
- 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...
- Miguel Ojeda will maintain all the stuff above.

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

V9 - "lcd" class changed to "auxlcd":
- Avoid conflict with other older/future lcd drivers,
- Improve understanding
- Apply for 2.6.19-rc1

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                          |   18
 drivers/Kconfig                      |    2
 drivers/Makefile                     |    1
 drivers/auxdisplay/Kconfig           |  103 ++++
 drivers/auxdisplay/Makefile          |    7
 drivers/auxdisplay/auxlcdclass.c     |   79 +++
 drivers/auxdisplay/cfag12864b.c      |  600 +++++++++++++++++++++++++
 drivers/auxdisplay/ks0108.c          |  171 +++++++
 include/linux/auxlcdclass.h          |   33 +
 include/linux/cfag12864b.h           |   58 ++
 include/linux/ks0108.h               |   36 +
 17 files changed, 1668 insertions(+)

miguelojeda-2.6.19-rc1-add-LCD-support.patch.v9

---

CREDITS +8 -0
diff -uprN -X dontdiff linux-2.6.19-rc1-vanilla/CREDITS linux-2.6.19-rc1/CREDITS
@@ -2562,6 +2562,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.19-rc1-vanilla/Documentation/auxdisplay/auxdisplay linux-2.6.19-rc1/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.19-rc1-vanilla/Documentation/ioctl-number.txt linux-2.6.19-rc1/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 Auxiliary LCD driver
+					<mailto:[email protected]>
drivers/auxdisplay/auxlcdclass.c +79 -0

79 lines not on this page · raw message

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/Makefile +7 -0
diff -uprN -X dontdiff linux-2.6.19-rc1-vanilla/drivers/auxdisplay/Makefile linux-2.6.19-rc1/drivers/auxdisplay/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the kernel auxiliary displays device drivers.
+#
+
+obj-$(CONFIG_AUXLCDCLASS)	+= auxlcdclass.o
+obj-$(CONFIG_KS0108)		+= ks0108.o
+obj-$(CONFIG_CFAG12864B)	+= cfag12864b.o
drivers/Kconfig +2 -0
diff -uprN -X dontdiff linux-2.6.19-rc1-vanilla/drivers/Kconfig linux-2.6.19-rc1/drivers/Kconfig
@@ -76,4 +76,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.19-rc1-vanilla/drivers/Makefile linux-2.6.19-rc1/drivers/Makefile
@@ -77,3 +77,4 @@ obj-$(CONFIG_CRYPTO)		+= crypto/
 obj-$(CONFIG_SUPERH)		+= sh/
 obj-$(CONFIG_GENERIC_TIME)	+= clocksource/
 obj-$(CONFIG_DMA_ENGINE)	+= dma/
+obj-y				+= auxdisplay/
include/linux/auxlcdclass.h +33 -0
diff -uprN -X dontdiff linux-2.6.19-rc1-vanilla/include/linux/auxlcdclass.h linux-2.6.19-rc1/include/linux/auxlcdclass.h
@@ -0,0 +1,33 @@
+/*
+ *    Filename: auxlcdclass.h
+ *     Version: 0.1.0
+ * Description: Auxiliary LCD Class Header
+ *     License: GPLv2
+ *
+ *      Author: Copyright (C) Miguel Ojeda Sandonis <[email protected]>
+ *        Date: 2006-10-05
+ *
+ *  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 _AUXLCDCLASS_H_
+#define _AUXLCDCLASS_H_
+
+#include <linux/device.h>
+
+extern struct class *auxlcdclass_class;
+
+#endif /* _AUXLCDCLASS_H_ */
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.19-rc1-vanilla/include/linux/ks0108.h linux-2.6.19-rc1/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_ */
MAINTAINERS +18 -0
diff -uprN -X dontdiff linux-2.6.19-rc1-vanilla/MAINTAINERS linux-2.6.19-rc1/MAINTAINERS
@@ -441,6 +441,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
+
 AVR32 ARCHITECTURE
 P:	Atmel AVR32 Support Team
 M:	[email protected]
@@ -646,6 +652,12 @@ L:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+CFAG12864B LCD DRIVER
+P:	Miguel Ojeda Sandonis
+M:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 COMMON INTERNET FILE SYSTEM (CIFS)
 P:	Steve French
 M:	[email protected]
@@ -1736,6 +1748,12 @@ M:	[email protected]
 L:	[email protected]
 S:	Maintained
 
+KS0108 LCD CONTROLLER DRIVER
+P:	Miguel Ojeda Sandonis
+M:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 LAPB module
 L:	[email protected]
 S:	Orphan