]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/video/omap/lcd_h6300.c
d476fe69f4b0e3954eb29f10177d9316f7c59d04
[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 <asm/io.h>
28
29 #include <asm/arch/omapfb.h>
30
31 /* #define OMAPFB_DBG 1 */
32
33 #include "debug.h"
34
35 //static struct clk *h6300_lcd_ck;
36
37 static int h6300_panel_init(struct omapfb_device *fbdev)
38 {
39         DBGENTER(1);
40 /*
41         if ((h6300_lcd_ck = clk_get (NULL, "lcd_ck")) == NULL) {
42                 printk(KERN_ERR "Unable to get the clock LCD_CK!!!\n");
43                 return -EPERM;
44         } clk_enable(h6300_lcd_ck);
45 */
46         DBGLEAVE(1);
47         printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() done\n");
48         return 0;
49 }
50
51 static void h6300_panel_cleanup(void)
52 {
53         DBGENTER(1);
54 /*
55         if (h6300_lcd_ck) {
56                 clk_disable(h6300_lcd_ck);
57                 clk_put(h6300_lcd_ck);
58                 h6300_lcd_ck = NULL;
59         }
60 */
61         DBGLEAVE(1);
62         printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() done\n");
63 }
64
65 static int h6300_panel_enable(void)
66 {
67         DBGENTER(1);
68         DBGLEAVE(1);
69         printk(KERN_INFO "lcd_h6300.c: h6300_panel_enable() done\n");
70         return 0;
71 }
72
73 static void h6300_panel_disable(void)
74 {
75         DBGENTER(1);
76         DBGLEAVE(1);
77         printk(KERN_INFO "lcd_h6300.c: h6300_panel_disable() done\n");  
78 }
79
80 static unsigned long h6300_panel_get_caps(void)
81 {
82         printk(KERN_INFO "lcd_h6300.c: h6300_panel_get_caps() called\n");       
83         return 0;
84 }
85
86 struct lcd_panel h6300_panel = {
87         .name           = "h6300",
88         .config         = OMAP_LCDC_PANEL_TFT,
89
90         .bpp            = 16,
91         .data_lines     = 16,
92         .x_res          = 240,
93         .y_res          = 320,
94         .pixel_clock    = 21000,
95         .hsw            = 12,
96         .hfp            = 10,
97         .hbp            = 10,
98         .vsw            = 3,
99         .vfp            = 10,
100         .vbp            = 3,
101         .pcd            = 0,
102
103         .init           = h6300_panel_init,
104         .cleanup        = h6300_panel_cleanup,
105         .enable         = h6300_panel_enable,
106         .disable        = h6300_panel_disable,
107         .get_caps       = h6300_panel_get_caps,
108 };
109
110 static int h6300_panel_probe(struct platform_device *pdev)
111 {
112         DBGENTER(1);
113         omapfb_register_panel(&h6300_panel);
114         return 0;
115 }
116
117 static int h6300_panel_remove(struct platform_device *pdev)
118 {
119         DBGENTER(1);
120         return 0;
121 }
122
123 static int h6300_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
124 {
125         DBGENTER(1);
126         return 0;
127 }
128
129 static int h6300_panel_resume(struct platform_device *pdev)
130 {
131         DBGENTER(1);
132         return 0;
133 }
134
135 struct platform_driver h6300_panel_driver = {
136         .probe          = h6300_panel_probe,
137         .remove         = h6300_panel_remove,
138         .suspend        = h6300_panel_suspend,
139         .resume         = h6300_panel_resume,
140         .driver         = {
141                 .name   = "lcd_h6300",
142                 .owner  = THIS_MODULE,
143         },
144 };
145
146 static int h6300_panel_drv_init(void)
147 {
148         return platform_driver_register(&h6300_panel_driver);
149 }
150
151 static void h6300_panel_drv_cleanup(void)
152 {
153         platform_driver_unregister(&h6300_panel_driver);
154 }
155
156 module_init(h6300_panel_drv_init);
157 module_exit(h6300_panel_drv_cleanup);