drivers: add lcd display support
Subsystems (5)
PATCH v7 1/1 drivers: add lcd display support
miguelojeda-2.6.18-add-lcd-display-support.patch.v7
Brief
-----
- Adds a "lcddisplay" 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 Display as a device driver.
(uses ks0108 device 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)
-----------------------
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/ioctl-number.txt | 2 Documentation/lcddisplay/cfag12864b | 402 ++++++++++++++++ Documentation/lcddisplay/lcddisplay | 37 + MAINTAINERS | 6 drivers/Kconfig | 2 drivers/Makefile | 1 drivers/lcddisplay/Kconfig | 106 ++++ drivers/lcddisplay/Makefile | 7 drivers/lcddisplay/cfag12864b.c | 600 +++++++++++++++++++++++++ drivers/lcddisplay/ks0108.c | 171 +++++++ drivers/lcddisplay/lcddisplay.c | 79 +++ include/linux/cfag12864b.h | 58 ++ include/linux/ks0108.h | 36 + include/linux/lcddisplay.h | 34 + 16 files changed, 1599 insertions(+)
Please review. (Roargh, I think this way I'm going to reach V123 :)
miguelojeda-2.6.18-add-lcd-display-support.patch.v7
---
CREDITS +8 -0
@@ -2535,6 +2535,14 @@ S: Subiaco, 6008 S: Perth, Western Australia S: Australia +N: Miguel Ojeda Sandonis +E: [email protected] +D: Author: LCD Display Drivers (ks0108, cfag12864b) +D: Maintainer: LCD Display Drivers Tree (drivers/lcddisplay/*) +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/ioctl-number.txt +2 -0
@@ -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 Display Driver + <mailto:[email protected]>
Documentation/lcddisplay/cfag12864b +402 -0
402 lines not on this page · raw message
Documentation/lcddisplay/lcddisplay +37 -0
@@ -0,0 +1,37 @@ + ================================= + LCD Display Drivers Documentation + ================================= + +License: GPL +Author & Maintainer: Miguel Ojeda Sandonis <[email protected]> +Date: 2006-09-30 + +-------- +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 LCD display series driver, like cfag12864b. + +- Claim for your IO ports in the controller driver. + +EOF
drivers/Kconfig +2 -0
@@ -74,4 +74,6 @@ source "drivers/rtc/Kconfig" source "drivers/dma/Kconfig" +source "drivers/lcddisplay/Kconfig" + endmenu
drivers/lcddisplay/cfag12864b.c +600 -0
600 lines not on this page · raw message
drivers/lcddisplay/Kconfig +106 -0
106 lines not on this page · raw message
drivers/lcddisplay/ks0108.c +171 -0
171 lines not on this page · raw message
drivers/lcddisplay/lcddisplay.c +79 -0
79 lines not on this page · raw message
drivers/lcddisplay/Makefile +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for the kernel LCD Display device drivers. +# + +obj-$(CONFIG_LCDDISPLAY) += lcddisplay.o +obj-$(CONFIG_KS0108) += ks0108.o +obj-$(CONFIG_CFAG12864B) += cfag12864b.o
drivers/Makefile +1 -0
@@ -76,3 +76,4 @@ obj-$(CONFIG_CRYPTO) += crypto/ obj-$(CONFIG_SUPERH) += sh/ obj-$(CONFIG_GENERIC_TIME) += clocksource/ obj-$(CONFIG_DMA_ENGINE) += dma/ +obj-$(CONFIG_LCDDISPLAY) += lcddisplay/
include/linux/cfag12864b.h +58 -0
58 lines not on this page · raw message
include/linux/ks0108.h +36 -0
@@ -0,0 +1,36 @@ +/* +* Filename: ks0108.h +* Version: 0.1.0 +* Description: ks0108 LCD Display Controller Driver Header +* License: GPLv2 or later +* +* Author: Copyright (C) Miguel Ojeda Sandonis <[email protected]> +* Date: 2006-09-28 +* +* 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/lcddisplay.h +34 -0
@@ -0,0 +1,34 @@ +/* +* Filename: lcddisplay.h +* Version: 0.1.0 +* Description: Display Class Header +* License: GPLv2 or later +* +* Author: Copyright (C) Miguel Ojeda Sandonis <[email protected]> +* Date: 2006-09-28 +* +* 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 _LCDDISPLAY_H_ +#define _LCDDISPLAY_H_ + +#include <linux/device.h> + +extern struct class *lcddisplay_class; + +#endif /* _LCDDISPLAY_H_ */ +
MAINTAINERS +6 -0
@@ -1707,6 +1707,12 @@ M: [email protected] L: [email protected] S: Maintained +LCD DISPLAY DRIVERS +P: Miguel Ojeda Sandonis +M: [email protected] +L: [email protected] +S: Maintained + LED SUBSYSTEM P: Richard Purdie M: [email protected]
Quoted 12 lines · Stefan Richter
It is as common as it is wrong. http://en.wikipedia.org/wiki/RAS_Syndrome
A contraction like LCDisplay, like my suggested lcdisplay for the path name, is IMO not suitable for use in normal written language. Use it at most for path names where we contract words into one or would write lc-display or
lc_display.Still wrong language.
"LCD" and "LC display" are correct.
Sure it is wrong, the point is what is the best to understading. "LCD display" seems better to me than just "LC display".
Maybe "drivers/lcdisplay" and "LCD" in common written places? Then we will have:
tristate "ks0108 LCD controller"
tristate "cfag12864b LCD"
That is the correct spelling, however, does it look good?
(I really don't know what is the best way to write it in english, I'm spanish and here it is more common to say "LCD display").
Quoted 1 line · Miguel Ojeda
On 10/1/06, Stefan Richter <[email protected]> wrote:
...
Quoted 1 line
Quoted 1 line
It is as common as it is wrong.
...
Quoted 5 lines
Quoted 2 lines
"LCD" and "LC display" are correct.
Sure it is wrong, the point is what is the best to understading. "LCD display" seems better to me than just "LC display".
...
Quoted 7 lines
tristate "ks0108 LCD controller"
tristate "cfag12864b LCD"That is the correct spelling, however, does it look good?
(I really don't know what is the best way to write it in english, I'm spanish and here it is more common to say "LCD display").
"LCD display" is wrong and, excuse me, dumb in *all* languages. The fact that it is common doesn't make it a smart thing to say or write. :-)
If you find "LCD" or "LC display" ugly to look at or hard to understand (IMO it is not hard to understand if it appears in a computer technology related context), you could write "liquid crystal display". I suppose you could also just write "cfag12864b display".
I am not sure which looks prettiest. But I know that "LCD display" looks really bad to everybody who knows what the D stands for. :-)
Signature · 3 lines
Stefan Richter -=====-=-==- =-=- ----= http://arcgraph.de/sr/
Quoted 4 lines · Stefan Richter
"LCD display" is wrong and, excuse me, dumb in *all* languages. The fact that it is common doesn't make it a smart thing to say or write. :-)
Well, not in all languages: You know, in other languages the "display" word's first letter isn't "d", so "LCD display" looks good at least in spanish, as we don't translate the english acronym. ;-)
Quoted 6 lines
If you find "LCD" or "LC display" ugly to look at or hard to understand (IMO it is not hard to understand if it appears in a computer technology related context), you could write "liquid crystal display". I suppose you could also just write "cfag12864b display".
I find "LC display" ugly, not "LCD". I know in english looks bad, I'm trying to find the best way to write it, I have no preference between them.
I think I will choose "LCD" for all places, also the pathname: drivers/lcd/
I will wait for the V7 to get reviewed, then I will fix it for the V8.
Quoted 2 lines · Stefan Richter
I am not sure which looks prettiest. But I know that "LCD display" looks really bad to everybody who knows what the D stands for. :-)
Maybe I'm confused, but doesn't the D stand for *DIODE*?
Quoted 1 line · [email protected] writes:
Maybe I'm confused, but doesn't the D stand for *DIODE*?
No, it's the D in LED that stands for diode.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 6 lines · On Sun, 01 Oct 2006 12:05:58 -0400 [email protected] wrote:
Quoted 2 lines · Stefan Richter
I am not sure which looks prettiest. But I know that "LCD display" looks really bad to everybody who knows what the D stands for. :-)
Maybe I'm confused, but doesn't the D stand for *DIODE*?
not that wikipedia or I know of.
---
~Randy
Quoted 2 lines · Miguel Ojeda
Quoted 1 line · Stefan Richter
"LCD display" is wrong and, excuse me, dumb in *all* languages.
...
Quoted 3 lines
Well, not in all languages: You know, in other languages the "display" word's first letter isn't "d", so "LCD display" looks good at least in spanish, as we don't translate the english acronym. ;-)
LCD is in Spanish, as in German, a foreign term. But still, its D is carrying the meaning of "display" or its native equivalent. ("Display" itself is even in common use in Spain, Germany, and many other countries.) In German, "display" may be translated to "Anzeige", "Bildschirm", "Display", "Monitor"; and any of "LCD-Anzeige", "LCD-Bildschirm", "LCD-Display", "LCD-Monitor" would be bad style. ("LCD-Display" would clearly be the worst of all, because one could argue that a display is just a part of a monitor, thus "LCD monitor" is arguably less redundant than "LCD display"...)
Signature · 3 lines
Stefan Richter -=====-=-==- =-=- ----= http://arcgraph.de/sr/
Quoted 1 line · [email protected] wrote:
doesn't the D stand for *DIODE*?
No. Cf. any dictionary or acronym database. The D of LED means diode.
Signature · 3 lines
Stefan Richter -=====-=-==- =-=- ----= http://arcgraph.de/sr/
Quoted 8 lines · Randy Dunlap
Quoted 5 lines · On Sun, 01 Oct 2006 12:05:58 -0400 [email protected] wrote:
Quoted 2 lines · Stefan Richter
I am not sure which looks prettiest. But I know that "LCD display" looks really bad to everybody who knows what the D stands for. :-)
Maybe I'm confused, but doesn't the D stand for *DIODE*?
not that wikipedia or I know of.
I think there is a problem with the name anyhow. Would you use the LCD(d)isplay driver for an OLED screen?
How about auxiliary display or AUXdisplay?
Alexander
Quoted 8 lines
---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 6 lines
Alexander van Heukelum [email protected] -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow
Quoted 5 lines · Andreas Schwab
Quoted 1 line · [email protected] writes:
Maybe I'm confused, but doesn't the D stand for *DIODE*?
No, it's the D in LED that stands for diode.
Argh. Ever wish your laptop had a caffeine detector to prevent you from posting before you were sufficiently awake? :)
Quoted 7 lines · Alexander van Heukelum
I think there is a problem with the name anyhow. Would you use the LCD(d)isplay driver for an OLED screen?
How about auxiliary display or AUXdisplay?
Alexander
Mi first guess was drivers/display/, to put driver about extra-displays, not only LCDs.
But people thought it can confuse users, so I chose to add "LCD" to be more specific.
And no, it is not an organic screen. It is for a cfag12864b LCD (Liquid Crystal Display):
Quoted 9 lines · Stefan Richter
LCD is in Spanish, as in German, a foreign term. But still, its D is carrying the meaning of "display" or its native equivalent. ("Display" itself is even in common use in Spain, Germany, and many other countries.) In German, "display" may be translated to "Anzeige", "Bildschirm", "Display", "Monitor"; and any of "LCD-Anzeige", "LCD-Bildschirm", "LCD-Display", "LCD-Monitor" would be bad style. ("LCD-Display" would clearly be the worst of all, because one could argue that a display is just a part of a monitor, thus "LCD monitor" is arguably less redundant than "LCD display"...)
I'm not saying it is the right way, just I'm saying which is the common way to say it in Spanish: We say "LCD" as "pantalla LCD"; and althought "pantalla" means "display", it is more expressive that way. We use "LCD" as a kind of display.
Yeah, we should use "pantalla LC", but we don't. However, in formal written language, you should write just "LCD", like in English, because it is wrong such "pantalla LCD".
Whatever. The point is that in English "LCD Display" is bad.
Quoted 12 lines · Miguel Ojeda
Quoted 7 lines · Alexander van Heukelum
I think there is a problem with the name anyhow. Would you use the LCD(d)isplay driver for an OLED screen?
How about auxiliary display or AUXdisplay?
Alexander
Mi first guess was
drivers/display/, to put driver about extra-displays, not only LCDs.
Quoted 7 lines
But people thought it can confuse users, so I chose to add "LCD" to be more specific.
And no, it is not an organic screen. It is for a cfag12864b LCD (Liquid Crystal Display):
Ah, I should have read the whole thread before replying. I have not read the code, but... In your original mail you mention it adds a new "lcddisplay" class. I think this wants to be called "auxdisplay".
For the device drivers, you could just use either the acronym alone or write it out, i.e., just use: cfag12864b Liquid Crystal Display driver, or (as stolen from that url) CFAG12864B Series Standard Graphic LCD driver.
Good luck,
Alexander
Signature · 5 lines
Alexander van Heukelum [email protected] -- http://www.fastmail.fm - Email service worth paying for. Try it for free
Quoted 2 lines · Miguel Ojeda
Sure it is wrong, the point is what is the best to understading. "LCD display" seems better to me than just "LC display".
To me too. Acronyms tend to be treated as opaque tokens in English:
their expansions tend not be be well known and don't really interact with their usage. "LCD display" is fine, and is clearer than both "LCD" or "liquid crystal display". (Some users won't know that a "liquid crystal display" is what they know as an "LCD display").
Andrew Wade
Ar Llu, 2006-10-02 am 14:49 -0400, ysgrifennodd Andrew James Wade:
Quoted 3 lines
To me too. Acronyms tend to be treated as opaque tokens in English:
their expansions tend not be be well known and don't really interact with their usage. "LCD display" is fine, and is clearer than both
Speak for yourself. LCD is wrong to my ears. Now "LCD monitor" on the other hand is a great solution.
Quoted 4 lines · Andrew James Wade
Quoted 2 lines · Miguel Ojeda
Sure it is wrong, the point is what is the best to understading. "LCD display" seems better to me than just "LC display".
Quoted 8 lines
To me too. Acronyms tend to be treated as opaque tokens in English:
their expansions tend not be be well known and don't really interact with their usage. "LCD display" is fine, and is clearer than both "LCD" or "liquid crystal display". (Some users won't know that a "liquid crystal display" is what they know as an "LCD display").Andrew Wade
I agree. As I said, in other languages is also common to use "LCD" as a adjective, not as a noun.
Andrew, can you tell me how should I name it? So I will be able to change it (if apply) and send the V8 patch.
I wish V8 will be the final patch...
Quoted 8 lines · Alan Cox
Ar Llu, 2006-10-02 am 14:49 -0400, ysgrifennodd Andrew James Wade:
Quoted 3 lines
To me too. Acronyms tend to be treated as opaque tokens in English:
their expansions tend not be be well known and don't really interact with their usage. "LCD display" is fine, and is clearer than bothSpeak for yourself. LCD is wrong to my ears. Now "LCD monitor" on the other hand is a great solution.
Good idea. It can work. However, is not "LCD monitor" like "LCD screen"? I mean, isn't "screen" a big display?
cfag12864b is just a 128x64 display. Is it right to say it is a "LCD monitor"?
Quoted 2 lines · Miguel Ojeda
Andrew, can you tell me how should I name it? So I will be able to change it (if apply) and send the V8 patch.
I'm afraid not; it looks like my suggestion "LCD display" grates on people's ears. Simply calling the device an "LCD" is probably the best bet, and "LCD screen" would be better than "LCD monitor". Screens can be any size, it's a fairly generic term.
The class name and directory name should probably include the word "display", but I don't know what the other part should be. What sort of displays should be included in this category, and what sort shouldn't?
Andrew Wade
Quoted 6 lines · Andrew James Wade
I'm afraid not; it looks like my suggestion "LCD display" grates on people's ears. Simply calling the device an "LCD" is probably the best bet, and "LCD screen" would be better than "LCD monitor". Screens can be any size, it's a fairly generic term.
Quoted 7 lines
The class name and directory name should probably include the word "display", but I don't know what the other part should be. What sort of displays should be included in this category, and what sort shouldn't?
Andrew Wade
My first idea was call it "display", for small/medium screens of any kind (LCD, OLED, FED, NED... whatever). I named it "drivers/display/", so anyone who create a driver for a display or display controller can put it there (creating a separator for its own category at Kconfig), as there aren't so many of them for now.
But people said "display" could be so generic and cause confusion with usual video drivers, so I renamed it to "drivers/lcddisplay/", as it is more expressive (however when someone will create a OLED driver will have to create a new folder...).
I would like to put any kind of display driver there (LCD, OLED...) not just LCDs and name it "drivers/display". I think people won't confuse them with VESA... as there aren't drivers for "screens", just for video cards (logically). But some people don't agree.
Quoted 26 lines · On Tue, 3 Oct 2006 14:55:07 +0200 Miguel Ojeda wrote:
Quoted 6 lines · Andrew James Wade
I'm afraid not; it looks like my suggestion "LCD display" grates on people's ears. Simply calling the device an "LCD" is probably the best bet, and "LCD screen" would be better than "LCD monitor". Screens can be any size, it's a fairly generic term.
Quoted 7 lines
The class name and directory name should probably include the word "display", but I don't know what the other part should be. What sort of displays should be included in this category, and what sort shouldn't?
Andrew Wade
My first idea was call it "display", for small/medium screens of any kind (LCD, OLED, FED, NED... whatever). I named it "
drivers/display/", so anyone who create a driver for a display or display controller can put it there (creating a separator for its own category atKconfig), as there aren't so many of them for now.But people said "display" could be so generic and cause confusion with usual video drivers, so I renamed it to "
drivers/lcddisplay/", as it is more expressive (however when someone will create a OLED driver will have to create a new folder...).
Quoted 4 lines
I would like to put any kind of display driver there (LCD, OLED...) not just LCDs and name it "
drivers/display". I think people won't confuse them with VESA... as there aren't drivers for "screens", just for video cards (logically). But some people don't agree.
I liked the "auxdisplay" suggestion, FWIW.
---
~Randy
drivers the site: http://monitordelcd.com/ you get. :P
--
This message was sent on behalf of [email protected] at openSubscriber.com
http://www.opensubscriber.com/message/[email protected]/5026653.html