Merge branch 'gemini_fix' of git://git.berlios.de/gemini-board into devel-stable
[pandora-kernel.git] / drivers / video / omap / lcd_apollon.c
1 /*
2  * LCD panel support for the Samsung OMAP2 Apollon board
3  *
4  * Copyright (C) 2005,2006 Samsung Electronics
5  * Author: Kyungmin Park <kyungmin.park@samsung.com>
6  *
7  * Derived from drivers/video/omap/lcd-h4.c
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the
11  * Free Software Foundation; either version 2 of the License, or (at your
12  * option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22  */
23
24 #include <linux/module.h>
25 #include <linux/platform_device.h>
26
27 #include <mach/gpio.h>
28 #include <plat/mux.h>
29
30 #include "omapfb.h"
31
32 /* #define USE_35INCH_LCD 1 */
33
34 static int apollon_panel_init(struct lcd_panel *panel,
35                                 struct omapfb_device *fbdev)
36 {
37         /* configure LCD PWR_EN */
38         omap_cfg_reg(M21_242X_GPIO11);
39         return 0;
40 }
41
42 static void apollon_panel_cleanup(struct lcd_panel *panel)
43 {
44 }
45
46 static int apollon_panel_enable(struct lcd_panel *panel)
47 {
48         return 0;
49 }
50
51 static void apollon_panel_disable(struct lcd_panel *panel)
52 {
53 }
54
55 static unsigned long apollon_panel_get_caps(struct lcd_panel *panel)
56 {
57         return 0;
58 }
59
60 struct lcd_panel apollon_panel = {
61         .name           = "apollon",
62         .config         = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
63                           OMAP_LCDC_INV_HSYNC,
64
65         .bpp            = 16,
66         .data_lines     = 18,
67 #ifdef USE_35INCH_LCD
68         .x_res          = 240,
69         .y_res          = 320,
70         .hsw            = 2,
71         .hfp            = 3,
72         .hbp            = 9,
73         .vsw            = 4,
74         .vfp            = 3,
75         .vbp            = 5,
76 #else
77         .x_res          = 480,
78         .y_res          = 272,
79         .hsw            = 41,
80         .hfp            = 2,
81         .hbp            = 2,
82         .vsw            = 10,
83         .vfp            = 2,
84         .vbp            = 2,
85 #endif
86         .pixel_clock    = 6250,
87
88         .init           = apollon_panel_init,
89         .cleanup        = apollon_panel_cleanup,
90         .enable         = apollon_panel_enable,
91         .disable        = apollon_panel_disable,
92         .get_caps       = apollon_panel_get_caps,
93 };
94
95 static int apollon_panel_probe(struct platform_device *pdev)
96 {
97         omapfb_register_panel(&apollon_panel);
98         return 0;
99 }
100
101 static int apollon_panel_remove(struct platform_device *pdev)
102 {
103         return 0;
104 }
105
106 static int apollon_panel_suspend(struct platform_device *pdev,
107                                   pm_message_t mesg)
108 {
109         return 0;
110 }
111
112 static int apollon_panel_resume(struct platform_device *pdev)
113 {
114         return 0;
115 }
116
117 struct platform_driver apollon_panel_driver = {
118         .probe          = apollon_panel_probe,
119         .remove         = apollon_panel_remove,
120         .suspend        = apollon_panel_suspend,
121         .resume         = apollon_panel_resume,
122         .driver         = {
123                 .name   = "apollon_lcd",
124                 .owner  = THIS_MODULE,
125         },
126 };
127
128 static int __init apollon_panel_drv_init(void)
129 {
130         return platform_driver_register(&apollon_panel_driver);
131 }
132
133 static void __exit apollon_panel_drv_exit(void)
134 {
135         platform_driver_unregister(&apollon_panel_driver);
136 }
137
138 module_init(apollon_panel_drv_init);
139 module_exit(apollon_panel_drv_exit);