From nobody Mon Sep 17 00:00:00 2001
From: Mika Laitio <lamikr@cc.jyu.fi>
Date: Tue, 18 Jul 2006 16:09:26 +0300
Subject: [PATCH] h6300 lcd fix.

---

 drivers/input/touchscreen/Kconfig      |    2 +-
 drivers/input/touchscreen/omap/ts_hx.c |    4 ++--
 drivers/video/omap/lcd_h6300.c         |   34 ++++++++++++++++----------------
 drivers/video/omap/lcdc.c              |    1 +
 drivers/video/omap/omapfb_main.c       |    1 +
 5 files changed, 22 insertions(+), 20 deletions(-)

ee05c1508127eebb1aa48c5f1579afb56d459124
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 3253906..a1d3dc6 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -114,7 +114,7 @@ config TOUCHSCREEN_HP600
 endif
 config TOUCHSCREEN_OMAP
 	tristate "OMAP touchscreen input driver"
-	depends on INPUT && INPUT_TOUCHSCREEN && (MACH_OMAP_H2 || MACH_OMAP_H3)
+	depends on INPUT && INPUT_TOUCHSCREEN && (MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H6300)
 	help
 	  Say Y here if you have an OMAP based board with touchscreen
 	  attached to it, e.g. OMAP H2 or H3
diff --git a/drivers/input/touchscreen/omap/ts_hx.c b/drivers/input/touchscreen/omap/ts_hx.c
index 9880873..42649a0 100644
--- a/drivers/input/touchscreen/omap/ts_hx.c
+++ b/drivers/input/touchscreen/omap/ts_hx.c
@@ -79,7 +79,7 @@ static int hx_ts_penup(void)
 
 }
 
-static int __init hx_ts_probe(struct omap_ts_t *ts)
+static int __devinit hx_ts_probe(struct omap_ts_t *ts)
 {
 	unsigned	gpio;
 
@@ -178,7 +178,7 @@ static void hx_ts_disable(void)
 }
 
 #ifdef	MODULE
-static void __exit hx_ts_remove(void)
+static void __devexit hx_ts_remove(void)
 {
 	if (machine_is_omap_h2())
 		omap_free_gpio(H2_GPIO_NUM);
diff --git a/drivers/video/omap/lcd_h6300.c b/drivers/video/omap/lcd_h6300.c
index 749f01c..04ed3f7 100644
--- a/drivers/video/omap/lcd_h6300.c
+++ b/drivers/video/omap/lcd_h6300.c
@@ -34,20 +34,20 @@ #include <asm/arch/omapfb.h>
 
 static int h6300_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() started\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() started\n");
 /*
 	if ((h6300_lcd_ck = clk_get (NULL, "lcd_ck")) == NULL) {
-		printk(KERN_ERR "Unable to get the clock LCD_CK!!!\n");
+		//printk(KERN_ERR "Unable to get the clock LCD_CK!!!\n");
 		return -EPERM;
 	} clk_enable(h6300_lcd_ck);
 */
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() done\n");
 	return 0;
 }
 
 static void h6300_panel_cleanup(struct lcd_panel *panel)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() started\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() started\n");
 /*
 	if (h6300_lcd_ck) {
 		clk_disable(h6300_lcd_ck);
@@ -55,23 +55,23 @@ static void h6300_panel_cleanup(struct l
 		h6300_lcd_ck = NULL;
 	}
 */
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() done\n");
 }
 
 static int h6300_panel_enable(struct lcd_panel *panel)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_enable() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_enable() done\n");
 	return 0;
 }
 
 static void h6300_panel_disable(struct lcd_panel *panel)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_disable() done\n");	
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_disable() done\n");	
 }
 
 static unsigned long h6300_panel_get_caps(struct lcd_panel *panel)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_get_caps() done\n");	
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_get_caps() done\n");	
 	return 0;
 }
 
@@ -101,39 +101,39 @@ struct lcd_panel h6300_panel = {
 
 static int h6300_panel_probe(struct platform_device *pdev)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_probe() started\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_probe() started\n");
 	omapfb_register_panel(&h6300_panel);
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_probe() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_probe() done\n");
 	return 0;
 }
 
 static int h6300_panel_remove(struct platform_device *pdev)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_remove() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_remove() done\n");
 	return 0;
 }
 
 static int h6300_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_suspend() started\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_suspend() started\n");
 	pca9535_gpio_write(GPIO3, HI);
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_suspend() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_suspend() done\n");
 	return 0;
 }
 
 static int h6300_panel_resume(struct platform_device *pdev)
 {
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_resume() started\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_resume() started\n");
 	pca9535_gpio_write(GPIO3, LOW);
-	printk(KERN_INFO "lcd_h6300.c: h6300_panel_resume() done\n");
+	//printk(KERN_INFO "lcd_h6300.c: h6300_panel_resume() done\n");
 	return 0;
 }
 
 struct platform_driver h6300_panel_driver = {
 	.probe		= h6300_panel_probe,
-	.remove	= h6300_panel_remove,
+	.remove		= h6300_panel_remove,
 	.suspend	= h6300_panel_suspend,
-	.resume	= h6300_panel_resume,
+	.resume		= h6300_panel_resume,
 	.driver		= {
 		.name	= "lcd_h6300",
 		.owner	= THIS_MODULE,
diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
index 87ae40b..d89041a 100644
--- a/drivers/video/omap/lcdc.c
+++ b/drivers/video/omap/lcdc.c
@@ -719,6 +719,7 @@ static int alloc_fbmem(struct omapfb_mem
 	}
 	region->size = frame_size;
 	region->paddr = lcdc.vram_phys;
+	region->vaddr = lcdc.vram_virt;
 	region->alloc = 1;
 
 	memset(lcdc.vram_virt, 0, lcdc.vram_size);
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 77ac419..d13ce42 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -420,6 +420,7 @@ static int set_color_mode(struct omapfb_
 		plane->color_mode = OMAPFB_COLOR_CLUT_8BPP;
 		return 0;
 	case 12:
+		var->bits_per_pixel = 16;
 		plane->color_mode = OMAPFB_COLOR_RGB444;
 		return 0;
 	case 16:
-- 
1.3.3

