2 * Based on drivers/video/omap/lcd_inn1510.c
4 * LCD panel support for the Amstrad E3 (Delta) videophone.
6 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include <linux/module.h>
24 #include <linux/platform_device.h>
26 #include <linux/delay.h>
28 #include <mach/board-ams-delta.h>
29 #include <mach/hardware.h>
30 #include <mach/omapfb.h>
32 #define AMS_DELTA_DEFAULT_CONTRAST 112
34 static int ams_delta_panel_init(struct lcd_panel *panel,
35 struct omapfb_device *fbdev)
40 static void ams_delta_panel_cleanup(struct lcd_panel *panel)
44 static int ams_delta_panel_enable(struct lcd_panel *panel)
46 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
47 AMS_DELTA_LATCH2_LCD_NDISP);
48 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
49 AMS_DELTA_LATCH2_LCD_VBLEN);
51 omap_writeb(1, OMAP_PWL_CLK_ENABLE);
52 omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP_PWL_ENABLE);
57 static void ams_delta_panel_disable(struct lcd_panel *panel)
59 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
60 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
63 static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
68 static struct lcd_panel ams_delta_panel = {
86 .init = ams_delta_panel_init,
87 .cleanup = ams_delta_panel_cleanup,
88 .enable = ams_delta_panel_enable,
89 .disable = ams_delta_panel_disable,
90 .get_caps = ams_delta_panel_get_caps,
93 static int ams_delta_panel_probe(struct platform_device *pdev)
95 omapfb_register_panel(&ams_delta_panel);
99 static int ams_delta_panel_remove(struct platform_device *pdev)
104 static int ams_delta_panel_suspend(struct platform_device *pdev,
110 static int ams_delta_panel_resume(struct platform_device *pdev)
115 struct platform_driver ams_delta_panel_driver = {
116 .probe = ams_delta_panel_probe,
117 .remove = ams_delta_panel_remove,
118 .suspend = ams_delta_panel_suspend,
119 .resume = ams_delta_panel_resume,
121 .name = "lcd_ams_delta",
122 .owner = THIS_MODULE,
126 static int ams_delta_panel_drv_init(void)
128 return platform_driver_register(&ams_delta_panel_driver);
131 static void ams_delta_panel_drv_cleanup(void)
133 platform_driver_unregister(&ams_delta_panel_driver);
136 module_init(ams_delta_panel_drv_init);
137 module_exit(ams_delta_panel_drv_cleanup);