Skip to contentSkip to conversation

drivers: add LCD support

PATCH In review Miguel Ojeda Sandonis 3 participants 10 messages Oct 5, 2006 – Oct 10, 2006 2 messages not in the archive

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
#1 lore raw

Hi!

Quoted 2 lines

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

No, I'm sorry. And I have to apologize for being blind.

I was going to say 'this is very important, because cellphones *do* have secondary displays, and we want to use them'. And yes it is important, but you got the interface wrong.

Quoted 33 lines
Documentation/ABI/testing/cfag12864b +33 -0
+		The cfag12864b LCD driver defines two ways to communicate
+		with the lcd.
+
+		1. Use seek and write syscalls. Bytes written appear on
+		   the screen without any formatting on the position pointed
+		   by the file offset.
+
+		   It is hardware dependent. It should be use to modify
+		   specific display's pixels to achieve higher refreshing
+		   rates.
+
+		2. Use ioctl syscall. The magic number is 0xFF.
+		   There are four ioctls:
+
+		   2.0. off	_IO(0xFF,0)
+
+			Power off display.
+
+			It doesn't clear the display.
+			It doesn't stop the controllers.
+
+		   2.1. on	_IO(0xFF,1)
+
+			Power on display.
+
+		   2.2. clear	_IO(0xFF,2)
+
+			Clear the display.
+
+		   2.3. format	_IOW(0xFF,3,void *)
+
+			Read the given buffer, transform it to the hardware
+			dependent format and show it on the screen.

Documentation/ABI/testing/cfag12864b line 48

