]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/video/omap/lcd_h6300.c
h63xx: lcd support patch converted from 2.6.16 to 2.6.28
[linux-2.6-omap-h63xx.git] / drivers / video / omap / lcd_h6300.c
1 /*
2  * File: drivers/video/omap_new/lcd-h6300.c
3  *
4  * LCD panel support for the TI OMAP1510 based iPAQ h63xx series of mobile phones.
5  * (h6315, h6340 and h6365)
6  *
7  * Copyright (C) 2009 Mika Laitio
8  * Copyright (C) 2009 Husam Senussi
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License as published by the
12  * Free Software Foundation; either version 2 of the License, or (at your
13  * option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
27 #include <linux/io.h>
28
29 #include <mach/fpga.h>
30 #include <mach/omapfb.h>
31
32 /* #define OMAPFB_DBG 1 */
33
34 //static struct clk *h6300_lcd_ck;
35
36 static int h6300_panel_init(struct omapfb_device *fbdev)
37 {
38 /*
39         if ((h6300_lcd_ck = clk_get (NULL, "lcd_ck")) == NULL) {
40                 printk(KERN_ERR "Unable to get the clock LCD_CK!!!\n");
41                 return -EPERM;
42         } clk_enable(h6300_lcd_ck);
43 */
44         printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() done\n");
45         return 0;
46 }
47
48 static void h6300_panel_cleanup(void)
49 {
50 /*
51         if (h6300_lcd_ck) {
52                 clk_disable(h6300_lcd_ck);
53                 clk_put(h6300_lcd_ck);
54                 h6300_lcd_ck = NULL;
55         }
56 */
57         printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() done\n");
58 }
59
60 static int h6300_panel_enable(void)
61 {
62         printk(KERN_INFO "lcd_h6300.c: h6300_panel_enable() done\n");
63         return 0;
64 }
65
66 static void h6300_panel_disable(void)
67 {
68         printk(KERN_INFO "lcd_h6300.c: h6300_panel_disable() done\n");  
69 }
70
71 static unsigned long h6300_panel_get_caps(void)
72 {
73         printk(KERN_INFO "lcd_h6300.c: h6300_panel_get_caps() called\n");       
74         return 0;
75 }
76
77 struct lcd_panel h6300_panel = {
78         .name           = "h6300",
79         .config         = OMAP_LCDC_PANEL_TFT,
80
81         .bpp            = 16,
82         .data_lines     = 16,
83         .x_res          = 240,
84         .y_res          = 320,
85         .pixel_clock    = 21000,
86         .hsw            = 12,
87         .hfp            = 10,
88         .hbp            = 10,
89         .vsw            = 3,
90         .vfp            = 10,
91         .vbp            = 3,
92         .pcd            = 0,
93
94         .init           = h6300_panel_init,
95         .cleanup        = h6300_panel_cleanup,
96         .enable         = h6300_panel_enable,
97         .disable        = h6300_panel_disable,
98         .get_caps       = h6300_panel_get_caps,
99 };
100
101 static int h6300_panel_probe(struct platform_device *pdev)
102 {
103         omapfb_register_panel(&h6300_panel);
104         return 0;
105 }
106
107 static int h6300_panel_remove(struct platform_device *pdev)
108 {
109         return 0;
110 }
111
112 static int h6300_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
113 {
114         return 0;
115 }
116
117 static int h6300_panel_resume(struct platform_device *pdev)
118 {
119         return 0;
120 }
121
122 struct platform_driver h6300_panel_driver = {
123         .probe          = h6300_panel_probe,
124         .remove         = h6300_panel_remove,
125         .suspend        = h6300_panel_suspend,
126         .resume         = h6300_panel_resume,
127         .driver         = {
128                 .name   = "lcd_h6300",
129                 .owner  = THIS_MODULE,
130         },
131 };
132
133 static int h6300_panel_drv_init(void)
134 {
135         return platform_driver_register(&h6300_panel_driver);
136 }
137
138 static void h6300_panel_drv_cleanup(void)
139 {
140         platform_driver_unregister(&h6300_panel_driver);
141 }
142
143 module_init(h6300_panel_drv_init);
144 module_exit(h6300_panel_drv_cleanup);