Full support for Ginger Console
[linux-ginger.git] / drivers / video / omap2 / displays / panel-generic.c
blobeb48d1afd8008437458bb3fe87e351b5ce785c42
1 /*
2 * Generic panel support
4 * Copyright (C) 2008 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <linux/module.h>
21 #include <linux/delay.h>
23 #include <plat/display.h>
25 static struct omap_video_timings generic_panel_timings = {
26 /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
27 .x_res = 640,
28 .y_res = 480,
29 .pixel_clock = 23500,
30 .hfp = 48,
31 .hsw = 32,
32 .hbp = 80,
33 .vfp = 3,
34 .vsw = 4,
35 .vbp = 7,
38 static int generic_panel_probe(struct omap_dss_device *dssdev)
40 dssdev->panel.config = OMAP_DSS_LCD_TFT;
41 dssdev->panel.timings = generic_panel_timings;
43 return 0;
46 static void generic_panel_remove(struct omap_dss_device *dssdev)
50 static int generic_panel_enable(struct omap_dss_device *dssdev)
52 int r = 0;
54 if (dssdev->platform_enable)
55 r = dssdev->platform_enable(dssdev);
57 return r;
60 static void generic_panel_disable(struct omap_dss_device *dssdev)
62 if (dssdev->platform_disable)
63 dssdev->platform_disable(dssdev);
66 static int generic_panel_suspend(struct omap_dss_device *dssdev)
68 generic_panel_disable(dssdev);
69 return 0;
72 static int generic_panel_resume(struct omap_dss_device *dssdev)
74 return generic_panel_enable(dssdev);
77 static struct omap_dss_driver generic_driver = {
78 .probe = generic_panel_probe,
79 .remove = generic_panel_remove,
81 .enable = generic_panel_enable,
82 .disable = generic_panel_disable,
83 .suspend = generic_panel_suspend,
84 .resume = generic_panel_resume,
86 .driver = {
87 .name = "generic_panel",
88 .owner = THIS_MODULE,
92 static int __init generic_panel_drv_init(void)
94 return omap_dss_register_driver(&generic_driver);
97 static void __exit generic_panel_drv_exit(void)
99 omap_dss_unregister_driver(&generic_driver);
102 module_init(generic_panel_drv_init);
103 module_exit(generic_panel_drv_exit);
104 MODULE_LICENSE("GPL");