DSS2: Add panel drivers
[pandora-kernel.git] / drivers / video / omap2 / displays / panel-samsung-lte430wq-f0c.c
1 /*
2  * LCD panel driver for Samsung LTE430WQ-F0C
3  *
4  * Author: Steve Sakoman <steve@sakoman.com>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by
8  * the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #include <linux/module.h>
20 #include <linux/delay.h>
21
22 #include <mach/display.h>
23
24 static int samsung_lte_panel_init(struct omap_display *display)
25 {
26         return 0;
27 }
28
29 static void samsung_lte_panel_cleanup(struct omap_display *display)
30 {
31 }
32
33 static int samsung_lte_panel_enable(struct omap_display *display)
34 {
35         int r = 0;
36
37         /* wait couple of vsyncs until enabling the LCD */
38         msleep(50);
39
40         if (display->hw_config.panel_enable)
41                 r = display->hw_config.panel_enable(display);
42
43         return r;
44 }
45
46 static void samsung_lte_panel_disable(struct omap_display *display)
47 {
48         if (display->hw_config.panel_disable)
49                 display->hw_config.panel_disable(display);
50
51         /* wait at least 5 vsyncs after disabling the LCD */
52         msleep(100);
53 }
54
55 static int samsung_lte_panel_suspend(struct omap_display *display)
56 {
57         samsung_lte_panel_disable(display);
58         return 0;
59 }
60
61 static int samsung_lte_panel_resume(struct omap_display *display)
62 {
63         return samsung_lte_panel_enable(display);
64 }
65
66 static struct omap_panel samsung_lte_panel = {
67         .owner          = THIS_MODULE,
68         .name           = "samsung-lte430wq-f0c",
69         .init           = samsung_lte_panel_init,
70         .cleanup        = samsung_lte_panel_cleanup,
71         .enable         = samsung_lte_panel_enable,
72         .disable        = samsung_lte_panel_disable,
73         .suspend        = samsung_lte_panel_suspend,
74         .resume         = samsung_lte_panel_resume,
75
76         .timings = {
77                 .x_res = 480,
78                 .y_res = 272,
79
80                 .pixel_clock    = 9200,
81
82                 .hsw            = 41,
83                 .hfp            = 8,
84                 .hbp            = 45-41,
85
86                 .vsw            = 10,
87                 .vfp            = 4,
88                 .vbp            = 12-10,
89         },
90
91         .config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS,
92 };
93
94
95 static int __init samsung_lte_panel_drv_init(void)
96 {
97         omap_dss_register_panel(&samsung_lte_panel);
98         return 0;
99 }
100
101 static void __exit samsung_lte_panel_drv_exit(void)
102 {
103         omap_dss_unregister_panel(&samsung_lte_panel);
104 }
105
106 module_init(samsung_lte_panel_drv_init);
107 module_exit(samsung_lte_panel_drv_exit);
108 MODULE_LICENSE("GPL");