diff options
author | Steve Sakoman <steve@sakoman.com> | 2009-09-22 19:46:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:49 -0400 |
commit | be481941c6ddfe96e5c17a5d6f077b00e7b7bdf1 (patch) | |
tree | 577d3463043f2ae8beeee8cf27c15622fa32a38e /drivers/video/omap | |
parent | 27969ccc2840c42bfbe4f55d08f0c7ec254d4e93 (diff) |
omapfb: add support for the Gumstix Overo LCD
Signed-off-by: Steve Sakoman <steve@sakoman.com>
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')
-rw-r--r-- | drivers/video/omap/Kconfig | 21 | ||||
-rw-r--r-- | drivers/video/omap/Makefile | 1 | ||||
-rw-r--r-- | drivers/video/omap/lcd_overo.c | 179 |
3 files changed, 201 insertions, 0 deletions
diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig index 574453f49e2b..eb05e0999383 100644 --- a/drivers/video/omap/Kconfig +++ b/drivers/video/omap/Kconfig | |||
@@ -7,6 +7,27 @@ config FB_OMAP | |||
7 | help | 7 | help |
8 | Frame buffer driver for OMAP based boards. | 8 | Frame buffer driver for OMAP based boards. |
9 | 9 | ||
10 | choice | ||
11 | depends on FB_OMAP && MACH_OVERO | ||
12 | prompt "Screen resolution" | ||
13 | default FB_OMAP_079M3R | ||
14 | help | ||
15 | Selected desired screen resolution | ||
16 | |||
17 | config FB_OMAP_031M3R | ||
18 | boolean "640 x 480 @ 60 Hz Reduced blanking" | ||
19 | |||
20 | config FB_OMAP_048M3R | ||
21 | boolean "800 x 600 @ 60 Hz Reduced blanking" | ||
22 | |||
23 | config FB_OMAP_079M3R | ||
24 | boolean "1024 x 768 @ 60 Hz Reduced blanking" | ||
25 | |||
26 | config FB_OMAP_092M9R | ||
27 | boolean "1280 x 720 @ 60 Hz Reduced blanking" | ||
28 | |||
29 | endchoice | ||
30 | |||
10 | config FB_OMAP_LCD_MIPID | 31 | config FB_OMAP_LCD_MIPID |
11 | bool "MIPI DBI-C/DCS compatible LCD support" | 32 | bool "MIPI DBI-C/DCS compatible LCD support" |
12 | depends on FB_OMAP && SPI_MASTER | 33 | depends on FB_OMAP && SPI_MASTER |
diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile index 9ff1815bed67..0d2996a41b39 100644 --- a/drivers/video/omap/Makefile +++ b/drivers/video/omap/Makefile | |||
@@ -33,6 +33,7 @@ objs-y$(CONFIG_MACH_OMAP2EVM) += lcd_omap2evm.o | |||
33 | objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o | 33 | objs-y$(CONFIG_MACH_OMAP3EVM) += lcd_omap3evm.o |
34 | objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o | 34 | objs-y$(CONFIG_MACH_OMAP3_BEAGLE) += lcd_omap3beagle.o |
35 | objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o | 35 | objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o |
36 | objs-y$(CONFIG_MACH_OVERO) += lcd_overo.o | ||
36 | 37 | ||
37 | omapfb-objs := $(objs-yy) | 38 | omapfb-objs := $(objs-yy) |
38 | 39 | ||
diff --git a/drivers/video/omap/lcd_overo.c b/drivers/video/omap/lcd_overo.c new file mode 100644 index 000000000000..2bc5c9268e5e --- /dev/null +++ b/drivers/video/omap/lcd_overo.c | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * LCD panel support for the Gumstix Overo | ||
3 | * | ||
4 | * Author: Steve Sakoman <steve@sakoman.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/i2c/twl4030.h> | ||
25 | |||
26 | #include <mach/gpio.h> | ||
27 | #include <mach/mux.h> | ||
28 | #include <mach/omapfb.h> | ||
29 | #include <asm/mach-types.h> | ||
30 | |||
31 | #define LCD_ENABLE 144 | ||
32 | |||
33 | static int overo_panel_init(struct lcd_panel *panel, | ||
34 | struct omapfb_device *fbdev) | ||
35 | { | ||
36 | if ((gpio_request(LCD_ENABLE, "LCD_ENABLE") == 0) && | ||
37 | (gpio_direction_output(LCD_ENABLE, 1) == 0)) | ||
38 | gpio_export(LCD_ENABLE, 0); | ||
39 | else | ||
40 | printk(KERN_ERR "could not obtain gpio for LCD_ENABLE\n"); | ||
41 | |||
42 | return 0; | ||
43 | } | ||
44 | |||
45 | static void overo_panel_cleanup(struct lcd_panel *panel) | ||
46 | { | ||
47 | gpio_free(LCD_ENABLE); | ||
48 | } | ||
49 | |||
50 | static int overo_panel_enable(struct lcd_panel *panel) | ||
51 | { | ||
52 | gpio_set_value(LCD_ENABLE, 1); | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static void overo_panel_disable(struct lcd_panel *panel) | ||
57 | { | ||
58 | gpio_set_value(LCD_ENABLE, 0); | ||
59 | } | ||
60 | |||
61 | static unsigned long overo_panel_get_caps(struct lcd_panel *panel) | ||
62 | { | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | struct lcd_panel overo_panel = { | ||
67 | .name = "overo", | ||
68 | .config = OMAP_LCDC_PANEL_TFT, | ||
69 | .bpp = 16, | ||
70 | .data_lines = 24, | ||
71 | |||
72 | #if defined CONFIG_FB_OMAP_031M3R | ||
73 | |||
74 | /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ | ||
75 | .x_res = 640, | ||
76 | .y_res = 480, | ||
77 | .hfp = 48, | ||
78 | .hsw = 32, | ||
79 | .hbp = 80, | ||
80 | .vfp = 3, | ||
81 | .vsw = 4, | ||
82 | .vbp = 7, | ||
83 | .pixel_clock = 23500, | ||
84 | |||
85 | #elif defined CONFIG_FB_OMAP_048M3R | ||
86 | |||
87 | /* 800 x 600 @ 60 Hz Reduced blanking VESA CVT 0.48M3-R */ | ||
88 | .x_res = 800, | ||
89 | .y_res = 600, | ||
90 | .hfp = 48, | ||
91 | .hsw = 32, | ||
92 | .hbp = 80, | ||
93 | .vfp = 3, | ||
94 | .vsw = 4, | ||
95 | .vbp = 11, | ||
96 | .pixel_clock = 35500, | ||
97 | |||
98 | #elif defined CONFIG_FB_OMAP_079M3R | ||
99 | |||
100 | /* 1024 x 768 @ 60 Hz Reduced blanking VESA CVT 0.79M3-R */ | ||
101 | .x_res = 1024, | ||
102 | .y_res = 768, | ||
103 | .hfp = 48, | ||
104 | .hsw = 32, | ||
105 | .hbp = 80, | ||
106 | .vfp = 3, | ||
107 | .vsw = 4, | ||
108 | .vbp = 15, | ||
109 | .pixel_clock = 56000, | ||
110 | |||
111 | #elif defined CONFIG_FB_OMAP_092M9R | ||
112 | |||
113 | /* 1280 x 720 @ 60 Hz Reduced blanking VESA CVT 0.92M9-R */ | ||
114 | .x_res = 1280, | ||
115 | .y_res = 720, | ||
116 | .hfp = 48, | ||
117 | .hsw = 32, | ||
118 | .hbp = 80, | ||
119 | .vfp = 3, | ||
120 | .vsw = 5, | ||
121 | .vbp = 13, | ||
122 | .pixel_clock = 64000, | ||
123 | |||
124 | #else | ||
125 | |||
126 | /* use 640 x 480 if no config option */ | ||
127 | /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */ | ||
128 | .x_res = 640, | ||
129 | .y_res = 480, | ||
130 | .hfp = 48, | ||
131 | .hsw = 32, | ||
132 | .hbp = 80, | ||
133 | .vfp = 3, | ||
134 | .vsw = 4, | ||
135 | .vbp = 7, | ||
136 | .pixel_clock = 23500, | ||
137 | |||
138 | #endif | ||
139 | |||
140 | .init = overo_panel_init, | ||
141 | .cleanup = overo_panel_cleanup, | ||
142 | .enable = overo_panel_enable, | ||
143 | .disable = overo_panel_disable, | ||
144 | .get_caps = overo_panel_get_caps, | ||
145 | }; | ||
146 | |||
147 | static int overo_panel_probe(struct platform_device *pdev) | ||
148 | { | ||
149 | omapfb_register_panel(&overo_panel); | ||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static int overo_panel_remove(struct platform_device *pdev) | ||
154 | { | ||
155 | /* omapfb does not have unregister_panel */ | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static struct platform_driver overo_panel_driver = { | ||
160 | .probe = overo_panel_probe, | ||
161 | .remove = overo_panel_remove, | ||
162 | .driver = { | ||
163 | .name = "overo_lcd", | ||
164 | .owner = THIS_MODULE, | ||
165 | }, | ||
166 | }; | ||
167 | |||
168 | static int __init overo_panel_drv_init(void) | ||
169 | { | ||
170 | return platform_driver_register(&overo_panel_driver); | ||
171 | } | ||
172 | |||
173 | static void __exit overo_panel_drv_exit(void) | ||
174 | { | ||
175 | platform_driver_unregister(&overo_panel_driver); | ||
176 | } | ||
177 | |||
178 | module_init(overo_panel_drv_init); | ||
179 | module_exit(overo_panel_drv_exit); | ||