aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap/lcd_ams_delta.c
diff options
context:
space:
mode:
authorJonathan McDowell <noodles@earth.li>2009-09-22 19:46:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:48 -0400
commit92e0ed074a4f134084bef47a44e948b6c6429a89 (patch)
treed95150d5729eed5aedf67e2dfc65905274c8afab /drivers/video/omap/lcd_ams_delta.c
parent66d2f99d0bb5a2972fb5c1d88b61169510e540d6 (diff)
omapfb: add support for the Amstrad Delta LCD
This is an updated version of the LCD driver for the Amstrad Delta to take into account the recent changes to the omapfb infrastructure. The Delta features a 480x320 12 bit DSTN panel. Signed-off-by: Jonathan McDowell <noodles@earth.li> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Imre Deak <imre.deak@nokia.com> Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/omap/lcd_ams_delta.c')
-rw-r--r--drivers/video/omap/lcd_ams_delta.c137
1 files changed, 137 insertions, 0 deletions
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
new file mode 100644
index 000000000000..1f7439955e02
--- /dev/null
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -0,0 +1,137 @@
1/*
2 * Based on drivers/video/omap/lcd_inn1510.c
3 *
4 * LCD panel support for the Amstrad E3 (Delta) videophone.
5 *
6 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
7 *
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.
12 *
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.
17 *
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.
21 */
22
23#include <linux/module.h>
24#include <linux/platform_device.h>
25#include <linux/io.h>
26#include <linux/delay.h>
27
28#include <mach/board-ams-delta.h>
29#include <mach/hardware.h>
30#include <mach/omapfb.h>
31
32#define AMS_DELTA_DEFAULT_CONTRAST 112
33
34static int ams_delta_panel_init(struct lcd_panel *panel,
35 struct omapfb_device *fbdev)
36{
37 return 0;
38}
39
40static void ams_delta_panel_cleanup(struct lcd_panel *panel)
41{
42}
43
44static int ams_delta_panel_enable(struct lcd_panel *panel)
45{
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);
50
51 omap_writeb(1, OMAP_PWL_CLK_ENABLE);
52 omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP_PWL_ENABLE);
53
54 return 0;
55}
56
57static void ams_delta_panel_disable(struct lcd_panel *panel)
58{
59 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
60 ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
61}
62
63static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
64{
65 return 0;
66}
67
68static struct lcd_panel ams_delta_panel = {
69 .name = "ams-delta",
70 .config = 0,
71
72 .bpp = 12,
73 .data_lines = 16,
74 .x_res = 480,
75 .y_res = 320,
76 .pixel_clock = 4687,
77 .hsw = 3,
78 .hfp = 1,
79 .hbp = 1,
80 .vsw = 1,
81 .vfp = 0,
82 .vbp = 0,
83 .pcd = 0,
84 .acb = 37,
85
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,
91};
92
93static int ams_delta_panel_probe(struct platform_device *pdev)
94{
95 omapfb_register_panel(&ams_delta_panel);
96 return 0;
97}
98
99static int ams_delta_panel_remove(struct platform_device *pdev)
100{
101 return 0;
102}
103
104static int ams_delta_panel_suspend(struct platform_device *pdev,
105 pm_message_t mesg)
106{
107 return 0;
108}
109
110static int ams_delta_panel_resume(struct platform_device *pdev)
111{
112 return 0;
113}
114
115struct 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,
120 .driver = {
121 .name = "lcd_ams_delta",
122 .owner = THIS_MODULE,
123 },
124};
125
126static int ams_delta_panel_drv_init(void)
127{
128 return platform_driver_register(&ams_delta_panel_driver);
129}
130
131static void ams_delta_panel_drv_cleanup(void)
132{
133 platform_driver_unregister(&ams_delta_panel_driver);
134}
135
136module_init(ams_delta_panel_drv_init);
137module_exit(ams_delta_panel_drv_cleanup);