Quoted 10 lines
Documentation/ABI/testing/cfag12864b +10 -0
+
+			The argument must point to a userspace buffer of
+			size 128*64 bytes (the display's size).
+
+			Each buffer's byte (unsigned) represent a pixel:
+				0  = pixel will turn off
+				>0 = pixel will turn on
+
+		For more information and examples, see
+		Documentation/auxdisplay/cfag12864b

So you have 128x64 pixels b/w display, and invented completely new interface to control it.

Fortunately we already have good interface for the display... It is called fbcon, and is more flexible than 128x64 b/w... but can do 128x64 b/w just fine.

Please use it. It is way more flexible, and it is right thing to do.

Pavel

Signature · 1 line
Thanks for all the (sleeping) penguins.
#2 lore raw
Quoted 11 lines · Pavel Machek

Hi!

No, I'm sorry. And I have to apologize for being blind.

I was going to say 'this is very important, because cellphones *do* have secondary displays, and we want to use them'. And yes it is important, but you got the interface wrong.

So you have 128x64 pixels b/w display, and invented completely new interface to control it.

Quoted 8 lines

Fortunately we already have good interface for the display... It is called fbcon, and is more flexible than 128x64 b/w... but can do 128x64 b/w just fine.

Please use it. It is way more flexible, and it is right thing to do.

Pavel

Hum, excuse me if I haven't understood you, but this LCD has nothing to do with cellphones or fbcon.

#3 lore raw

Hi!

Quoted 9 lines
Quoted 9 lines

No, I'm sorry. And I have to apologize for being blind.

I was going to say 'this is very important, because cellphones *do* have secondary displays, and we want to use them'. And yes it is important, but you got the interface wrong.

So you have 128x64 pixels b/w display, and invented completely new interface to control it.

Quoted 8 lines
Quoted 5 lines

Fortunately we already have good interface for the display... It is called fbcon, and is more flexible than 128x64 b/w... but can do 128x64 b/w just fine.

Please use it. It is way more flexible, and it is right thing to do.

Hum, excuse me if I haven't understood you, but this LCD has nothing to do with cellphones or fbcon.

To the contrary.

If you take a look at clamshell cellphone, it often has small status display on the outside; sometimes black&white. (What I'm trying to say is "this kind of status displays is going to become very common in future).

And fbcon is perfectly capable of driving your display, and there are no downsides in using fbcon to do that... and when your VGA card dies, you'll be able to login using keyboard + tiny display :-))).

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
In reply to a message not in the archive
Quoted 4 lines · Pavel Machek

Yep... but when we have /dev/fbcfag12864b ... do we need /dev/cfag12864bX ? I think it is useless at that point.

Well, because cfag12864b is the generic one I think it should be in the /dev directory (whatever if you use or don't it / whatever if it is useless or not).

Quoted 3 lines

/dev/fbcfag12864b is very easy to "manipulate by hand" too.

Yep, IMO we should add a Kconfig option instead of mixing both by default (cfag12864b and fbcfag12864b); anyway I think having cfag12864b & fbcfag12864b is better than mixing it all in one module.

It is a good idea that adds many advantages; althought I don't know if other people will agree with adding it. I have no problem coding the fbcfag12864b module in my free time; but I prefer to remain the other modules as they are now and add the fbcfag12864b later in time: I'm waiting them to get into one of the -rcs without more radical changes.

#7 lore raw

Hi!

Quoted 6 lines
Quoted 2 lines

Yep... but when we have /dev/fbcfag12864b ... do we need /dev/cfag12864bX ? I think it is useless at that point.

Well, because cfag12864b is the generic one I think it should be in the /dev directory (whatever if you use or don't it / whatever if it is useless or not).

I do not understand, both /dev/fbcfag12864b and /dev/cfag12864bX are in /dev/...

What is advantage of /dev/cfag12864bX over /dev/fbcfag12864b ?

(And I guess you should invent better name... /dev/fbaux0?)

Quoted 6 lines
Quoted 1 line

/dev/fbcfag12864b is very easy to "manipulate by hand" too.

Yep, IMO we should add a Kconfig option instead of mixing both by default (cfag12864b and fbcfag12864b); anyway I think having cfag12864b & fbcfag12864b is better than mixing it all in one module.

I do not think we need a Kconfig option, and I do not think we need /dev/cfag12864bX . Just use /dev/fbaux0, always.

Quoted 2 lines

modules as they are now and add the fbcfag12864b later in time: I'm waiting them to get into one of the -rcs without more radical changes.

I do not think it is suitable for -rc at this point, and it does not have chance before 2.6.20-rc1, anyway.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw
Quoted 6 lines · Pavel Machek

Hi!

I do not understand, both /dev/fbcfag12864b and /dev/cfag12864bX are in /dev/...

I mean: I think it is better to have the cfag12864b device than doesn't.

Quoted 9 lines

What is advantage of /dev/cfag12864bX over /dev/fbcfag12864b ?

(And I guess you should invent better name... /dev/fbaux0?)

I do not think we need a Kconfig option, and I do not think we need /dev/cfag12864bX . Just use /dev/fbaux0, always.

One is the pure device, the other one is the framebuffer device. I think having both is better than just one. There is no advantage, they are different.

Maybe someone doesn't need any of the framebuffer advantages and just wants to write to it directly, for better performance, for example:
The LCD needs to change 8 pixels (1 byte) every write, if you modify a single pixel at the framebuffer device you will write more times than you need for the same result (right? I'm not sure of this); the LCD is not capable of high refreshing rates.

And well, I think it is better that way. About the Kconfig activating both modules (cfag12864b and fbcfag12864b) I really don't care. One option = easy of use. Both options = more control. Maybe someone just needs the pure device :-/ We can really know how the requeriments will be, but I think having more options in the future is better than shrinking them now.

Quoted 4 lines

I do not think it is suitable for -rc at this point, and it does not have chance before 2.6.20-rc1, anyway.

No? Why not? Time is not a problem, I would want to know why are you saying that.

If you are talking about the code's quality, well, the modules are working fine, they have been reviewed by many people, and I and some friend have tested them enought times to be sure they work. They doesn't remove or change any other's code, they doesn't get compiled by default either...

If you are talking about the framebuffer device, it is something that can be added later, without any withdraws; and without having to stop or modify the other device drivers; as is an additional feature that should be added as other module "fbcfag12864b", like:

lcd -> parport -> ks0108 -> cfag12864b -> fbcfag12864b -> fbcon -> console

This way, adding future forks/modifications is easier and doesn't affect other modules. Right now, we are providing cfag12864b support to Linux, then, we will be able to provide a framebuffer device for the cfag12864b; then, ...; then, ...

#9 lore raw
Quoted 1 line · Miguel Ojeda

On 10/9/06, Pavel Machek <[email protected]> wrote:

...

Quoted 3 lines
Quoted 3 lines

What is advantage of /dev/cfag12864bX over /dev/fbcfag12864b ?

(And I guess you should invent better name... /dev/fbaux0?)

If the driver exposes sensible information, udev can give names.

...

Quoted 5 lines
Quoted 2 lines

I do not think it is suitable for -rc at this point, and it does not have chance before 2.6.20-rc1, anyway.

No? Why not? Time is not a problem, I would want to know why are you saying that.

Linus currently has a rule for merge windows; akpm certainly doesn't.

On 10/8/2006 11:36 PM, Miguel Ojeda wrote:

||| I have no problem coding the fbcfag12864b module in my free time;
||| but I prefer to remain the other modules as they are now and add
||| the fbcfag12864b later in time: I'm waiting them to get into one
||| of the -rcs without more radical changes.

An interface which promises to be future-proof, especially if it is an interface to userspace, is of course a requirement to get into mainline in the first place. (However I don't know enough about the interfaces discussed here nor about your requirements to say anything specifically about your interface or the one Pavel suggested.)

Signature · 3 lines
Stefan Richter
-=====-=-==- =-=- -=---
http://arcgraph.de/sr/
#10 lore raw
Quoted 9 lines · Stefan Richter
Quoted 1 line · Miguel Ojeda

On 10/9/06, Pavel Machek <[email protected]> wrote:

...

Quoted 3 lines
Quoted 3 lines

What is advantage of /dev/cfag12864bX over /dev/fbcfag12864b ?

(And I guess you should invent better name... /dev/fbaux0?)

If the driver exposes sensible information, udev can give names.

Quoted 9 lines

...

Quoted 5 lines
Quoted 2 lines

I do not think it is suitable for -rc at this point, and it does not have chance before 2.6.20-rc1, anyway.

No? Why not? Time is not a problem, I would want to know why are you saying that.

Linus currently has a rule for merge windows; akpm certainly doesn't.

I meant that time is not a problem (it is not a critical part), so the drivers can wait peacefully until the next merge window (althought they don't compromise any other part of the kernel :). But I thought he could be saying that the code is not ready (because of the framebuffer).

Quoted 7 lines · Miguel Ojeda
||| I have no problem coding the fbcfag12864b module in my free time;
||| but I prefer to remain the other modules as they are now and add
||| the fbcfag12864b later in time: I'm waiting them to get into one
||| of the -rcs without more radical changes.
Quoted 6 lines

An interface which promises to be future-proof, especially if it is an interface to userspace, is of course a requirement to get into mainline in the first place. (However I don't know enough about the interfaces discussed here nor about your requirements to say anything specifically about your interface or the one Pavel suggested.)

Sure, the point is that there is no new interface:

My thought: The cfag12864b module creates a device node /dev/cfag12864b which represents the physical display. If you write there, you get the pixels painted in the screen. So if I code a new fbcfag12864b module which depends on the cfag12864b module and creates a new device, a framebuffer one. The framebuffer interface is also "standard", right?. This way, as there are not any new interfaces, and as cfag12864b doesn't know anything about fbcfag12864b and fbcfag12864b doesn't have to know about the hardware, it is future-proof as there is not going to be any changes and no new interfaces in any way. The cfag12864b will remain without any changes.

Pavel suggested that I should recode the cfag12864b to destroy all about the /dev/cfag12864b, and just create the fbcfag12864b device. I think this mixs different concepts (the framebuffer abstraction with the hardware), create less maintanieable code (as it mixs hardware io related code with the framebuffer code: someone could improve the fbcfag12864b without having to read about the cfag12864b driver, for example; or change some function to meet the new kernel release instead of having to take care of more irrelevant code), less scalable (as it is mixed together), more hardware specific (maybe it is possible to create a framebuffer device for every lcd of 128x64 dimensions), etc.

Miguel Ojeda

#11 lore raw
In reply to Miguel Ojeda

Hi!

Quoted 5 lines
Quoted 5 lines

What is advantage of /dev/cfag12864bX over /dev/fbcfag12864b ?

(And I guess you should invent better name... /dev/fbaux0?)

Quoted 7 lines
Quoted 3 lines

I do not think we need a Kconfig option, and I do not think we need /dev/cfag12864bX . Just use /dev/fbaux0, always.

One is the pure device, the other one is the framebuffer device. I think having both is better than just one. There is no advantage, they are different.

No, having two different interfaces when one would be enough is stupid.

Face it... you are writing driver for framebuffer. (Small, slow, black&white, but still framebuffer).

Quoted 6 lines

Maybe someone doesn't need any of the framebuffer advantages and just wants to write to it directly, for better performance, for example:
The LCD needs to change 8 pixels (1 byte) every write, if you modify a single pixel at the framebuffer device you will write more times than you need for the same result (right? I'm not sure of this); the LCD is

Wrong, I think you only need to change 1bit, so framebuffer device actually performs better.

Quoted 5 lines
Quoted 2 lines

I do not think it is suitable for -rc at this point, and it does not have chance before 2.6.20-rc1, anyway.

No? Why not? Time is not a problem, I would want to know why are you saying that.

Bad user<->kernel interface is good enough reason for the patch not to be merged anywhere.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html