2 * LCD panel driver for Toppoly TDO35S
4 * Copyright (C) 2009 CompuLab, Ltd.
5 * Author: Mike Rapoport <mike@compulab.co.il>
7 * Based on generic panel support
8 * Copyright (C) 2008 Nokia Corporation
9 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License version 2 as published by
13 * the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 * You should have received a copy of the GNU General Public License along with
21 * this program. If not, see <http://www.gnu.org/licenses/>.
24 #include <linux/module.h>
25 #include <linux/delay.h>
27 #include <plat/display.h>
29 static struct omap_video_timings toppoly_tdo_panel_timings
= {
30 /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
45 static int toppoly_tdo_panel_power_on(struct omap_dss_device
*dssdev
)
49 r
= omapdss_dpi_display_enable(dssdev
);
53 if (dssdev
->platform_enable
) {
54 r
= dssdev
->platform_enable(dssdev
);
61 omapdss_dpi_display_disable(dssdev
);
66 static void toppoly_tdo_panel_power_off(struct omap_dss_device
*dssdev
)
68 if (dssdev
->platform_disable
)
69 dssdev
->platform_disable(dssdev
);
71 omapdss_dpi_display_disable(dssdev
);
74 static int toppoly_tdo_panel_probe(struct omap_dss_device
*dssdev
)
76 dssdev
->panel
.config
= OMAP_DSS_LCD_TFT
| OMAP_DSS_LCD_IVS
|
78 dssdev
->panel
.timings
= toppoly_tdo_panel_timings
;
83 static void toppoly_tdo_panel_remove(struct omap_dss_device
*dssdev
)
87 static int toppoly_tdo_panel_enable(struct omap_dss_device
*dssdev
)
91 r
= toppoly_tdo_panel_power_on(dssdev
);
95 dssdev
->state
= OMAP_DSS_DISPLAY_ACTIVE
;
100 static void toppoly_tdo_panel_disable(struct omap_dss_device
*dssdev
)
102 toppoly_tdo_panel_power_off(dssdev
);
104 dssdev
->state
= OMAP_DSS_DISPLAY_DISABLED
;
107 static int toppoly_tdo_panel_suspend(struct omap_dss_device
*dssdev
)
109 toppoly_tdo_panel_power_off(dssdev
);
110 dssdev
->state
= OMAP_DSS_DISPLAY_SUSPENDED
;
114 static int toppoly_tdo_panel_resume(struct omap_dss_device
*dssdev
)
118 r
= toppoly_tdo_panel_power_on(dssdev
);
122 dssdev
->state
= OMAP_DSS_DISPLAY_ACTIVE
;
127 static struct omap_dss_driver generic_driver
= {
128 .probe
= toppoly_tdo_panel_probe
,
129 .remove
= toppoly_tdo_panel_remove
,
131 .enable
= toppoly_tdo_panel_enable
,
132 .disable
= toppoly_tdo_panel_disable
,
133 .suspend
= toppoly_tdo_panel_suspend
,
134 .resume
= toppoly_tdo_panel_resume
,
137 .name
= "toppoly_tdo35s_panel",
138 .owner
= THIS_MODULE
,
142 static int __init
toppoly_tdo_panel_drv_init(void)
144 return omap_dss_register_driver(&generic_driver
);
147 static void __exit
toppoly_tdo_panel_drv_exit(void)
149 omap_dss_unregister_driver(&generic_driver
);
152 module_init(toppoly_tdo_panel_drv_init
);
153 module_exit(toppoly_tdo_panel_drv_exit
);
154 MODULE_LICENSE("GPL");