2 * File: drivers/video/omap/lcd_ams_delta.c
4 * Based on drivers/video/omap/lcd_inn1510.c
6 * LCD panel support for the Amstrad E3 (Delta) videophone.
8 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
28 #include <asm/delay.h>
31 #include <asm/arch/board-ams-delta.h>
32 #include <asm/arch/omap16xx.h>
33 #include <asm/arch/omapfb.h>
35 #define AMS_DELTA_DEFAULT_CONTRAST 112
37 static int ams_delta_panel_init(struct lcd_panel *panel,
38 struct omapfb_device *fbdev)
43 static void ams_delta_panel_cleanup(struct lcd_panel *panel)
47 static int ams_delta_panel_enable(struct lcd_panel *panel)
49 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
50 AMS_DELTA_LATCH2_LCD_NDISP);
51 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
52 AMS_DELTA_LATCH2_LCD_VBLEN);
54 omap_writeb(1, OMAP16XX_PWL_CLK_ENABLE);
55 omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP16XX_PWL_ENABLE);
60 static void ams_delta_panel_disable(struct lcd_panel *panel)
62 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
63 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
66 static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
71 static struct lcd_panel ams_delta_panel = {
89 .init = ams_delta_panel_init,
90 .cleanup = ams_delta_panel_cleanup,
91 .enable = ams_delta_panel_enable,
92 .disable = ams_delta_panel_disable,
93 .get_caps = ams_delta_panel_get_caps,
96 static int ams_delta_panel_probe(struct platform_device *pdev)
98 omapfb_register_panel(&ams_delta_panel);
102 static int ams_delta_panel_remove(struct platform_device *pdev)
107 static int ams_delta_panel_suspend(struct platform_device *pdev,
113 static int ams_delta_panel_resume(struct platform_device *pdev)
118 struct platform_driver ams_delta_panel_driver = {
119 .probe = ams_delta_panel_probe,
120 .remove = ams_delta_panel_remove,
121 .suspend = ams_delta_panel_suspend,
122 .resume = ams_delta_panel_resume,
124 .name = "lcd_ams_delta",
125 .owner = THIS_MODULE,
129 static int ams_delta_panel_drv_init(void)
131 return platform_driver_register(&ams_delta_panel_driver);
134 static void ams_delta_panel_drv_cleanup(void)
136 platform_driver_unregister(&ams_delta_panel_driver);
139 module_init(ams_delta_panel_drv_init);
140 module_exit(ams_delta_panel_drv_cleanup);