2 * LCD panel driver for Ginger Console
3 * Author: LynxLuna <lynxluna@gmail.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
18 #include <linux/module.h>
19 #include <linux/delay.h>
21 #include <plat/display.h>
23 static char _lcd_type
[10] = "Unknown\0";
25 static struct omap_video_timings ginger_lcd_timing
= {
28 .hsw
= 41, /* hsync_len (4) - 1 */
29 .hfp
= 2, /* right_margin (4) - 1 */
30 .hbp
= 2, /* left_margin (40) - 1 */
31 .vsw
= 10, /* vsync_len (2) - 1 */
32 .vfp
= 2, /* lower_margin */
33 .vbp
= 2, /* upper_margin (8) - 1 */
37 static int ginger_panel_probe(struct omap_dss_device
*dssdev
)
39 dssdev
->panel
.config
= OMAP_DSS_LCD_TFT
| OMAP_DSS_LCD_IVS
| OMAP_DSS_LCD_IHS
;
40 printk(KERN_INFO
"Probing Ginger LCD... [%s]", _lcd_type
);
41 dssdev
->panel
.timings
= ginger_lcd_timing
;
45 static void ginger_panel_remove(struct omap_dss_device
*dssdev
)
49 static int ginger_panel_enable(struct omap_dss_device
*dssdev
)
53 /* wait couple of vsyncs until enabling the LCD */
56 if (dssdev
->platform_enable
)
57 r
= dssdev
->platform_enable(dssdev
);
62 static void ginger_panel_disable(struct omap_dss_device
*dssdev
)
64 if (dssdev
->platform_disable
)
65 dssdev
->platform_disable(dssdev
);
67 /* wait at least 5 vsyncs after disabling the LCD */
72 static int ginger_panel_suspend(struct omap_dss_device
*dssdev
)
74 ginger_panel_disable(dssdev
);
78 static int ginger_panel_resume(struct omap_dss_device
*dssdev
)
80 return ginger_panel_enable(dssdev
);
83 static struct omap_dss_driver ginger_driver
= {
84 .probe
= ginger_panel_probe
,
85 .remove
= ginger_panel_remove
,
87 .enable
= ginger_panel_enable
,
88 .disable
= ginger_panel_disable
,
89 .suspend
= ginger_panel_suspend
,
90 .resume
= ginger_panel_resume
,
93 .name
= "ginger_panel",
98 static int __init
ginger_panel_drv_init(void)
100 printk ("Registering Ginger LCD Driver....");
101 return omap_dss_register_driver(&ginger_driver
);
104 static void __exit
ginger_panel_drv_exit(void)
106 omap_dss_unregister_driver(&ginger_driver
);
109 module_param_string(lcd
,_lcd_type
, 10, 0);
111 module_init(ginger_panel_drv_init
);
112 module_exit(ginger_panel_drv_exit
);
113 MODULE_LICENSE("GPL");