The patch titled drivers: add LCD support (update 4) has been added to the -mm tree. Its filename is drivers-add-lcd-support-update-4.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: drivers: add LCD support (update 4) From: Miguel Ojeda Sandonis <maxextreme@xxxxxxxxx> - Adds mmaping support for the cfag12864bfb. - Exchange the wiring drawing URL to a local ASCII drawing at Documentation/auxdisplay/cfag12864b. Signed-off-by: Miguel Ojeda Sandonis <maxextreme@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- Documentation/auxdisplay/cfag12864b | 33 +++++++++++++++++++++--- drivers/auxdisplay/Kconfig | 7 ----- drivers/auxdisplay/cfag12864b.c | 22 ++++++++++------ drivers/auxdisplay/cfag12864bfb.c | 35 ++++++++++++++++++++++++-- 4 files changed, 77 insertions(+), 20 deletions(-) diff -puN Documentation/auxdisplay/cfag12864b~drivers-add-lcd-support-update-4 Documentation/auxdisplay/cfag12864b --- a/Documentation/auxdisplay/cfag12864b~drivers-add-lcd-support-update-4 +++ a/Documentation/auxdisplay/cfag12864b @@ -4,7 +4,7 @@ License: GPLv2 Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@xxxxxxxxx> -Date: 2006-10-11 +Date: 2006-10-26 @@ -51,12 +51,37 @@ Addresses: 64 each page The cfag12864b LCD Series don't have official wiring. -The common wiring is done to the parallel port: +The common wiring is done to the parallel port as shown: -http://www.skippari.net/lcd/sekalaista/crystalfontz_cfag12864B-TMI-V.png +Parallel Port cfag12864b -You can get help at Crystalfontz and LCDInfo forums. + Name Pin# Pin# Name +Strobe ( 1)------------------------------(17) Enable +Data 0 ( 2)------------------------------( 4) Data 0 +Data 1 ( 3)------------------------------( 5) Data 1 +Data 2 ( 4)------------------------------( 6) Data 2 +Data 3 ( 5)------------------------------( 7) Data 3 +Data 4 ( 6)------------------------------( 8) Data 4 +Data 5 ( 7)------------------------------( 9) Data 5 +Data 6 ( 8)------------------------------(10) Data 6 +Data 7 ( 9)------------------------------(11) Data 7 + (10) [+5v]---( 1) Vdd + (11) [GND]---( 2) Ground + (12) [+5v]---(14) Reset + (13) [GND]---(15) Read / Write + Line (14)------------------------------(13) Controller Select 1 + (15) + Init (16)------------------------------(12) Controller Select 2 +Select (17)------------------------------(16) Data / Instruction +Ground (18)---[GND] [+5v]---(19) LED + +Ground (19)---[GND] +Ground (20)---[GND] E A Values: +Ground (21)---[GND] [GND]---[P1]---(18) Vee · R = Resistor = 22 ohm +Ground (22)---[GND] | · P1 = Preset = 10 Kohm +Ground (23)---[GND] ---- S ------( 3) V0 · P2 = Preset = 1 Kohm +Ground (24)---[GND] | | +Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - ------------------------ diff -puN drivers/auxdisplay/cfag12864b.c~drivers-add-lcd-support-update-4 drivers/auxdisplay/cfag12864b.c --- a/drivers/auxdisplay/cfag12864b.c~drivers-add-lcd-support-update-4 +++ a/drivers/auxdisplay/cfag12864b.c @@ -6,7 +6,7 @@ * Depends: ks0108 * * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@xxxxxxxxx> - * Date: 2006-10-13 + * Date: 2006-10-26 * * 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 @@ -182,7 +182,7 @@ static void cfag12864b_nop(void) * cfag12864b Internal Commands */ -unsigned char *cfag12864b_cache; +static unsigned char *cfag12864b_cache; unsigned char *cfag12864b_buffer; EXPORT_SYMBOL_GPL(cfag12864b_buffer); @@ -264,12 +264,18 @@ static int __init cfag12864b_init(void) { int ret = -EINVAL; - cfag12864b_buffer = vmalloc(sizeof(unsigned char) * - CFAG12864B_SIZE); + if(PAGE_SIZE < CFAG12864B_SIZE) { + printk(KERN_ERR CFAG12864B_NAME ": ERROR: " + "page size (%i) < cfag12864b size (%i)\n", + (unsigned int)PAGE_SIZE, CFAG12864B_SIZE); + ret = -ENOMEM; + goto none; + } + + cfag12864b_buffer = (unsigned char *) __get_free_page(GFP_KERNEL); if (cfag12864b_buffer == NULL) { printk(KERN_ERR CFAG12864B_NAME ": ERROR: " - "can't v-alloc buffer (%i bytes)\n", - CFAG12864B_SIZE); + "can't get a free page\n"); ret = -ENOMEM; goto none; } @@ -302,7 +308,7 @@ cachealloced: kfree(cfag12864b_cache); bufferalloced: - vfree(cfag12864b_buffer); + free_page((unsigned long) cfag12864b_buffer); none: return ret; @@ -317,7 +323,7 @@ static void __exit cfag12864b_exit(void) cfag12864b_off(); kfree(cfag12864b_cache); - vfree(cfag12864b_buffer); + free_page((unsigned long) cfag12864b_buffer); } module_init(cfag12864b_init); diff -puN drivers/auxdisplay/cfag12864bfb.c~drivers-add-lcd-support-update-4 drivers/auxdisplay/cfag12864bfb.c --- a/drivers/auxdisplay/cfag12864bfb.c~drivers-add-lcd-support-update-4 +++ a/drivers/auxdisplay/cfag12864bfb.c @@ -6,7 +6,7 @@ * Depends: cfag12864b * * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@xxxxxxxxx> - * Date: 2006-10-13 + * Date: 2006-10-26 * * 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 @@ -35,6 +35,7 @@ #include <linux/platform_device.h> #include <linux/init.h> #include <linux/cfag12864b.h> +#include <asm/semaphore.h> #include <asm/uaccess.h> #define CFAG12864BFB_NAME "cfag12864bfb" @@ -66,11 +67,41 @@ static struct fb_var_screeninfo cfag1286 .vmode = FB_VMODE_NONINTERLACED, }; +DECLARE_MUTEX(cfag12864bfb_sem); + +struct page *cfag12864bfb_vma_nopage(struct vm_area_struct *vma, + unsigned long address, int *type) +{ + struct page *page; + down(&cfag12864bfb_sem); + + page = virt_to_page(cfag12864b_buffer); + get_page(page); + + if(type) + *type = VM_FAULT_MINOR; + + up(&cfag12864bfb_sem); + return page; +} + +static struct vm_operations_struct cfag12864bfb_vm_ops = { + .nopage = cfag12864bfb_vma_nopage, +}; + +static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma) +{ + vma->vm_ops = &cfag12864bfb_vm_ops; + vma->vm_flags |= VM_RESERVED; + return 0; +} + static struct fb_ops cfag12864bfb_ops = { .owner = THIS_MODULE, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, + .fb_mmap = cfag12864bfb_mmap, }; static int __init cfag12864bfb_probe(struct platform_device *device) @@ -81,7 +112,7 @@ static int __init cfag12864bfb_probe(str if (!info) goto none; - info->screen_base = (char __iomem *)cfag12864b_buffer; + info->screen_base = (char __iomem *) cfag12864b_buffer; info->screen_size = CFAG12864B_SIZE; info->fbops = &cfag12864bfb_ops; info->fix = cfag12864bfb_fix; diff -puN drivers/auxdisplay/Kconfig~drivers-add-lcd-support-update-4 drivers/auxdisplay/Kconfig --- a/drivers/auxdisplay/Kconfig~drivers-add-lcd-support-update-4 +++ a/drivers/auxdisplay/Kconfig @@ -71,12 +71,7 @@ config CFAG12864B say Y. You also need the ks0108 LCD Controller driver. For help about how to wire your LCD to the parallel port, - check this image: - - http://www.skippari.net/lcd/sekalaista/crystalfontz_cfag12864B-TMI-V.png - - Also, you can find help in Crystalfontz and LCDStudio forums. - Check Documentation/lcddisplay/cfag12864b for more information. + check Documentation/auxdisplay/cfag12864b The LCD framebuffer driver can be attached to a console. It will work fine. However, you can't attach it to the fbdev driver _ Patches currently in -mm which might be from maxextreme@xxxxxxxxx are drivers-add-lcd-support-3.patch drivers-add-lcd-support-3-Kconfig-fix.patch drivers-add-lcd-support-update-4.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html